mirror of
https://github.com/Mibew/design.git
synced 2025-01-22 18:10:33 +03:00
Move update_operator_permissions function to libs/operator.php
This commit is contained in:
parent
a31cdfce24
commit
a23d9fa216
@ -53,6 +53,19 @@ function permission_ids() {
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set new permissions to operator
|
||||
* @param int $operator_id Operator ID
|
||||
* @param int $perm New permissions value
|
||||
*/
|
||||
function update_operator_permissions($operator_id, $perm) {
|
||||
$db = Database::getInstance();
|
||||
$db->query(
|
||||
"update {chatoperator} set iperm = ? where operatorid = ?",
|
||||
array($perm, $operator_id)
|
||||
);
|
||||
}
|
||||
|
||||
function operator_by_login($login)
|
||||
{
|
||||
$db = Database::getInstance();
|
||||
|
@ -22,15 +22,6 @@ require_once('../libs/operator_settings.php');
|
||||
$operator = check_login();
|
||||
csrfchecktoken();
|
||||
|
||||
function update_operator_permissions($operatorid, $newvalue)
|
||||
{
|
||||
$db = Database::getInstance();
|
||||
$db->query(
|
||||
"update {chatoperator} set iperm = ? where operatorid = ?",
|
||||
array($newvalue, $operatorid)
|
||||
);
|
||||
}
|
||||
|
||||
$opId = verifyparam("op", "/^\d{1,9}$/");
|
||||
$page = array('opid' => $opId, 'canmodify' => is_capable(CAN_ADMINISTRATE, $operator) ? "1" : "");
|
||||
$errors = array();
|
||||
|
Loading…
Reference in New Issue
Block a user