Portions created by the Initial Developer are Copyright (C) 2008-2015 the Initial Developer. All Rights Reserved. Contributor(s): Mark J Crane Luis Daniel Lucio Quiroz */ include "root.php"; require_once "resources/require.php"; require_once "resources/check_auth.php"; if (permission_exists('operator_panel_view')) { //access granted } else { echo "access denied"; exit; } //add multi-lingual support $language = new text; $text = $language->get(); //set user status if (isset($_REQUEST['status']) && $_REQUEST['status'] != '') { $user_status = check_str($_REQUEST['status']); //sql update $sql = "update v_users set "; $sql .= "user_status = '".$user_status."' "; $sql .= "where domain_uuid = '".$_SESSION['domain_uuid']."' "; $sql .= "and user_uuid = '".$_SESSION['user']['user_uuid']."' "; if (permission_exists("user_account_setting_edit")) { $count = $db->exec(check_sql($sql)); } //if call center app is installed then update the user_status if (is_dir($_SERVER["DOCUMENT_ROOT"].PROJECT_PATH.'/app/call_center')) { //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 ".$_SESSION['user']['username']."@".$_SESSION['domain_name']." '".$user_status."'"; $switch_result = event_socket_request($fp, 'api '.$switch_cmd); //update the user state $cmd = "api callcenter_config agent set state ".$_SESSION['user']['username']."@".$_SESSION['domain_name']." Waiting"; $response = event_socket_request($fp, $cmd); } exit; } $document['title'] = $text['title-operator_panel']; require_once "resources/header.php"; ?>