Hide Device Provisioning on the extensions page if app/devices is not installed.

This commit is contained in:
Mark Crane 2014-03-04 05:59:34 +00:00
parent 2eabe478f2
commit 2e2c31eb36
1 changed files with 273 additions and 265 deletions

View File

@ -111,6 +111,7 @@ else {
} }
//delete the line from the v_device_lines //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 ($_GET["a"] == "delete" && strlen($_REQUEST["device_line_uuid"]) > 0 && permission_exists("extension_delete")) {
//set the variables //set the variables
$extension_uuid = check_str($_REQUEST["id"]); $extension_uuid = check_str($_REQUEST["id"]);
@ -126,6 +127,7 @@ else {
header("Location: extension_edit.php?id=".$extension_uuid); header("Location: extension_edit.php?id=".$extension_uuid);
return; return;
} }
}
//assign the extension to the user //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 && $_GET["a"] != "delete") {
@ -155,6 +157,7 @@ else {
} }
//assign the line to the device //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 && $_GET["a"] != "delete") {
//set the variables //set the variables
$extension_uuid = check_str($_REQUEST["id"]); $extension_uuid = check_str($_REQUEST["id"]);
@ -233,6 +236,7 @@ else {
header("Location: extension_edit.php?id=".$extension_uuid); header("Location: extension_edit.php?id=".$extension_uuid);
return; return;
} }
}
if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
@ -579,8 +583,10 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
} }
//write the provision files //write the provision files
if (is_dir($_SERVER["DOCUMENT_ROOT"].PROJECT_PATH.'/app/provision')) {
require_once "app/provision/provision_write.php"; require_once "app/provision/provision_write.php";
$ext = new extension; $ext = new extension;
}
//delete extension from memcache //delete extension from memcache
$fp = event_socket_create($_SESSION['event_socket_ip_address'], $_SESSION['event_socket_port'], $_SESSION['event_socket_password']); $fp = event_socket_create($_SESSION['event_socket_ip_address'], $_SESSION['event_socket_port'], $_SESSION['event_socket_password']);
@ -1133,6 +1139,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
echo "</tr>\n"; echo "</tr>\n";
if ($action == "update") { if ($action == "update") {
if (is_dir($_SERVER["DOCUMENT_ROOT"].PROJECT_PATH.'/app/devices')) {
echo "<tr>\n"; echo "<tr>\n";
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n"; echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
echo " ".$text['label-provisioning'].":\n"; echo " ".$text['label-provisioning'].":\n";
@ -1329,6 +1336,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
echo "</td>\n"; echo "</td>\n";
echo "</tr>\n"; echo "</tr>\n";
} }
}
if (is_dir($_SERVER["DOCUMENT_ROOT"].PROJECT_PATH.'/app/voicemails')) { if (is_dir($_SERVER["DOCUMENT_ROOT"].PROJECT_PATH.'/app/voicemails')) {
echo "<tr>\n"; echo "<tr>\n";