add Handler_Administrative

This commit is contained in:
Andrew Dolgov 2021-02-14 15:50:46 +03:00
parent 33ea46c2bc
commit 0b7377238a
3 changed files with 13 additions and 24 deletions

View File

@ -0,0 +1,11 @@
<?php
class Handler_Administrative extends Handler_Protected {
function before($method) {
if (parent::before($method)) {
if (($_SESSION["access_level"] ?? 0) >= 10) {
return true;
}
}
return false;
}
}

View File

@ -1,20 +1,9 @@
<?php <?php
class Pref_System extends Handler_Protected { class Pref_System extends Handler_Administrative {
private $log_page_limit = 15; private $log_page_limit = 15;
function before($method) {
if (parent::before($method)) {
if ($_SESSION["access_level"] < 10) {
print __("Your access level is insufficient to open this tab.");
return false;
}
return true;
}
return false;
}
function csrf_ignore($method) { function csrf_ignore($method) {
$csrf_ignored = array("index"); $csrf_ignored = array("index");

View File

@ -1,16 +1,5 @@
<?php <?php
class Pref_Users extends Handler_Protected { class Pref_Users extends Handler_Administrative {
function before($method) {
if (parent::before($method)) {
if ($_SESSION["access_level"] < 10) {
print __("Your access level is insufficient to open this tab.");
return false;
}
return true;
}
return false;
}
function csrf_ignore($method) { function csrf_ignore($method) {
$csrf_ignored = array("index", "userdetails"); $csrf_ignored = array("index", "userdetails");