diff --git a/src/messenger/webim/libs/operator.php b/src/messenger/webim/libs/operator.php index 9f98333f..6684a203 100644 --- a/src/messenger/webim/libs/operator.php +++ b/src/messenger/webim/libs/operator.php @@ -173,22 +173,6 @@ function append_query($link,$pv) { return "$link$infix$pv"; } -function generate_button($title,$locale,$style,$group,$inner,$showhost,$forcesecure,$modsecurity) { - $link = get_app_location($showhost,$forcesecure)."/client.php"; - if($locale) - $link = append_query($link, "locale=$locale"); - if($style) - $link = append_query($link, "style=$style"); - if($group) - $link = append_query($link, "group=$group"); - - $modsecfix = $modsecurity ? ".replace('http://','').replace('https://','')" : ""; - $jslink = append_query("'".$link,"url='+escape(document.location.href$modsecfix)+'&referrer='+escape(document.referrer$modsecfix)"); - $temp = get_popup($link, "$jslink", - $inner, $title, "webim", "toolbar=0,scrollbars=0,location=0,status=1,menubar=0,width=640,height=480,resizable=1" ); - return "".$temp.""; -} - function check_login($redirect=true) { global $webimroot; if( !isset( $_SESSION['operator'] ) ) { diff --git a/src/messenger/webim/operator/getcode.php b/src/messenger/webim/operator/getcode.php index 245e708b..b101a45d 100644 --- a/src/messenger/webim/operator/getcode.php +++ b/src/messenger/webim/operator/getcode.php @@ -23,6 +23,22 @@ require_once('../libs/common.php'); require_once('../libs/operator.php'); require_once('../libs/groups.php'); +function generate_button($title,$locale,$style,$group,$inner,$showhost,$forcesecure,$modsecurity) { + $link = get_app_location($showhost,$forcesecure)."/client.php"; + if($locale) + $link = append_query($link, "locale=$locale"); + if($style) + $link = append_query($link, "style=$style"); + if($group) + $link = append_query($link, "group=$group"); + + $modsecfix = $modsecurity ? ".replace('http://','').replace('https://','')" : ""; + $jslink = append_query("'".$link,"url='+escape(document.location.href$modsecfix)+'&referrer='+escape(document.referrer$modsecfix)"); + $temp = get_popup($link, "$jslink", + $inner, $title, "webim", "toolbar=0,scrollbars=0,location=0,status=1,menubar=0,width=640,height=480,resizable=1" ); + return "".$temp.""; +} + $operator = check_login(); loadsettings();