* You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ require_once '../libs/common.php'; require_once '../libs/chat.php'; require_once '../libs/userinfo.php'; require_once '../libs/operator.php'; require_once '../libs/groups.php'; $operator = get_logged_in(); if (!$operator) { start_xml_output(); echo "<error><descr>" . escape_with_cdata(safe_htmlspecialchars(myiconv($mibew_encoding, "utf-8", getstring("agent.not_logged_in")))) . "</descr></error>"; exit; } $threadstate_to_string = array($state_queue => "wait", $state_waiting => "prio", $state_chatting => "chat", $state_closed => "closed", $state_loading => "wait", $state_left => "closed"); $threadstate_key = array($state_queue => "chat.thread.state_wait", $state_waiting => "chat.thread.state_wait_for_another_agent", $state_chatting => "chat.thread.state_chatting_with_agent", $state_closed => "chat.thread.state_closed", $state_loading => "chat.thread.state_loading"); function thread_to_xml($thread, $link) { global $state_chatting, $threadstate_to_string, $threadstate_key, $mibew_encoding, $operator, $settings, $can_viewthreads, $can_takeover, $mysqlprefix; $state = $threadstate_to_string[$thread['istate']]; $result = "<thread id=\"" . safe_htmlspecialchars(safe_htmlspecialchars($thread['threadid'])) . "\" stateid=\"{$state}\""; if ($state == "closed") { return $result . "/>"; }
function check_logged_in() { global $session_expired; my_session_start(); $o_user = get_logged_in(); if ($o_user === NULL) { return FALSE; } return TRUE; }