Do not include the voicemail unless the app/voicemails directory exists.
This commit is contained in:
parent
6f0631b8c4
commit
5aff644a70
|
|
@ -443,11 +443,14 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
|
|||
$db->exec(check_sql($sql));
|
||||
unset($sql);
|
||||
}
|
||||
|
||||
//add or update voicemail
|
||||
if (is_dir($_SERVER["DOCUMENT_ROOT"].PROJECT_PATH.'/app/voicemails')) {
|
||||
//set the voicemail password
|
||||
if (strlen($vm_password) == 0) {
|
||||
$vm_password = generate_password(9, 1);
|
||||
}
|
||||
//add or update voicemail
|
||||
//voicemail class
|
||||
require_once "app/extensions/resources/classes/extension.php";
|
||||
$ext = new extension;
|
||||
$ext->db = $db;
|
||||
|
|
@ -462,6 +465,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
|
|||
$ext->description = $description;
|
||||
$ext->voicemail();
|
||||
unset($ext);
|
||||
}
|
||||
//increment the extension number
|
||||
$extension++;
|
||||
}
|
||||
|
|
@ -545,6 +549,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
|
|||
unset($sql);
|
||||
|
||||
//add or update voicemail
|
||||
if (is_dir($_SERVER["DOCUMENT_ROOT"].PROJECT_PATH.'/app/voicemails')) {
|
||||
require_once "app/extensions/resources/classes/extension.php";
|
||||
$ext = new extension;
|
||||
$ext->db = $db;
|
||||
|
|
@ -559,6 +564,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
|
|||
$ext->description = $description;
|
||||
$ext->voicemail();
|
||||
unset($ext);
|
||||
}
|
||||
} //if ($action == "update")
|
||||
|
||||
//check the permissions
|
||||
|
|
@ -685,6 +691,8 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
|
|||
}
|
||||
|
||||
//get the voicemail data
|
||||
if (is_dir($_SERVER["DOCUMENT_ROOT"].PROJECT_PATH.'/app/voicemails')) {
|
||||
//get the voicemails
|
||||
$sql = "select * from v_voicemails ";
|
||||
$sql .= "where domain_uuid = '$domain_uuid' ";
|
||||
if (is_numeric($extension)) {
|
||||
|
|
@ -706,10 +714,10 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
|
|||
$vm_enabled = $row["voicemail_enabled"];
|
||||
}
|
||||
unset ($prep_statement);
|
||||
|
||||
//clean the variables
|
||||
//clean the variables
|
||||
$vm_password = str_replace("#", "", $vm_password);
|
||||
$vm_mailto = str_replace(" ", "", $vm_mailto);
|
||||
}
|
||||
|
||||
//set the defaults
|
||||
if (strlen($limit_max) == 0) { $limit_max = '5'; }
|
||||
|
|
@ -900,6 +908,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
|
|||
echo " </tr>";
|
||||
}
|
||||
|
||||
if (is_dir($_SERVER["DOCUMENT_ROOT"].PROJECT_PATH.'/app/voicemails')) {
|
||||
echo "<tr>\n";
|
||||
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
|
||||
echo " ".$text['label-vm_password'].":\n";
|
||||
|
|
@ -910,6 +919,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
|
|||
echo "<span onclick=\"document.getElementById('show_vm_password').innerHTML = ''\">".$text['description-vm_password']." </span><span id='show_vm_password'></span>\n";
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
}
|
||||
|
||||
echo "<tr>\n";
|
||||
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
|
||||
|
|
@ -1320,6 +1330,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
|
|||
echo "</tr>\n";
|
||||
}
|
||||
|
||||
if (is_dir($_SERVER["DOCUMENT_ROOT"].PROJECT_PATH.'/app/voicemails')) {
|
||||
echo "<tr>\n";
|
||||
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
|
||||
echo " ".$text['label-vm_enabled'].":\n";
|
||||
|
|
@ -1405,6 +1416,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
|
|||
echo $text['description-vm_keep_local_after_email']."\n";
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
}
|
||||
|
||||
if (permission_exists('extension_toll')) {
|
||||
echo "<tr>\n";
|
||||
|
|
|
|||
Loading…
Reference in New Issue