diff --git a/src/messenger/js/users.js b/src/messenger/js/users.js
index 84abcf1f..ec21e839 100644
--- a/src/messenger/js/users.js
+++ b/src/messenger/js/users.js
@@ -119,6 +119,11 @@ var HtmlGenerationUtils = {
gen += '';
}
return HtmlGenerationUtils.generateOneRowTable(gen);
+ },
+ banCell: function(id){
+ return '
';} ,di:function(content){return'\074\u0074ab\u006c\145 w\u0069dth\075"\06100%"\040ce\u006cl\u0073\u0070a\143\u0069ng\u003d"\u0030"\u0020\u0063e\154\u006c\u0070\141dd\u0069\156g\u003d"\060"\040bo\162d\145\162\u003d"\u0030"\076\074\164r\u003e'+content+'\074/\164\141\142le>';} ,ei:function(fi,gi,id,ai,bi,ci,ct,vi){var wi=2;var link=gi+"\077\164\150\162e\141\u0064\075"+id;var xi='\074t\u0064\u0020c\154a\163s\075"ta\u0062l\u0065"\040\u0073\164\u0079le\u003d"\160a\144\u0064\151ng-\u006ce\u0066t\u003a0p\170\073\040\u0070\141\144ding-\162i\147\150t\072\u0030\u0070x\u003b"\076';xi+=si.ki((vi||!ai)?link:link+"\046\u0076\151ew\u006f\156\154y=\164ru\u0065",localized[bi?0:1],"I\155Ce\u006e\u0074er"+id,fi,01130,0644,ci);xi+='\074/\164d\076<\057\164d\u003e';if(bi){xi+=' | ';xi+=si.ki(link,localized[0],"ImCe\156\u0074\145r"+id,'\074\151m\147\u0020sr\143\075"'+st+'\u002fi\u006dag\u0065\u0073\u002ft\142li\143\u006c\u0073\160\u0065ak\u002e\147i\146"\040\u0077i\u0064t\u0068\u003d"\061\065"\040\u0068\145\151\u0067\u0068\164\u003d"1\u0035" bo\u0072de\u0072="0"\040\141\154\164\u003d"'+localized[0]+'"\076',01130,0644,null);xi+='<\057\u0074d\076';wi++;} if(ai){xi+=' | ';xi+=si.ki(link+"\046v\151\u0065wo\u006e\u006c\u0079=\u0074ru\u0065",localized[1],"\u0049\u006d\u0043\u0065n\164e\u0072"+id,'\074\u0069\u006d\u0067 \163\u0072\143="'+st+'\057\151m\141\147e\163\u002ft\u0062\154i\143lr\145a\144\056gif"\040\167\u0069d\u0074\150="\0615"\u0020\150e\u0069ght="\061\065" \u0062or\144\145\u0072\075"\u0030"\u0020\141\154t\075"'+localized[1]+'"\076',0x258,0644,null);xi+='\074/\164\144\076';wi++;} if(ct!=""){xi+='\074/tr>\074\164\u0072\u003e<\164\144\u0020\u0063\154\141s\u0073="\146\151rstme\u0073\163\141g\145"\u0020al\151\147n\u003d"r\u0069\u0067h\164"\040\143ols\160\u0061\156\u003d"'+wi+'">\074\141\u0020h\u0072\145f="\152\u0061v\u0061sc\u0072ipt:\166\157\u0069\u0064\0500\u0029"\040t\151\164\u006ce="'+ct+'" o\156\u0063l\151\u0063\153\075"a\u006ce\162\u0074\u0028t\150\u0069\u0073.\164\u0069\164\u006ce\u0029\073\u0072\145\u0074urn f\141\u006c\u0073\145;">';xi+=ct.length>036?ct.substring(0,0x1e)+'.\056\056':ct;xi+='<\u002fa><\057\u0074d>';} return si.di(xi);} } ;sq.yi=mn.nn();mn.sn(sq.yi,sq.lq,{qn:function(pq){this.oq(pq);this.pq.ri=this.ri.on(this);this.pq.iu=this.iu.on(this);this.pq.hu=this.hu.on(this);this.pq.zi=0;this.$i=new Object();this._i=0;this.t=this.pq.mj;this.nj=new sq.qi(this.pq);} ,ri:function(){return"\u0063\157\155p\u0061n\171\u003d"+this.pq.company+"&s\u0069\156c\u0065\075"+this.pq.zi;} ,$t:function(ku){this.pq.status.innerHTML=ku;} ,iu:function(s){this.$t(s);} ,qj:function(rh){var id,rj,sj,ai=false,bi=false,ci=null;for(var i=0;i=ej.rowIndex)){si.ui(this.t,ji.rowIndex+1);this.t.deleteRow(ji.rowIndex);this.$i[id]=null;ji=null;} if(ji==null){ji=this.t.insertRow(dj.rowIndex+1);si.ii(this.t,dj.rowIndex+2);ji.id="t\150\162"+id;this.$i[id]=new Array(kj,oj,rj);ls.insertCell(ji,"\u006e\141\155\u0065","ta\u0062\u006c\u0065",null,(27+3),si.ei(ij,this.pq.agentservl,id,ai,bi,ci,ct,rj!='\u0063\u0068\u0061\u0074'));si.ti(ji);ls.insertCell(ji,"c\u006f\156\164id","t\141\u0062\u006c\145","\143\u0065n\u0074e\u0072",null,jj);si.ti(ji);ls.insertCell(ji,"\u0073\u0074\141\u0074\u0065","\164\u0061b\154\u0065","\u0063\145\u006eter",null,sj);si.ti(ji);ls.insertCell(ji,"\u006f\160","ta\u0062\154e","c\145nt\u0065r",null,lj);si.ti(ji);ls.insertCell(ji,"\u0074\u0069\u006d\145","t\141ble","c\145\156\u0074\145r",null,this.fj(kj));si.ti(ji);ls.insertCell(ji,"\167\u0061it","\u0074a\u0062l\145","c\u0065\u006e\164\145r",null,(rj!='\143\150at'?this.fj(oj):'-'));si.ti(ji);ls.insertCell(ji,"\u0065\164c","ta\u0062\154\145","c\u0065nt\145\162",null,pj);if(rj=='\167\u0061\u0069\u0074'||rj=='\160\u0072i\157')return true;} else{this.$i[id]=new Array(kj,oj,rj);uj(this.t,ji,"\156\141\155\u0065",si.ei(ij,this.pq.agentservl,id,ai,bi,ci,ct,rj!='\143\150a\u0074'));uj(this.t,ji,"\u0063\157\u006e\u0074\u0069d",jj);uj(this.t,ji,"\163\164a\164e",sj);uj(this.t,ji,"\157p",lj);uj(this.t,ji,"\u0074\151\155\145",this.fj(kj));uj(this.t,ji,"\167\141\151\u0074",(rj!='\u0063ha\u0074'?this.fj(oj):'\u002d'));uj(this.t,ji,"e\164\u0063",pj);} return false;} ,gj:function(){function aj(t,id,bj){var dj=t.rows[id];var ej=t.rows[id+"\u0065nd"];if(dj==null||ej==null)return;var cj=ej.cells["\u0073\u0074at\u0075s"];if(cj==null)return;cj.innerHTML=(dj.rowIndex+1==ej.rowIndex)?bj:"";cj.height=(dj.rowIndex+1==ej.rowIndex)?036:012;} aj(this.t,"\u0077\141\u0069\164",this.pq.noclients);aj(this.t,"\u0070\162i\157",this.pq.noclients);aj(this.t,"\143\150\u0061\164",this.pq.noclients);} ,fj:function(vj){var wj=Math.floor(((new Date()).getTime()-vj-this._i)/(684+316));var xj=Math.floor(wj/0x3c);var yj="";wj=wj%074;if(wj<(7+3))wj="\u0030"+wj;if(xj>=074){var zj=Math.floor(xj/(54+6));xj=xj%0x3c;if(xj<012)xj="\u0030"+xj;yj=zj+":";} return yj+xj+":"+wj;} ,$j:function(){for(var i in this.$i){if(this.$i[i]!=null){var value=this.$i[i];var ji=ls.os("t\150r"+i,this.t);if(ji!=null){function uj(ds,ji,id,hj){var ws=ls.fs(id,ji,ds);if(ws)ws.innerHTML=hj;} uj(this.t,ji,"tim\145",this.fj(value[0]));uj(this.t,ji,"w\u0061i\u0074",(value[2]!='\143hat'?this.fj(value[1]):'\u002d'));} } } } ,hu:function(_j){var mk=false;if(_j.tagName=='t\u0068r\145\u0061\u0064s'){var nk=qs.ks(_j,"\164\u0069m\u0065");var qk=qs.ks(_j,"r\145\u0076\u0069s\151\157\u006e");if(nk)this._i=(new Date()).getTime()-nk;if(qk)this.pq.zi=qk;for(var i=0;i<_j.childNodes.length;i++){var rh=_j.childNodes[i];if(rh.tagName=='\164\150\u0072\u0065\u0061d')if(this.qj(rh))mk=true;} this.gj();this.$j();this.$t("U\u0070 \u0074o\u0020\144\u0061\u0074e");if(mk){xs(st+'\057\163o\u0075\u006eds\057n\u0065\167\137u\u0073\u0065\162\056\167\u0061\166');window.focus();} } else if(_j.tagName=='e\u0072\u0072o\162'){this.$t(qs.rs(_j,"d\145s\u0063r"));} else{this.$t("rec\157\u006e\156\145\u0063t\151\156\147");} } } );var st="";kr.lr(window,'\u006fnl\157\u0061d',function(){st=updaterOptions.wroot;new sq.yi(({mj:$("\164hre\u0061d\u006c\u0069st"),status:$("\u0063o\156n\u0073t\141\164u\u0073")} ).un(updaterOptions||{} ));} );
\ No newline at end of file
+sq.qi=mn.nn();mn.sn(sq.qi,sq.lq,{qn:function(pq){this.oq(pq);this.pq.onComplete=this.ot.on(this);this.pq.jr=this.pt.on(this);this.pq.hr=this._q.on(this);this.pq.timeout=(3262+1738);this.frequency=(this.pq.frequency||2);this.dt={} ;this.xt();} ,pt:function(yt,zt){if(this.pq.iu)this.pq.iu("\u006fffli\156\u0065\054\040\162\u0065\143\u006f\156n\u0065c\u0074\151\156g");this._t();this.mu=setTimeout(this.xt.on(this),(723+277));} ,_q:function(yt){if(this.pq.iu)this.pq.iu("\164i\u006de\157\165\164\u002c\u0020\162\145c\157\u006e\156\u0065c\u0074i\u006e\147");this._t();this.mu=setTimeout(this.xt.on(this),(692+308));} ,_t:function(){if(this.dt.pq)this.dt.pq.onComplete=undefined;clearTimeout(this.mu);} ,xt:function(){if(this.pq.ri)this.pq.fq=(this.pq.ri)();this.dt=new sq.vq(this.pq.url,this.pq);} ,ot:function(ou){try{var uu=sq.uq(ou);if(uu){(this.pq.hu||sq.kq)(uu);} else{if(this.pq.iu)this.pq.iu("\u0072e\u0063onne\143\u0074\u0069\156\u0067");} } catch(e){} this.mu=setTimeout(this.xt.on(this),this.frequency*(667+333));} } );var si={ti:function(es){var ws=es.insertCell(-1);ws.style.backgroundImage='\u0075\u0072\154('+st+'/\151mag\145\163\057ta\142l\u0065\144i\u0076\u0033\056gi\146\u0029';ws.innerHTML='\u003ci\u006d\147\040src\075"'+st+'\057\u0069\155a\u0067es\u002f\u0066r\145\u0065\056\147\u0069\u0066"\040\u0077\151\144\u0074\u0068\075"\063"\040h\u0065\151\u0067\150t\u003d"\u0031"\u0020\142ord\145r="0"\040\u0061\154t\u003d""\u003e';} ,ui:function(ds,hi){ds.deleteRow(hi+2);ds.deleteRow(hi+1);ds.deleteRow(hi);} ,ii:function(ds,hi){var ji=ds.insertRow(hi);var ws=ji.insertCell(-1);ws.colSpan=015;ws.height=2;ji=ds.insertRow(hi);ws=ji.insertCell(-1);ws.colSpan=(12+1);ws.style.backgroundColor='\043\u00451E\u0031E1';ws.innerHTML='\u003c\u0069\155g \163\u0072\143\075"'+st+'/i\u006d\141\u0067\145\u0073/f\u0072\145e\u002e\u0067\u0069f" \u0077\u0069dt\u0068\075"\061"\040\150e\u0069g\u0068\164\u003d"\061" \142or\u0064e\u0072="\u0030" \u0061\154t=""\076';ji=ds.insertRow(hi);ws=ji.insertCell(-1);ws.colSpan=(9+4);ws.height=2;} ,ki:function(link,title,li,oi,width,height,pi){return'\074a \150r\u0065\u0066="'+link+'"'+(pi!=null?'\u0020\u0063l\141\163s\u003d"'+pi+'"':'')+' t\141\162\u0067e\164\075"\u005fb\u006can\153" \u0074i\u0074\154\145="'+title+'" onc\154i\u0063\u006b="\u0074\150\u0069s\056\156\145\u0077\127\151nd\157\167 \u003d \u0077i\156dow\u002e\157\160\145n\u0028\''+link+'\'\u002c\u0020\''+li+'\'\u002c\040\'\164oo\u006c\u0062a\u0072\075\060\054s\u0063\162\u006fl\154\u0062\u0061r\163\u003d\060,loc\141t\u0069on\u003d\u0030,s\u0074at\165s\075\061,\u006d\u0065\u006eu\142\141\162\u003d\u0030\054\u0077\u0069dt\u0068\075'+width+',\150eig\u0068\164='+height+',\162e\u0073i\172\u0061\142le\u003d\u0031\');\u0074h\u0069\u0073\056\u006eew\u0057ind\u006fw.\146\157c\165\163\u0028\u0029\u003bt\u0068\u0069\163\u002e\156\u0065\167\u0057\u0069\156d\157w\056o\u0070e\156e\162\u003d\167\151\u006e\u0064\157w;\u0072e\u0074urn \u0066\u0061\u006cs\u0065;"\u003e'+oi+'\074\u002f\u0061>';} ,di:function(content){return'\074\u0074ab\u006c\145 w\u0069dth\075"\06100%"\040ce\u006cl\u0073\u0070a\143\u0069ng\u003d"\u0030"\u0020\u0063e\154\u006c\u0070\141dd\u0069\156g\u003d"\060"\040bo\162d\145\162\u003d"\u0030"\076\074\164r\u003e'+content+'\074/\164\141\142le>';} ,ei:function(fi,gi,id,ai,bi,ci,ct,vi){var wi=2;var link=gi+"\077\164\150\162e\141\u0064\075"+id;var xi='\074t\u0064\u0020c\154a\163s\075"ta\u0062l\u0065"\040\u0073\164\u0079le\u003d"\160a\144\u0064\151ng-\u006ce\u0066t\u003a0p\170\073\040\u0070\141\144ding-\162i\147\150t\072\u0030\u0070x\u003b"\076';xi+=si.ki((vi||!ai)?link:link+"\046\u0076\151ew\u006f\156\154y=\164ru\u0065",localized[bi?0:1],"I\155Ce\u006e\u0074er"+id,fi,01130,0644,ci);xi+='\074/\164d\076<\057\164d\u003e';if(bi){xi+=' | ';xi+=si.ki(link,localized[0],"ImCe\156\u0074\145r"+id,'\074\151m\147\u0020sr\143\075"'+st+'\u002fi\u006dag\u0065\u0073\u002ft\142li\143\u006c\u0073\160\u0065ak\u002e\147i\146"\040\u0077i\u0064t\u0068\u003d"\061\065"\040\u0068\145\151\u0067\u0068\164\u003d"1\u0035" bo\u0072de\u0072="0"\040\141\154\164\u003d"'+localized[0]+'"\076',01130,0644,null);xi+='<\057\u0074d\076';wi++;} if(ai){xi+=' | ';xi+=si.ki(link+"\046v\151\u0065wo\u006e\u006c\u0079=\u0074ru\u0065",localized[1],"\u0049\u006d\u0043\u0065n\164e\u0072"+id,'\074\u0069\u006d\u0067 \163\u0072\143="'+st+'\057\151m\141\147e\163\u002ft\u0062\154i\143lr\145a\144\056gif"\040\167\u0069d\u0074\150="\0615"\u0020\150e\u0069ght="\061\065" \u0062or\144\145\u0072\075"\u0030"\u0020\141\154t\075"'+localized[1]+'"\076',0x258,0644,null);xi+='\074/\164\144\076';wi++;} if(ct!=""){xi+='\074/tr>\074\164\u0072\u003e<\164\144\u0020\u0063\154\141s\u0073="\146\151rstme\u0073\163\141g\145"\u0020al\151\147n\u003d"r\u0069\u0067h\164"\040\143ols\160\u0061\156\u003d"'+wi+'">\074\141\u0020h\u0072\145f="\152\u0061v\u0061sc\u0072ipt:\166\157\u0069\u0064\0500\u0029"\040t\151\164\u006ce="'+ct+'" o\156\u0063l\151\u0063\153\075"a\u006ce\162\u0074\u0028t\150\u0069\u0073.\164\u0069\164\u006ce\u0029\073\u0072\145\u0074urn f\141\u006c\u0073\145;">';xi+=ct.length>036?ct.substring(0,0x1e)+'.\056\056':ct;xi+='<\u002fa><\057\u0074d>';} return si.di(xi);} ,yi:function(id){return'<\u0074\144 \u0077i\144\u0074\u0068="\u0033\060"\u0020\141\u006c\u0069\u0067\156="\u0063e\156\u0074\145\162">'+si.ki(st+'\u002f\157\160\u0065\u0072\141t\157\162/\142a\156.\160\150p?\u0074\150r\u0065\u0061\u0064\075'+id,localized[2],"\142a\156"+id,'\u003ci\u006d\147\040\u0073\162\143="'+st+'\u002f\u0069\u006d\u0061g\u0065\u0073\057\u0062\u0061\156.\147\u0069f"\u0020\167id\u0074\150\u003d"\061\u0035" \u0068eigh\164\075"15"\u0020b\157r\144\145\u0072\u003d"\060"\u0020al\164="'+localized[2]+'">',0x226,0670,null)+'\164d\u003e';} } ;sq.zi=mn.nn();mn.sn(sq.zi,sq.lq,{qn:function(pq){this.oq(pq);this.pq.ri=this.ri.on(this);this.pq.iu=this.iu.on(this);this.pq.hu=this.hu.on(this);this.pq.$i=0;this._i=new Object();this.mj=0;this.t=this.pq.nj;this.qj=new sq.qi(this.pq);} ,ri:function(){return"\143\157\u006d\u0070\u0061\u006ey\u003d"+this.pq.company+"\046s\151\156\u0063\u0065\075"+this.pq.$i;} ,$t:function(ku){this.pq.status.innerHTML=ku;} ,iu:function(s){this.$t(s);} ,rj:function(rh){var id,sj,tj,ai=false,bi=false,ci=null;for(var i=0;i=fj.rowIndex)){si.ui(this.t,ji.rowIndex+1);this.t.deleteRow(ji.rowIndex);this._i[id]=null;ji=null;} if(ji==null){ji=this.t.insertRow(ej.rowIndex+1);si.ii(this.t,ej.rowIndex+2);ji.id="t\u0068\162"+id;this._i[id]=new Array(lj,pj,sj);ls.insertCell(ji,"\156\141m\145","\u0074ab\u006ce",null,036,si.ei(jj,this.pq.agentservl,id,ai,bi,ci,ct,sj!='\143h\141t'));si.ti(ji);ls.insertCell(ji,"\143ontid","\164\141bl\145","ce\u006et\u0065\162",null,kj);si.ti(ji);ls.insertCell(ji,"state","\u0074ab\u006ce","\u0063\u0065\156\u0074e\u0072",null,tj);si.ti(ji);ls.insertCell(ji,"\u006f\160","t\u0061\u0062l\145","c\u0065nt\145\162",null,oj);si.ti(ji);ls.insertCell(ji,"\164\u0069\155\145","\164a\u0062\154\u0065","c\145\u006e\u0074e\u0072",null,this.gj(lj));si.ti(ji);ls.insertCell(ji,"\u0077ai\u0074","\164ab\154\145","\u0063\u0065nt\u0065\u0072",null,(sj!='c\150a\164'?this.gj(pj):'\u002d'));si.ti(ji);ls.insertCell(ji,"etc","\u0074\141\142le","ce\u006eter",null,dj);if(sj=='w\141\u0069\164'||sj=='p\u0072i\157')return true;} else{this._i[id]=new Array(lj,pj,sj);hj(this.t,ji,"n\141\u006d\145",si.ei(jj,this.pq.agentservl,id,ai,bi,ci,ct,sj!='\143\u0068at'));hj(this.t,ji,"cont\u0069d",kj);hj(this.t,ji,"\u0073\164a\u0074\145",tj);hj(this.t,ji,"\157\u0070",oj);hj(this.t,ji,"\164\151m\u0065",this.gj(lj));hj(this.t,ji,"\u0077\u0061\151t",(sj!='c\150\u0061t'?this.gj(pj):'\055'));hj(this.t,ji,"\u0065\164c",dj);} return false;} ,aj:function(){function bj(t,id,cj){var ej=t.rows[id];var fj=t.rows[id+"end"];if(ej==null||fj==null)return;var vj=fj.cells["\163ta\u0074u\163"];if(vj==null)return;vj.innerHTML=(ej.rowIndex+1==fj.rowIndex)?cj:"";vj.height=(ej.rowIndex+1==fj.rowIndex)?(27+3):012;} bj(this.t,"\167\141it",this.pq.noclients);bj(this.t,"p\162io",this.pq.noclients);bj(this.t,"\u0063\u0068\u0061t",this.pq.noclients);} ,gj:function(wj){var xj=Math.floor(((new Date()).getTime()-wj-this.mj)/01750);var yj=Math.floor(xj/(55+5));var zj="";xj=xj%074;if(xj<(8+2))xj="\u0030"+xj;if(yj>=0x3c){var $j=Math.floor(yj/(41+19));yj=yj%074;if(yj<012)yj="0"+yj;zj=$j+"\u003a";} return zj+yj+"\u003a"+xj;} ,_j:function(){for(var i in this._i){if(this._i[i]!=null){var value=this._i[i];var ji=ls.os("\164\150\162"+i,this.t);if(ji!=null){function hj(ds,ji,id,ij){var ws=ls.fs(id,ji,ds);if(ws)ws.innerHTML=ij;} hj(this.t,ji,"\164i\155\u0065",this.gj(value[0]));hj(this.t,ji,"\167\u0061it",(value[2]!='cha\u0074'?this.gj(value[1]):'-'));} } } } ,hu:function(mk){var nk=false;if(mk.tagName=='\164\150r\145ads'){var qk=qs.ks(mk,"t\u0069\155\145");var rk=qs.ks(mk,"\u0072e\166\151si\u006f\u006e");if(qk)this.mj=(new Date()).getTime()-qk;if(rk)this.pq.$i=rk;for(var i=0;i unix_timestamp(CURRENT_TIMESTAMP) AND address = '".quote_smart($addr,$link)."'", $link );
+}
+
function thread_by_id($id) {
$link = connect();
$thread = thread_by_id_($id,$link);
diff --git a/src/messenger/webim/libs/common.php b/src/messenger/webim/libs/common.php
index ac750407..8a86c873 100644
--- a/src/messenger/webim/libs/common.php
+++ b/src/messenger/webim/libs/common.php
@@ -425,7 +425,8 @@ $settings = array(
'email' => '', /* inbox for left messages */
'title' => 'Company',
'hosturl' => 'http://webim.sourceforge.net',
- 'logo' => ''
+ 'logo' => '',
+ 'enableban' => '0'
);
$settingsloaded = false;
$settings_in_db = array();
diff --git a/src/messenger/webim/locales/en/images/delete.gif b/src/messenger/webim/locales/en/images/delete.gif
new file mode 100644
index 00000000..46a4218e
Binary files /dev/null and b/src/messenger/webim/locales/en/images/delete.gif differ
diff --git a/src/messenger/webim/locales/en/properties b/src/messenger/webim/locales/en/properties
index 4513820f..6e0617bd 100644
--- a/src/messenger/webim/locales/en/properties
+++ b/src/messenger/webim/locales/en/properties
@@ -135,23 +135,42 @@ form.field.password_confirm=Confirmation
form.field.password_confirm.description=Confirm new password.
form.field.password=Password
form.field.password.description=Enter new password or leave the field empty to keep previous one.
+form.field.address=Visitor's Address
+form.field.address.description=Ex: 12.23.45.123 or todo.com
+form.field.ban_days=Days
+form.field.ban_days.description=How many days to ignore this address
+form.field.ban_comment=Comment
+form.field.ban_comment.description=Reason of block
button.enter=Enter
button.save=Save
button.search=Search
+button.delete=Delete
tag.pagination.info=Page {0} of {1}, {2}-{3} from {4}
tag.pagination.no_items=Found 0 elements
+tag.pagination.no_items.elements=No elements
image.chat.history=/locales/en/images/history.gif
image.chat.message=/locales/en/images/message.gif
image.button.login=/locales/en/images/login.gif
image.button.save=/locales/en/images/save.gif
image.button.search=/locales/en/images/search.gif
+image.button.delete=/locales/en/images/delete.gif
+page_bans.list=List of banned IPs:
+page_bans.title=Blocked
+page_bans.to=Till
+page_bans.add=Add address
+page_ban.title=Block address
+page_ban.intro=Here you can block malicious visitors that affect you work by spam messages.
+page_ban.sent=Address {0} is blocked for specified number of days.
+page_ban.thread=You opened this window for "{0}" thread, Address field is already filled. Select number of days and click Send.
admin.content.client_settings=Specify options affecting chat window and common system behavior
app.title=Web Instant Messenger
+ban.error.duplicate=Address {0} is already in the system, click here to edit it.
chat.came.from=Vistor came from page {0}
confirm.take.head=Change operator
confirm.take.message=Visitor {0} is already served by {1}. Are your really sure you wan't to start chatting the visitor?
confirm.take.no=No, close the window
confirm.take.yes=Yes, I'm sure
+content.blocked=Here you can defend from malicious visitors.
content.history=Search the dialogs history
content.logoff=Log out of the system.
errors.wrong_field=Please fill "{0}" correctly.
@@ -193,6 +212,7 @@ leavemessage.title=Leave your message
leftMenu.client_settings=Settings
localeid=English (en)
menu.agents=Agents list
+menu.blocked=Blocked visitors
menu.main=Main
menu.operator=You are {0}
no_such_operator=No such operator
@@ -209,8 +229,10 @@ settings.company.title=Company title
settings.company.title.description=Enter your company title
settings.email=Email
settings.email.description=Enter email to receive system messages
+settings.enableban=Enable feature "Malicious Visitors"
+settings.enableban.description=Using it you can block attacks from specific IPs
settings.host=URL of your website
-settings.host.description=Destination for you company name or logo link
+settings.host.description=Destination for you company name or logo link
settings.logo=Your company logo
settings.logo.description=Enter http address of your company logo
settings.no.title=Please enter your company title
diff --git a/src/messenger/webim/locales/ru/images/delete.gif b/src/messenger/webim/locales/ru/images/delete.gif
new file mode 100644
index 00000000..5b0f8f63
Binary files /dev/null and b/src/messenger/webim/locales/ru/images/delete.gif differ
diff --git a/src/messenger/webim/locales/ru/properties b/src/messenger/webim/locales/ru/properties
index 333c43c2..20db362f 100644
--- a/src/messenger/webim/locales/ru/properties
+++ b/src/messenger/webim/locales/ru/properties
@@ -135,23 +135,42 @@ form.field.password_confirm=
form.field.password_confirm.description=Подтвердите введенный пароль.
form.field.password=Пароль
form.field.password.description=Введите новый пароль или оставьте поле пустым, чтобы сохранить старый.
+form.field.address=Адрес посетителя
+form.field.address.description=Например: 12.23.45.123 или relay.info.ru
+form.field.ban_days=Дни
+form.field.ban_days.description=Количество дней, на которое будет запрещен адрес
+form.field.ban_comment=Комментарий
+form.field.ban_comment.description=Причина запрета
button.enter=Войти
button.save=Сохранить
button.search=Искать
+button.delete=Удалить
tag.pagination.info=Страница {0} из {1}, показаны {2}-{3} из {4}
tag.pagination.no_items=Ничего не найдено
+tag.pagination.no_items.elements=Нет элементов для отображения.
image.chat.history=/locales/ru/images/history.gif
image.chat.message=/locales/ru/images/message.gif
image.button.login=/locales/ru/images/login.gif
image.button.save=/locales/ru/images/save.gif
image.button.search=/locales/ru/images/search.gif
+image.button.delete=/locales/ru/images/delete.gif
+page_bans.list=Список запрещенных адресов:
+page_bans.title=Запреты
+page_bans.to=До
+page_bans.add=Добавить адрес
+page_ban.title=Запрет адреса
+page_ban.intro=С помощью механизма запрета Вы можете бороться с нежелательными посетителями, которые нарушают работу консультантов, открывая большое количество окон или присылая спам сообщения.
+page_ban.sent=Адрес {0} запрещен на указанное число дней.
+page_ban.thread=Вы открыли это окно для диалога с "{0}", поэтому поле Адрес уже заполнено. Выберите количество дней и нажмите Отправить.
admin.content.client_settings=Вы можете задать опции влияющие на отображение чат окна и общее поведение системы
app.title=Веб Мессенджер
+ban.error.duplicate=Адрес {0} уже зарегестрирован в системе, нажмите здесь чтобы отредактировать его.
chat.came.from=Посетитель пришел со страницы {0}
confirm.take.head=Сменить оператора
confirm.take.message=С посетителем {0} уже общается {1}. Вы уверены что хотите сменить его?
confirm.take.no=Нет, закрыть окно
confirm.take.yes=Да, я уверен
+content.blocked=Здесь можно защищаться от спама и вредных посетителей
content.history=Поиск по истории диалогов
content.logoff=Покинуть систему.
errors.wrong_field=Неправильно заполнено поле "{0}"
@@ -193,6 +212,7 @@ leavemessage.title=
leftMenu.client_settings=Настройки
localeid=Russian (ru)
menu.agents=Список агентов
+menu.blocked=Нежелательные посетители
menu.main=Главная
menu.operator=Вы {0}
no_such_operator=Запрашиваемая учетная запись не существует
@@ -209,6 +229,8 @@ settings.company.title=
settings.company.title.description=Введите название Вашей компании
settings.email=Адрес электронной почты
settings.email.description=Введите адрес электронной почты для получения сообщений от системы
+settings.enableban=Включить функцию "Нежелательные посетители"
+settings.enableban.description=С ее помощью можно блокировать атаки с определенных адресов
settings.host=Ссылка на ваш веб сайт
settings.host.description=Будет открываться по нажатию на логотип или название компании в чат окне
settings.logo=Лого компании
diff --git a/src/messenger/webim/operator/ban.php b/src/messenger/webim/operator/ban.php
new file mode 100644
index 00000000..47493a88
--- /dev/null
+++ b/src/messenger/webim/operator/ban.php
@@ -0,0 +1,119 @@
+ '', 'operator' => topage(get_operator_name($operator)) );
+$page['saved'] = false;
+$page['thread'] = '';
+$page['threadid'] = '';
+$errors = array();
+
+if( isset($_POST['address']) ) {
+ $banId = verifyparam( "banId", "/^(\d{1,9})?$/", "");
+ $address = getparam("address");
+ $days = getparam("days");
+ $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( !preg_match( "/^\d+$/", $days )) {
+ $errors[] = wrong_field("form.field.ban_days");
+ }
+
+ if( !$comment ) {
+ $errors[] = no_field("form.field.ban_comment");
+ }
+
+ $link = connect();
+ $existing_ban = ban_for_addr_($address,$link);
+ mysql_close($link);
+
+ if( (!$banId && $existing_ban) ||
+ ( $banId && $existing_ban && $banId != $existing_ban['banid']) ) {
+ $errors[] = getlocal2("ban.error.duplicate",array($address,$existing_ban['banid']));
+ }
+
+ if( count($errors) == 0 ) {
+ $link = connect();
+ $utime = time() + $days * 24*60*60;
+ if (!$banId) {
+ $query = sprintf(
+ "insert into chatban (dtmcreated,dtmtill,address,comment) values (CURRENT_TIMESTAMP,%s,'%s','%s')",
+ "FROM_UNIXTIME($utime)",
+ quote_smart($address,$link),
+ quote_smart($comment,$link));
+ perform_query($query,$link);
+ } else {
+ $query = sprintf(
+ "update chatban set dtmtill = %s,address = '%s',comment = '%s' where banid = $banId",
+ "FROM_UNIXTIME($utime)",
+ quote_smart($address,$link),
+ quote_smart($comment,$link));
+ perform_query($query,$link);
+ }
+ mysql_close($link);
+
+ if(!$threadid) {
+ header("Location: $webimroot/operator/blocked.php");
+ exit;
+ } else {
+ $page['saved'] = true;
+ $page['address'] = $address;
+ }
+ } else {
+ $page['banId'] = topage($banId);
+ $page['formaddress'] = topage($address);
+ $page['formdays'] = topage($days);
+ $page['formcomment'] = topage($comment);
+ $page['threadid'] = $threadid;
+ }
+} else if(isset($_GET['id'])) {
+ $banId = verifyparam( 'id', "/^\d{1,9}$/");
+ $link = connect();
+ $ban = select_one_row("select banid,(unix_timestamp(dtmtill)-unix_timestamp(CURRENT_TIMESTAMP)) as days,address,comment from chatban where banid = $banId", $link);
+ mysql_close($link);
+
+ if( $ban ) {
+ $page['banId'] = topage($ban['banid']);
+ $page['formaddress'] = topage($ban['address']);
+ $page['formdays'] = topage(round($ban['days']/86400));
+ $page['formcomment'] = topage($ban['comment']);
+ } else {
+ $errors[] = "Wrong id";
+ }
+} else if(isset($_GET['thread'])) {
+ $threadid = verifyparam( 'thread', "/^\d{1,9}$/");
+ $thread = thread_by_id($threadid);
+ if( $thread ) {
+ $page['thread'] = topage($thread['userName']);
+ $page['threadid'] = $threadid;
+ $page['formaddress'] = topage($thread['remote']);
+ $page['formdays'] = 15;
+ }
+}
+
+start_html_output();
+require('../view/ban.php');
+exit;
+?>
\ No newline at end of file
diff --git a/src/messenger/webim/operator/blocked.php b/src/messenger/webim/operator/blocked.php
new file mode 100644
index 00000000..00ddd334
--- /dev/null
+++ b/src/messenger/webim/operator/blocked.php
@@ -0,0 +1,57 @@
+
\ No newline at end of file
diff --git a/src/messenger/webim/operator/index.php b/src/messenger/webim/operator/index.php
index 0d970159..a98194c5 100644
--- a/src/messenger/webim/operator/index.php
+++ b/src/messenger/webim/operator/index.php
@@ -16,11 +16,13 @@ require_once('../libs/common.php');
require_once('../libs/operator.php');
$operator = check_login();
+loadsettings();
$page = array(
'operator' => topage(get_operator_name($operator)),
'version' => $version,
- 'localeLinks' => get_locale_links("$webimroot/operator/index.php")
+ 'localeLinks' => get_locale_links("$webimroot/operator/index.php"),
+ 'showban' => $settings['enableban'] == "1"
);
start_html_output();
diff --git a/src/messenger/webim/operator/settings.php b/src/messenger/webim/operator/settings.php
index 686bf4a0..fc7ac798 100644
--- a/src/messenger/webim/operator/settings.php
+++ b/src/messenger/webim/operator/settings.php
@@ -39,12 +39,14 @@ $email = $settings['email'];
$title = $settings['title'];
$logo = $settings['logo'];
$hosturl = $settings['hosturl'];
+$enableban = $settings['enableban'];
if (isset($_POST['email']) && isset($_POST['title']) && isset($_POST['logo'])) {
$email = getparam('email');
$title = getparam('title');
$logo = getparam('logo');
$hosturl = getparam('hosturl');
+ $enableban = verifyparam("enableban","/^on$/", "") == "on" ? "1" : "0";
if($email && !is_valid_email($email)) {
$errors[] = getlocal("settings.wrong.email");
@@ -55,6 +57,7 @@ if (isset($_POST['email']) && isset($_POST['title']) && isset($_POST['logo'])) {
$settings['title'] = $title;
$settings['logo'] = $logo;
$settings['hosturl'] = $hosturl;
+ $settings['enableban'] = $enableban;
update_settings();
header("Location: $webimroot/operator/index.php");
exit;
@@ -66,6 +69,7 @@ $page['formemail'] = topage($email);
$page['formtitle'] = topage($title);
$page['formlogo'] = topage($logo);
$page['formhosturl'] = topage($hosturl);
+$page['formenableban'] = $enableban == "1";
start_html_output();
require('../view/settings.php');
diff --git a/src/messenger/webim/operator/update.php b/src/messenger/webim/operator/update.php
index 5d444847..f0b22193 100644
--- a/src/messenger/webim/operator/update.php
+++ b/src/messenger/webim/operator/update.php
@@ -85,6 +85,11 @@ function thread_to_xml($thread,$link) {
$result .= " canview=\"true\"";
}
+ $banForThread = ban_for_addr_($thread['remote'],$link);
+ if($banForThread) {
+ $result .= " ban=\"blocked\"";
+ }
+
$result .= " state=\"$state\" typing=\"".$thread['userTyping']."\">";
$result .= "".htmlspecialchars(htmlspecialchars(get_user_name($thread['userName'],$thread['remote'], $thread['userid'])))."";
$result .= "".htmlspecialchars(htmlspecialchars($thread['remote']))."";
@@ -92,6 +97,10 @@ function thread_to_xml($thread,$link) {
$result .= "";
$result .= "".$thread['unix_timestamp(dtmmodified)']."000";
+ if($banForThread) {
+ $result .= "".$banForThread['comment']."";
+ }
+
$userAgent = get_useragent_version($thread['userAgent']);
$result .= "".$userAgent."";
if( $thread["shownmessageid"] != 0 ) {
diff --git a/src/messenger/webim/view/ban.php b/src/messenger/webim/view/ban.php
new file mode 100644
index 00000000..c0a6ac29
--- /dev/null
+++ b/src/messenger/webim/view/ban.php
@@ -0,0 +1,117 @@
+
+
+
+
+
+
+
+
+
+
+
+ -
+
+
+">
+">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 0 ) { ?>
+
+
+ |
+ |
+
+ 0 ) {
+ print getlocal("errors.header");
+ foreach( $errors as $e ) {
+ print getlocal("errors.prefix");
+ print $e;
+ print getlocal("errors.suffix");
+ }
+ print getlocal("errors.footer");
+ } ?>
+
+ |
+
+
+
+
+
+
+
+
+
+
+
+ |
+
+
+
+
+
+
diff --git a/src/messenger/webim/view/blocked_visitors.php b/src/messenger/webim/view/blocked_visitors.php
new file mode 100644
index 00000000..7c8fd817
--- /dev/null
+++ b/src/messenger/webim/view/blocked_visitors.php
@@ -0,0 +1,147 @@
+
+
+
+
+
+
+
+
+
+
+
+ -
+
+
+">
+">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 0 ) { ?>
+
+
+ |
+ |
+
+ 0 ) {
+ print getlocal("errors.header");
+ foreach( $errors as $e ) {
+ print getlocal("errors.prefix");
+ print $e;
+ print getlocal("errors.suffix");
+ }
+ print getlocal("errors.footer");
+ } ?>
+
+ |
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ |
+
+
+
+
+
+
diff --git a/src/messenger/webim/view/menu.php b/src/messenger/webim/view/menu.php
index 2c8a4d64..77021100 100644
--- a/src/messenger/webim/view/menu.php
+++ b/src/messenger/webim/view/menu.php
@@ -53,7 +53,9 @@
|
| |
|
| |
-
+
+ |
| |
+
|
| |
|
| |
diff --git a/src/messenger/webim/view/settings.php b/src/messenger/webim/view/settings.php
index b28a8b1a..6257d54b 100644
--- a/src/messenger/webim/view/settings.php
+++ b/src/messenger/webim/view/settings.php
@@ -82,6 +82,10 @@
| | — | |
+ | | | |
+ />
+ | | — | |
+
| | |
| |