|
@@ -4,10 +4,10 @@ require_once ($_SERVER['DOCUMENT_ROOT']."/inc/auth.php");
|
|
|
require_once ($_SERVER['DOCUMENT_ROOT']."/inc/languages/" . HTML_LANG . ".php");
|
|
require_once ($_SERVER['DOCUMENT_ROOT']."/inc/languages/" . HTML_LANG . ".php");
|
|
|
require_once ($_SERVER['DOCUMENT_ROOT']."/inc/header.php");
|
|
require_once ($_SERVER['DOCUMENT_ROOT']."/inc/header.php");
|
|
|
$default_sort='ip_int';
|
|
$default_sort='ip_int';
|
|
|
|
|
+require_once ($_SERVER['DOCUMENT_ROOT']."/inc/devmodelsfilter.php");
|
|
|
require_once ($_SERVER['DOCUMENT_ROOT']."/inc/oufilter.php");
|
|
require_once ($_SERVER['DOCUMENT_ROOT']."/inc/oufilter.php");
|
|
|
require_once ($_SERVER['DOCUMENT_ROOT']."/inc/subnetfilter.php");
|
|
require_once ($_SERVER['DOCUMENT_ROOT']."/inc/subnetfilter.php");
|
|
|
require_once ($_SERVER['DOCUMENT_ROOT']."/inc/sortfilter.php");
|
|
require_once ($_SERVER['DOCUMENT_ROOT']."/inc/sortfilter.php");
|
|
|
-require_once ($_SERVER['DOCUMENT_ROOT']."/inc/vendorfilter.php");
|
|
|
|
|
require_once ($_SERVER['DOCUMENT_ROOT']."/inc/devtypesfilter.php");
|
|
require_once ($_SERVER['DOCUMENT_ROOT']."/inc/devtypesfilter.php");
|
|
|
require_once ($_SERVER['DOCUMENT_ROOT']."/inc/buildingfilter.php");
|
|
require_once ($_SERVER['DOCUMENT_ROOT']."/inc/buildingfilter.php");
|
|
|
|
|
|
|
@@ -15,8 +15,6 @@ $unknown=1;
|
|
|
if (!isset($_POST['f_unknown']) and isset($_POST['OK'])) { $unknown=0; }
|
|
if (!isset($_POST['f_unknown']) and isset($_POST['OK'])) { $unknown=0; }
|
|
|
if (isset($_POST['f_unknown'])) { $unknown=$_POST['f_unknown']*1; }
|
|
if (isset($_POST['f_unknown'])) { $unknown=$_POST['f_unknown']*1; }
|
|
|
|
|
|
|
|
-$params =[];
|
|
|
|
|
-
|
|
|
|
|
$unknown_checked='';
|
|
$unknown_checked='';
|
|
|
if ($unknown) { $unknown_checked='checked="checked"'; }
|
|
if ($unknown) { $unknown_checked='checked="checked"'; }
|
|
|
|
|
|
|
@@ -27,26 +25,22 @@ if ($sort_field == 'model_name') { $sort_table = 'M'; }
|
|
|
|
|
|
|
|
$sort_url = "<a href=index-passive.php?ou=" . $rou;
|
|
$sort_url = "<a href=index-passive.php?ou=" . $rou;
|
|
|
|
|
|
|
|
-if ($rou == 0) { $ou_filter = ''; } else { $ou_filter = " and L.ou_id=? "; $params[]=$rou; }
|
|
|
|
|
|
|
+$filter = '';
|
|
|
|
|
+$params =[];
|
|
|
|
|
|
|
|
-if ($rsubnet == 0) { $subnet_filter = ''; } else {
|
|
|
|
|
|
|
+if ($f_building_id > 0) { $filter .= ' and D.building_id=?'; $params[]=$f_building_id; }
|
|
|
|
|
+if ($f_devtype_id >= 0) { $filter .= ' and D.device_type=?'; $params[]=$f_devtype_id; } else { $filter .= ' and D.device_type> ?'; $params[]=2; }
|
|
|
|
|
+if ($f_devmodel_id > 0) { $filter .= ' and D.device_model_id=?'; $params[]= $f_devmodel_id; }
|
|
|
|
|
+if ($rou > 0) { $filter .= ' and L.ou_id=? '; $params[]=$rou; }
|
|
|
|
|
+if ($rsubnet > 0) {
|
|
|
$subnet_range = get_subnet_range($db_link,$rsubnet);
|
|
$subnet_range = get_subnet_range($db_link,$rsubnet);
|
|
|
if (!empty($subnet_range)) {
|
|
if (!empty($subnet_range)) {
|
|
|
- $subnet_filter = " and A.ip_int>=? and A.ip_int<=?";
|
|
|
|
|
|
|
+ $filter .= " and A.ip_int>=? and A.ip_int<=?";
|
|
|
$params[]=$subnet_range['start'];
|
|
$params[]=$subnet_range['start'];
|
|
|
$params[]=$subnet_range['stop'];
|
|
$params[]=$subnet_range['stop'];
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-$d_filter='';
|
|
|
|
|
-if ($f_building_id > 0) { $d_filter .= ' and D.building_id=?'; $params[]=$f_building_id; }
|
|
|
|
|
-if ($f_devtype_id > 0) {
|
|
|
|
|
- $d_filter .= ' and D.device_type=?';
|
|
|
|
|
- $params[]= $f_devtype_id;
|
|
|
|
|
- } else { $d_filter .= ' and D.device_type>2'; }
|
|
|
|
|
-
|
|
|
|
|
-$ip_list_filter = $ou_filter.$subnet_filter;
|
|
|
|
|
-
|
|
|
|
|
unset($_POST);
|
|
unset($_POST);
|
|
|
|
|
|
|
|
print_device_submenu($page_url);
|
|
print_device_submenu($page_url);
|
|
@@ -60,7 +54,8 @@ print_device_submenu($page_url);
|
|
|
<td class="info"> <?php print_devtypes_select($db_link, "devtypes", $f_devtype_id, "id>2"); ?>
|
|
<td class="info"> <?php print_devtypes_select($db_link, "devtypes", $f_devtype_id, "id>2"); ?>
|
|
|
<td class="info"> <?php print WEB_device_show_location; ?></td>
|
|
<td class="info"> <?php print WEB_device_show_location; ?></td>
|
|
|
<td class="info" colspan=2> <?php print_building_select($db_link, "building_id", $f_building_id); ?></td>
|
|
<td class="info" colspan=2> <?php print_building_select($db_link, "building_id", $f_building_id); ?></td>
|
|
|
-<td class="info" colspan=2 align=right><input name="OK" type="submit" value="<?php echo WEB_btn_show; ?>"></td>
|
|
|
|
|
|
|
+<td class="info"><?php print WEB_device_hide_unknown." "; ?> <input type=checkbox name=f_unknown value="1" <?php print $unknown_checked; ?>> </td>
|
|
|
|
|
+<td class="info" align=right><input name="OK" type="submit" value="<?php echo WEB_btn_show; ?>"></td>
|
|
|
</tr>
|
|
</tr>
|
|
|
<tr>
|
|
<tr>
|
|
|
<td class="info"><?php print WEB_cell_ou." "; ?> </td>
|
|
<td class="info"><?php print WEB_cell_ou." "; ?> </td>
|
|
@@ -68,9 +63,7 @@ print_device_submenu($page_url);
|
|
|
<td class="info"><?php print WEB_rows_at_page." :"; print_row_at_pages('rows',$displayed); ?></td>
|
|
<td class="info"><?php print WEB_rows_at_page." :"; print_row_at_pages('rows',$displayed); ?></td>
|
|
|
<td class="info"><?php print WEB_network_subnet; ?> </td>
|
|
<td class="info"><?php print WEB_network_subnet; ?> </td>
|
|
|
<td class="info"><?php print_subnet_select_office($db_link, 'subnet', $rsubnet); ?></td>
|
|
<td class="info"><?php print_subnet_select_office($db_link, 'subnet', $rsubnet); ?></td>
|
|
|
-<td class="info"><?php print WEB_device_hide_unknown." "; ?> <input type=checkbox name=f_unknown value="1" <?php print $unknown_checked; ?>> </td>
|
|
|
|
|
-<td class="info"><?php print WEB_model_vendor." "; print_vendor_select($db_link,"vendor_select",$f_vendor_select); ?></td>
|
|
|
|
|
-</td>
|
|
|
|
|
|
|
+<td class="info" colspan=2><?php print WEB_models; print_devmodels_select($db_link, "devmodels", $f_devmodel_id, 'device_type>2'); ?></td>
|
|
|
</tr>
|
|
</tr>
|
|
|
</table>
|
|
</table>
|
|
|
</form>
|
|
</form>
|
|
@@ -111,17 +104,11 @@ print_device_submenu($page_url);
|
|
|
|
|
|
|
|
<?php
|
|
<?php
|
|
|
|
|
|
|
|
-$u_filter='';
|
|
|
|
|
-if ($unknown and $f_vendor_select==0) { $u_filter=' AND V.id<>1 '; } else {
|
|
|
|
|
- if (!empty($f_vendor_select) and $f_vendor_select>=1) {
|
|
|
|
|
- $u_filter = " AND V.id=? ";
|
|
|
|
|
- $params[]=$f_vendor_select;
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
|
|
|
|
|
-$countSQL="SELECT Count(*) FROM user_auth A, user_list L, devices D, device_models M, vendors V
|
|
|
|
|
-WHERE D.user_id=L.id AND A.ip = D.ip AND D.device_model_id=M.id AND M.vendor_id=V.id AND A.deleted =0
|
|
|
|
|
-$u_filter $ip_list_filter $d_filter";
|
|
|
|
|
|
|
+$countSQL="SELECT Count(*) FROM user_auth A, user_list L, devices D, device_models M
|
|
|
|
|
+WHERE D.user_id=L.id AND A.ip = D.ip AND D.device_model_id=M.id AND A.deleted =0
|
|
|
|
|
+$filter";
|
|
|
|
|
+
|
|
|
$count_records = get_single_field($db_link,$countSQL, $params);
|
|
$count_records = get_single_field($db_link,$countSQL, $params);
|
|
|
$total=ceil($count_records/$displayed);
|
|
$total=ceil($count_records/$displayed);
|
|
|
if ($page>$total) { $page=$total; }
|
|
if ($page>$total) { $page=$total; }
|
|
@@ -146,10 +133,10 @@ print_navigation($page_url,$page,$displayed,$count_records,$total);
|
|
|
</tr>
|
|
</tr>
|
|
|
<?php
|
|
<?php
|
|
|
|
|
|
|
|
-$sSQL = "SELECT A.id, D.id as dev_id, D.device_type, A.ip, A.mac, A.user_id, L.login, D.description, A.last_found, V.name, M.model_name
|
|
|
|
|
-FROM user_auth A, user_list L, devices D, device_models M, vendors V
|
|
|
|
|
-WHERE D.user_id=L.id AND A.ip = D.ip AND D.device_model_id=M.id AND M.vendor_id=V.id AND A.deleted =0
|
|
|
|
|
-$u_filter $ip_list_filter $d_filter
|
|
|
|
|
|
|
+$sSQL = "SELECT A.id, D.id as dev_id, D.device_type, A.ip, A.mac, A.user_id, L.login, D.description, A.last_found, M.model_name
|
|
|
|
|
+FROM user_auth A, user_list L, devices D, device_models M
|
|
|
|
|
+WHERE D.user_id=L.id AND A.ip = D.ip AND D.device_model_id=M.id AND A.deleted =0
|
|
|
|
|
+$filter
|
|
|
ORDER BY $sort_table.$sort_field $order LIMIT ? OFFSET ?";
|
|
ORDER BY $sort_table.$sort_field $order LIMIT ? OFFSET ?";
|
|
|
$params[]=$displayed;
|
|
$params[]=$displayed;
|
|
|
$params[]=$start;
|
|
$params[]=$start;
|
|
@@ -171,13 +158,6 @@ foreach ($users as $user) {
|
|
|
print "</table>\n";
|
|
print "</table>\n";
|
|
|
print_navigation($page_url,$page,$displayed,$count_records,$total);
|
|
print_navigation($page_url,$page,$displayed,$count_records,$total);
|
|
|
?>
|
|
?>
|
|
|
-<br>
|
|
|
|
|
-<table class="data">
|
|
|
|
|
-<tr><td><?php echo WEB_color_description; ?></td></tr>
|
|
|
|
|
-<tr>
|
|
|
|
|
-<td class="warn"><?php echo WEB_color_user_disabled; ?></td>
|
|
|
|
|
-<td class="error"><?php echo WEB_color_user_blocked; ?></td>
|
|
|
|
|
-</table>
|
|
|
|
|
</form>
|
|
</form>
|
|
|
|
|
|
|
|
<script src="/js/remodal/remodal.min.js"></script>
|
|
<script src="/js/remodal/remodal.min.js"></script>
|