diff --git a/html/.htaccess b/html/.htaccess
index fb36aec524..84cf5163c7 100644
--- a/html/.htaccess
+++ b/html/.htaccess
@@ -8,44 +8,12 @@ RewriteCond %{REQUEST_URI} !^(.*)\.jpg$
RewriteCond %{REQUEST_URI} !^(.*)\.gif$
RewriteCond %{REQUEST_URI} !^(.*)\.png$
-RewriteRule ^cust/ ?page=cust
-
-RewriteRule ^bare/(.+)/ index-bare.php?page=$1
-RewriteRule ^bare/(.+)/(.+)/ index-bare.php?page=$1&opta=$2
-RewriteRule ^bare/(.+)/(.+)/(.+)/ index-bare.php?page=$1&opta=$2&optb=$3
-
-RewriteRule ^mobile/([a-z|0-9]+)/(.+)/(.+)/ mobile.php?page=$1&opta=$2&optb=$3
-RewriteRule ^mobile/([a-z|0-9]+)/(.+)/ mobile.php?page=$1&opta=$2
-RewriteRule ^mobile/([a-z|0-9]+)/ mobile.php?page=$1
-RewriteRule ^mobile/ mobile.php
-
-## Rewrites for Devices
-
-RewriteRule ^devices/location/(.+)/ ?page=devices&location=$1
-RewriteRule ^devices/alerted/ ?page=devices&status=alerted
-RewriteRule ^devices/alerted/ ?page=devices&status=alerted
-RewriteRule ^devices/(.+)/ ?page=devices&type=$1
-
-RewriteRule ^interfaces/(.+)/ ?page=interfaces&type=$1
-
-RewriteRule ^vrf/(.+)/(.+)/(.+)/ ?page=vrf&id=$1&opta=$2&optb=$3
-RewriteRule ^vrf/(.+)/(.+)/ ?page=vrf&id=$1&opta=$2
-RewriteRule ^vrf/(.+)/ ?page=vrf&id=$1
-RewriteRule ^device/([0-9]+)/([a-z]+)/(.+)/(.+)/(.+)/(.+)/(.+)/(.+)/(.+)/ ?page=device&id=$1§ion=$2&opta=$3&optb=$4&optc=$5&optd=$6&opte=$7&optf=$8&optg=$9
-RewriteRule ^device/([0-9]+)/([a-z]+)/(.+)/(.+)/(.+)/(.+)/(.+)/(.+)/ ?page=device&id=$1§ion=$2&opta=$3&optb=$4&optc=$5&optd=$6&opte=$7&optf=$8
-RewriteRule ^device/([0-9]+)/([a-z]+)/(.+)/(.+)/(.+)/(.+)/(.+)/ ?page=device&id=$1§ion=$2&opta=$3&optb=$4&optc=$5&optd=$6&opte=$7
-RewriteRule ^device/([0-9]+)/([a-z]+)/(.+)/(.+)/(.+)/(.+)/ ?page=device&id=$1§ion=$2&opta=$3&optb=$4&optc=$5&optd=$6
-RewriteRule ^device/([0-9]+)/([a-z]+)/(.+)/(.+)/(.+)/ ?page=device&id=$1§ion=$2&opta=$3&optb=$4&optc=$5
-RewriteRule ^device/([0-9]+)/([a-z]+)/(.+)/(.+)/ ?page=device&id=$1§ion=$2&opta=$3&optb=$4
-RewriteRule ^device/([0-9]+)/([a-z]+)/(.+)/ ?page=device&id=$1§ion=$2&opta=$3
-RewriteRule ^device/([0-9]+)/([a-z]+)/ ?page=device&id=$1§ion=$2
-RewriteRule ^device/([0-9]+) ?page=device&id=$1
-
-RewriteRule ^([a-z|0-9\-]+)/$ ?page=$1
-
-RewriteRule ^([a-z|0-9]+)/(.+)/(.+)/(.+)/(.+)/(.+)/$ ?page=$1&opta=$2&optb=$3&optc=$4&optd=$5&opte=$6
-RewriteRule ^([a-z|0-9]+)/(.+)/(.+)/(.+)/(.+)/$ ?page=$1&opta=$2&optb=$3&optc=$4&optd=$5
-RewriteRule ^([a-z|0-9]+)/(.+)/(.+)/(.+)/$ ?page=$1&opta=$2&optb=$3&optc=$4
-RewriteRule ^([a-z|0-9]+)/(.+)/(.+)/$ ?page=$1&opta=$2&optb=$3
-RewriteRule ^([a-z|0-9]+)/(.+)/$ ?page=$1&opta=$2
-
+RewriteRule ^([a-z|0-9]+)/(.+)/(.+)/(.+)/(.+)/(.+)/(.+)/(.+)/(.+)/$ ?page=$1&opta=$2&optb=$3&optc=$4&optd=$5&opte=$6&optf=$7&optg=$8&opth=$9
+RewriteRule ^([a-z|0-9]+)/(.+)/(.+)/(.+)/(.+)/(.+)/(.+)/(.+)/$ ?page=$1&opta=$2&optb=$3&optc=$4&optd=$5&opte=$6&optf=$7&optg=$8
+RewriteRule ^([a-z|0-9]+)/(.+)/(.+)/(.+)/(.+)/(.+)/(.+)/$ ?page=$1&opta=$2&optb=$3&optc=$4&optd=$5&opte=$6&optf=$7
+RewriteRule ^([a-z|0-9]+)/(.+)/(.+)/(.+)/(.+)/(.+)/$ ?page=$1&opta=$2&optb=$3&optc=$4&optd=$5&opte=$6
+RewriteRule ^([a-z|0-9]+)/(.+)/(.+)/(.+)/(.+)/$ ?page=$1&opta=$2&optb=$3&optc=$4&optd=$5
+RewriteRule ^([a-z|0-9]+)/(.+)/(.+)/(.+)/$ ?page=$1&opta=$2&optb=$3&optc=$4
+RewriteRule ^([a-z|0-9]+)/(.+)/(.+)/$ ?page=$1&opta=$2&optb=$3
+RewriteRule ^([a-z|0-9]+)/(.+)/$ ?page=$1&opta=$2
+RewriteRule ^([a-z|0-9]+)/$ ?page=$1
diff --git a/html/includes/print-menubar.php b/html/includes/print-menubar.php
index f0f2a237f2..ed625d5210 100644
--- a/html/includes/print-menubar.php
+++ b/html/includes/print-menubar.php
@@ -217,7 +217,7 @@ if ($config['show_locations'])
' . $location . ' ');
+ echo('
');
include("pages/device/".mres(basename($section)).".inc.php");
diff --git a/html/pages/device/apps.inc.php b/html/pages/device/apps.inc.php
index 4876532e4d..de9ad7bdd1 100644
--- a/html/pages/device/apps.inc.php
+++ b/html/pages/device/apps.inc.php
@@ -10,27 +10,27 @@ foreach (dbFetchRows("SELECT * FROM `applications` WHERE `device_id` = ?", array
{
echo($sep);
- if (!$_GET['opta']) { $_GET['opta'] = $app['app_type']; }
+ if (!$_GET['optc']) { $_GET['optc'] = $app['app_type']; }
- if ($_GET['opta'] == $app['app_type'])
+ if ($_GET['optc'] == $app['app_type'])
{
echo(""); }
+ echo("
" . $app['app_type'] ."");
+ if ($_GET['optc'] == $app['app_type']) { echo(""); }
$sep = " | ";
}
print_optionbar_end();
-$app = dbFetchRow("SELECT * FROM `applications` WHERE `device_id` = ? AND `app_type` = ?", array($device['device_id'], $_GET['opta']));
+$app = dbFetchRow("SELECT * FROM `applications` WHERE `device_id` = ? AND `app_type` = ?", array($device['device_id'], $_GET['optc']));
-if (is_file("pages/device/apps/".mres($_GET['opta']).".inc.php"))
+if (is_file("pages/device/apps/".mres($_GET['optc']).".inc.php"))
{
- include("pages/device/apps/".mres($_GET['opta']).".inc.php");
+ include("pages/device/apps/".mres($_GET['optc']).".inc.php");
}
?>
diff --git a/html/pages/device/collectd.inc.php b/html/pages/device/collectd.inc.php
index 17cbc5bc92..ea712dd840 100644
--- a/html/pages/device/collectd.inc.php
+++ b/html/pages/device/collectd.inc.php
@@ -51,11 +51,11 @@ print_optionbar_start();
$plugins = collectd_list_plugins($device['hostname']);
unset($sep);
foreach ($plugins as &$plugin) {
- if (!$_GET['opta']) { $_GET['opta'] = $plugin; }
+ if (!$_GET['optc']) { $_GET['optc'] = $plugin; }
echo($sep);
- if ($_GET['opta'] == $plugin) { echo(""); }
$sep = ' | ';
}
unset ($sep);
@@ -64,13 +64,13 @@ print_optionbar_end();
$i=0;
- $pinsts = collectd_list_pinsts($device['hostname'], $_GET['opta']);
+ $pinsts = collectd_list_pinsts($device['hostname'], $_GET['optc']);
foreach ($pinsts as &$instance) {
- $types = collectd_list_types($device['hostname'], $_GET['opta'], $instance);
+ $types = collectd_list_types($device['hostname'], $_GET['optc'], $instance);
foreach ($types as &$type) {
- $typeinstances = collectd_list_tinsts($device['hostname'], $_GET['opta'], $instance, $type);
+ $typeinstances = collectd_list_tinsts($device['hostname'], $_GET['optc'], $instance, $type);
if ($MetaGraphDefs[$type]) { $typeinstances = array($MetaGraphDefs[$type]); }
@@ -81,16 +81,16 @@ print_optionbar_end();
echo('
');
echo('
');
if ($tinst) {
- echo($_GET['opta']." $instance - $type - $tinst");
+ echo($_GET['optc']." $instance - $type - $tinst");
} else {
- echo($_GET['opta']." $instance - $type");
+ echo($_GET['optc']." $instance - $type");
}
echo("
");
$graph_array['type'] = "device_collectd";
$graph_array['id'] = $device['device_id'];
- $graph_array['c_plugin'] = $_GET['opta'];
+ $graph_array['c_plugin'] = $_GET['optc'];
$graph_array['c_plugin_instance'] = $instance;
$graph_array['c_type'] = $type;
$graph_array['c_type_instance'] = $tinst;
diff --git a/html/pages/device/edit.inc.php b/html/pages/device/edit.inc.php
index 0b26c819a8..e12084441c 100644
--- a/html/pages/device/edit.inc.php
+++ b/html/pages/device/edit.inc.php
@@ -25,9 +25,9 @@ if ($_SESSION['userlevel'] < '7')
unset($sep);
foreach ($panes as $type => $text)
{
- if (!isset($_GET['opta'])) { $_GET['opta'] = $type; }
+ if (!isset($_GET['optc'])) { $_GET['optc'] = $type; }
echo($sep);
- if ($_GET['opta'] == $type)
+ if ($_GET['optc'] == $type)
{
echo(""); }
+ echo("
" . $text ."");
+ if ($_GET['optc'] == $type) { echo(""); }
$sep = " | ";
}
print_optionbar_end();
- if (is_file("pages/device/edit/".mres($_GET['opta']).".inc.php"))
+ if (is_file("pages/device/edit/".mres($_GET['optc']).".inc.php"))
{
- include("pages/device/edit/".mres($_GET['opta']).".inc.php");
+ include("pages/device/edit/".mres($_GET['optc']).".inc.php");
}
}
diff --git a/html/pages/device/graphs.inc.php b/html/pages/device/graphs.inc.php
index 5b6aba95a4..d2840bdbab 100644
--- a/html/pages/device/graphs.inc.php
+++ b/html/pages/device/graphs.inc.php
@@ -24,15 +24,15 @@ foreach ($config['graph_sections'] as $section)
if (isset($graph_enable) && is_array($graph_enable[$section]))
{
$type = strtolower($section);
- if (!$_GET['opta']) { $_GET['opta'] = $type; }
+ if (!$_GET['optc']) { $_GET['optc'] = $type; }
echo($sep);
- if ($_GET['opta'] == $type)
+ if ($_GET['optc'] == $type)
{
echo('");
}
@@ -43,7 +43,7 @@ foreach ($config['graph_sections'] as $section)
unset ($sep);
print_optionbar_end();
-$graph_enable = $graph_enable[$_GET['opta']];
+$graph_enable = $graph_enable[$_GET['optc']];
foreach ($config['graph_types']['device'] as $graph => $entry)
{
diff --git a/html/pages/device/health.inc.php b/html/pages/device/health.inc.php
index 5e443b042e..09cb0fc663 100644
--- a/html/pages/device/health.inc.php
+++ b/html/pages/device/health.inc.php
@@ -44,28 +44,28 @@ print_optionbar_start();
echo("
Health » ");
-if (!$_GET['opta']) { $_GET['opta'] = "overview"; }
+if (!$_GET['optc']) { $_GET['optc'] = "overview"; }
unset($sep);
foreach ($datas as $type)
{
echo($sep);
- if ($_GET['opta'] == $type)
+ if ($_GET['optc'] == $type)
{
echo('"); }
+ echo("
" . $type_text[$type] ."");
+ if ($_GET['optc'] == $type) { echo(""); }
$sep = " | ";
}
print_optionbar_end();
-if (is_file("pages/device/health/".mres($_GET['opta']).".inc.php"))
+if (is_file("pages/device/health/".mres($_GET['optc']).".inc.php"))
{
- include("pages/device/health/".mres($_GET['opta']).".inc.php");
+ include("pages/device/health/".mres($_GET['optc']).".inc.php");
} else {
foreach ($datas as $type)
{
diff --git a/html/pages/device/port.inc.php b/html/pages/device/port.inc.php
index 8b7ccdc434..b2f474c284 100644
--- a/html/pages/device/port.inc.php
+++ b/html/pages/device/port.inc.php
@@ -1,8 +1,8 @@
");
print_optionbar_start();
-if ($_GET['optb'] == "graphs" || !$_GET['optb']) { echo(""); }
echo(" | ");
-if ($_GET['optb'] == "realtime" || !$_GET['optb']) { echo(""); }
if (dbFetchCell("SELECT COUNT(*) FROM `ports_adsl` WHERE `interface_id` = '".$interface['interface_id']."'") )
{
echo(" | ");
- if ($_GET['optb'] == "adsl") { echo(""); }
}
echo(" | ");
-if ($_GET['optb'] == "arp") { echo(""); }
if (dbFetchCell("SELECT COUNT(*) FROM `ports` WHERE `pagpGroupIfIndex` = '".
$interface['ifIndex']."' and `device_id` = '".$device['device_id']."'") )
{
echo(" | ");
- if ($_GET['optb'] == "pagp") { echo(""); }
}
if (dbFetchCell("SELECT count(*) FROM mac_accounting WHERE interface_id = '".$interface['interface_id']."'") > "0" )
{
echo(" | Mac Accounting : ");
- if ($_GET['optb'] == "macaccounting" && $_GET['optc'] == "bits" && !$_GET['optd']) { echo(""); }
echo("(");
- if ($_GET['optb'] == "macaccounting" && $_GET['optc'] == "bits" && $_GET['optd'] == "thumbs") { echo(""); }
echo('|');
- if ($_GET['optb'] == "macaccounting" && $_GET['optc'] == "bits" && $_GET['optd'] == "top10") { echo(""); }
echo(") | ");
- if ($_GET['optb'] == "macaccounting" && $_GET['optc'] == "pkts" && !$_GET['optd']) { echo(""); }
echo("(");
- if ($_GET['optb'] == "macaccounting" && $_GET['optc'] == "pkts" && $_GET['optd'] == "thumbs") { echo(""); }
echo(")");
}
if (dbFetchCell("SELECT COUNT(*) FROM juniAtmVp WHERE interface_id = '".$interface['interface_id']."'") > "0" )
{
echo(" | ATM VPs : ");
- if ($_GET['optb'] == "junose-atm-vp" && $_GET['optc'] == "bits") { echo(""); }
echo(" | ");
- if ($_GET['optb'] == "junose-atm-vp" && $_GET['optc'] == "packets") { echo(""); }
echo(" | ");
- if ($_GET['optb'] == "junose-atm-vp" && $_GET['optc'] == "cells") { echo(""); }
echo(" | ");
- if ($_GET['optb'] == "junose-atm-vp" && $_GET['optc'] == "errors") { echo(""); }
}
print_optionbar_end();
echo("
");
-include("pages/device/port/".mres($_GET['optb']).".inc.php");
+include("pages/device/port/".mres($_GET['optd']).".inc.php");
echo("
");
?>
diff --git a/html/pages/device/ports.inc.php b/html/pages/device/ports.inc.php
index 2c5f1f9d2f..5e15f00f8e 100644
--- a/html/pages/device/ports.inc.php
+++ b/html/pages/device/ports.inc.php
@@ -1,8 +1,8 @@
$text)
{
echo($sep);
- if ($_GET['opta'] == $option) { echo(""); }
+ if ($_GET['optc'] == $option) { echo(""); }
$sep = " | ";
}
@@ -45,21 +45,21 @@ $graph_types = array("bits" => "Bits",
foreach ($graph_types as $type => $descr)
{
echo("$type_sep");
- if ($_GET['optb'] == $type && $_GET['optc'] != "thumbs") { echo(""); }
echo('(');
- if ($_GET['optb'] == $type && $_GET['optc'] == "thumbs") { echo(""); }
echo(')');
$type_sep = " | ";
}
print_optionbar_end();
-if ($_GET['optc'] == thumbs)
+if ($_GET['opte'] == thumbs)
{
$timeperiods = array('-1day','-1week','-1month','-1year');
$from = '-1day';
@@ -81,11 +81,11 @@ if ($_GET['optc'] == thumbs)
}
echo("
");
} else {
- if ($_GET['opta'] == "arp" || $_GET['opta'] == "adsl" || $_GET['opta'] == "neighbours")
+ if ($_GET['optc'] == "arp" || $_GET['optc'] == "adsl" || $_GET['optc'] == "neighbours")
{
- include("ports/".$_GET['opta'].".inc.php");
+ include("ports/".$_GET['optc'].".inc.php");
} else {
- if ($_GET['opta'] == "details") { $port_details = 1; }
+ if ($_GET['optc'] == "details") { $port_details = 1; }
echo("
");
$i = "1";
diff --git a/html/pages/device/routing.inc.php b/html/pages/device/routing.inc.php
index 3939e5e30a..72ca23bb86 100644
--- a/html/pages/device/routing.inc.php
+++ b/html/pages/device/routing.inc.php
@@ -14,25 +14,25 @@ unset($sep);
foreach ($routing_tabs as $type)
{
- if (!$_GET['opta']) { $_GET['opta'] = $type; }
+ if (!$_GET['optc']) { $_GET['optc'] = $type; }
echo($sep);
- if ($_GET['opta'] == $type)
+ if ($_GET['optc'] == $type)
{
echo('"); }
+ if ($_GET['optc'] == $type) { echo(""); }
$sep = " | ";
}
print_optionbar_end();
-if (is_file("pages/device/routing/".mres($_GET['opta']).".inc.php"))
+if (is_file("pages/device/routing/".mres($_GET['optc']).".inc.php"))
{
- include("pages/device/routing/".mres($_GET['opta']).".inc.php");
+ include("pages/device/routing/".mres($_GET['optc']).".inc.php");
} else {
foreach ($routing_tabs as $type)
{
diff --git a/html/pages/device/services.inc.php b/html/pages/device/services.inc.php
index 7e307808d1..bceb8d066e 100644
--- a/html/pages/device/services.inc.php
+++ b/html/pages/device/services.inc.php
@@ -5,18 +5,18 @@ echo("Services » ");
$menu_options = array('basic' => 'Basic',
'details' => 'Details');
-if (!$_GET['opta']) { $_GET['opta'] = "basic"; }
+if (!$_GET['optc']) { $_GET['optc'] = "basic"; }
$sep = "";
foreach ($menu_options as $option => $text)
{
echo($sep);
- if ($_GET['opta'] == $option)
+ if ($_GET['optc'] == $option)
{
echo("");
}
@@ -35,7 +35,7 @@ if (dbFetchCell("SELECT COUNT(service_id) FROM `services` WHERE device_id = ?",
{
include("includes/print-service.inc.php");
- if ($_GET['opta'] == "details")
+ if ($_GET['optc'] == "details")
{
$graph_array['height'] = "100";
$graph_array['width'] = "210";
diff --git a/html/pages/device/showconfig.inc.php b/html/pages/device/showconfig.inc.php
index 470cf40cb8..ec8ebf7421 100644
--- a/html/pages/device/showconfig.inc.php
+++ b/html/pages/device/showconfig.inc.php
@@ -19,7 +19,7 @@ if ($_SESSION['userlevel'] >= "7")
echo("Config » ");
- if (!$_GET['opta']) {
+ if (!$_GET['optc']) {
echo('");
@@ -38,10 +38,10 @@ if ($_SESSION['userlevel'] >= "7")
echo($sep);
$revlist[] = $svnlog["rev"];
- if ($_GET['opta'] == $svnlog["rev"]) { echo('"); }
$sep = " | ";
}
@@ -49,8 +49,8 @@ if ($_SESSION['userlevel'] >= "7")
print_optionbar_end();
- if (function_exists('svn_log') && in_array($_GET['opta'], $revlist)) {
- list($diff, $errors) = svn_diff($file, $_GET['opta']-1, $file, $_GET['opta']);
+ if (function_exists('svn_log') && in_array($_GET['optc'], $revlist)) {
+ list($diff, $errors) = svn_diff($file, $_GET['optc']-1, $file, $_GET['optc']);
if (!$diff) {
$text = "No Difference";
} else {
diff --git a/html/pages/devices.inc.php b/html/pages/devices.inc.php
index 6e1dc20624..47554e16dd 100644
--- a/html/pages/devices.inc.php
+++ b/html/pages/devices.inc.php
@@ -1,18 +1,30 @@
$get_var) {
+ if(strstr($key, "opt")) {
+ list($name, $value) = explode("|", $get_var);
+ $_POST[$name] = $value;
+ }
+}
+
+### FIXME - build this string in new method
+
if ($_POST['hostname']) { $where .= " AND hostname LIKE '%".mres($_POST['hostname'])."%'"; }
if ($_POST['os']) { $where .= " AND os = '".mres($_POST['os'])."'"; }
if ($_POST['version']) { $where .= " AND version = '".mres($_POST['version'])."'"; }
if ($_POST['hardware']) { $where .= " AND hardware = '".mres($_POST['hardware'])."'"; }
if ($_POST['features']) { $where .= " AND features = '".mres($_POST['features'])."'"; }
-if ($_GET['type']) { $where .= " AND type = '" .mres($_GET[type]). "'"; }
-if (isset($_REQUEST['location']))
-{
- if ($_GET['location'] == "Unset") { $location_filter = ''; }
- if ($_GET['location'] && !isset($_POST['location'])) { $location_filter = $_GET['location']; }
- if ($_POST['location']) { $location_filter = $_POST['location']; }
-}
+if ($_GET['location'] == "Unset") { $location_filter = ''; }
+if ($_GET['location'] && !isset($_POST['location'])) { $location_filter = $_GET['location']; }
+if ($_POST['location']) { $location_filter = $_POST['location']; }
+
+print_r($_POST);
print_optionbar_start(62);
?>