2007-10-10 19:15:47 +04:00
|
|
|
<?php
|
|
|
|
/*
|
2013-03-07 01:22:53 +04:00
|
|
|
* Copyright 2005-2013 the original author or authors.
|
2013-03-05 03:24:26 +04:00
|
|
|
*
|
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
* you may not use this file except in compliance with the License.
|
|
|
|
* 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.
|
2007-10-10 19:15:47 +04:00
|
|
|
*/
|
|
|
|
|
2008-06-05 01:36:54 +04:00
|
|
|
require_once('libs/common.php');
|
2009-08-10 16:47:14 +04:00
|
|
|
require_once('libs/chat.php');
|
2008-06-05 01:36:54 +04:00
|
|
|
require_once('libs/operator.php');
|
2009-06-05 03:01:17 +04:00
|
|
|
require_once('libs/groups.php');
|
2007-10-10 19:15:47 +04:00
|
|
|
|
2009-08-10 16:47:14 +04:00
|
|
|
$referer = isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : "";
|
|
|
|
if($referer && isset($_SESSION['threadid'])) {
|
|
|
|
$link = connect();
|
|
|
|
$thread = thread_by_id_($_SESSION['threadid'], $link);
|
|
|
|
if ($thread && $thread['istate'] != $state_closed) {
|
|
|
|
$msg = getstring2_("chat.client.visited.page", array($referer), $thread['locale']);
|
|
|
|
post_message_($thread['threadid'], $kind_for_agent,$msg,$link);
|
|
|
|
}
|
2011-11-09 18:16:37 +04:00
|
|
|
close_connection($link);
|
2009-08-10 16:47:14 +04:00
|
|
|
}
|
|
|
|
|
2009-09-01 12:50:11 +04:00
|
|
|
$image = verifyparam(isset($_GET['image']) ? "image" : "i", "/^\w+$/", "webim");
|
2008-09-30 03:14:17 +04:00
|
|
|
$lang = verifyparam(isset($_GET['language']) ? "language" : "lang", "/^[\w-]{2,5}$/", "");
|
2009-01-14 00:57:49 +03:00
|
|
|
if(!$lang || !locale_exists($lang)) {
|
2007-10-10 19:15:47 +04:00
|
|
|
$lang = $current_locale;
|
2008-06-05 02:51:46 +04:00
|
|
|
}
|
2007-10-10 19:15:47 +04:00
|
|
|
|
2009-06-05 03:01:17 +04:00
|
|
|
$groupid = verifyparam( "group", "/^\d{1,8}$/", "");
|
|
|
|
if($groupid) {
|
|
|
|
loadsettings();
|
|
|
|
if($settings['enablegroups'] == '1') {
|
|
|
|
$group = group_by_id($groupid);
|
|
|
|
if(!$group) {
|
|
|
|
$groupid = "";
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
$groupid = "";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
$image_postfix = has_online_operators($groupid) ? "on" : "off";
|
2008-05-06 01:08:57 +04:00
|
|
|
$filename = "locales/${lang}/button/${image}_${image_postfix}.gif";
|
2007-10-10 19:15:47 +04:00
|
|
|
|
2008-05-06 01:08:57 +04:00
|
|
|
$fp = fopen($filename, 'rb') or die("no image");
|
2011-03-01 00:12:07 +03:00
|
|
|
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
|
|
|
|
header("Cache-Control: no-store, no-cache, must-revalidate");
|
|
|
|
header("Pragma: no-cache");
|
2007-10-10 19:15:47 +04:00
|
|
|
header("Content-Type: image/gif");
|
2008-05-06 01:08:57 +04:00
|
|
|
header("Content-Length: ".filesize($filename));
|
2009-09-08 18:58:36 +04:00
|
|
|
if(function_exists('fpassthru')){
|
|
|
|
@fpassthru($fp);
|
|
|
|
} else {
|
|
|
|
while( (!feof($fp)) && (connection_status()==0)){
|
|
|
|
print(fread($fp, 1024*8));
|
|
|
|
flush();
|
|
|
|
}
|
|
|
|
fclose($fp);
|
|
|
|
}
|
2007-10-10 19:15:47 +04:00
|
|
|
exit;
|
2007-05-10 21:31:10 +04:00
|
|
|
?>
|