diff --git a/html/includes/functions.inc.php b/html/includes/functions.inc.php index a2343c771..9a2068544 100644 --- a/html/includes/functions.inc.php +++ b/html/includes/functions.inc.php @@ -109,6 +109,7 @@ function print_graph_popup($graph_array) } + function permissions_cache($user_id) { $permissions = array(); $query = mysql_query("SELECT * FROM devices_perms WHERE user_id = '".$user_id."'"); diff --git a/html/includes/print-interface-adsl.inc.php b/html/includes/print-interface-adsl.inc.php index 2bcc0537e..12626f488 100644 --- a/html/includes/print-interface-adsl.inc.php +++ b/html/includes/print-interface-adsl.inc.php @@ -49,43 +49,43 @@ $width="120"; $height="40"; $from = $day; - echo(""); - echo(formatRates($interface['ifInOctets_rate'] * 8)."/".formatRates($interface['ifOutOctets_rate'] * 8)); + echo(""); + echo(formatRates($interface['ifInOctets_rate'] * 8)." ".formatRates($interface['ifOutOctets_rate'] * 8)); echo("
"); $interface['graph_type'] = "port_bits"; echo(generateiflink($interface, "", $interface['graph_type'])); - echo(""); + echo(""); echo("".formatRates($interface['adslAturChanCurrTxRate']) . "/". formatRates($interface['adslAtucChanCurrTxRate'])); echo("
"); $interface['graph_type'] = "port_adsl_speed"; echo(generateiflink($interface, "", $interface['graph_type'])); - echo(""); + echo(""); echo("".formatRates($interface['adslAturCurrAttainableRate']) . "/". formatRates($interface['adslAtucCurrAttainableRate'])); echo("
"); $interface['graph_type'] = "port_adsl_attainable"; echo(generateiflink($interface, "", $interface['graph_type'])); - echo(""); + echo(""); echo("".$interface['adslAturCurrAtn'] . "dB/". $interface['adslAtucCurrAtn'] . "dB"); echo("
"); $interface['graph_type'] = "port_adsl_attenuation"; echo(generateiflink($interface, "", $interface['graph_type'])); - echo(""); + echo(""); echo("".$interface['adslAturCurrSnrMgn'] . "dB/". $interface['adslAtucCurrSnrMgn'] . "dB"); echo("
"); $interface['graph_type'] = "port_adsl_snr"; echo(generateiflink($interface, "", $interface['graph_type'])); - echo(""); + echo(""); echo("".$interface['adslAturCurrOutputPwr'] . "dBm/". $interface['adslAtucCurrOutputPwr'] . "dBm"); echo("
"); $interface['graph_type'] = "port_adsl_power"; diff --git a/html/index.php b/html/index.php index 070fd52b6..1db387b6e 100755 --- a/html/index.php +++ b/html/index.php @@ -4,8 +4,8 @@ ini_set('allow_url_fopen', 0); ini_set('display_errors', 0); -#$debug=1; -if($debug) { +if(strpos($_SERVER['REQUEST_URI'], "debug")) { + $debug = "1"; ini_set('display_errors', 1); ini_set('display_startup_errors', 1); ini_set('log_errors', 1); diff --git a/html/pages/device.inc.php b/html/pages/device.inc.php index f21081b6b..bca930dcf 100644 --- a/html/pages/device.inc.php +++ b/html/pages/device.inc.php @@ -2,7 +2,15 @@ if($_GET['id']) {$_GET['id'] = mres($_GET['id']); } -if(devicepermitted($_GET['id'])) { +print_r($_GET); + +if($_GET['section'] == "interface" && is_numeric($_GET['opta']) && interfacepermitted($_GET['opta'])) { + echo("device!"); + $check_device = get_device_id_by_interface_id($_GET['opta']); + $permit_ports = 1; +} + +if(devicepermitted($_GET['id']) || $check_device == $_GET['id']) { $selected['iface'] = "selected"; @@ -13,7 +21,6 @@ $section = mres($_GET['section']); $section = str_replace(".", "", $section); $select[$section] = "selected"; - $device_query = mysql_query("SELECT * FROM `devices` WHERE `device_id` = '" . $_GET['id'] . "'"); while($device = mysql_fetch_array($device_query)) { @@ -23,11 +30,11 @@ while($device = mysql_fetch_array($device_query)) { include("includes/device-header.inc.php"); echo(""); -echo("
"); + echo("
"); -echo('