Esempio n. 1
0
 if (!permission_exists('user_domain')) {
     $sql .= "domain_uuid = '" . $domain_uuid . "' and ";
 }
 $sql .= "user_uuid = '" . $user_uuid . "' ";
 $db->exec(check_sql($sql));
 // if call center installed
 if (file_exists($_SERVER["PROJECT_ROOT"] . "/app/call_center/app_config.php")) {
     // update agent and tiers tables
     $sql = "update v_call_center_agents set agent_name = '" . $username . "' where domain_uuid = '" . $domain_uuid . "' and agent_name = '" . $username_old . "' ";
     $db->exec(check_sql($sql));
     unset($sql);
     $sql = "update v_call_center_tiers set agent_name = '" . $username . "' where domain_uuid = '" . $domain_uuid . "' and agent_name = '" . $username_old . "' ";
     $db->exec(check_sql($sql));
     unset($sql);
     //syncrhonize the configuration
     save_call_center_xml();
     //update the user_status
     $fp = event_socket_create($_SESSION['event_socket_ip_address'], $_SESSION['event_socket_port'], $_SESSION['event_socket_password']);
     $switch_cmd .= "callcenter_config agent set status " . $username . "@" . $_SESSION['domains'][$domain_uuid]['domain_name'] . " '" . $user_status . "'";
     $switch_result = event_socket_request($fp, 'api ' . $switch_cmd);
     //update the user state
     $cmd = "api callcenter_config agent set state " . $username . "@" . $_SESSION['domains'][$domain_uuid]['domain_name'] . " Waiting";
     $response = event_socket_request($fp, $cmd);
 }
 //redirect the browser
 $_SESSION["message"] = $text['message-update'];
 if ($_REQUEST['action'] == $text['button-add']) {
     header("Location: usersupdate.php?id=" . $user_uuid);
 } else {
     header("Location: index.php");
 }
Esempio n. 2
0
 function save_switch_xml()
 {
     if (is_readable($_SESSION['switch']['dialplan']['dir'])) {
         save_dialplan_xml();
     }
     if (is_readable($_SESSION['switch']['extensions']['dir'])) {
         if (file_exists($_SERVER["DOCUMENT_ROOT"] . PROJECT_PATH . "/app/extensions/resources/classes/extension.php")) {
             require_once $_SERVER["DOCUMENT_ROOT"] . PROJECT_PATH . "app/extensions/resources/classes/extension.php";
             $extension = new extension();
             $extension->xml();
         }
     }
     if (is_readable($_SESSION['switch']['conf']['dir'])) {
         if (file_exists($_SERVER['DOCUMENT_ROOT'] . PROJECT_PATH . "/app/settings/app_config.php")) {
             save_setting_xml();
         }
         if (file_exists($_SERVER['DOCUMENT_ROOT'] . PROJECT_PATH . "/app/modules/app_config.php")) {
             save_module_xml();
         }
         if (file_exists($_SERVER['DOCUMENT_ROOT'] . PROJECT_PATH . "/app/vars/app_config.php")) {
             save_var_xml();
         }
         if (file_exists($_SERVER['DOCUMENT_ROOT'] . PROJECT_PATH . "/app/call_center/app_config.php")) {
             save_call_center_xml();
         }
         if (file_exists($_SERVER['DOCUMENT_ROOT'] . PROJECT_PATH . "/app/gateways/app_config.php")) {
             save_gateway_xml();
         }
         //if (file_exists($_SERVER['DOCUMENT_ROOT'].PROJECT_PATH."/app/ivr_menu/app_config.php")) {
         //	save_ivr_menu_xml();
         //}
         if (file_exists($_SERVER['DOCUMENT_ROOT'] . PROJECT_PATH . "/app/sip_profiles/app_config.php")) {
             save_sip_profile_xml();
         }
     }
 }