mirror of
https://github.com/Mibew/tray.git
synced 2025-01-22 18:10:34 +03:00
[ban] disable ban completely if turned off, ban any address, show previos ban if already in the list
git-svn-id: https://webim.svn.sourceforge.net/svnroot/webim/trunk@194 c66351dc-e62f-0410-b875-e3a5c0b9693f
This commit is contained in:
parent
4dba04534a
commit
39049f8b03
@ -120,9 +120,9 @@ var HtmlGenerationUtils = {
|
||||
}
|
||||
return HtmlGenerationUtils.generateOneRowTable(gen);
|
||||
},
|
||||
banCell: function(id){
|
||||
banCell: function(id,banid){
|
||||
return '<td width="30" align="center">'+
|
||||
HtmlGenerationUtils.popupLink( webimRoot+'/operator/ban.php?thread='+id, localized[2], "ban"+id, '<img src="'+webimRoot+'/images/ban.gif" width="15" height="15" border="0" alt="'+localized[2]+'">', 550, 440, null)+
|
||||
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]+'">', 550, 440, null)+
|
||||
'</td>';
|
||||
}
|
||||
};
|
||||
@ -155,7 +155,7 @@ Class.inherit( Ajax.ThreadListUpdater, Ajax.Base, {
|
||||
},
|
||||
|
||||
updateThread: function(node) {
|
||||
var id, stateid, vstate, canview = false, canopen = false, ban = null;
|
||||
var id, stateid, vstate, canview = false, canopen = false, canban = false, ban = null, banid = null;
|
||||
|
||||
for( var i = 0; i < node.attributes.length; i++ ) {
|
||||
var attr = node.attributes[i];
|
||||
@ -169,8 +169,12 @@ Class.inherit( Ajax.ThreadListUpdater, Ajax.Base, {
|
||||
canopen = true;
|
||||
else if( attr.nodeName == "canview" )
|
||||
canview = true;
|
||||
else if( attr.nodeName == "canban" )
|
||||
canban = true;
|
||||
else if( attr.nodeName == "ban" )
|
||||
ban = attr.nodeValue;
|
||||
else if( attr.nodeName == "banid" )
|
||||
banid = attr.nodeValue;
|
||||
}
|
||||
|
||||
function setcell(_table, row,id,pcontent) {
|
||||
@ -201,7 +205,9 @@ Class.inherit( Ajax.ThreadListUpdater, Ajax.Base, {
|
||||
etc = '<td class="table">'+NodeUtils.getNodeValue(node,"reason")+'</td>';
|
||||
}
|
||||
|
||||
etc += HtmlGenerationUtils.banCell(id);
|
||||
if(canban) {
|
||||
etc += HtmlGenerationUtils.banCell(id,banid);
|
||||
}
|
||||
etc = HtmlGenerationUtils.generateOneRowTable(etc);
|
||||
|
||||
var startRow = CommonUtils.getRow(stateid, this.t);
|
||||
|
@ -1 +1 @@
|
||||
var myAgent="";var sk=0;var myRealAgent="";function tk(){var uk=["\u006f\160er\u0061","m\u0073\u0069\145","\163a\u0066\141\u0072\151","firef\u006f\170","n\145\u0074\u0073\143a\160\145","\u006d\u006fz\u0069lla"];var oj=navigator.userAgent.toLowerCase();for(var i=0;i<uk.length;i++){var hk=uk[i];if(oj.indexOf(hk)!=-1){myAgent=hk;if(!window.RegExp)break;var ik=new RegExp(hk+"\133\040\/]\077\u0028[\060-\071]\053(\.\u005b0\u002d\071\135\053)\077\u0029");if(ik.exec(oj)!=null){sk=parseFloat(RegExp.$1);} break;} } myRealAgent=myAgent;if(navigator.product=="\u0047ec\u006b\u006f")myAgent="moz";} tk();function getEl(name){return document.getElementById(name);}
|
||||
var myAgent="";var uk=0;var myRealAgent="";function hk(){var ik=["\157pera","\u006ds\151\145","\u0073\u0061fa\162\151","\u0066\u0069r\u0065fox","n\u0065t\u0073cap\145","\u006d\u006fz\u0069l\154\u0061"];var dj=navigator.userAgent.toLowerCase();for(var i=0;i<ik.length;i++){var jk=ik[i];if(dj.indexOf(jk)!=-1){myAgent=jk;if(!window.RegExp)break;var kk=new RegExp(jk+"[ \/]\u003f(\u005b\060\055\071]\053\u0028\.\u005b0\u002d9]\u002b\u0029\u003f)");if(kk.exec(dj)!=null){uk=parseFloat(RegExp.$1);} break;} } myRealAgent=myAgent;if(navigator.product=="\107e\u0063\153\u006f")myAgent="mo\u007a";} hk();function getEl(name){return document.getElementById(name);}
|
File diff suppressed because one or more lines are too long
@ -31,10 +31,8 @@ if( isset($_POST['address']) ) {
|
||||
$comment = getparam('comment');
|
||||
$threadid = isset($_POST['threadid']) ? getparam('threadid') : "";
|
||||
|
||||
if( !preg_match( "/^(\d{1,3}.\d{1,3}.\d{1,3}.\d{1,3})$/", $address )) {
|
||||
if( !preg_match("/^([a-z0-9-]+\.)+[a-z0-9-]+$/", $address)) {
|
||||
$errors[] = wrong_field("form.field.address");
|
||||
}
|
||||
if( !$address ) {
|
||||
$errors[] = no_field("form.field.address");
|
||||
}
|
||||
|
||||
if( !preg_match( "/^\d+$/", $days )) {
|
||||
|
@ -69,7 +69,7 @@ function get_useragent_version($userAgent) {
|
||||
}
|
||||
|
||||
function thread_to_xml($thread,$link) {
|
||||
global $threadstate_to_string, $threadstate_key, $webim_encoding, $operator;
|
||||
global $threadstate_to_string, $threadstate_key, $webim_encoding, $operator, $settings;
|
||||
$state = $threadstate_to_string[$thread['istate']];
|
||||
$result = "<thread id=\"".$thread['threadid']."\" stateid=\"$state\"";
|
||||
if( $state == "closed" )
|
||||
@ -81,13 +81,16 @@ function thread_to_xml($thread,$link) {
|
||||
: ($thread['agentName'] ? $thread['agentName'] : "-");
|
||||
|
||||
$result .= " canopen=\"true\"";
|
||||
if( $thread['agentId'] != $operator['operatorid'] && $thread['nextagent'] != $operator['operatorid']) {
|
||||
if ($thread['agentId'] != $operator['operatorid'] && $thread['nextagent'] != $operator['operatorid']) {
|
||||
$result .= " canview=\"true\"";
|
||||
}
|
||||
if ($settings['enableban'] == "1") {
|
||||
$result .= " canban=\"true\"";
|
||||
}
|
||||
|
||||
$banForThread = ban_for_addr_($thread['remote'],$link);
|
||||
$banForThread = $settings['enableban'] == "1" ? ban_for_addr_($thread['remote'],$link) : false;
|
||||
if($banForThread) {
|
||||
$result .= " ban=\"blocked\"";
|
||||
$result .= " ban=\"blocked\" banid=\"".$banForThread['banid']."\"";
|
||||
}
|
||||
|
||||
$result .= " state=\"$state\" typing=\"".$thread['userTyping']."\">";
|
||||
|
Loading…
Reference in New Issue
Block a user