2007-10-10 19:15:47 +04:00
|
|
|
<?php
|
|
|
|
/*
|
2009-06-04 02:44:32 +04:00
|
|
|
* This file is part of Mibew Messenger project.
|
2007-10-10 19:15:47 +04:00
|
|
|
*
|
2009-06-04 02:44:32 +04:00
|
|
|
* Copyright (c) 2005-2009 Mibew Messenger Community
|
2007-10-10 19:15:47 +04:00
|
|
|
* All rights reserved. This program and the accompanying materials
|
|
|
|
* are made available under the terms of the Eclipse Public License v1.0
|
|
|
|
* which accompanies this distribution, and is available at
|
|
|
|
* http://www.eclipse.org/legal/epl-v10.html
|
|
|
|
*
|
|
|
|
* Contributors:
|
|
|
|
* Evgeny Gryaznov - initial API and implementation
|
|
|
|
*/
|
|
|
|
|
2008-06-05 01:36:54 +04:00
|
|
|
require_once('libs/common.php');
|
|
|
|
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
|
|
|
|
|
|
|
$image = verifyparam("image","/^\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");
|
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));
|
2007-10-10 19:15:47 +04:00
|
|
|
fpassthru($fp);
|
|
|
|
exit;
|
2007-05-10 21:31:10 +04:00
|
|
|
?>
|