[Web] Started work on ACL, fix notifications

This commit is contained in:
andryyy
2017-08-18 22:18:14 +02:00
parent d6bfccecba
commit 66ae588445
8 changed files with 254 additions and 21 deletions

View File

@@ -1,5 +1,4 @@
<?php
function policy($_action, $_scope, $_data = null) {
global $pdo;
global $redis;
@@ -99,6 +98,13 @@ function policy($_action, $_scope, $_data = null) {
);
return false;
}
if (!isset($_SESSION['acl']['spam_policy']) || $_SESSION['acl']['spam_policy'] != "1" ) {
$_SESSION['return'] = array(
'type' => 'danger',
'msg' => sprintf($lang['danger']['access_denied'])
);
return false;
}
if ($_data['object_list'] == "bl") {
$object_list = "blacklist_from";
}
@@ -233,6 +239,13 @@ function policy($_action, $_scope, $_data = null) {
else {
$prefids = $_data['prefid'];
}
if (!isset($_SESSION['acl']['spam_policy']) || $_SESSION['acl']['spam_policy'] != "1" ) {
$_SESSION['return'] = array(
'type' => 'danger',
'msg' => sprintf($lang['danger']['access_denied'])
);
return false;
}
foreach ($prefids as $prefid) {
if (!is_numeric($prefid)) {
$_SESSION['return'] = array(