Completely wiped out the old application name
@ -31,7 +31,7 @@ if($referer && isset($_SESSION['threadid'])) {
|
||||
mysql_close($link);
|
||||
}
|
||||
|
||||
$image = verifyparam(isset($_GET['image']) ? "image" : "i", "/^\w+$/", "webim");
|
||||
$image = verifyparam(isset($_GET['image']) ? "image" : "i", "/^\w+$/", "mibew");
|
||||
$lang = verifyparam(isset($_GET['language']) ? "language" : "lang", "/^[\w-]{2,5}$/", "");
|
||||
if(!$lang || !locale_pattern_check($lang) || !locale_exists($lang)) {
|
||||
$lang = $current_locale;
|
||||
|
@ -79,7 +79,7 @@ if( !isset($_GET['token']) || !isset($_GET['thread']) ) {
|
||||
if($settings['usercanchangename'] == "1" && isset($_POST['name'])) {
|
||||
$newname = getparam("name");
|
||||
if($newname != $visitor['name']) {
|
||||
$data = strtr(base64_encode(myiconv($webim_encoding,"utf-8",$newname)), '+/=', '-_,');
|
||||
$data = strtr(base64_encode(myiconv($mibew_encoding,"utf-8",$newname)), '+/=', '-_,');
|
||||
setcookie($namecookie, $data, time()+60*60*24*365);
|
||||
$visitor['name'] = $newname;
|
||||
}
|
||||
@ -151,7 +151,7 @@ if( !isset($_GET['token']) || !isset($_GET['thread']) ) {
|
||||
$token = $thread['ltoken'];
|
||||
$level = get_remote_level($_SERVER['HTTP_USER_AGENT']);
|
||||
$chatstyle = verifyparam( "style", "/^\w+$/", "");
|
||||
header("Location: $webimroot/client.php?thread=$threadid&token=$token&level=$level".($chatstyle ? "&style=$chatstyle" : ""));
|
||||
header("Location: $mibewroot/client.php?thread=$threadid&token=$token&level=$level".($chatstyle ? "&style=$chatstyle" : ""));
|
||||
exit;
|
||||
}
|
||||
|
||||
|
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 2.2 KiB |
@ -141,10 +141,10 @@ $dbtables_can_update = array(
|
||||
|
||||
function show_install_err($text)
|
||||
{
|
||||
global $page, $version, $errors, $webimroot;
|
||||
global $page, $version, $errors, $mibewroot;
|
||||
$page = array(
|
||||
'version' => $version,
|
||||
'localeLinks' => get_locale_links("$webimroot/install/index.php")
|
||||
'localeLinks' => get_locale_links("$mibewroot/install/index.php")
|
||||
);
|
||||
$errors = array($text);
|
||||
start_html_output();
|
||||
|
@ -163,6 +163,6 @@ if ($act == "silentcreateall") {
|
||||
}
|
||||
|
||||
mysql_close($link);
|
||||
header("Location: $webimroot/install/index.php");
|
||||
header("Location: $mibewroot/install/index.php");
|
||||
exit;
|
||||
?>
|
||||
|
@ -21,7 +21,7 @@ require_once('dbinfo.php');
|
||||
|
||||
$page = array(
|
||||
'version' => $version,
|
||||
'localeLinks' => get_locale_links("$webimroot/install/index.php")
|
||||
'localeLinks' => get_locale_links("$mibewroot/install/index.php")
|
||||
);
|
||||
|
||||
$page['done'] = array();
|
||||
@ -30,9 +30,9 @@ $page['nextnotice'] = false;
|
||||
$page['soundcheck'] = false;
|
||||
$errors = array();
|
||||
|
||||
function check_webimroot()
|
||||
function check_mibewroot()
|
||||
{
|
||||
global $page, $errors, $webimroot;
|
||||
global $page, $errors, $mibewroot;
|
||||
$requestUri = $_SERVER["REQUEST_URI"];
|
||||
if (!preg_match('/^(.*)\\/install(\\/[^\\/\\\\]*)?$/', $requestUri, $matches)) {
|
||||
$errors[] = "Cannot detect application location: $requestUri";
|
||||
@ -40,9 +40,9 @@ function check_webimroot()
|
||||
}
|
||||
$applocation = $matches[1];
|
||||
|
||||
if ($applocation != $webimroot) {
|
||||
$errors[] = "Please, check file ${applocation}/libs/config.php<br/>Wrong value of \$webimroot variable, should be \"$applocation\"";
|
||||
$webimroot = $applocation;
|
||||
if ($applocation != $mibewroot) {
|
||||
$errors[] = "Please, check file ${applocation}/libs/config.php<br/>Wrong value of \$mibewroot variable, should be \"$applocation\"";
|
||||
$mibewroot = $applocation;
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -87,12 +87,12 @@ function fpermissions($file)
|
||||
|
||||
function check_files()
|
||||
{
|
||||
global $page, $errors, $webimroot;
|
||||
global $page, $errors, $mibewroot;
|
||||
|
||||
$packageFile = dirname(__FILE__) . "/package";
|
||||
$fp = @fopen($packageFile, "r");
|
||||
if ($fp === FALSE) {
|
||||
$errors[] = getlocal2("install.cannot_read", array("$webimroot/install/package"));
|
||||
$errors[] = getlocal2("install.cannot_read", array("$mibewroot/install/package"));
|
||||
if (file_exists($packageFile)) {
|
||||
$errors[] = getlocal2("install.check_permissions", array(fpermissions($packageFile)));
|
||||
}
|
||||
@ -113,10 +113,10 @@ function check_files()
|
||||
$relativeName = dirname(__FILE__) . "/../$file";
|
||||
if (!is_readable($relativeName)) {
|
||||
if (file_exists($relativeName)) {
|
||||
$errors[] = getlocal2("install.cannot_read", array("$webimroot/$file"));
|
||||
$errors[] = getlocal2("install.cannot_read", array("$mibewroot/$file"));
|
||||
$errors[] = getlocal2("install.check_permissions", array(fpermissions($relativeName)));
|
||||
} else {
|
||||
$errors[] = getlocal2("install.no_file", array("$webimroot/$file"));
|
||||
$errors[] = getlocal2("install.no_file", array("$mibewroot/$file"));
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@ -127,7 +127,7 @@ function check_files()
|
||||
$result = md5(str_replace("\r", "", file_get_contents($relativeName)));
|
||||
}
|
||||
if ($result != $sum) {
|
||||
$errors[] = getlocal2("install.bad_checksum", array("$webimroot/$file"));
|
||||
$errors[] = getlocal2("install.bad_checksum", array("$mibewroot/$file"));
|
||||
$errors[] = getlocal("install.check_files");
|
||||
return false;
|
||||
}
|
||||
@ -140,7 +140,7 @@ function check_files()
|
||||
|
||||
function check_connection()
|
||||
{
|
||||
global $mysqlhost, $mysqllogin, $mysqlpass, $page, $errors, $webimroot;
|
||||
global $mysqlhost, $mysqllogin, $mysqlpass, $page, $errors, $mibewroot;
|
||||
$link = @mysql_connect($mysqlhost, $mysqllogin, $mysqlpass);
|
||||
if ($link) {
|
||||
$result = mysql_query("SELECT VERSION() as c", $link);
|
||||
@ -161,7 +161,7 @@ function check_connection()
|
||||
|
||||
function check_database($link)
|
||||
{
|
||||
global $mysqldb, $force_charset_in_connection, $dbencoding, $page, $webimroot;
|
||||
global $mysqldb, $force_charset_in_connection, $dbencoding, $page, $mibewroot;
|
||||
if (mysql_select_db($mysqldb, $link)) {
|
||||
$page['done'][] = getlocal2("install.2.db_exists", array($mysqldb));
|
||||
if ($force_charset_in_connection) {
|
||||
@ -171,14 +171,14 @@ function check_database($link)
|
||||
} else {
|
||||
$page['nextstep'] = getlocal2("install.2.create", array($mysqldb));
|
||||
$page['nextnotice'] = getlocal("install.2.notice");
|
||||
$page['nextstepurl'] = "$webimroot/install/dbperform.php?act=createdb";
|
||||
$page['nextstepurl'] = "$mibewroot/install/dbperform.php?act=createdb";
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
function check_tables($link)
|
||||
{
|
||||
global $dbtables, $page, $webimroot;
|
||||
global $dbtables, $page, $mibewroot;
|
||||
$curr_tables = get_tables($link);
|
||||
if ($curr_tables !== false) {
|
||||
$tocreate = array_diff(array_keys($dbtables), $curr_tables);
|
||||
@ -187,7 +187,7 @@ function check_tables($link)
|
||||
return true;
|
||||
} else {
|
||||
$page['nextstep'] = getlocal("install.3.create");
|
||||
$page['nextstepurl'] = "$webimroot/install/dbperform.php?act=ct";
|
||||
$page['nextstepurl'] = "$mibewroot/install/dbperform.php?act=ct";
|
||||
}
|
||||
}
|
||||
return false;
|
||||
@ -195,7 +195,7 @@ function check_tables($link)
|
||||
|
||||
function check_columns($link)
|
||||
{
|
||||
global $dbtables, $dbtables_can_update, $errors, $page, $webimroot;
|
||||
global $dbtables, $dbtables_can_update, $errors, $page, $mibewroot;
|
||||
|
||||
$need_to_create_columns = false;
|
||||
foreach ($dbtables as $id => $columns) {
|
||||
@ -209,7 +209,7 @@ function check_columns($link)
|
||||
if (count($cannot_update) != 0) {
|
||||
$errors[] = "Key columns are absent in table `$id'. Unable to continue installation.";
|
||||
$page['nextstep'] = getlocal("install.kill_tables");
|
||||
$page['nextstepurl'] = "$webimroot/install/dbperform.php?act=dt";
|
||||
$page['nextstepurl'] = "$mibewroot/install/dbperform.php?act=dt";
|
||||
$page['nextnotice'] = getlocal("install.kill_tables.notice");
|
||||
return false;
|
||||
}
|
||||
@ -219,7 +219,7 @@ function check_columns($link)
|
||||
|
||||
if ($need_to_create_columns) {
|
||||
$page['nextstep'] = getlocal("install.4.create");
|
||||
$page['nextstepurl'] = "$webimroot/install/dbperform.php?act=addcolumns";
|
||||
$page['nextstepurl'] = "$mibewroot/install/dbperform.php?act=addcolumns";
|
||||
$page['nextnotice'] = getlocal("install.4.notice");
|
||||
return false;
|
||||
}
|
||||
@ -254,11 +254,11 @@ function check_admin($link)
|
||||
|
||||
function check_status()
|
||||
{
|
||||
global $page, $webimroot, $settings, $dbversion;
|
||||
global $page, $mibewroot, $settings, $dbversion;
|
||||
|
||||
$page['done'][] = getlocal2("install.0.php", array(phpversion()));
|
||||
|
||||
if (!check_webimroot()) {
|
||||
if (!check_mibewroot()) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -292,8 +292,8 @@ function check_status()
|
||||
|
||||
if (!check_admin($link)) {
|
||||
$page['nextstep'] = getlocal("installed.login_link");
|
||||
$page['nextnotice'] = getlocal2("installed.notice", array("${webimroot}/install/"));
|
||||
$page['nextstepurl'] = "$webimroot/operator/login.php?login=admin";
|
||||
$page['nextnotice'] = getlocal2("installed.notice", array("${mibewroot}/install/"));
|
||||
$page['nextstepurl'] = "$mibewroot/operator/login.php?login=admin";
|
||||
}
|
||||
|
||||
$page['show_small_login'] = true;
|
||||
|
@ -14,11 +14,11 @@ Class.inherit(Ajax.ChatThreadUpdater,Ajax.Base,{initialize:function(a){this.setO
|
||||
update:function(){this.updateOptions("refresh");this.updater=new Ajax.Request(this._options.servl,this._options)},requestComplete:function(a){try{this.enableInput(!0);this.cansend=!0;var b=Ajax.getXml(a);b&&"thread"==b.tagName?this.updateContent(b):this.handleError(a,b,"refresh messages failed")}catch(c){}this.skipNextsound=!1;this.timer=setTimeout(this.update.bind(this),1E3*this.frequency)},postMessage:function(a){if(""!=a&&this.cansend){this.cansend=!1;this.stopUpdate();this.skipNextsound=!0;this.updateOptions("post");
|
||||
var b={}.extend(this._options);b.parameters+="&message="+encodeURIComponent(a);b.onComplete=function(a){this.requestComplete(a);this._options.message&&(this._options.message.value="",this._options.message.focus())}.bind(this);"opera"!=myRealAgent&&this.enableInput(!1);this.updater=new Ajax.Request(this._options.servl,b)}},changeName:function(a){this.skipNextsound=!0;new Ajax.Request(this._options.servl,{parameters:"act=rename&thread="+(this._options.threadid||0)+"&token="+(this._options.token||0)+
|
||||
"&name="+encodeURIComponent(a)})},onThreadClosed:function(a){var b=Ajax.getXml(a);b&&"closed"==b.tagName?setTimeout("window.close()",2E3):this.handleError(a,b,"cannot close")},closeThread:function(){var a="act=close&thread="+(this._options.threadid||0)+"&token="+(this._options.token||0);this._options.user&&(a+="&user=true");new Ajax.Request(this._options.servl,{parameters:a,onComplete:this.onThreadClosed.bind(this)})},processMessage:function(a,b){var c=NodeUtils.getNodeText(b);FrameUtils.insertIntoFrame(a,
|
||||
c)},showTyping:function(a){$("typingdiv")&&($("typingdiv").style.display=a?"inline":"none")},setupAvatar:function(a){a=NodeUtils.getNodeText(a);this._options.avatar&&this._options.user&&(this._options.avatar.innerHTML=""!=a?'<img src="'+Chat.webimRoot+'/images/free.gif" width="7" height="1" border="0" alt="" /><img src="'+a+'" border="0" alt=""/>':"")},updateContent:function(a){var b=!1,c=this._options.container,d=NodeUtils.getAttrValue(a,"lastid");d&&(this._options.lastid=d);(d=NodeUtils.getAttrValue(a,
|
||||
c)},showTyping:function(a){$("typingdiv")&&($("typingdiv").style.display=a?"inline":"none")},setupAvatar:function(a){a=NodeUtils.getNodeText(a);this._options.avatar&&this._options.user&&(this._options.avatar.innerHTML=""!=a?'<img src="'+Chat.mibewRoot+'/images/free.gif" width="7" height="1" border="0" alt="" /><img src="'+a+'" border="0" alt=""/>':"")},updateContent:function(a){var b=!1,c=this._options.container,d=NodeUtils.getAttrValue(a,"lastid");d&&(this._options.lastid=d);(d=NodeUtils.getAttrValue(a,
|
||||
"typing"))&&this.showTyping("1"==d);(d=NodeUtils.getAttrValue(a,"canpost"))&&("1"==d&&!this.ownThread||this.ownThread&&"1"!=d)&&(window.location.href=window.location.href);for(d=0;d<a.childNodes.length;d++){var e=a.childNodes[d];"message"==e.tagName?(b=!0,this.processMessage(c,e)):"avatar"==e.tagName&&this.setupAvatar(e)}0<=window.location.search.indexOf("trace=on")?(a="updated",0<this.lastupdate&&(c=((new Date).getTime()-this.lastupdate)/1E3,a=a+", "+c+" secs",10<c&&alert(a)),this.lastupdate=(new Date).getTime(),
|
||||
this.setStatus(a)):this.clearStatus();b&&(FrameUtils.scrollDown(this._options.container),this.skipNextsound||(b=$("soundimg"),(null==b||b.className.match(/\bisound\b/))&&playSound(Chat.webimRoot+"/sounds/new_message.wav")),this.focused||window.focus())},isSendkey:function(a,b){return 13==b&&(a||this._options.ignorectrl)||10==b},handleKeyDown:function(a){a?(ctrl=a.ctrlKey,a=a.which):(a=event.keyCode,ctrl=event.ctrlKey);return this._options.message&&this.isSendkey(ctrl,a)?(a=this._options.message.value,
|
||||
this.setStatus(a)):this.clearStatus();b&&(FrameUtils.scrollDown(this._options.container),this.skipNextsound||(b=$("soundimg"),(null==b||b.className.match(/\bisound\b/))&&playSound(Chat.mibewRoot+"/sounds/new_message.wav")),this.focused||window.focus())},isSendkey:function(a,b){return 13==b&&(a||this._options.ignorectrl)||10==b},handleKeyDown:function(a){a?(ctrl=a.ctrlKey,a=a.which):(a=event.keyCode,ctrl=event.ctrlKey);return this._options.message&&this.isSendkey(ctrl,a)?(a=this._options.message.value,
|
||||
this._options.ignorectrl&&(a=a.replace(/[\r\n]+$/,"")),this.postMessage(a),!1):!0},handleError:function(a,b,c){b&&"error"==b.tagName?this.setStatus(NodeUtils.getNodeValue(b,"descr")):this.setStatus("reconnecting")},showStatusDiv:function(a){$("engineinfo")&&($("engineinfo").style.display="inline",$("engineinfo").innerHTML=a)},setStatus:function(a){this.statusTimeout&&clearTimeout(this.statusTimeout);this.showStatusDiv(a);this.statusTimeout=setTimeout(this.clearStatus.bind(this),4E3)},clearStatus:function(){$("engineinfo").style.display=
|
||||
"none"}});var Chat={threadUpdater:{},applyName:function(){Chat.threadUpdater.changeName($("uname").value);$("changename1").style.display="none";$("changename2").style.display="inline";$("unamelink").innerHTML=htmlescape($("uname").value)},showNameField:function(){$("changename1").style.display="inline";$("changename2").style.display="none"}};
|
||||
Behaviour.register({"#postmessage a":function(a){a.onclick=function(){var a=$("msgwnd");a&&Chat.threadUpdater.postMessage(a.value)}},"select#predefined":function(a){a.onchange=function(){var a=$("msgwnd");0!=this.selectedIndex&&(a.value=this.options[this.selectedIndex].innerText||this.options[this.selectedIndex].innerHTML);this.selectedIndex=0;a.focus()}},"div#changename2 a":function(a){a.onclick=function(){Chat.showNameField();return!1}},"div#changename1 a":function(a){a.onclick=function(){Chat.applyName();
|
||||
return!1}},"div#changename1 input#uname":function(a){a.onkeydown=function(a){13==(a||event).keyCode&&Chat.applyName()}},"a#refresh":function(a){a.onclick=function(){Chat.threadUpdater.stopUpdate();Chat.threadUpdater.update()}},"a#togglesound":function(a){a.onclick=function(){var a=$("soundimg");a&&(a.className.match(/\bisound\b/)?a.className="tplimage inosound":a.className="tplimage isound",(a=$("msgwnd"))&&a.focus())}},"a.closethread":function(a){a.onclick=function(){Chat.threadUpdater.closeThread()}}});
|
||||
EventHelper.register(window,"onload",function(){Chat.webimRoot=threadParams.wroot;Chat.cssfile=threadParams.cssfile;Chat.threadUpdater=new Ajax.ChatThreadUpdater({ignorectrl:-1,container:"safari"==myRealAgent?self.frames[0]:$("chatwnd"),avatar:$("avatarwnd"),message:$("msgwnd")}.extend(threadParams||{}))});
|
||||
EventHelper.register(window,"onload",function(){Chat.mibewRoot=threadParams.wroot;Chat.cssfile=threadParams.cssfile;Chat.threadUpdater=new Ajax.ChatThreadUpdater({ignorectrl:-1,container:"safari"==myRealAgent?self.frames[0]:$("chatwnd"),avatar:$("avatarwnd"),message:$("msgwnd")}.extend(threadParams||{}))});
|
||||
|
@ -1,29 +1,29 @@
|
||||
function loadNews() {
|
||||
if (typeof(window.webimNews) == "undefined" || typeof(window.webimNews.length) == "undefined")
|
||||
if (typeof(window.mibewNews) == "undefined" || typeof(window.mibewNews.length) == "undefined")
|
||||
return;
|
||||
|
||||
var str = "<div>";
|
||||
for (var i = 0; i < window.webimNews.length; i++) {
|
||||
str += "<div class=\"newstitle\"><a hre" + "f=\"" + window.webimNews[i].link + "\">" + window.webimNews[i].title + "</a>, <span class=\"small\">" + window.webimNews[i].date + "</span></div>";
|
||||
str += "<div class=\"newstext\">" + window.webimNews[i].message+"</div>";
|
||||
for (var i = 0; i < window.mibewNews.length; i++) {
|
||||
str += "<div class=\"newstitle\"><a hre" + "f=\"" + window.mibewNews[i].link + "\">" + window.mibewNews[i].title + "</a>, <span class=\"small\">" + window.mibewNews[i].date + "</span></div>";
|
||||
str += "<div class=\"newstext\">" + window.mibewNews[i].message+"</div>";
|
||||
}
|
||||
$("#news").html(str + "</div>");
|
||||
}
|
||||
|
||||
function loadVersion() {
|
||||
if(typeof(window.webimLatest) == "undefined" || typeof(window.webimLatest.version) == "undefined")
|
||||
if(typeof(window.mibewLatest) == "undefined" || typeof(window.mibewLatest.version) == "undefined")
|
||||
return;
|
||||
|
||||
var current = $("#cver").html();
|
||||
|
||||
if(current != window.webimLatest.version) {
|
||||
if(current < window.webimLatest.version) {
|
||||
if(current != window.mibewLatest.version) {
|
||||
if(current < window.mibewLatest.version) {
|
||||
$("#cver").css("color","red");
|
||||
}
|
||||
$("#lver").html(window.webimLatest.version+", Download <a href=\""+window.webimLatest.download+"\">"+window.webimLatest.title+"</a>");
|
||||
$("#lver").html(window.mibewLatest.version+", Download <a href=\""+window.mibewLatest.download+"\">"+window.mibewLatest.title+"</a>");
|
||||
} else {
|
||||
$("#cver").css("color","green");
|
||||
$("#lver").html(window.webimLatest.version);
|
||||
$("#lver").html(window.mibewLatest.version);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -10,9 +10,9 @@ Class.inherit(Ajax.PeriodicalUpdater,Ajax.Base,{initialize:function(a){this.setO
|
||||
1E3)},handleTimeout:function(a){this._options.handleError&&this._options.handleError("timeout, reconnecting");this.stopUpdate();this.timer=setTimeout(this.update.bind(this),1E3)},stopUpdate:function(){this.updater._options&&(this.updater._options.onComplete=void 0);clearTimeout(this.timer)},update:function(){this._options.updateParams&&(this._options.parameters=this._options.updateParams());this.updater=new Ajax.Request(this._options.url,this._options)},requestComplete:function(a){try{var b=Ajax.getXml(a);
|
||||
b?(this._options.updateContent||Ajax.emptyFunction)(b):this._options.handleError&&this._options.handleError("reconnecting")}catch(c){}this.timer=setTimeout(this.update.bind(this),1E3*this.frequency)}});
|
||||
var HtmlGenerationUtils={popupLink:function(a,b,c,d,e,m,l){return'<a href="'+a+'"'+(null!=l?' class="'+l+'"':"")+' target="_blank" title="'+b+'" onclick="this.newWindow = window.open(\''+a+"', '"+c+"', 'toolbar=0,scrollbars=0,location=0,status=1,menubar=0,width="+e+",height="+m+",resizable=1');this.newWindow.focus();this.newWindow.opener=window;return false;\">"+d+"</a>"},generateOneRowTable:function(a){return'<table class="inner"><tr>'+a+"</tr></table>"},viewOpenCell:function(a,b,c,d,e,m,l,p){m=
|
||||
2;b=b+"?thread="+c;var f="<td>",f=e||d?f+HtmlGenerationUtils.popupLink(p||!d?b:b+"&viewonly=true",localized[e?0:1],"ImCenter"+c,a,640,480,null):f+('<a href="#">'+a+"</a>"),f=f+"</td>";e&&(f=f+'<td class="icon">'+HtmlGenerationUtils.popupLink(b,localized[0],"ImCenter"+c,'<img src="'+webimRoot+'/images/tbliclspeak.gif" width="15" height="15" border="0" alt="'+localized[0]+'">',640,480,null),f+="</td>",m++);d&&(f+='<td class="icon">',f+=HtmlGenerationUtils.popupLink(b+"&viewonly=true",localized[1],"ImCenter"+
|
||||
c,'<img src="'+webimRoot+'/images/tbliclread.gif" width="15" height="15" border="0" alt="'+localized[1]+'">',640,480,null),f+="</td>",m++);""!=l&&(f+='</tr><tr><td class="firstmessage" colspan="'+m+'"><a href="javascript:void(0)" title="'+l+'" onclick="alert(this.title);return false;">',f+=30<l.length?l.substring(0,30)+"...":l,f+="</a></td>");return HtmlGenerationUtils.generateOneRowTable(f)},banCell:function(a,b){return'<td class="icon">'+HtmlGenerationUtils.popupLink(webimRoot+"/operator/ban.php?"+
|
||||
(b?"id="+b:"thread="+a),localized[2],"ban"+a,'<img src="'+webimRoot+'/images/ban.gif" width="15" height="15" border="0" alt="'+localized[2]+'">',720,480,null)+"</td>"}};Ajax.ThreadListUpdater=Class.create();
|
||||
2;b=b+"?thread="+c;var f="<td>",f=e||d?f+HtmlGenerationUtils.popupLink(p||!d?b:b+"&viewonly=true",localized[e?0:1],"ImCenter"+c,a,640,480,null):f+('<a href="#">'+a+"</a>"),f=f+"</td>";e&&(f=f+'<td class="icon">'+HtmlGenerationUtils.popupLink(b,localized[0],"ImCenter"+c,'<img src="'+mibewRoot+'/images/tbliclspeak.gif" width="15" height="15" border="0" alt="'+localized[0]+'">',640,480,null),f+="</td>",m++);d&&(f+='<td class="icon">',f+=HtmlGenerationUtils.popupLink(b+"&viewonly=true",localized[1],"ImCenter"+
|
||||
c,'<img src="'+mibewRoot+'/images/tbliclread.gif" width="15" height="15" border="0" alt="'+localized[1]+'">',640,480,null),f+="</td>",m++);""!=l&&(f+='</tr><tr><td class="firstmessage" colspan="'+m+'"><a href="javascript:void(0)" title="'+l+'" onclick="alert(this.title);return false;">',f+=30<l.length?l.substring(0,30)+"...":l,f+="</a></td>");return HtmlGenerationUtils.generateOneRowTable(f)},banCell:function(a,b){return'<td class="icon">'+HtmlGenerationUtils.popupLink(mibewRoot+"/operator/ban.php?"+
|
||||
(b?"id="+b:"thread="+a),localized[2],"ban"+a,'<img src="'+mibewRoot+'/images/ban.gif" width="15" height="15" border="0" alt="'+localized[2]+'">',720,480,null)+"</td>"}};Ajax.ThreadListUpdater=Class.create();
|
||||
Class.inherit(Ajax.ThreadListUpdater,Ajax.Base,{initialize:function(a){this.setOptions(a);this._options.updateParams=this.updateParams.bind(this);this._options.handleError=this.handleError.bind(this);this._options.updateContent=this.updateContent.bind(this);this._options.lastrevision=0;this.threadTimers={};this.delta=0;this.t=this._options.table;this.periodicalUpdater=new Ajax.PeriodicalUpdater(this._options)},updateParams:function(){return"since="+this._options.lastrevision+"&status="+this._options.istatus+
|
||||
(this._options.showonline?"&showonline=1":"")},setStatus:function(a){this._options.status.innerHTML=a},handleError:function(a){this.setStatus(a)},updateThread:function(a){function b(a,b,c,d){if(a=CommonUtils.getCell(c,b,a))a.innerHTML=d}for(var c,d,e,m=!1,l=!1,p=!1,f=null,q=null,g=0;g<a.attributes.length;g++){var n=a.attributes[g];"id"==n.nodeName?c=n.nodeValue:"stateid"==n.nodeName?d=n.nodeValue:"state"==n.nodeName?e=n.nodeValue:"canopen"==n.nodeName?l=!0:"canview"==n.nodeName?m=!0:"canban"==n.nodeName?
|
||||
p=!0:"ban"==n.nodeName?f=n.nodeValue:"banid"==n.nodeName&&(q=n.nodeValue)}g=CommonUtils.getRow("thr"+c,this.t);if("closed"==d)g&&this.t.deleteRow(g.rowIndex),this.threadTimers[c]=null;else{var n=NodeUtils.getNodeValue(a,"name"),u=NodeUtils.getNodeValue(a,"addr"),s=NodeUtils.getNodeValue(a,"time"),v=NodeUtils.getNodeValue(a,"agent"),t=NodeUtils.getNodeValue(a,"modified"),w=NodeUtils.getNodeValue(a,"message"),r="<td>"+NodeUtils.getNodeValue(a,"useragent")+"</td>";null!=f&&(r="<td>"+NodeUtils.getNodeValue(a,
|
||||
@ -21,7 +21,7 @@ this._options.agentservl,c,m,l,f,w,"chat"!=d)),CommonUtils.insertCell(g,"contid"
|
||||
[s,t,d],g.className="blocked"==f&&"chat"!=d?"ban":"in"+d,b(this.t,g,"name",HtmlGenerationUtils.viewOpenCell(n,this._options.agentservl,c,m,l,f,w,"chat"!=d)),b(this.t,g,"contid",u),b(this.t,g,"state",e),b(this.t,g,"op",v),b(this.t,g,"time",this.getTimeSince(s)),b(this.t,g,"wait","chat"!=d?this.getTimeSince(t):"-"),b(this.t,g,"etc",r);return!1}},updateQueueMessages:function(){function a(a,b){var c=$(b),l=$(b+"end");return null==c||null==l?!1:c.rowIndex+1<l.rowIndex}var b=$("statustd");if(b){var c=a(this.t,
|
||||
"twait")||a(this.t,"tprio")||a(this.t,"tchat");b.innerHTML=c?"":this._options.noclients;b.height=c?5:30}},getTimeSince:function(a){a=Math.floor(((new Date).getTime()-a-this.delta)/1E3);var b=Math.floor(a/60),c="";a%=60;10>a&&(a="0"+a);60<=b&&(c=Math.floor(b/60),b%=60,10>b&&(b="0"+b),c+=":");return c+b+":"+a},updateTimers:function(){for(var a in this.threadTimers)if(null!=this.threadTimers[a]){var b=this.threadTimers[a],c=CommonUtils.getRow("thr"+a,this.t);if(null!=c){var d=this.getTimeSince(b[0]),
|
||||
e=CommonUtils.getCell("time",c,this.t);e&&(e.innerHTML=d);b="chat"!=b[2]?this.getTimeSince(b[1]):"-";if(c=CommonUtils.getCell("wait",c,this.t))c.innerHTML=b}}},updateThreads:function(a){var b=!1,c=NodeUtils.getAttrValue(a,"time"),d=NodeUtils.getAttrValue(a,"revision");c&&(this.delta=(new Date).getTime()-c);d&&(this._options.lastrevision=d);for(c=0;c<a.childNodes.length;c++)d=a.childNodes[c],"thread"==d.tagName&&this.updateThread(d)&&(b=!0);this.updateQueueMessages();this.updateTimers();this.setStatus(this._options.istatus?
|
||||
"Away":"Up to date");b&&(playSound(webimRoot+"/sounds/new_user.wav"),window.focus(),updaterOptions.showpopup&&alert(localized[5]))},updateOperators:function(a){var b=$("onlineoperators");if(b){for(var c=[],d=0;d<a.childNodes.length;d++){var e=a.childNodes[d];if("operator"==e.tagName){var m=NodeUtils.getAttrValue(e,"name"),e=null!=NodeUtils.getAttrValue(e,"away");c[c.length]='<img src="'+webimRoot+"/images/op"+(e?"away":"online")+'.gif" width="12" height="12" border="0" alt="'+localized[1]+'"> '+m}}b.innerHTML=
|
||||
"Away":"Up to date");b&&(playSound(mibewRoot+"/sounds/new_user.wav"),window.focus(),updaterOptions.showpopup&&alert(localized[5]))},updateOperators:function(a){var b=$("onlineoperators");if(b){for(var c=[],d=0;d<a.childNodes.length;d++){var e=a.childNodes[d];if("operator"==e.tagName){var m=NodeUtils.getAttrValue(e,"name"),e=null!=NodeUtils.getAttrValue(e,"away");c[c.length]='<img src="'+mibewRoot+"/images/op"+(e?"away":"online")+'.gif" width="12" height="12" border="0" alt="'+localized[1]+'"> '+m}}b.innerHTML=
|
||||
c.join(", ")}},updateContent:function(a){if("update"==a.tagName)for(var b=0;b<a.childNodes.length;b++){var c=a.childNodes[b];"threads"==c.tagName?this.updateThreads(c):"operators"==c.tagName&&this.updateOperators(c)}else"error"==a.tagName?this.setStatus(NodeUtils.getNodeValue(a,"descr")):this.setStatus("reconnecting")}});
|
||||
function togglemenu(){$("sidebar")&&($("wcontent")&&$("togglemenu"))&&("contentnomenu"==$("wcontent").className?($("sidebar").style.display="block",$("wcontent").className="contentinner",$("togglemenu").innerHTML=localized[4]):($("sidebar").style.display="none",$("wcontent").className="contentnomenu",$("togglemenu").innerHTML=localized[3]))}var webimRoot="";Behaviour.register({"#togglemenu":function(a){a.onclick=function(){togglemenu()}}});
|
||||
EventHelper.register(window,"onload",function(){webimRoot=updaterOptions.wroot;new Ajax.ThreadListUpdater({table:$("threadlist"),status:$("connstatus"),istatus:0}.extend(updaterOptions||{}));updaterOptions.havemenu||togglemenu()});
|
||||
function togglemenu(){$("sidebar")&&($("wcontent")&&$("togglemenu"))&&("contentnomenu"==$("wcontent").className?($("sidebar").style.display="block",$("wcontent").className="contentinner",$("togglemenu").innerHTML=localized[4]):($("sidebar").style.display="none",$("wcontent").className="contentnomenu",$("togglemenu").innerHTML=localized[3]))}var mibewRoot="";Behaviour.register({"#togglemenu":function(a){a.onclick=function(){togglemenu()}}});
|
||||
EventHelper.register(window,"onload",function(){mibewRoot=updaterOptions.wroot;new Ajax.ThreadListUpdater({table:$("threadlist"),status:$("connstatus"),istatus:0}.extend(updaterOptions||{}));updaterOptions.havemenu||togglemenu()});
|
||||
|
@ -2,12 +2,12 @@
|
||||
|
||||
<project basedir="." default="update" name="Obfuscator">
|
||||
<property name="closure.c" value="/usr/local/closure/compiler.jar" />
|
||||
<property name="webim.location" value="../165" />
|
||||
<property name="mibew.location" value="../165" />
|
||||
|
||||
<target name="update">
|
||||
<java jar="${closure.c}" fork="true">
|
||||
<arg value="--module_output_path_prefix"/>
|
||||
<arg value="${webim.location}/"/>
|
||||
<arg value="${mibew.location}/"/>
|
||||
<arg value="--module"/>
|
||||
<arg value="common:1"/>
|
||||
<arg value="--js"/>
|
||||
|
@ -198,7 +198,7 @@ Class.inherit( Ajax.ChatThreadUpdater, Ajax.Base, {
|
||||
var imageLink = NodeUtils.getNodeText(avatar);
|
||||
if( this._options.avatar && this._options.user ) {
|
||||
this._options.avatar.innerHTML = imageLink != ""
|
||||
? "<img src=\""+Chat.webimRoot+"/images/free.gif\" width=\"7\" height=\"1\" border=\"0\" alt=\"\" /><img src=\""
|
||||
? "<img src=\""+Chat.mibewRoot+"/images/free.gif\" width=\"7\" height=\"1\" border=\"0\" alt=\"\" /><img src=\""
|
||||
+imageLink+ "\" border=\"0\" alt=\"\"/>"
|
||||
: "";
|
||||
}
|
||||
@ -253,7 +253,7 @@ Class.inherit( Ajax.ChatThreadUpdater, Ajax.Base, {
|
||||
if(!this.skipNextsound) {
|
||||
var tsound = $('soundimg');
|
||||
if(tsound == null || tsound.className.match(new RegExp("\\bisound\\b")) ) {
|
||||
playSound(Chat.webimRoot+'/sounds/new_message.wav');
|
||||
playSound(Chat.mibewRoot+'/sounds/new_message.wav');
|
||||
}
|
||||
}
|
||||
if( !this.focused ) {
|
||||
@ -391,7 +391,7 @@ Behaviour.register({
|
||||
});
|
||||
|
||||
EventHelper.register(window, 'onload', function(){
|
||||
Chat.webimRoot = threadParams.wroot;
|
||||
Chat.mibewRoot = threadParams.wroot;
|
||||
Chat.cssfile = threadParams.cssfile;
|
||||
Chat.threadUpdater = new Ajax.ChatThreadUpdater(({ignorectrl:-1,container:myRealAgent=='safari'?self.frames[0]:$("chatwnd"),avatar:$("avatarwnd"),message:$("msgwnd")}).extend( threadParams || {} ));
|
||||
});
|
@ -85,13 +85,13 @@ var HtmlGenerationUtils = {
|
||||
gen += '</td>';
|
||||
if( canopen ) {
|
||||
gen += '<td class="icon">';
|
||||
gen += HtmlGenerationUtils.popupLink( link, localized[0], "ImCenter"+id, '<img src="'+webimRoot+'/images/tbliclspeak.gif" width="15" height="15" border="0" alt="'+localized[0]+'">', 640, 480, null);
|
||||
gen += HtmlGenerationUtils.popupLink( link, localized[0], "ImCenter"+id, '<img src="'+mibewRoot+'/images/tbliclspeak.gif" width="15" height="15" border="0" alt="'+localized[0]+'">', 640, 480, null);
|
||||
gen += '</td>';
|
||||
cellsCount++;
|
||||
}
|
||||
if( canview ) {
|
||||
gen += '<td class="icon">';
|
||||
gen += HtmlGenerationUtils.popupLink( link+"&viewonly=true", localized[1], "ImCenter"+id, '<img src="'+webimRoot+'/images/tbliclread.gif" width="15" height="15" border="0" alt="'+localized[1]+'">', 640, 480, null);
|
||||
gen += HtmlGenerationUtils.popupLink( link+"&viewonly=true", localized[1], "ImCenter"+id, '<img src="'+mibewRoot+'/images/tbliclread.gif" width="15" height="15" border="0" alt="'+localized[1]+'">', 640, 480, null);
|
||||
gen += '</td>';
|
||||
cellsCount++;
|
||||
}
|
||||
@ -104,7 +104,7 @@ var HtmlGenerationUtils = {
|
||||
},
|
||||
banCell: function(id,banid){
|
||||
return '<td class="icon">'+
|
||||
HtmlGenerationUtils.popupLink( webimRoot+'/operator/ban.php?'+(banid ? 'id='+banid : 'thread='+id), localized[2], "ban"+id, '<img src="'+webimRoot+'/images/ban.gif" width="15" height="15" border="0" alt="'+localized[2]+'">', 720, 480, null)+
|
||||
HtmlGenerationUtils.popupLink( mibewRoot+'/operator/ban.php?'+(banid ? 'id='+banid : 'thread='+id), localized[2], "ban"+id, '<img src="'+mibewRoot+'/images/ban.gif" width="15" height="15" border="0" alt="'+localized[2]+'">', 720, 480, null)+
|
||||
'</td>';
|
||||
}
|
||||
};
|
||||
@ -301,7 +301,7 @@ Class.inherit( Ajax.ThreadListUpdater, Ajax.Base, {
|
||||
this.updateTimers();
|
||||
this.setStatus(this._options.istatus ? "Away" : "Up to date");
|
||||
if( newAdded ) {
|
||||
playSound(webimRoot+'/sounds/new_user.wav');
|
||||
playSound(mibewRoot+'/sounds/new_user.wav');
|
||||
window.focus();
|
||||
if(updaterOptions.showpopup) {
|
||||
alert(localized[5]);
|
||||
@ -325,7 +325,7 @@ Class.inherit( Ajax.ThreadListUpdater, Ajax.Base, {
|
||||
var isAway = NodeUtils.getAttrValue(node, 'away') != null;
|
||||
|
||||
names[names.length] =
|
||||
'<img src="'+webimRoot+'/images/op'+(isAway ? 'away' : 'online')+
|
||||
'<img src="'+mibewRoot+'/images/op'+(isAway ? 'away' : 'online')+
|
||||
'.gif" width="12" height="12" border="0" alt="'+localized[1]+'"> '+ name;
|
||||
}
|
||||
|
||||
@ -365,7 +365,7 @@ if($("sidebar") && $("wcontent") && $("togglemenu")) {
|
||||
}
|
||||
}
|
||||
|
||||
var webimRoot = "";
|
||||
var mibewRoot = "";
|
||||
|
||||
Behaviour.register({
|
||||
'#togglemenu' : function(el) {
|
||||
@ -376,7 +376,7 @@ Behaviour.register({
|
||||
});
|
||||
|
||||
EventHelper.register(window, 'onload', function(){
|
||||
webimRoot = updaterOptions.wroot;
|
||||
mibewRoot = updaterOptions.wroot;
|
||||
new Ajax.ThreadListUpdater(({table:$("threadlist"),status:$("connstatus"),istatus:0}).extend(updaterOptions || {}));
|
||||
if(!updaterOptions.havemenu) {
|
||||
togglemenu();
|
||||
|
@ -114,7 +114,7 @@ function message_to_text($msg)
|
||||
|
||||
function get_messages($threadid, $meth, $isuser, &$lastid)
|
||||
{
|
||||
global $kind_for_agent, $kind_avatar, $webim_encoding, $mysqlprefix;
|
||||
global $kind_for_agent, $kind_avatar, $mibew_encoding, $mysqlprefix;
|
||||
$link = connect();
|
||||
|
||||
$query = sprintf(
|
||||
@ -129,10 +129,10 @@ function get_messages($threadid, $meth, $isuser, &$lastid)
|
||||
if ($meth == 'xml') {
|
||||
switch ($msg['ikind']) {
|
||||
case $kind_avatar:
|
||||
$message = "<avatar>" . myiconv($webim_encoding, "utf-8", escape_with_cdata($msg['tmessage'])) . "</avatar>";
|
||||
$message = "<avatar>" . myiconv($mibew_encoding, "utf-8", escape_with_cdata($msg['tmessage'])) . "</avatar>";
|
||||
break;
|
||||
default:
|
||||
$message = "<message>" . myiconv($webim_encoding, "utf-8", escape_with_cdata(message_to_html($msg))) . "</message>\n";
|
||||
$message = "<message>" . myiconv($mibew_encoding, "utf-8", escape_with_cdata(message_to_html($msg))) . "</message>\n";
|
||||
}
|
||||
} else {
|
||||
if ($msg['ikind'] != $kind_avatar) {
|
||||
@ -152,7 +152,7 @@ function get_messages($threadid, $meth, $isuser, &$lastid)
|
||||
|
||||
function print_thread_messages($thread, $token, $lastid, $isuser, $format, $agentid = null)
|
||||
{
|
||||
global $webim_encoding, $webimroot, $connection_timeout, $settings;
|
||||
global $mibew_encoding, $mibewroot, $connection_timeout, $settings;
|
||||
$threadid = $thread['threadid'];
|
||||
$istyping = abs($thread['current'] - $thread[$isuser ? "lpagent" : "lpuser"]) < $connection_timeout
|
||||
&& $thread[$isuser ? "agentTyping" : "userTyping"] == "1" ? "1" : "0";
|
||||
@ -171,12 +171,12 @@ function print_thread_messages($thread, $token, $lastid, $isuser, $format, $agen
|
||||
$output = get_messages($threadid, "html", $isuser, $lastid);
|
||||
|
||||
start_html_output();
|
||||
$url = "$webimroot/thread.php?act=refresh&thread=" . safe_htmlspecialchars($threadid) . "&token=" . safe_htmlspecialchars($token) . "&html=on&user=" . ($isuser ? "true" : "false");
|
||||
$url = "$mibewroot/thread.php?act=refresh&thread=" . safe_htmlspecialchars($threadid) . "&token=" . safe_htmlspecialchars($token) . "&html=on&user=" . ($isuser ? "true" : "false");
|
||||
|
||||
print(
|
||||
"<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">" .
|
||||
"<html>\n<head>\n" .
|
||||
"<link href=\"$webimroot/styles/default/chat.css\" rel=\"stylesheet\" type=\"text/css\">\n" .
|
||||
"<link href=\"$mibewroot/styles/default/chat.css\" rel=\"stylesheet\" type=\"text/css\">\n" .
|
||||
"<meta http-equiv=\"Refresh\" content=\"" . safe_htmlspecialchars($settings['updatefrequency_oldchat']) . "; URL=$url&sn=11\">\n" .
|
||||
"<meta http-equiv=\"Pragma\" content=\"no-cache\">\n" .
|
||||
"<title>chat</title>\n" .
|
||||
@ -287,7 +287,7 @@ function setup_logo()
|
||||
loadsettings();
|
||||
$page['ct.company.name'] = safe_htmlspecialchars(topage($settings['title']));
|
||||
$page['ct.company.chatLogoURL'] = safe_htmlspecialchars(topage($settings['logo']));
|
||||
$page['webimHost'] = safe_htmlspecialchars(topage($settings['hosturl']));
|
||||
$page['mibewHost'] = safe_htmlspecialchars(topage($settings['hosturl']));
|
||||
}
|
||||
|
||||
function setup_leavemessage($name, $email, $message, $groupid, $groupname, $info, $referrer, $canshowcaptcha)
|
||||
@ -344,7 +344,7 @@ function setup_survey($name, $email, $groupid, $info, $referrer, $canshowcaptcha
|
||||
|
||||
function setup_chatview_for_user($thread, $level)
|
||||
{
|
||||
global $page, $webimroot, $settings;
|
||||
global $page, $mibewroot, $settings;
|
||||
loadsettings();
|
||||
$page = array();
|
||||
$page['agent'] = false;
|
||||
@ -370,7 +370,7 @@ function setup_chatview_for_user($thread, $level)
|
||||
}
|
||||
|
||||
$params = "thread=" . $thread['threadid'] . "&token=" . $thread['ltoken'];
|
||||
$page['mailLink'] = safe_htmlspecialchars("$webimroot/client.php?" . $params . "&level=$level&act=mailthread");
|
||||
$page['mailLink'] = safe_htmlspecialchars("$mibewroot/client.php?" . $params . "&level=$level&act=mailthread");
|
||||
|
||||
if ($settings['enablessl'] == "1" && !is_secure_request()) {
|
||||
$page['sslLink'] = safe_htmlspecialchars(get_app_location(true, true) . "/client.php?" . $params . "&level=$level");
|
||||
@ -409,7 +409,7 @@ function load_canned_messages($locale, $groupid)
|
||||
|
||||
function setup_chatview_for_operator($thread, $operator)
|
||||
{
|
||||
global $page, $webimroot, $company_logo_link, $company_name, $settings;
|
||||
global $page, $mibewroot, $company_logo_link, $company_name, $settings;
|
||||
loadsettings();
|
||||
$page = array();
|
||||
$page['agent'] = true;
|
||||
@ -435,7 +435,7 @@ function setup_chatview_for_operator($thread, $operator)
|
||||
$page['isOpera95'] = is_agent_opera95();
|
||||
$page['neediframesrc'] = needsFramesrc();
|
||||
$page['historyParams'] = array("userid" => "" . $thread['userid']);
|
||||
$page['historyParamsLink'] = safe_htmlspecialchars(add_params($webimroot . "/operator/userhistory.php", $page['historyParams']));
|
||||
$page['historyParamsLink'] = safe_htmlspecialchars(add_params($mibewroot . "/operator/userhistory.php", $page['historyParams']));
|
||||
$predefinedres = "";
|
||||
$canned_messages = load_canned_messages($thread['locale'], $thread['groupid']);
|
||||
foreach ($canned_messages as $answer) {
|
||||
@ -443,7 +443,7 @@ function setup_chatview_for_operator($thread, $operator)
|
||||
}
|
||||
$page['predefinedAnswers'] = $predefinedres;
|
||||
$params = "thread=" . $thread['threadid'] . "&token=" . $thread['ltoken'];
|
||||
$page['redirectLink'] = safe_htmlspecialchars("$webimroot/operator/agent.php?" . $params . "&act=redirect");
|
||||
$page['redirectLink'] = safe_htmlspecialchars("$mibewroot/operator/agent.php?" . $params . "&act=redirect");
|
||||
|
||||
$page['namePostfix'] = "";
|
||||
$page['frequency'] = $settings['updatefrequency_chat'];
|
||||
@ -750,13 +750,13 @@ function check_connections_from_remote($remote, $link)
|
||||
|
||||
function visitor_from_request()
|
||||
{
|
||||
global $namecookie, $webim_encoding, $usercookie;
|
||||
global $namecookie, $mibew_encoding, $usercookie;
|
||||
$defaultName = getstring("chat.default.username");
|
||||
$userName = $defaultName;
|
||||
if (isset($_COOKIE[$namecookie])) {
|
||||
$data = base64_decode(strtr($_COOKIE[$namecookie], '-_,', '+/='));
|
||||
if (strlen($data) > 0) {
|
||||
$userName = myiconv("utf-8", $webim_encoding, $data);
|
||||
$userName = myiconv("utf-8", $mibew_encoding, $data);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -22,7 +22,7 @@ require_once(dirname(__FILE__) . '/converter.php');
|
||||
require_once(dirname(__FILE__) . '/config.php');
|
||||
|
||||
// Sanitize path to application and remove extra slashes
|
||||
$webimroot = join("/", array_map("urlencode", preg_split('/\//', preg_replace('/\/+$/', '', preg_replace('/\/{2,}/', '/', '/' . $webimroot)))));
|
||||
$mibewroot = join("/", array_map("urlencode", preg_split('/\//', preg_replace('/\/+$/', '', preg_replace('/\/{2,}/', '/', '/' . $mibewroot)))));
|
||||
|
||||
// Sanitize database tables prefix
|
||||
$mysqlprefix = preg_replace('/[^A-Za-z0-9_$]/', '', $mysqlprefix);
|
||||
@ -41,7 +41,7 @@ $jsver = "165";
|
||||
if (is_secure_request()) {
|
||||
@ini_set('session.cookie_secure', TRUE);
|
||||
}
|
||||
@ini_set('session.cookie_path', "$webimroot/");
|
||||
@ini_set('session.cookie_path', "$mibewroot/");
|
||||
@ini_set('session.name', 'MibewSessionID');
|
||||
|
||||
session_start();
|
||||
@ -150,7 +150,7 @@ function get_user_locale()
|
||||
|
||||
function get_locale()
|
||||
{
|
||||
global $webimroot, $locale_cookie_name;
|
||||
global $mibewroot, $locale_cookie_name;
|
||||
|
||||
$locale = verifyparam("locale", "/./", "");
|
||||
|
||||
@ -164,7 +164,7 @@ function get_locale()
|
||||
$locale = get_user_locale();
|
||||
}
|
||||
|
||||
setcookie($locale_cookie_name, $locale, time() + 60 * 60 * 24 * 1000, "$webimroot/");
|
||||
setcookie($locale_cookie_name, $locale, time() + 60 * 60 * 24 * 1000, "$mibewroot/");
|
||||
return $locale;
|
||||
}
|
||||
|
||||
@ -194,9 +194,9 @@ function get_locale_links($href)
|
||||
|
||||
function load_messages($locale)
|
||||
{
|
||||
global $messages, $webim_encoding, $output_encoding;
|
||||
global $messages, $mibew_encoding, $output_encoding;
|
||||
$hash = array();
|
||||
$current_encoding = $webim_encoding;
|
||||
$current_encoding = $mibew_encoding;
|
||||
|
||||
$fp = fopen(dirname(__FILE__) . "/../locales/$locale/properties", "r");
|
||||
if ($fp === FALSE) {
|
||||
@ -210,10 +210,10 @@ function load_messages($locale)
|
||||
$current_encoding = trim($keyval[1]);
|
||||
} else if ($keyval[0] == 'output_encoding') {
|
||||
$output_encoding[$locale] = trim($keyval[1]);
|
||||
} else if ($current_encoding == $webim_encoding) {
|
||||
} else if ($current_encoding == $mibew_encoding) {
|
||||
$hash[$keyval[0]] = str_replace("\\n", "\n", trim($keyval[1]));
|
||||
} else {
|
||||
$hash[$keyval[0]] = myiconv($current_encoding, $webim_encoding, str_replace("\\n", "\n", trim($keyval[1])));
|
||||
$hash[$keyval[0]] = myiconv($current_encoding, $mibew_encoding, str_replace("\\n", "\n", trim($keyval[1])));
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -223,10 +223,10 @@ function load_messages($locale)
|
||||
|
||||
function getoutputenc()
|
||||
{
|
||||
global $current_locale, $output_encoding, $webim_encoding, $messages;
|
||||
global $current_locale, $output_encoding, $mibew_encoding, $messages;
|
||||
if (!isset($messages[$current_locale]))
|
||||
load_messages($current_locale);
|
||||
return isset($output_encoding[$current_locale]) ? $output_encoding[$current_locale] : $webim_encoding;
|
||||
return isset($output_encoding[$current_locale]) ? $output_encoding[$current_locale] : $mibew_encoding;
|
||||
}
|
||||
|
||||
function getstring_($text, $locale, $raw = false)
|
||||
@ -254,22 +254,22 @@ function getstring($text, $raw = false)
|
||||
|
||||
function getlocal($text, $raw = false)
|
||||
{
|
||||
global $current_locale, $webim_encoding;
|
||||
$string = myiconv($webim_encoding, getoutputenc(), getstring_($text, $current_locale), true);
|
||||
global $current_locale, $mibew_encoding;
|
||||
$string = myiconv($mibew_encoding, getoutputenc(), getstring_($text, $current_locale), true);
|
||||
return $raw ? $string : sanitize_string($string, 'low', 'moderate');
|
||||
}
|
||||
|
||||
function getlocal_($text, $locale, $raw = false)
|
||||
{
|
||||
global $webim_encoding;
|
||||
$string = myiconv($webim_encoding, getoutputenc(), getstring_($text, $locale), true);
|
||||
global $mibew_encoding;
|
||||
$string = myiconv($mibew_encoding, getoutputenc(), getstring_($text, $locale), true);
|
||||
return $raw ? $string : sanitize_string($string, 'low', 'moderate');
|
||||
}
|
||||
|
||||
function topage($text)
|
||||
{
|
||||
global $webim_encoding;
|
||||
return myiconv($webim_encoding, getoutputenc(), $text);
|
||||
global $mibew_encoding;
|
||||
return myiconv($mibew_encoding, getoutputenc(), $text);
|
||||
}
|
||||
|
||||
function getstring2_($text, $params, $locale, $raw = false)
|
||||
@ -290,8 +290,8 @@ function getstring2($text, $params, $raw = false)
|
||||
|
||||
function getlocal2($text, $params, $raw = false)
|
||||
{
|
||||
global $current_locale, $webim_encoding;
|
||||
$string = myiconv($webim_encoding, getoutputenc(), getstring_($text, $current_locale, true));
|
||||
global $current_locale, $mibew_encoding;
|
||||
$string = myiconv($mibew_encoding, getoutputenc(), getstring_($text, $current_locale, true));
|
||||
for ($i = 0; $i < count($params); $i++) {
|
||||
$string = str_replace("{" . $i . "}", $params[$i], $string);
|
||||
}
|
||||
@ -301,8 +301,8 @@ function getlocal2($text, $params, $raw = false)
|
||||
/* prepares for Javascript string */
|
||||
function getlocalforJS($text, $params)
|
||||
{
|
||||
global $current_locale, $webim_encoding;
|
||||
$string = myiconv($webim_encoding, getoutputenc(), getstring_($text, $current_locale, true));
|
||||
global $current_locale, $mibew_encoding;
|
||||
$string = myiconv($mibew_encoding, getoutputenc(), getstring_($text, $current_locale, true));
|
||||
$string = str_replace("\"", "\\\"", str_replace("\n", "\\n", $string));
|
||||
for ($i = 0; $i < count($params); $i++) {
|
||||
$string = str_replace("{" . $i . "}", $params[$i], $string);
|
||||
@ -313,9 +313,9 @@ function getlocalforJS($text, $params)
|
||||
/* ajax server actions use utf-8 */
|
||||
function getrawparam($name)
|
||||
{
|
||||
global $webim_encoding;
|
||||
global $mibew_encoding;
|
||||
if (isset($_POST[$name])) {
|
||||
$value = myiconv("utf-8", $webim_encoding, $_POST[$name]);
|
||||
$value = myiconv("utf-8", $mibew_encoding, $_POST[$name]);
|
||||
if (get_magic_quotes_gpc()) {
|
||||
$value = stripslashes($value);
|
||||
}
|
||||
@ -327,9 +327,9 @@ function getrawparam($name)
|
||||
/* form processors use current Output encoding */
|
||||
function getparam($name)
|
||||
{
|
||||
global $webim_encoding;
|
||||
global $mibew_encoding;
|
||||
if (isset($_POST[$name])) {
|
||||
$value = myiconv(getoutputenc(), $webim_encoding, $_POST[$name]);
|
||||
$value = myiconv(getoutputenc(), $mibew_encoding, $_POST[$name]);
|
||||
if (get_magic_quotes_gpc()) {
|
||||
$value = stripslashes($value);
|
||||
}
|
||||
@ -363,11 +363,11 @@ function unicode_urldecode($url)
|
||||
|
||||
function getgetparam($name, $default = '')
|
||||
{
|
||||
global $webim_encoding;
|
||||
global $mibew_encoding;
|
||||
if (!isset($_GET[$name]) || !$_GET[$name]) {
|
||||
return $default;
|
||||
}
|
||||
$value = myiconv("utf-8", $webim_encoding, unicode_urldecode($_GET[$name]));
|
||||
$value = myiconv("utf-8", $mibew_encoding, unicode_urldecode($_GET[$name]));
|
||||
if (get_magic_quotes_gpc()) {
|
||||
$value = stripslashes($value);
|
||||
}
|
||||
@ -563,11 +563,11 @@ function is_valid_email($email)
|
||||
|
||||
function get_app_location($showhost, $issecure)
|
||||
{
|
||||
global $webimroot;
|
||||
global $mibewroot;
|
||||
if ($showhost) {
|
||||
return ($issecure ? "https://" : "http://") . $_SERVER['HTTP_HOST'] . $webimroot;
|
||||
return ($issecure ? "https://" : "http://") . $_SERVER['HTTP_HOST'] . $mibewroot;
|
||||
} else {
|
||||
return $webimroot;
|
||||
return $mibewroot;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -18,19 +18,19 @@
|
||||
/*
|
||||
* Application path on server
|
||||
*/
|
||||
$webimroot = "/webim";
|
||||
$mibewroot = "/mibew";
|
||||
|
||||
/*
|
||||
* Internal encoding
|
||||
*/
|
||||
$webim_encoding = "utf-8";
|
||||
$mibew_encoding = "utf-8";
|
||||
|
||||
/*
|
||||
* MySQL Database parameters
|
||||
*/
|
||||
$mysqlhost = "localhost";
|
||||
$mysqldb = "webim_db";
|
||||
$mysqllogin = "webim_lite";
|
||||
$mysqldb = "mibew_db";
|
||||
$mysqllogin = "mibew";
|
||||
$mysqlpass = "123";
|
||||
$mysqlprefix = "";
|
||||
|
||||
@ -40,7 +40,7 @@ $force_charset_in_connection = true;
|
||||
/*
|
||||
* Mailbox
|
||||
*/
|
||||
$webim_mailbox = "webim@yourdomain.com";
|
||||
$mibew_mailbox = "mibew@yourdomain.com";
|
||||
$mail_encoding = "utf-8";
|
||||
|
||||
/*
|
||||
|
@ -17,9 +17,9 @@
|
||||
|
||||
function demo_print_message($msg, $format)
|
||||
{
|
||||
global $webim_encoding;
|
||||
global $mibew_encoding;
|
||||
if ($format == "xml") {
|
||||
print "<message>" . myiconv($webim_encoding, "utf-8", escape_with_cdata(message_to_html($msg))) . "</message>\n";
|
||||
print "<message>" . myiconv($mibew_encoding, "utf-8", escape_with_cdata(message_to_html($msg))) . "</message>\n";
|
||||
} else {
|
||||
print topage(message_to_html($msg));
|
||||
}
|
||||
@ -27,7 +27,7 @@ function demo_print_message($msg, $format)
|
||||
|
||||
function demo_process_thread($act, $outformat, $lastid, $isuser, $canpost, $istyping, $postmessage)
|
||||
{
|
||||
global $kind_for_agent, $kind_info, $kind_events, $kind_user, $kind_agent, $webimroot, $settings;
|
||||
global $kind_for_agent, $kind_info, $kind_events, $kind_user, $kind_agent, $mibewroot, $settings;
|
||||
loadsettings();
|
||||
if ($act == "refresh" || $act == "post") {
|
||||
$lastid++;
|
||||
@ -36,12 +36,12 @@ function demo_process_thread($act, $outformat, $lastid, $isuser, $canpost, $isty
|
||||
print("<thread lastid=\"$lastid\" typing=\"" . ($istyping ? 1 : 0) . "\" canpost=\"" . ($canpost ? 1 : 0) . "\">");
|
||||
} else {
|
||||
start_html_output();
|
||||
$url = "$webimroot/thread.php?act=refresh&thread=0&token=123&html=on&user=" . ($isuser ? "true" : "false");
|
||||
$url = "$mibewroot/thread.php?act=refresh&thread=0&token=123&html=on&user=" . ($isuser ? "true" : "false");
|
||||
|
||||
print(
|
||||
"<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">" .
|
||||
"<html>\n<head>\n" .
|
||||
"<link href=\"$webimroot/styles/default/chat.css\" rel=\"stylesheet\" type=\"text/css\">\n" .
|
||||
"<link href=\"$mibewroot/styles/default/chat.css\" rel=\"stylesheet\" type=\"text/css\">\n" .
|
||||
"<meta http-equiv=\"Refresh\" content=\"" . $settings['updatefrequency_oldchat'] . "; URL=$url&sn=11\">\n" .
|
||||
"<meta http-equiv=\"Pragma\" content=\"no-cache\">\n" .
|
||||
"<title>chat</title>\n" .
|
||||
|
@ -42,16 +42,16 @@ function expand_condition($matches)
|
||||
|
||||
function expand_var($matches)
|
||||
{
|
||||
global $page, $webimroot, $jsver, $errors, $current_style;
|
||||
global $page, $mibewroot, $jsver, $errors, $current_style;
|
||||
$prefix = $matches[1];
|
||||
$var = $matches[2];
|
||||
if (!$prefix) {
|
||||
if ($var == 'webimroot') {
|
||||
return $webimroot;
|
||||
if ($var == 'mibewroot') {
|
||||
return $mibewroot;
|
||||
} else if ($var == 'jsver') {
|
||||
return $jsver;
|
||||
} else if ($var == 'tplroot') {
|
||||
return "$webimroot/styles/$current_style";
|
||||
return "$mibewroot/styles/$current_style";
|
||||
} else if ($var == 'styleid') {
|
||||
return $current_style;
|
||||
} else if ($var == 'pagination') {
|
||||
|
@ -17,11 +17,11 @@
|
||||
|
||||
function setup_getcode_tabs($active)
|
||||
{
|
||||
global $page, $webimroot;
|
||||
global $page, $mibewroot;
|
||||
$page['tabselected'] = $active;
|
||||
$page['tabs'] = array(
|
||||
array('title' => getlocal("page_getcode.tab.image"), 'link' => "$webimroot/operator/getcode.php"),
|
||||
array('title' => getlocal("page_getcode.tab.text"), 'link' => "$webimroot/operator/gettextcode.php"),
|
||||
array('title' => getlocal("page_getcode.tab.image"), 'link' => "$mibewroot/operator/getcode.php"),
|
||||
array('title' => getlocal("page_getcode.tab.text"), 'link' => "$mibewroot/operator/gettextcode.php"),
|
||||
);
|
||||
}
|
||||
|
||||
@ -38,7 +38,7 @@ function generate_button($title, $locale, $style, $group, $inner, $showhost, $fo
|
||||
$modsecfix = $modsecurity ? ".replace('http://','').replace('https://','')" : "";
|
||||
$jslink = safe_htmlspecialchars(append_query("'" . $link, "url='+escape(document.location.href$modsecfix)+'&referrer='+escape(document.referrer$modsecfix)"));
|
||||
$temp = get_popup(safe_htmlspecialchars($link), "$jslink",
|
||||
$inner, safe_htmlspecialchars($title), "webim", "toolbar=0,scrollbars=0,location=0,status=1,menubar=0,width=640,height=480,resizable=1");
|
||||
$inner, safe_htmlspecialchars($title), "mibew", "toolbar=0,scrollbars=0,location=0,status=1,menubar=0,width=640,height=480,resizable=1");
|
||||
return "<!-- mibew button -->" . $temp . "<!-- / mibew button -->";
|
||||
}
|
||||
|
||||
|
@ -36,12 +36,12 @@ function get_group_name($group)
|
||||
|
||||
function setup_group_settings_tabs($gid, $active)
|
||||
{
|
||||
global $page, $webimroot, $settings;
|
||||
global $page, $mibewroot, $settings;
|
||||
if ($gid) {
|
||||
$page['tabselected'] = $active;
|
||||
$page['tabs'] = array(
|
||||
array('title' => getlocal("page_group.tab.main"), 'link' => "$webimroot/operator/group.php?gid=$gid"),
|
||||
array('title' => getlocal("page_group.tab.members"), 'link' => "$webimroot/operator/groupmembers.php?gid=$gid"),
|
||||
array('title' => getlocal("page_group.tab.main"), 'link' => "$mibewroot/operator/group.php?gid=$gid"),
|
||||
array('title' => getlocal("page_group.tab.members"), 'link' => "$mibewroot/operator/groupmembers.php?gid=$gid"),
|
||||
);
|
||||
} else {
|
||||
$page['tabs'] = array();
|
||||
|
@ -33,19 +33,19 @@ function log_notification($locale, $kind, $to, $subj, $text, $refop, $link)
|
||||
|
||||
function mibew_mail($toaddr, $reply_to, $subject, $body, $link)
|
||||
{
|
||||
global $webim_encoding, $webim_mailbox, $mail_encoding, $current_locale;
|
||||
global $mibew_encoding, $mibew_mailbox, $mail_encoding, $current_locale;
|
||||
|
||||
$headers = "From: $webim_mailbox\r\n"
|
||||
. "Reply-To: " . myiconv($webim_encoding, $mail_encoding, $reply_to) . "\r\n"
|
||||
$headers = "From: $mibew_mailbox\r\n"
|
||||
. "Reply-To: " . myiconv($mibew_encoding, $mail_encoding, $reply_to) . "\r\n"
|
||||
. "Content-Type: text/plain; charset=$mail_encoding\r\n"
|
||||
. 'X-Mailer: PHP/' . phpversion();
|
||||
|
||||
$real_subject = "=?" . $mail_encoding . "?B?" . base64_encode(myiconv($webim_encoding, $mail_encoding, $subject)) . "?=";
|
||||
$real_subject = "=?" . $mail_encoding . "?B?" . base64_encode(myiconv($mibew_encoding, $mail_encoding, $subject)) . "?=";
|
||||
|
||||
$body = preg_replace("/\n/", "\r\n", $body);
|
||||
|
||||
log_notification($current_locale, "mail", $toaddr, $subject, $body, null, $link);
|
||||
@mail($toaddr, $real_subject, wordwrap(myiconv($webim_encoding, $mail_encoding, $body), 70), $headers);
|
||||
@mail($toaddr, $real_subject, wordwrap(myiconv($mibew_encoding, $mail_encoding, $body), 70), $headers);
|
||||
}
|
||||
|
||||
function mibew_xmpp($toaddr, $subject, $text, $link)
|
||||
|
@ -211,7 +211,7 @@ function append_query($link, $pv)
|
||||
|
||||
function check_login($redirect = true)
|
||||
{
|
||||
global $webimroot, $mysqlprefix, $remember_cookie_name;
|
||||
global $mibewroot, $mysqlprefix, $remember_cookie_name;
|
||||
if (!isset($_SESSION["${mysqlprefix}operator"])) {
|
||||
if (isset($_COOKIE[$remember_cookie_name])) {
|
||||
list($login, $pwd) = preg_split('/\x0/', base64_decode($_COOKIE[$remember_cookie_name]), 2);
|
||||
@ -227,7 +227,7 @@ function check_login($redirect = true)
|
||||
}
|
||||
if ($redirect) {
|
||||
$_SESSION['backpath'] = $requested;
|
||||
header("Location: $webimroot/operator/login.php");
|
||||
header("Location: $mibewroot/operator/login.php");
|
||||
exit;
|
||||
} else {
|
||||
return null;
|
||||
@ -244,30 +244,30 @@ function get_logged_in()
|
||||
|
||||
function login_operator($operator, $remember, $https = FALSE)
|
||||
{
|
||||
global $webimroot, $mysqlprefix, $remember_cookie_name;
|
||||
global $mibewroot, $mysqlprefix, $remember_cookie_name;
|
||||
$_SESSION["${mysqlprefix}operator"] = $operator;
|
||||
if ($remember) {
|
||||
$value = base64_encode($operator['vclogin'] . "\x0" . calculate_password_hash($operator['vclogin'], $operator['vcpassword']));
|
||||
setcookie($remember_cookie_name, $value, time() + 60 * 60 * 24 * 1000, "$webimroot/", NULL, $https, TRUE);
|
||||
setcookie($remember_cookie_name, $value, time() + 60 * 60 * 24 * 1000, "$mibewroot/", NULL, $https, TRUE);
|
||||
|
||||
} else if (isset($_COOKIE[$remember_cookie_name])) {
|
||||
setcookie($remember_cookie_name, '', time() - 3600, "$webimroot/");
|
||||
setcookie($remember_cookie_name, '', time() - 3600, "$mibewroot/");
|
||||
}
|
||||
}
|
||||
|
||||
function logout_operator()
|
||||
{
|
||||
global $webimroot, $mysqlprefix, $remember_cookie_name;
|
||||
global $mibewroot, $mysqlprefix, $remember_cookie_name;
|
||||
unset($_SESSION["${mysqlprefix}operator"]);
|
||||
unset($_SESSION['backpath']);
|
||||
if (isset($_COOKIE[$remember_cookie_name])) {
|
||||
setcookie($remember_cookie_name, '', time() - 3600, "$webimroot/");
|
||||
setcookie($remember_cookie_name, '', time() - 3600, "$mibewroot/");
|
||||
}
|
||||
}
|
||||
|
||||
function setup_redirect_links($threadid, $token)
|
||||
{
|
||||
global $page, $webimroot, $settings, $mysqlprefix;
|
||||
global $page, $mibewroot, $settings, $mysqlprefix;
|
||||
loadsettings();
|
||||
$link = connect();
|
||||
|
||||
@ -306,7 +306,7 @@ function setup_redirect_links($threadid, $token)
|
||||
: getlocal("char.redirect.operator.away_suff")
|
||||
)
|
||||
: "";
|
||||
$agent_list .= "<li><a href=\"" . add_params($webimroot . "/operator/redirect.php", $params) .
|
||||
$agent_list .= "<li><a href=\"" . add_params($mibewroot . "/operator/redirect.php", $params) .
|
||||
"\" title=\"" . safe_htmlspecialchars(topage(get_operator_name($agent))) . "\">" .
|
||||
safe_htmlspecialchars(topage(get_operator_name($agent))) .
|
||||
"</a> $status</li>";
|
||||
@ -323,7 +323,7 @@ function setup_redirect_links($threadid, $token)
|
||||
: ($group['ilastseenaway'] !== NULL && $group['ilastseenaway'] < $settings['online_timeout']
|
||||
? getlocal("char.redirect.operator.away_suff")
|
||||
: "");
|
||||
$group_list .= "<li><a href=\"" . add_params($webimroot . "/operator/redirect.php", $params) .
|
||||
$group_list .= "<li><a href=\"" . add_params($mibewroot . "/operator/redirect.php", $params) .
|
||||
"\" title=\"" . safe_htmlspecialchars(topage(get_group_name($group))) . "\">" .
|
||||
safe_htmlspecialchars(topage(get_group_name($group))) .
|
||||
"</a> $status</li>";
|
||||
|
@ -17,23 +17,23 @@
|
||||
|
||||
function setup_operator_settings_tabs($opId, $active)
|
||||
{
|
||||
global $page, $webimroot, $settings;
|
||||
global $page, $mibewroot, $settings;
|
||||
loadsettings();
|
||||
|
||||
if ($opId) {
|
||||
$page['tabselected'] = $active;
|
||||
if ($settings['enablegroups'] == '1') {
|
||||
$page['tabs'] = array(
|
||||
array('title' => getlocal("page_agent.tab.main"), 'link' => "$webimroot/operator/operator.php?op=$opId"),
|
||||
array('title' => getlocal("page_agent.tab.avatar"), 'link' => "$webimroot/operator/avatar.php?op=$opId"),
|
||||
array('title' => getlocal("page_agent.tab.groups"), 'link' => "$webimroot/operator/opgroups.php?op=$opId"),
|
||||
array('title' => getlocal("page_agent.tab.permissions"), 'link' => "$webimroot/operator/permissions.php?op=$opId"),
|
||||
array('title' => getlocal("page_agent.tab.main"), 'link' => "$mibewroot/operator/operator.php?op=$opId"),
|
||||
array('title' => getlocal("page_agent.tab.avatar"), 'link' => "$mibewroot/operator/avatar.php?op=$opId"),
|
||||
array('title' => getlocal("page_agent.tab.groups"), 'link' => "$mibewroot/operator/opgroups.php?op=$opId"),
|
||||
array('title' => getlocal("page_agent.tab.permissions"), 'link' => "$mibewroot/operator/permissions.php?op=$opId"),
|
||||
);
|
||||
} else {
|
||||
$page['tabs'] = array(
|
||||
array('title' => getlocal("page_agent.tab.main"), 'link' => "$webimroot/operator/operator.php?op=$opId"),
|
||||
array('title' => getlocal("page_agent.tab.avatar"), 'link' => "$webimroot/operator/avatar.php?op=$opId"),
|
||||
array('title' => getlocal("page_agent.tab.permissions"), 'link' => "$webimroot/operator/permissions.php?op=$opId"),
|
||||
array('title' => getlocal("page_agent.tab.main"), 'link' => "$mibewroot/operator/operator.php?op=$opId"),
|
||||
array('title' => getlocal("page_agent.tab.avatar"), 'link' => "$mibewroot/operator/avatar.php?op=$opId"),
|
||||
array('title' => getlocal("page_agent.tab.permissions"), 'link' => "$mibewroot/operator/permissions.php?op=$opId"),
|
||||
);
|
||||
if ($active == 3) $active--;
|
||||
}
|
||||
|
@ -28,8 +28,8 @@ function generate_pagination_link($page, $title, $raw = false)
|
||||
|
||||
function generate_pagination_image($id, $alt)
|
||||
{
|
||||
global $webimroot;
|
||||
return "<img src=\"$webimroot/images/$id.gif\" border=\"0\" alt=\"" . safe_htmlspecialchars($alt) . "\"/>";
|
||||
global $mibewroot;
|
||||
return "<img src=\"$mibewroot/images/$id.gif\" border=\"0\" alt=\"" . safe_htmlspecialchars($alt) . "\"/>";
|
||||
}
|
||||
|
||||
function prepare_pagination($items_count, $default_items_per_page = 15)
|
||||
|
@ -32,13 +32,13 @@ function update_settings()
|
||||
|
||||
function setup_settings_tabs($active)
|
||||
{
|
||||
global $page, $webimroot;
|
||||
global $page, $mibewroot;
|
||||
$page['tabselected'] = $active;
|
||||
$page['tabs'] = array(
|
||||
array('title' => getlocal("page_settings.tab.main"), 'link' => "$webimroot/operator/settings.php"),
|
||||
array('title' => getlocal("page_settings.tab.features"), 'link' => "$webimroot/operator/features.php"),
|
||||
array('title' => getlocal("page_settings.tab.performance"), 'link' => "$webimroot/operator/performance.php"),
|
||||
array('title' => getlocal("page_settings.tab.themes"), 'link' => "$webimroot/operator/themes.php"),
|
||||
array('title' => getlocal("page_settings.tab.main"), 'link' => "$mibewroot/operator/settings.php"),
|
||||
array('title' => getlocal("page_settings.tab.features"), 'link' => "$mibewroot/operator/features.php"),
|
||||
array('title' => getlocal("page_settings.tab.performance"), 'link' => "$mibewroot/operator/performance.php"),
|
||||
array('title' => getlocal("page_settings.tab.themes"), 'link' => "$mibewroot/operator/themes.php"),
|
||||
);
|
||||
}
|
||||
|
||||
|
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.5 KiB |
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.5 KiB |
Before Width: | Height: | Size: 4.6 KiB After Width: | Height: | Size: 4.6 KiB |
Before Width: | Height: | Size: 4.5 KiB After Width: | Height: | Size: 4.5 KiB |
Before Width: | Height: | Size: 4.5 KiB After Width: | Height: | Size: 4.5 KiB |
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 15 KiB |
Before Width: | Height: | Size: 4.7 KiB After Width: | Height: | Size: 4.7 KiB |
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 14 KiB |
Before Width: | Height: | Size: 4.3 KiB After Width: | Height: | Size: 4.3 KiB |
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 14 KiB |
Before Width: | Height: | Size: 4.3 KiB After Width: | Height: | Size: 4.3 KiB |
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 14 KiB |
Before Width: | Height: | Size: 4.4 KiB After Width: | Height: | Size: 4.4 KiB |
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 14 KiB |
Before Width: | Height: | Size: 4.3 KiB After Width: | Height: | Size: 4.3 KiB |
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 14 KiB |
Before Width: | Height: | Size: 4.3 KiB After Width: | Height: | Size: 4.3 KiB |
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 14 KiB |
Before Width: | Height: | Size: 4.3 KiB After Width: | Height: | Size: 4.3 KiB |
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 14 KiB |
Before Width: | Height: | Size: 4.3 KiB After Width: | Height: | Size: 4.3 KiB |
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 14 KiB |
Before Width: | Height: | Size: 4.5 KiB After Width: | Height: | Size: 4.5 KiB |
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 15 KiB |
Before Width: | Height: | Size: 4.1 KiB After Width: | Height: | Size: 4.1 KiB |
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 13 KiB |
Before Width: | Height: | Size: 4.4 KiB After Width: | Height: | Size: 4.4 KiB |
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 15 KiB |
Before Width: | Height: | Size: 4.3 KiB After Width: | Height: | Size: 4.3 KiB |
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 14 KiB |
Before Width: | Height: | Size: 4.3 KiB After Width: | Height: | Size: 4.3 KiB |
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 14 KiB |
Before Width: | Height: | Size: 4.3 KiB After Width: | Height: | Size: 4.3 KiB |
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 14 KiB |
Before Width: | Height: | Size: 3.5 KiB After Width: | Height: | Size: 3.5 KiB |
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 15 KiB |
Before Width: | Height: | Size: 4.4 KiB After Width: | Height: | Size: 4.4 KiB |
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 14 KiB |
Before Width: | Height: | Size: 4.3 KiB After Width: | Height: | Size: 4.3 KiB |
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 14 KiB |
Before Width: | Height: | Size: 4.2 KiB After Width: | Height: | Size: 4.2 KiB |
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 13 KiB |
Before Width: | Height: | Size: 4.2 KiB After Width: | Height: | Size: 4.2 KiB |
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 13 KiB |
Before Width: | Height: | Size: 4.7 KiB After Width: | Height: | Size: 4.7 KiB |
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 16 KiB |
Before Width: | Height: | Size: 4.4 KiB After Width: | Height: | Size: 4.4 KiB |
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 14 KiB |
Before Width: | Height: | Size: 4.6 KiB After Width: | Height: | Size: 4.6 KiB |
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 15 KiB |
Before Width: | Height: | Size: 4.3 KiB After Width: | Height: | Size: 4.3 KiB |
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 14 KiB |
Before Width: | Height: | Size: 5.2 KiB After Width: | Height: | Size: 5.2 KiB |
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 18 KiB |
Before Width: | Height: | Size: 4.5 KiB After Width: | Height: | Size: 4.5 KiB |
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 15 KiB |
Before Width: | Height: | Size: 4.4 KiB After Width: | Height: | Size: 4.4 KiB |
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 15 KiB |
Before Width: | Height: | Size: 6.2 KiB After Width: | Height: | Size: 6.2 KiB |
Before Width: | Height: | Size: 6.1 KiB After Width: | Height: | Size: 6.1 KiB |
Before Width: | Height: | Size: 3.5 KiB After Width: | Height: | Size: 3.5 KiB |
Before Width: | Height: | Size: 3.3 KiB After Width: | Height: | Size: 3.3 KiB |
@ -61,7 +61,7 @@ $subject = getstring("mail.user.history.subject", true);
|
||||
$body = getstring2("mail.user.history.body", array($thread['userName'],$history), true);
|
||||
|
||||
$link = connect();
|
||||
mibew_mail($email, $webim_mailbox, $subject, $body, $link);
|
||||
mibew_mail($email, $mibew_mailbox, $subject, $body, $link);
|
||||
mysql_close($link);
|
||||
|
||||
setup_logo();
|
||||
|
@ -83,7 +83,7 @@ if (!isset($_GET['token'])) {
|
||||
}
|
||||
|
||||
$token = $thread['ltoken'];
|
||||
header("Location: $webimroot/operator/agent.php?thread=" . intval($threadid) . "&token=" . intval($token) . "&level=" . urlencode($remote_level));
|
||||
header("Location: $mibewroot/operator/agent.php?thread=" . intval($threadid) . "&token=" . intval($token) . "&level=" . urlencode($remote_level));
|
||||
exit;
|
||||
}
|
||||
|
||||
|
@ -64,7 +64,7 @@ if (!$op) {
|
||||
if (!@move_uploaded_file($_FILES['avatarFile']['tmp_name'], $full_file_path)) {
|
||||
$errors[] = failed_uploading_file($orig_filename, "errors.file.move.error");
|
||||
} else {
|
||||
$avatar = "$webimroot/images/avatar/$new_file_name";
|
||||
$avatar = "$mibewroot/images/avatar/$new_file_name";
|
||||
}
|
||||
}
|
||||
} else {
|
||||
@ -77,7 +77,7 @@ if (!$op) {
|
||||
if ($opId && $avatar && $_SESSION["${mysqlprefix}operator"] && $operator['operatorid'] == $opId) {
|
||||
$_SESSION["${mysqlprefix}operator"]['vcavatar'] = $avatar;
|
||||
}
|
||||
header("Location: $webimroot/operator/avatar.php?op=" . intval($opId));
|
||||
header("Location: $mibewroot/operator/avatar.php?op=" . intval($opId));
|
||||
exit;
|
||||
} else {
|
||||
$page['avatar'] = topage($op['vcavatar']);
|
||||
@ -86,7 +86,7 @@ if (!$op) {
|
||||
} else {
|
||||
if (isset($_GET['delete']) && $_GET['delete'] == "true" && $canmodify) {
|
||||
update_operator_avatar($op['operatorid'], '');
|
||||
header("Location: $webimroot/operator/avatar.php?op=" . intval($opId));
|
||||
header("Location: $mibewroot/operator/avatar.php?op=" . intval($opId));
|
||||
exit;
|
||||
}
|
||||
$page['avatar'] = topage($op['vcavatar']);
|
||||
|
@ -79,7 +79,7 @@ if (isset($_POST['address'])) {
|
||||
mysql_close($link);
|
||||
|
||||
if (!$threadid) {
|
||||
header("Location: $webimroot/operator/blocked.php");
|
||||
header("Location: $mibewroot/operator/blocked.php");
|
||||
exit;
|
||||
} else {
|
||||
$page['saved'] = true;
|
||||
|
@ -39,7 +39,7 @@ if (isset($_GET['act']) && $_GET['act'] == 'del') {
|
||||
|
||||
if (count($errors) == 0) {
|
||||
perform_query("delete from ${mysqlprefix}chatban where banid = " . intval($banId), $link);
|
||||
header("Location: $webimroot/operator/blocked.php");
|
||||
header("Location: $mibewroot/operator/blocked.php");
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
@ -110,7 +110,7 @@ if (isset($_GET['act']) && $_GET['act'] == 'delete') {
|
||||
$link = connect();
|
||||
perform_query("delete from ${mysqlprefix}chatresponses where id = " . intval($key), $link);
|
||||
mysql_close($link);
|
||||
header("Location: $webimroot/operator/canned.php?lang=" . urlencode($lang) . "&group=" . intval($groupid));
|
||||
header("Location: $mibewroot/operator/canned.php?lang=" . urlencode($lang) . "&group=" . intval($groupid));
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
@ -48,7 +48,7 @@ if (isset($_POST['sent'])) {
|
||||
$settings[$opt] = verifyparam($opt, "/^on$/", "") == "on" ? "1" : "0";
|
||||
}
|
||||
update_settings();
|
||||
header("Location: $webimroot/operator/features.php?stored");
|
||||
header("Location: $mibewroot/operator/features.php?stored");
|
||||
exit;
|
||||
} else {
|
||||
$errors[] = "Not an administrator";
|
||||
|
@ -24,7 +24,7 @@ $operator = check_login();
|
||||
loadsettings();
|
||||
|
||||
$imageLocales = get_image_locales_map("../locales");
|
||||
$image = verifyparam(isset($_GET['image']) ? "image" : "i", "/^\w+$/", "webim");
|
||||
$image = verifyparam(isset($_GET['image']) ? "image" : "i", "/^\w+$/", "mibew");
|
||||
if (!isset($imageLocales[$image])) {
|
||||
$errors[] = "Unknown image: $image";
|
||||
$avail = array_keys($imageLocales);
|
||||
|
@ -95,11 +95,11 @@ if (isset($_POST['name'])) {
|
||||
if (count($errors) == 0) {
|
||||
if (!$groupid) {
|
||||
$newdep = create_group($name, $description, $commonname, $commondescription, $email);
|
||||
header("Location: $webimroot/operator/groupmembers.php?gid=" . intval($newdep['groupid']));
|
||||
header("Location: $mibewroot/operator/groupmembers.php?gid=" . intval($newdep['groupid']));
|
||||
exit;
|
||||
} else {
|
||||
update_group($groupid, $name, $description, $commonname, $commondescription, $email);
|
||||
header("Location: $webimroot/operator/group.php?gid=" . intval($groupid) . "&stored");
|
||||
header("Location: $mibewroot/operator/group.php?gid=" . intval($groupid) . "&stored");
|
||||
exit;
|
||||
}
|
||||
} else {
|
||||
|
@ -74,7 +74,7 @@ if (!$group) {
|
||||
}
|
||||
|
||||
update_group_members($groupid, $new_members);
|
||||
header("Location: $webimroot/operator/groupmembers.php?gid=" . intval($groupid) . "&stored");
|
||||
header("Location: $mibewroot/operator/groupmembers.php?gid=" . intval($groupid) . "&stored");
|
||||
exit;
|
||||
}
|
||||
|
||||
|
@ -39,7 +39,7 @@ if (isset($_GET['act']) && $_GET['act'] == 'del') {
|
||||
perform_query("delete from ${mysqlprefix}chatgroupoperator where groupid = " . intval($groupid), $link);
|
||||
perform_query("update ${mysqlprefix}chatthread set groupid = 0 where groupid = " . intval($groupid), $link);
|
||||
mysql_close($link);
|
||||
header("Location: $webimroot/operator/groups.php");
|
||||
header("Location: $mibewroot/operator/groups.php");
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
@ -27,7 +27,7 @@ loadsettings();
|
||||
setlocale(LC_TIME, getstring("time.locale"));
|
||||
|
||||
$page = array();
|
||||
$query = isset($_GET['q']) ? myiconv(getoutputenc(), $webim_encoding, $_GET['q']) : false;
|
||||
$query = isset($_GET['q']) ? myiconv(getoutputenc(), $mibew_encoding, $_GET['q']) : false;
|
||||
|
||||
if ($query !== false) {
|
||||
$link = connect();
|
||||
|
@ -27,13 +27,13 @@ mysql_close($link);
|
||||
|
||||
$page = array(
|
||||
'version' => $version,
|
||||
'localeLinks' => get_locale_links("$webimroot/operator/index.php"),
|
||||
'localeLinks' => get_locale_links("$mibewroot/operator/index.php"),
|
||||
'needUpdate' => $settings['dbversion'] != $dbversion,
|
||||
'needChangePassword' => check_password_hash($operator['vclogin'], '', $operator['vcpassword']),
|
||||
'profilePage' => "$webimroot/operator/operator.php?op=".safe_htmlspecialchars($operator['operatorid']),
|
||||
'updateWizard' => "$webimroot/install/",
|
||||
'profilePage' => "$mibewroot/operator/operator.php?op=".safe_htmlspecialchars($operator['operatorid']),
|
||||
'updateWizard' => "$mibewroot/install/",
|
||||
'newFeatures' => $settings['featuresversion'] != $featuresversion,
|
||||
'featuresPage' => "$webimroot/operator/features.php",
|
||||
'featuresPage' => "$mibewroot/operator/features.php",
|
||||
'isOnline' => $isonline
|
||||
);
|
||||
|
||||
|
@ -30,10 +30,10 @@ if (isset($_POST['login']) && isset($_POST['password'])) {
|
||||
if ($operator && isset($operator['vcpassword']) && check_password_hash($login, $password, $operator['vcpassword'])) {
|
||||
|
||||
$target = $password == ''
|
||||
? "$webimroot/operator/operator.php?op=" . intval($operator['operatorid'])
|
||||
? "$mibewroot/operator/operator.php?op=" . intval($operator['operatorid'])
|
||||
: (isset($_SESSION['backpath'])
|
||||
? $_SESSION['backpath']
|
||||
: "$webimroot/operator/index.php");
|
||||
: "$mibewroot/operator/index.php");
|
||||
|
||||
login_operator($operator, $remember, is_secure_request());
|
||||
header("Location: $target");
|
||||
@ -48,7 +48,7 @@ if (isset($_POST['login']) && isset($_POST['password'])) {
|
||||
$page['formlogin'] = $login;
|
||||
}
|
||||
|
||||
$page['localeLinks'] = get_locale_links("$webimroot/operator/login.php");
|
||||
$page['localeLinks'] = get_locale_links("$mibewroot/operator/login.php");
|
||||
start_html_output();
|
||||
require('../view/login.php');
|
||||
?>
|