示例#1
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;
         $ext->domain_uuid = $domain_uuid;
         $ext->extension = $extension;
         $ext->number_alias = $number_alias;
         $ext->voicemail_password = $voicemail_password;
         $ext->voicemail_mail_to = $voicemail_mail_to;
         $ext->voicemail_file = $voicemail_file;
         $ext->voicemail_local_after_email = $voicemail_local_after_email;
         $ext->voicemail_enabled = $voicemail_enabled;
         $ext->description = $description;
         $ext->voicemail();
         unset($ext);
     }
     //update devices having extension assigned to line(s) with new password
     $sql = "update v_device_lines set ";
     $sql .= "password = '******' ";
     $sql .= "where domain_uuid = '" . $domain_uuid . "' ";
     $sql .= "and server_address = '" . $_SESSION['domain_name'] . "' ";
     $sql .= "and user_id = '" . $extension . "' ";
     $db->exec(check_sql($sql));
     unset($sql);
 }
 //if ($action == "update")
 //check the permissions
 if (permission_exists('extension_add') || permission_exists('extension_edit')) {
     //synchronize configuration