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

@@ -74,10 +74,20 @@ if (isset($_POST['submit']))
$rs = $db->Execute($sql); $rs = $db->Execute($sql);
if (!empty($rs)) if (!empty($rs))
{
//only update extension if we aren't on a case
$sql = "SELECT case_id
FROM `case`
WHERE current_operator_id = $operator_id";
$cc= $db->GetOne($sql);
if (empty($cc))
{ {
$sql = "UPDATE extension $sql = "UPDATE extension
SET current_operator_id = NULL SET current_operator_id = NULL
WHERE current_operator_id= $operator_id"; WHERE current_operator_id= $operator_id";
$db->Execute($sql); $db->Execute($sql);
if (!empty($_POST['extension_id'])) if (!empty($_POST['extension_id']))
@@ -87,6 +97,7 @@ if (isset($_POST['submit']))
WHERE extension_id = " . intval($_POST['extension_id']); WHERE extension_id = " . intval($_POST['extension_id']);
$db->Execute($sql); $db->Execute($sql);
}
} }
if (HTPASSWD_PATH !== false && !empty($_POST['password'])) if (HTPASSWD_PATH !== false && !empty($_POST['password']))