diff --git a/src/messenger/webim/libs/operator.php b/src/messenger/webim/libs/operator.php index f41d0ecb..6eabc317 100644 --- a/src/messenger/webim/libs/operator.php +++ b/src/messenger/webim/libs/operator.php @@ -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(); diff --git a/src/messenger/webim/operator/permissions.php b/src/messenger/webim/operator/permissions.php index 8d307066..d83af65e 100644 --- a/src/messenger/webim/operator/permissions.php +++ b/src/messenger/webim/operator/permissions.php @@ -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();