integrate 1.5.2 changes into trunk

git-svn-id: https://webim.svn.sourceforge.net/svnroot/webim/trunk@339 c66351dc-e62f-0410-b875-e3a5c0b9693f
This commit is contained in:
Evgeny Gryaznov 2009-02-03 23:33:30 +00:00
parent ef036a4621
commit 0b4b186dd1
6 changed files with 25 additions and 8 deletions

View File

@ -32,7 +32,11 @@ if( !isset($_GET['token']) || !isset($_GET['thread']) ) {
exit;
}
$referer = isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : "";
$referer = isset($_GET['url']) ? $_GET['url'] :
(isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : "");
if(isset($_GET['referrer']) && $_GET['referrer']) {
$referer .= "\n".$_GET['referrer'];
}
$extAddr = $_SERVER['REMOTE_ADDR'];
if (isset($_SERVER['HTTP_X_FORWARDED_FOR']) &&
$_SERVER['HTTP_X_FORWARDED_FOR'] != $_SERVER['REMOTE_ADDR']) {

View File

@ -1,3 +1,8 @@
1.5.2
-----
[!] lost query parameters after login redirect
[+] added referrer into button code
1.5.1
-----
[!] significant optimization of chat window (both themes), reduced number of images and their sizes

View File

@ -343,8 +343,9 @@ function wrong_field($key) {
return getlocal2("errors.wrong_field",array(getlocal($key)));
}
function get_popup($href,$message,$title,$wndName,$options) {
return "<a href=\"$href\" target=\"_blank\" ".($title?"title=\"$title\" ":"")."onclick=\"if(navigator.userAgent.toLowerCase().indexOf('opera') != -1 && window.event.preventDefault) window.event.preventDefault();this.newWindow = window.open('$href', '$wndName', '$options');this.newWindow.focus();this.newWindow.opener=window;return false;\">$message</a>";
function get_popup($href,$jshref,$message,$title,$wndName,$options) {
if(!$jshref) { $jshref = "'$href'"; }
return "<a href=\"$href\" target=\"_blank\" ".($title?"title=\"$title\" ":"")."onclick=\"if(navigator.userAgent.toLowerCase().indexOf('opera') != -1 && window.event.preventDefault) window.event.preventDefault();this.newWindow = window.open($jshref, '$wndName', '$options');this.newWindow.focus();this.newWindow.opener=window;return false;\">$message</a>";
}
function get_image($href,$width,$height) {

View File

@ -126,8 +126,9 @@ function get_operator_name($operator) {
}
function generate_button($title,$locale,$style,$inner,$showhost,$forcesecure) {
$link = get_app_location($showhost,$forcesecure)."/client.php". ($locale?"?locale=$locale" : "").($style ? ($locale?"&":"?")."style=$style" : "");
$temp = get_popup($link, $inner, $title, "webim", "toolbar=0,scrollbars=0,location=0,status=1,menubar=0,width=640,height=480,resizable=1" );
$link = get_app_location($showhost,$forcesecure)."/client.php". ($locale?"?locale=$locale" : "").($style ? ($locale?"&amp;":"?")."style=$style" : "");
$temp = get_popup($link, "'$link".($locale||$style?"&amp;":"?")."url='+escape(document.location.href)+'&amp;referrer='+escape(document.referrer)",
$inner, $title, "webim", "toolbar=0,scrollbars=0,location=0,status=1,menubar=0,width=640,height=480,resizable=1" );
return "<!-- webim button -->".$temp."<!-- / webim button -->";
}
@ -142,7 +143,11 @@ function check_login() {
return $op;
}
}
$_SESSION['backpath'] = $_SERVER['PHP_SELF'];
$requested = $_SERVER['PHP_SELF'];
if($_SERVER['REQUEST_METHOD'] == 'GET' && $_SERVER['QUERY_STRING']) {
$requested .= "?".$_SERVER['QUERY_STRING'];
}
$_SESSION['backpath'] = $requested;
header("Location: $webimroot/operator/login.php");
exit;
}

View File

@ -86,12 +86,14 @@ if($stringid) {
if(isset($_POST['translation'])) {
$translation = getparam('translation');
if(!$translation) {
$errors[] = no_field("form.field.translation");
}
if(count($errors) == 0) {
if (get_magic_quotes_gpc()) {
$translation = stripslashes($translation);
}
save_message($target, $stringid, $translation);
$page['saved'] = true;

View File

@ -72,7 +72,7 @@ function get_user_addr($addr) {
global $settings;
if($settings['geolink'] && preg_match( "/(\\d+\\.\\d+\\.\\d+\\.\\d+)/", $addr, $matches )) {
$userip = $matches[1];
return get_popup(str_replace("{ip}", $userip, $settings['geolink']), htmlspecialchars($addr), "GeoLocation", "ip$userip", $settings['geolinkparams']);
return get_popup(str_replace("{ip}", $userip, $settings['geolink']), '', htmlspecialchars($addr), "GeoLocation", "ip$userip", $settings['geolinkparams']);
}
return htmlspecialchars($addr);
}