diff --git a/html/includes/functions.inc.php b/html/includes/functions.inc.php
index 8d056e06b3..4a6b7f201f 100644
--- a/html/includes/functions.inc.php
+++ b/html/includes/functions.inc.php
@@ -712,7 +712,7 @@ function generate_pagination($count,$limit,$page,$links = 2) {
}
function is_admin() {
- if ($_SESSION['userlevel'] == '10') {
+ if ($_SESSION['userlevel'] >= '10') {
$allowed = true;
} else {
$allowed = false;
@@ -720,4 +720,8 @@ function is_admin() {
return $allowed;
}
+function demo_account() {
+ print_error("You are logged in as a demo account, this page isn't accessible to you");
+}
+
?>
diff --git a/html/includes/print-alert-rules.php b/html/includes/print-alert-rules.php
index ce99291564..8c6f144d35 100644
--- a/html/includes/print-alert-rules.php
+++ b/html/includes/print-alert-rules.php
@@ -46,7 +46,7 @@ echo '
';
echo ('
');
-if ($_SESSION['userlevel'] == '10') {
+if ($_SESSION['userlevel'] >= '10') {
echo('');
}
echo (' |
@@ -128,12 +128,12 @@ foreach( dbFetchRows($full_query, $param) as $rule ) {
}
echo "
Max: ".$rule_extra['count']." Delay: ".$rule_extra['delay']." | ";
echo "
";
- if ($_SESSION['userlevel'] == '10') {
+ if ($_SESSION['userlevel'] >= '10') {
echo "";
}
echo " | ";
echo "
";
- if ($_SESSION['userlevel'] == '10') {
+ if ($_SESSION['userlevel'] >= '10') {
echo " ";
echo "";
}
@@ -153,7 +153,7 @@ echo '
';
if($count < 1) {
- if ($_SESSION['userlevel'] == '10') {
+ if ($_SESSION['userlevel'] >= '10') {
echo ' | ";
echo "
";
- if ($_SESSION['userlevel'] == '10') {
+ if ($_SESSION['userlevel'] >= '10') {
$ack_ico = 'volume-up';
$ack_col = 'success';
if(in_array($alert['state'],array(2,3,4))) {
diff --git a/html/includes/print-menubar.php b/html/includes/print-menubar.php
index 16f3767588..0885389eaf 100644
--- a/html/includes/print-menubar.php
+++ b/html/includes/print-menubar.php
@@ -43,7 +43,7 @@ if (isset($config['enable_bgp']) && $config['enable_bgp'])
Overview
Alerts
= '10') {
?>
Alert Rules
Alert Templates
diff --git a/html/pages/addsrv.inc.php b/html/pages/addsrv.inc.php
index 23c945b9eb..3fdadd6b05 100644
--- a/html/pages/addsrv.inc.php
+++ b/html/pages/addsrv.inc.php
@@ -8,7 +8,7 @@ else
{
if ($_POST['addsrv'])
{
- if ($_SESSION['userlevel'] == '10')
+ if ($_SESSION['userlevel'] >= '10')
{
$updated = '1';
diff --git a/html/pages/adduser.inc.php b/html/pages/adduser.inc.php
index 248ccf2344..c0a7db564f 100644
--- a/html/pages/adduser.inc.php
+++ b/html/pages/adduser.inc.php
@@ -4,6 +4,9 @@ if ($_SESSION['userlevel'] < '10')
{
include("includes/error-no-perm.inc.php");
}
+elseif ($_SESSION['userlevel'] == 11) {
+ demo_account();
+}
else
{
echo("Add User");
@@ -92,6 +95,7 @@ echo("
+
diff --git a/html/pages/api-access.inc.php b/html/pages/api-access.inc.php
index f1052c91b2..a1b6e5a528 100644
--- a/html/pages/api-access.inc.php
+++ b/html/pages/api-access.inc.php
@@ -12,7 +12,7 @@
* the source code distribution for details.
*/
-if ($_SESSION['userlevel'] == '10')
+if ($_SESSION['userlevel'] >= '10')
{
if(empty($_POST['token'])) {
$_POST['token'] = bin2hex(openssl_random_pseudo_bytes(16));
diff --git a/html/pages/authlog.inc.php b/html/pages/authlog.inc.php
index 801afd40a4..606345526e 100644
--- a/html/pages/authlog.inc.php
+++ b/html/pages/authlog.inc.php
@@ -1,6 +1,6 @@
= '10')
{
echo(" ");
diff --git a/html/pages/bill.inc.php b/html/pages/bill.inc.php
index 8563518b20..c6c0029e65 100644
--- a/html/pages/bill.inc.php
+++ b/html/pages/bill.inc.php
@@ -2,7 +2,7 @@
$bill_id = mres($vars['bill_id']);
-if ($_SESSION['userlevel'] == "10")
+if ($_SESSION['userlevel'] >= "10")
{
include("pages/bill/actions.inc.php");
}
@@ -94,7 +94,7 @@ if (bill_permitted($bill_id))
echo('Historical Usage');
if ($vars['view'] == "history") { echo(""); }
- if ($_SESSION['userlevel'] == "10")
+ if ($_SESSION['userlevel'] >= "10")
{
echo(" | ");
if ($vars['view'] == "edit") { echo(" |