2
0
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:
Adam Zammit
2013-11-25 16:31:08 +11:00
parent 7de149df5d
commit 2bbe9ea06a

View File

@@ -75,18 +75,29 @@ if (isset($_POST['submit']))
if (!empty($rs))
{
$sql = "UPDATE extension
SET current_operator_id = NULL
WHERE current_operator_id= $operator_id";
$db->Execute($sql);
//only update extension if we aren't on a case
$sql = "SELECT case_id
FROM `case`
WHERE current_operator_id = $operator_id";
if (!empty($_POST['extension_id']))
$cc= $db->GetOne($sql);
if (empty($cc))
{
$sql = "UPDATE extension
SET current_operator_id = $operator_id
WHERE extension_id = " . intval($_POST['extension_id']);
SET current_operator_id = NULL
WHERE current_operator_id= $operator_id";
$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']))