mirror of
https://github.com/Mibew/mibew.git
synced 2025-02-07 00:14:40 +03:00
Added new permission for operators to see Notifications
This commit is contained in:
parent
9a0c9f42a1
commit
01eff99db9
@ -21,14 +21,16 @@ $can_administrate = 0;
|
||||
$can_takeover = 1;
|
||||
$can_viewthreads = 2;
|
||||
$can_modifyprofile = 3;
|
||||
$can_viewnotifications = 4;
|
||||
|
||||
$can_count = 4;
|
||||
$can_count = 5;
|
||||
|
||||
$permission_ids = array(
|
||||
$can_administrate => "admin",
|
||||
$can_takeover => "takeover",
|
||||
$can_viewthreads => "viewthreads",
|
||||
$can_modifyprofile => "modifyprofile"
|
||||
$can_modifyprofile => "modifyprofile",
|
||||
$can_viewnotifications => "viewnotifications"
|
||||
);
|
||||
|
||||
function operator_by_login($login)
|
||||
@ -356,13 +358,14 @@ function is_capable($perm, $operator)
|
||||
|
||||
function prepare_menu($operator, $hasright = true)
|
||||
{
|
||||
global $page, $settings, $can_administrate;
|
||||
global $page, $settings, $can_administrate,$can_viewnotifications;
|
||||
$page['operator'] = topage(get_operator_name($operator));
|
||||
if ($hasright) {
|
||||
loadsettings();
|
||||
$page['showban'] = $settings['enableban'] == "1";
|
||||
$page['showgroups'] = $settings['enablegroups'] == "1";
|
||||
$page['showstat'] = $settings['enablestatistics'] == "1";
|
||||
$page['shownotifications'] = is_capable($can_viewnotifications, $operator);
|
||||
$page['showadmin'] = is_capable($can_administrate, $operator);
|
||||
$page['currentopid'] = $operator['operatorid'];
|
||||
}
|
||||
|
@ -415,6 +415,7 @@ permission.admin=System administration: settings, operators management, button g
|
||||
permission.modifyprofile=Ability to modify profile
|
||||
permission.takeover=Take over chat thread
|
||||
permission.viewthreads=View another operator's chat thread
|
||||
permission.viewnotifications=View clients notifications
|
||||
permissions.intro=Change restrictions and available features for this operator.
|
||||
permissions.title=Permissions
|
||||
presurvey.department=Choose Department:
|
||||
|
@ -25,7 +25,7 @@ $operator = check_login();
|
||||
$page = array();
|
||||
$errors = array();
|
||||
|
||||
if (!is_capable($can_administrate, $operator)) {
|
||||
if (!is_capable($can_administrate, $operator) && !is_capable($can_viewnotifications, $operator)) {
|
||||
die("Permission denied.");
|
||||
}
|
||||
|
||||
|
@ -58,6 +58,8 @@ function tpl_menu() { global $page, $mibewroot, $errors;
|
||||
<li<?php menuli("settings")?>><a href="<?php echo $mibewroot ?>/operator/settings.php"><?php echo getlocal('leftMenu.client_settings') ?></a></li>
|
||||
<li<?php menuli("translate")?>><a href="<?php echo $mibewroot ?>/operator/translate.php"><?php echo getlocal('menu.translate') ?></a></li>
|
||||
<li<?php menuli("updates")?>><a href="<?php echo $mibewroot ?>/operator/updates.php"><?php echo getlocal('menu.updates') ?></a></li>
|
||||
<?php } ?>
|
||||
<?php if(isset($page['shownotifications']) && $page['shownotifications']) { ?>
|
||||
<li<?php menuli("notifications")?>><a href="<?php echo $mibewroot ?>/operator/notifications.php"><?php echo getlocal('menu.notifications') ?></a></li>
|
||||
<?php } ?>
|
||||
<?php if(isset($page['currentopid']) && $page['currentopid']) {?>
|
||||
|
Loading…
Reference in New Issue
Block a user