Hot Desking update the code so the unique id and pin number are updated.
This commit is contained in:
parent
f4a40954ef
commit
060ba47b79
|
|
@ -40,6 +40,7 @@ else {
|
|||
$text[$key] = $value[$_SESSION['domain']['language']['code']];
|
||||
}
|
||||
|
||||
//get the id
|
||||
if (count($_GET) > 0) {
|
||||
$id = check_str($_GET["id"]);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -124,7 +124,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
|
|||
if ($action == "update" && permission_exists('extension_edit')) {
|
||||
//update the extension
|
||||
$sql = "update v_extensions set ";
|
||||
$sql .= "unique_id = '$unique_id', ";
|
||||
$sql .= "unique_id = '$unique_id' ";
|
||||
$sql .= "where domain_uuid = '$domain_uuid' ";
|
||||
$sql .= "and extension_uuid = '$extension_uuid'";
|
||||
$db->exec(check_sql($sql));
|
||||
|
|
@ -133,7 +133,6 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
|
|||
//update the voicemail
|
||||
if (strlen($vm_password) > 0) {
|
||||
$sql = "update v_voicemails set ";
|
||||
$sql .= "unique_id = '$unique_id', ";
|
||||
$sql .= "voicemail_password = '$vm_password' ";
|
||||
$sql .= "where domain_uuid = '$domain_uuid' ";
|
||||
if (is_numeric($extension)) {
|
||||
|
|
@ -182,7 +181,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
|
|||
|
||||
//pre-populate the form
|
||||
if ($_POST["persistformvar"] != "true") {
|
||||
//$extension_uuid = $_GET["id"];
|
||||
//get the extension data
|
||||
$sql = "select * from v_extensions ";
|
||||
$sql .= "where domain_uuid = '$domain_uuid' ";
|
||||
$sql .= "and extension_uuid = '$extension_uuid' ";
|
||||
|
|
@ -193,9 +192,24 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
|
|||
$extension = $row["extension"];
|
||||
$dial_string = $row["dial_string"];
|
||||
$unique_id = $row["unique_id"];
|
||||
$password = $row["password"];
|
||||
$vm_password = $row["vm_password"];
|
||||
$vm_password = str_replace("#", "", $vm_password); //preserves leading zeros
|
||||
}
|
||||
unset ($prep_statement);
|
||||
|
||||
//get the voicemail data
|
||||
$sql = "select * from v_voicemails ";
|
||||
$sql .= "where domain_uuid = '$domain_uuid' ";
|
||||
if (is_numeric($extension)) {
|
||||
$sql .= "and voicemail_id = '$extension' ";
|
||||
}
|
||||
else {
|
||||
$sql .= "and voicemail_id = '$number_alias' ";
|
||||
}
|
||||
//$sql .= "and voicemail_enabled = 'true' ";
|
||||
$prep_statement = $db->prepare(check_sql($sql));
|
||||
$prep_statement->execute();
|
||||
$result = $prep_statement->fetchAll(PDO::FETCH_NAMED);
|
||||
foreach ($result as &$row) {
|
||||
$vm_password = $row["voicemail_password"];
|
||||
}
|
||||
unset ($prep_statement);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue