mirror of
https://github.com/ACSPRI/queXS
synced 2024-04-02 12:12:16 +00:00
Only allow extension changes when not on a case
This commit is contained in:
@@ -75,18 +75,29 @@ if (isset($_POST['submit']))
|
|||||||
|
|
||||||
if (!empty($rs))
|
if (!empty($rs))
|
||||||
{
|
{
|
||||||
$sql = "UPDATE extension
|
//only update extension if we aren't on a case
|
||||||
SET current_operator_id = NULL
|
$sql = "SELECT case_id
|
||||||
WHERE current_operator_id= $operator_id";
|
FROM `case`
|
||||||
$db->Execute($sql);
|
WHERE current_operator_id = $operator_id";
|
||||||
|
|
||||||
if (!empty($_POST['extension_id']))
|
$cc= $db->GetOne($sql);
|
||||||
|
|
||||||
|
if (empty($cc))
|
||||||
{
|
{
|
||||||
$sql = "UPDATE extension
|
$sql = "UPDATE extension
|
||||||
SET current_operator_id = $operator_id
|
SET current_operator_id = NULL
|
||||||
WHERE extension_id = " . intval($_POST['extension_id']);
|
WHERE current_operator_id= $operator_id";
|
||||||
|
|
||||||
$db->Execute($sql);
|
$db->Execute($sql);
|
||||||
|
|
||||||
|
if (!empty($_POST['extension_id']))
|
||||||
|
{
|
||||||
|
$sql = "UPDATE extension
|
||||||
|
SET current_operator_id = $operator_id
|
||||||
|
WHERE extension_id = " . intval($_POST['extension_id']);
|
||||||
|
|
||||||
|
$db->Execute($sql);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (HTPASSWD_PATH !== false && !empty($_POST['password']))
|
if (HTPASSWD_PATH !== false && !empty($_POST['password']))
|
||||||
|
|||||||
Reference in New Issue
Block a user