diff --git a/app/extensions/extension_edit.php b/app/extensions/extension_edit.php
index d35b61a1ef..1ee9be4dcb 100644
--- a/app/extensions/extension_edit.php
+++ b/app/extensions/extension_edit.php
@@ -96,43 +96,35 @@ else {
}
//delete the user from the v_extension_users
- if ($_GET["a"] == "delete" && strlen($_REQUEST["user_uuid"]) > 0 && permission_exists("extension_delete")) {
+ if ($_REQUEST["delete_type"] == "user" && strlen($_REQUEST["delete_uuid"]) > 0 && permission_exists("extension_delete")) {
//set the variables
- $user_uuid = check_str($_REQUEST["user_uuid"]);
$extension_uuid = check_str($_REQUEST["id"]);
+ $user_uuid = check_str($_REQUEST["delete_uuid"]);
//delete the group from the users
$sql = "delete from v_extension_users ";
$sql .= "where domain_uuid = '".$domain_uuid."' ";
$sql .= "and extension_uuid = '".$extension_uuid."' ";
$sql .= "and user_uuid = '".$user_uuid."' ";
$db->exec(check_sql($sql));
- //redirect the browser
- $_SESSION["message"] = $text['message-delete'];
- header("Location: extension_edit.php?id=".$extension_uuid);
- return;
}
//delete the line from the v_device_lines
if (is_dir($_SERVER["DOCUMENT_ROOT"].PROJECT_PATH.'/app/devices')) {
- if ($_GET["a"] == "delete" && strlen($_REQUEST["device_line_uuid"]) > 0 && permission_exists("extension_delete")) {
+ if ($_REQUEST["delete_type"] == "device_line" && strlen($_REQUEST["delete_uuid"]) > 0 && permission_exists("extension_delete")) {
//set the variables
$extension_uuid = check_str($_REQUEST["id"]);
- $device_line_uuid = check_str($_REQUEST["device_line_uuid"]);
+ $device_line_uuid = check_str($_REQUEST["delete_uuid"]);
//delete device_line
$sql = "delete from v_device_lines ";
$sql .= "where domain_uuid = '$domain_uuid' ";
$sql .= "and device_line_uuid = '$device_line_uuid' ";
$db->exec(check_sql($sql));
unset($sql);
- //redirect the browser
- $_SESSION["message"] = $text['message-delete'];
- header("Location: extension_edit.php?id=".$extension_uuid);
- return;
}
}
//assign the extension to the user
- if (strlen($_REQUEST["user_uuid"]) > 0 && strlen($_REQUEST["id"]) > 0 && $_GET["a"] != "delete") {
+ if (strlen($_REQUEST["user_uuid"]) > 0 && strlen($_REQUEST["id"]) > 0) {
//set the variables
$user_uuid = check_str($_REQUEST["user_uuid"]);
$extension_uuid = check_str($_REQUEST["id"]);
@@ -152,16 +144,11 @@ else {
$sql_insert .= "'".$user_uuid."' ";
$sql_insert .= ")";
$db->exec($sql_insert);
-
- //redirect the browser
- $_SESSION["message"] = $text['message-add'];
- header("Location: extension_edit.php?id=".$extension_uuid);
- return;
}
//assign the line to the device
if (is_dir($_SERVER["DOCUMENT_ROOT"].PROJECT_PATH.'/app/devices')) {
- if (strlen($_REQUEST["device_mac_address"]) > 0 && strlen($_REQUEST["id"]) > 0 && $_GET["a"] != "delete") {
+ if (strlen($_REQUEST["device_mac_address"]) > 0 && strlen($_REQUEST["id"]) > 0) {
//set the variables
$extension_uuid = check_str($_REQUEST["id"]);
@@ -244,11 +231,6 @@ else {
$sql_insert .= ")";
//echo $sql_insert."
\n";
$db->exec($sql_insert);
-
- //redirect the browser
- $_SESSION["message"] = $text['message-add'];
- header("Location: extension_edit.php?id=".$extension_uuid);
- return;
}
}
@@ -355,7 +337,6 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
$sql .= "extension, ";
$sql .= "number_alias, ";
$sql .= "password, ";
- //$sql .= "vm_password, ";
$sql .= "accountcode, ";
$sql .= "effective_caller_id_name, ";
$sql .= "effective_caller_id_number, ";
@@ -368,10 +349,6 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
$sql .= "directory_exten_visible, ";
$sql .= "limit_max, ";
$sql .= "limit_destination, ";
- //$sql .= "vm_enabled, ";
- //$sql .= "vm_mailto, ";
- //$sql .= "vm_attach_file, ";
- //$sql .= "vm_keep_local_after_email, ";
$sql .= "user_context, ";
if (permission_exists('extension_toll')) {
$sql .= "toll_allow, ";
@@ -406,7 +383,6 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
$sql .= "'$extension', ";
$sql .= "'$number_alias', ";
$sql .= "'$password', ";
- //$sql .= "'user-choose', ";
$sql .= "'$accountcode', ";
$sql .= "'$effective_caller_id_name', ";
$sql .= "'$effective_caller_id_number', ";
@@ -419,10 +395,6 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
$sql .= "'$directory_exten_visible', ";
$sql .= "'$limit_max', ";
$sql .= "'$limit_destination', ";
- //$sql .= "'$vm_enabled', ";
- //$sql .= "'$vm_mailto', ";
- //$sql .= "'$vm_attach_file', ";
- //$sql .= "'$vm_keep_local_after_email', ";
$sql .= "'$user_context', ";
if (permission_exists('extension_toll')) {
$sql .= "'$toll_allow', ";
@@ -509,7 +481,6 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
$sql .= "extension = '$extension', ";
$sql .= "number_alias = '$number_alias', ";
$sql .= "password = '$password', ";
- //$sql .= "vm_password = '$vm_password', ";
$sql .= "accountcode = '$accountcode', ";
$sql .= "effective_caller_id_name = '$effective_caller_id_name', ";
$sql .= "effective_caller_id_number = '$effective_caller_id_number', ";
@@ -522,10 +493,6 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
$sql .= "directory_exten_visible = '$directory_exten_visible', ";
$sql .= "limit_max = '$limit_max', ";
$sql .= "limit_destination = '$limit_destination', ";
- //$sql .= "vm_enabled = '$vm_enabled', ";
- //$sql .= "vm_mailto = '$vm_mailto', ";
- //$sql .= "vm_attach_file = '$vm_attach_file', ";
- //$sql .= "vm_keep_local_after_email = '$vm_keep_local_after_email', ";
$sql .= "user_context = '$user_context', ";
if (permission_exists('extension_toll')) {
$sql .= "toll_allow = '$toll_allow', ";
@@ -694,11 +661,6 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
$directory_exten_visible = $row["directory_exten_visible"];
$limit_max = $row["limit_max"];
$limit_destination = $row["limit_destination"];
- //$vm_password = $row["vm_password"];
- //$vm_enabled = $row["vm_enabled"];
- //$vm_mailto = $row["vm_mailto"];
- //$vm_attach_file = $row["vm_attach_file"];
- //$vm_keep_local_after_email = $row["vm_keep_local_after_email"];
$user_context = $row["user_context"];
$toll_allow = $row["toll_allow"];
$call_timeout = $row["call_timeout"];
@@ -821,7 +783,7 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
if ($action != "add") {
echo " \n";
}
- echo " \n";
+ echo " \n";
echo "
\n";
echo "\n";
echo "\n";
@@ -921,12 +883,13 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
$result = $prep_statement->fetchAll(PDO::FETCH_NAMED);
$result_count = count($result);
if ($result_count > 0) {
- echo "
| ".$field['username']." | \n"; echo "\n"; - echo " $v_link_label_delete\n"; + echo " $v_link_label_delete\n"; +// echo " $v_link_label_delete\n"; echo " | \n"; echo "