From 2443b4e0a5cf5a1f4823b2168ee1da50f3c25ffe Mon Sep 17 00:00:00 2001 From: Evgeny Gryaznov Date: Mon, 8 Dec 2008 23:47:40 +0000 Subject: [PATCH] permissions git-svn-id: https://webim.svn.sourceforge.net/svnroot/webim/trunk@221 c66351dc-e62f-0410-b875-e3a5c0b9693f --- src/messenger/js/users.js | 6 ++- src/messenger/webim/images/ban.gif | Bin 185 -> 372 bytes src/messenger/webim/js/users.js | 2 +- src/messenger/webim/libs/expand.php | 4 +- src/messenger/webim/locales/en/properties | 3 +- src/messenger/webim/locales/ru/properties | 3 +- src/messenger/webim/operator/agent.php | 39 ++++++++++++++---- src/messenger/webim/operator/avatar.php | 1 + src/messenger/webim/operator/index.php | 3 +- src/messenger/webim/operator/operator.php | 8 ++-- src/messenger/webim/operator/permissions.php | 4 ++ src/messenger/webim/operator/update.php | 11 +++-- .../webim/styles/default/templates/error.tpl | 2 +- .../webim/styles/original/templates/error.tpl | 2 +- src/messenger/webim/view/avatar.php | 6 +++ src/messenger/webim/view/menu.php | 7 +++- src/messenger/webim/view/permissions.php | 6 +++ 17 files changed, 83 insertions(+), 24 deletions(-) diff --git a/src/messenger/js/users.js b/src/messenger/js/users.js index 0af5708b..5819aba9 100644 --- a/src/messenger/js/users.js +++ b/src/messenger/js/users.js @@ -99,7 +99,11 @@ var HtmlGenerationUtils = { var cellsCount = 2; var link = servlet+"?thread="+id; var gen = ''; - gen += HtmlGenerationUtils.popupLink( (cantakenow||!canview) ? link : link+"&viewonly=true", localized[canopen ? 0 : 1], "ImCenter"+id, username, 640, 480, ban); + if(canopen || canview ) { + gen += HtmlGenerationUtils.popupLink( (cantakenow||!canview) ? link : link+"&viewonly=true", localized[canopen ? 0 : 1], "ImCenter"+id, username, 640, 480, ban); + } else { + gen += '' + username + ''; + } gen += ''; if( canopen ) { gen += ''; diff --git a/src/messenger/webim/images/ban.gif b/src/messenger/webim/images/ban.gif index bcc793d041b124c0b04a7e5fa26f8f3ab29eca6a..d11165bf258a96f78338703095947bd750c78b4e 100644 GIT binary patch literal 372 zcmZ?wbhEHb9f_VAI_Y4*wl0@8{4^oI%#Yo(?8)zx zx^?GcV{f;&f4*^Jmzda#jT@h?Sg}i7{M*BaA1_?k!o+m9uWvI0!+$VfzyOLrSr{1@ zEE#k_G9W)OuuVKLCtyWFPRP22M(Rv==lP#VirmSXW5RfLn$?lER%xaN?Z+HjFE>s; zJ%uU7_}4chpQ7g3XM4J@<{25AnHwvbo21n>7+aW_v*?&JrFJ!@GMV%6wp%dQPfP7H z(5{--U1P?ntj5nazbB1>QNzj5TwZ)bDg%d{l(R0UN<@?yqb#2{mso(mh@iJKH>(h< JgtsGuH2~PJoU{M{ literal 185 zcmZ?wbhEHb';} ,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,01200,0740,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',01200,0740,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',0x280,0740,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,zi){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?'+(zi?'\u0069\144\u003d'+zi:'\u0074\150\162e\141d\075'+id),localized[2],"\142a\u006e"+id,'<\151m\u0067\040sr\u0063\u003d"'+st+'\u002f\151\u006d\u0061g\145\u0073\u002fban\056\147\u0069\u0066" w\u0069\144\u0074\u0068="\0615"\u0020hei\147\u0068\u0074="\u0031\065" \142\157\u0072d\u0065\u0072="\060" a\154\164\u003d"'+localized[2]+'"\076',01046,0x1b8,null)+'<\u002f\u0074\144\u003e';} ,$i:function(_i,mj){return si.ki('\u0068\u0074\u0074p\u003a\057'+'/a\160\u0069\u002eh\157\u0073t\u0069p\056\151\u006ef\u006f\u002fg\u0065t\137\u0068\u0074\u006dl\056p\u0068\u0070\077\u0069\160='+_i,"\107eo\u004coc\u0061\u0074\u0069\157n","\151p"+_i,mj,(387+13),(93+7),null);} } ;sq.nj=mn.nn();mn.sn(sq.nj,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.qj=0;this.rj=new Object();this.sj=0;this.t=this.pq.tj;this.uj=new sq.qi(this.pq);} ,ri:function(){return"c\157\u006d\160a\u006ey\075"+this.pq.company+"\u0026s\u0069n\143\145\u003d"+this.pq.qj;} ,$t:function(ku){this.pq.status.innerHTML=ku;} ,iu:function(s){this.$t(s);} ,hj:function(rh){var id,ij,jj,ai=false,bi=false,kj=false,ci=null,zi=null;for(var i=0;i';if(ci!=null){bj='\u003c\u0074\144 clas\u0073="\164\141\u0062\u006ce"\076'+qs.rs(rh,"\162\u0065\141\163\u006f\u006e")+'\074/\164d>';} var cj=new RegExp("\u0028\u005b\060-\071\u005d+\.\u005b\060\u002d9\135\053\.\u005b\060-9]\u002b\.\133\u0030\u002d\071\135\u002b)");if(cj.exec(ej)!=null){var vj=RegExp.$1;ej=si.$i(vj,ej);} if(kj){bj+=si.yi(id,zi);} bj=si.di(bj);var wj=ls.os(ij,this.t);var xj=ls.os(ij+"e\u006e\u0064",this.t);if(ji!=null&&(ji.rowIndex<=wj.rowIndex||ji.rowIndex>=xj.rowIndex)){si.ui(this.t,ji.rowIndex+1);this.t.deleteRow(ji.rowIndex);this.rj[id]=null;ji=null;} if(ji==null){ji=this.t.insertRow(wj.rowIndex+1);si.ii(this.t,wj.rowIndex+2);ji.id="t\150r"+id;this.rj[id]=new Array(fj,aj,ij);ls.insertCell(ji,"\156ame","\164\u0061\142\154\u0065",null,(23+7),si.ei(dj,this.pq.agentservl,id,ai,bi,ci,ct,ij!='c\150\141\u0074'));si.ti(ji);ls.insertCell(ji,"co\156\u0074id","tabl\u0065","\u0063\u0065nt\u0065\162",null,ej);si.ti(ji);ls.insertCell(ji,"\163\u0074a\164\145","\u0074\u0061\u0062\u006c\145","c\145\u006et\u0065r",null,jj);si.ti(ji);ls.insertCell(ji,"\u006f\160","table","cen\u0074e\162",null,gj);si.ti(ji);ls.insertCell(ji,"\164\151\155\145","t\141\142le","\u0063\u0065\u006et\145\162",null,this.yj(fj));si.ti(ji);ls.insertCell(ji,"\u0077\141\u0069t","\164\u0061\u0062\u006ce","c\145n\164e\162",null,(ij!='\143\u0068\u0061\164'?this.yj(aj):'\u002d'));si.ti(ji);ls.insertCell(ji,"et\u0063","\164a\142\154e","cent\145\u0072",null,bj);if(ij=='w\141\u0069\164'||ij=='\u0070\162i\u006f')return true;} else{this.rj[id]=new Array(fj,aj,ij);oj(this.t,ji,"\u006e\u0061\u006de",si.ei(dj,this.pq.agentservl,id,ai,bi,ci,ct,ij!='ch\141t'));oj(this.t,ji,"c\u006f\156\164\151d",ej);oj(this.t,ji,"s\164\u0061\164\u0065",jj);oj(this.t,ji,"\157\160",gj);oj(this.t,ji,"t\u0069m\145",this.yj(fj));oj(this.t,ji,"wai\164",(ij!='\143\150\u0061\164'?this.yj(aj):'\055'));oj(this.t,ji,"e\u0074\u0063",bj);} return false;} ,zj:function(){function $j(t,id,_j){var wj=t.rows[id];var xj=t.rows[id+"end"];if(wj==null||xj==null)return;var mk=xj.cells["\u0073\u0074atus"];if(mk==null)return;mk.innerHTML=(wj.rowIndex+1==xj.rowIndex)?_j:"";mk.height=(wj.rowIndex+1==xj.rowIndex)?(24+6):012;} $j(this.t,"\167ai\164",this.pq.noclients);$j(this.t,"\160ri\157",this.pq.noclients);$j(this.t,"\u0063\150\u0061\164",this.pq.noclients);} ,yj:function(nk){var qk=Math.floor(((new Date()).getTime()-nk-this.sj)/0x3e8);var rk=Math.floor(qk/074);var sk="";qk=qk%0x3c;if(qk<012)qk="\060"+qk;if(rk>=(48+12)){var tk=Math.floor(rk/074);rk=rk%074;if(rk<(9+1))rk="\060"+rk;sk=tk+":";} return sk+rk+"\072"+qk;} ,uk:function(){for(var i in this.rj){if(this.rj[i]!=null){var value=this.rj[i];var ji=ls.os("\164\150\162"+i,this.t);if(ji!=null){function oj(ds,ji,id,pj){var ws=ls.fs(id,ji,ds);if(ws)ws.innerHTML=pj;} oj(this.t,ji,"\u0074\151\155e",this.yj(value[0]));oj(this.t,ji,"wai\u0074",(value[2]!='\u0063\u0068\u0061\164'?this.yj(value[1]):'\u002d'));} } } } ,hu:function(hk){var ik=false;if(hk.tagName=='t\u0068\u0072\145\u0061ds'){var jk=qs.ks(hk,"\u0074i\u006d\145");var kk=qs.ks(hk,"revis\u0069\157\156");if(jk)this.sj=(new Date()).getTime()-jk;if(kk)this.pq.qj=kk;for(var i=0;i';} ,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';if(bi||ai){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,01200,0740,ci);} else{xi+='\074a\040h\162ef="#">'+fi+'\u003c/\141>';} xi+='<\057t\u0064\076\u003ct\144\076<\u0069\u006d\147 src="'+st+'\u002fi\155ag\145\u0073/\146\u0072\u0065e\u002eg\u0069f" \167i\144t\u0068\075"5" \150eig\u0068t\u003d"\061"\u0020bord\u0065\u0072="0"\u0020alt\075""\076\u003c\u002ftd\076';if(bi){xi+='<\164\u0064\u0020widt\u0068\075"30" a\154ign\075"\u0063en\u0074e\u0072">';xi+=si.ki(link,localized[0],"I\u006d\103e\156\u0074er"+id,'\u003c\u0069mg\u0020\u0073\u0072c="'+st+'/i\u006d\u0061\147\u0065s/\u0074\142l\151\u0063l\u0073\160\u0065a\u006b\u002e\147\151\u0066"\u0020\167\151\u0064\u0074\150\u003d"1\u0035" he\u0069gh\u0074="1\u0035" b\157\162\u0064\u0065\u0072\u003d"0"\040\u0061lt="'+localized[0]+'">',(563+77),(407+73),null);xi+='<\u002ftd\u003e';wi++;} if(ai){xi+='',01200,(351+129),null);xi+='\074/td>';wi++;} if(ct!=""){xi+='\074\057\u0074\u0072>\074t\u0072\u003e\074td\040c\154\141ss="\u0066\151\162s\164\u006d\u0065ss\141\147e"\u0020a\u006c\u0069g\156\075"\162igh\164"\u0020\u0063\157ls\160\u0061\u006e\075"'+wi+'"\u003e';xi+=ct.length>0x1e?ct.substring(0,(20+10))+'\056\056.':ct;xi+='\u003c/a>\074\u002ftd>';} return si.di(xi);} ,yi:function(id,zi){return'\u003ct\144\u0020\167\u0069\u0064th\u003d"30"\040a\u006c\u0069\u0067\156="\u0063e\156\u0074\145\162">'+si.ki(st+'\u002f\157\160\u0065\u0072\141t\157\162/\142a\156.\160\150p?'+(zi?'\u0069\144\u003d'+zi:'\u0074\150\162e\141d\075'+id),localized[2],"\142a\u006e"+id,'<\151m\u0067\040sr\u0063\u003d"'+st+'\u002f\151\u006d\u0061g\145\u0073\u002fban\056\147\u0069\u0066" w\u0069\144\u0074\u0068="\0615"\u0020hei\147\u0068\u0074="\u0031\065" \142\157\u0072d\u0065\u0072="\060" a\154\164\u003d"'+localized[2]+'"\076',01046,0x1b8,null)+'<\u002f\u0074\144\u003e';} ,$i:function(_i,mj){return si.ki('\u0068\u0074\u0074p\u003a\057'+'/a\160\u0069\u002eh\157\u0073t\u0069p\056\151\u006ef\u006f\u002fg\u0065t\137\u0068\u0074\u006dl\056p\u0068\u0070\077\u0069\160='+_i,"\107eo\u004coc\u0061\u0074\u0069\157n","\151p"+_i,mj,(387+13),(93+7),null);} } ;sq.nj=mn.nn();mn.sn(sq.nj,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.qj=0;this.rj=new Object();this.sj=0;this.t=this.pq.tj;this.uj=new sq.qi(this.pq);} ,ri:function(){return"c\157\u006d\160a\u006ey\075"+this.pq.company+"\u0026s\u0069n\143\145\u003d"+this.pq.qj;} ,$t:function(ku){this.pq.status.innerHTML=ku;} ,iu:function(s){this.$t(s);} ,hj:function(rh){var id,ij,jj,ai=false,bi=false,kj=false,ci=null,zi=null;for(var i=0;i';if(ci!=null){bj='\u003c\u0074\144 clas\u0073="\164\141\u0062\u006ce"\076'+qs.rs(rh,"\162\u0065\141\163\u006f\u006e")+'\074/\164d>';} var cj=new RegExp("\u0028\u005b\060-\071\u005d+\.\u005b\060\u002d9\135\053\.\u005b\060-9]\u002b\.\133\u0030\u002d\071\135\u002b)");if(cj.exec(ej)!=null){var vj=RegExp.$1;ej=si.$i(vj,ej);} if(kj){bj+=si.yi(id,zi);} bj=si.di(bj);var wj=ls.os(ij,this.t);var xj=ls.os(ij+"e\u006e\u0064",this.t);if(ji!=null&&(ji.rowIndex<=wj.rowIndex||ji.rowIndex>=xj.rowIndex)){si.ui(this.t,ji.rowIndex+1);this.t.deleteRow(ji.rowIndex);this.rj[id]=null;ji=null;} if(ji==null){ji=this.t.insertRow(wj.rowIndex+1);si.ii(this.t,wj.rowIndex+2);ji.id="t\150r"+id;this.rj[id]=new Array(fj,aj,ij);ls.insertCell(ji,"\156ame","\164\u0061\142\154\u0065",null,(23+7),si.ei(dj,this.pq.agentservl,id,ai,bi,ci,ct,ij!='c\150\141\u0074'));si.ti(ji);ls.insertCell(ji,"co\156\u0074id","tabl\u0065","\u0063\u0065nt\u0065\162",null,ej);si.ti(ji);ls.insertCell(ji,"\163\u0074a\164\145","\u0074\u0061\u0062\u006c\145","c\145\u006et\u0065r",null,jj);si.ti(ji);ls.insertCell(ji,"\u006f\160","table","cen\u0074e\162",null,gj);si.ti(ji);ls.insertCell(ji,"\164\151\155\145","t\141\142le","\u0063\u0065\u006et\145\162",null,this.yj(fj));si.ti(ji);ls.insertCell(ji,"\u0077\141\u0069t","\164\u0061\u0062\u006ce","c\145n\164e\162",null,(ij!='\143\u0068\u0061\164'?this.yj(aj):'\u002d'));si.ti(ji);ls.insertCell(ji,"et\u0063","\164a\142\154e","cent\145\u0072",null,bj);if(ij=='w\141\u0069\164'||ij=='\u0070\162i\u006f')return true;} else{this.rj[id]=new Array(fj,aj,ij);oj(this.t,ji,"\u006e\u0061\u006de",si.ei(dj,this.pq.agentservl,id,ai,bi,ci,ct,ij!='ch\141t'));oj(this.t,ji,"c\u006f\156\164\151d",ej);oj(this.t,ji,"s\164\u0061\164\u0065",jj);oj(this.t,ji,"\157\160",gj);oj(this.t,ji,"t\u0069m\145",this.yj(fj));oj(this.t,ji,"wai\164",(ij!='\143\150\u0061\164'?this.yj(aj):'\055'));oj(this.t,ji,"e\u0074\u0063",bj);} return false;} ,zj:function(){function $j(t,id,_j){var wj=t.rows[id];var xj=t.rows[id+"end"];if(wj==null||xj==null)return;var mk=xj.cells["\u0073\u0074atus"];if(mk==null)return;mk.innerHTML=(wj.rowIndex+1==xj.rowIndex)?_j:"";mk.height=(wj.rowIndex+1==xj.rowIndex)?(24+6):012;} $j(this.t,"\167ai\164",this.pq.noclients);$j(this.t,"\160ri\157",this.pq.noclients);$j(this.t,"\u0063\150\u0061\164",this.pq.noclients);} ,yj:function(nk){var qk=Math.floor(((new Date()).getTime()-nk-this.sj)/0x3e8);var rk=Math.floor(qk/074);var sk="";qk=qk%0x3c;if(qk<012)qk="\060"+qk;if(rk>=(48+12)){var tk=Math.floor(rk/074);rk=rk%074;if(rk<(9+1))rk="\060"+rk;sk=tk+":";} return sk+rk+"\072"+qk;} ,uk:function(){for(var i in this.rj){if(this.rj[i]!=null){var value=this.rj[i];var ji=ls.os("\164\150\162"+i,this.t);if(ji!=null){function oj(ds,ji,id,pj){var ws=ls.fs(id,ji,ds);if(ws)ws.innerHTML=pj;} oj(this.t,ji,"\u0074\151\155e",this.yj(value[0]));oj(this.t,ji,"wai\u0074",(value[2]!='\u0063\u0068\u0061\164'?this.yj(value[1]):'\u002d'));} } } } ,hu:function(hk){var ik=false;if(hk.tagName=='t\u0068\u0072\145\u0061ds'){var jk=qs.ks(hk,"\u0074i\u006d\145");var kk=qs.ks(hk,"revis\u0069\157\156");if(jk)this.sj=(new Date()).getTime()-jk;if(kk)this.pq.qj=kk;for(var i=0;i 0 ) { - $result = getlocal("errors.header"); + $result = getlocal("$var.header"); foreach( $errors as $e ) { $result .= getlocal("errors.prefix").$e.getlocal("errors.suffix"); } diff --git a/src/messenger/webim/locales/en/properties b/src/messenger/webim/locales/en/properties index 5f173082..8b986505 100644 --- a/src/messenger/webim/locales/en/properties +++ b/src/messenger/webim/locales/en/properties @@ -124,6 +124,7 @@ page.gen_button.sample=Example page.gen_button.code.description=Caution! Please don't change
the code manually because
we don't guarantee that
it will work! mail.user.history.subject=Web Messenger: dialog history mail.user.history.body=Hello, {0}!\n\nYour chat history: \n\n{1}\n--- \nKind Regards,\nWeb Messenger +harderrors.header=Cannot execute:
    errors.header=Correct the mistakes:
      errors.prefix=
    • errors.suffix=
    • @@ -265,7 +266,7 @@ page_avatar.intro=You can upload your photo only in JPG, GIF, PNG or TIF image f page_avatar.title=Upload photo page_search.intro=Search for chat history of a specified user or a specified phrase in a message. page_settings.intro=Specify options affecting chat window and common system behavior -permission.admin=System administration: settings, operators management +permission.admin=System administration: settings, operators management, button generation permission.takeover=Take over chat thread permission.viewthreads=View another operator's chat thread permissions.intro=Here you can control operator's permissions diff --git a/src/messenger/webim/locales/ru/properties b/src/messenger/webim/locales/ru/properties index 3867d66f..321d7b59 100644 --- a/src/messenger/webim/locales/ru/properties +++ b/src/messenger/webim/locales/ru/properties @@ -124,6 +124,7 @@ page.gen_button.sample= page.gen_button.code.description=Внимание! При внесении
      каких-либо изменений
      в этот код работоспособность
      кнопки не гарантируется! mail.user.history.subject=Веб Мессенджер: история диалога mail.user.history.body=Здраствуйте, {0}!\n\nПо Вашему запросу, высылаем историю: \n\n{1}\n--- \nС уважением,\nВеб Мессенджер +harderrors.header=Невозможно выполнить:
        errors.header=Исправьте ошибки:
          errors.prefix=
        • errors.suffix=
        • @@ -265,7 +266,7 @@ page_avatar.intro= page_avatar.title=Загрузка фотографии page_search.intro=На данной странице можно осуществить поиск диалогов по имени пользователя или фразе, встречающейся в сообщении. page_settings.intro=Здесь вы можете задать опции влияющие на отображение чат окна и общее поведение системы -permission.admin=Администрирование системы: настройка, управление операторами +permission.admin=Администрирование системы: настройка, управление операторами, генерация кнопки permission.takeover=Перехватывать диалоги у других операторов permission.viewthreads=Просматривать диалоги других операторов в режиме реального времени permissions.intro=Здесь вы можете ограничить возможности оператора diff --git a/src/messenger/webim/operator/agent.php b/src/messenger/webim/operator/agent.php index 4b97b104..13c244a1 100644 --- a/src/messenger/webim/operator/agent.php +++ b/src/messenger/webim/operator/agent.php @@ -37,17 +37,33 @@ if( !isset($_GET['token']) ) { $viewonly = verifyparam( "viewonly", "/^true$/", false); $forcetake = verifyparam("force", "/^true$/", false); - if( !$viewonly && $thread['istate'] == $state_chatting && $operator['operatorid'] != $thread['agentId'] && $forcetake == false ) { - $page = array( - 'user' => topage($thread['userName']), 'agent' => topage($thread['agentName']), 'link' => $_SERVER['PHP_SELF']."?thread=$threadid&force=true" - ); - start_html_output(); - require('../view/confirm.php'); - exit; + if( !$viewonly && $thread['istate'] == $state_chatting && $operator['operatorid'] != $thread['agentId'] ) { + + if(!is_capable($can_takeover, $operator)) { + $errors = array("Cannot take over"); + start_html_output(); + expand("../styles", getchatstyle(), "error.tpl"); + exit; + } + + if( $forcetake == false ) { + $page = array( + 'user' => topage($thread['userName']), 'agent' => topage($thread['agentName']), 'link' => $_SERVER['PHP_SELF']."?thread=$threadid&force=true" + ); + start_html_output(); + require('../view/confirm.php'); + exit; + } } - if (!$viewonly) + if (!$viewonly) { take_thread($thread,$operator); + } else if(!is_capable($can_viewthreads, $operator)) { + $errors = array("Cannot view threads"); + start_html_output(); + expand("../styles", getchatstyle(), "error.tpl"); + exit; + } $token = $thread['ltoken']; header("Location: $webimroot/operator/agent.php?thread=$threadid&token=$token&level=$remote_level"); @@ -61,6 +77,13 @@ if( !$thread || !isset($thread['ltoken']) || $token != $thread['ltoken'] ) { die("wrong thread"); } +if($thread['agentId'] != $operator['operatorid'] && !is_capable($can_viewthreads, $operator)) { + $errors = array("Cannot view threads"); + start_html_output(); + expand("../styles", getchatstyle(), "error.tpl"); + exit; +} + setup_chatview_for_operator($thread, $operator); start_html_output(); diff --git a/src/messenger/webim/operator/avatar.php b/src/messenger/webim/operator/avatar.php index dd8bb8ae..e70a74fa 100644 --- a/src/messenger/webim/operator/avatar.php +++ b/src/messenger/webim/operator/avatar.php @@ -85,6 +85,7 @@ $page['tabs'] = array( getlocal("page_agent.tab.avatar") => "", getlocal("page_agent.tab.permissions") => "$webimroot/operator/permissions.php?op=$opId" ); +$page['currentop'] = topage(get_operator_name($op))." (".$op['vclogin'].")"; start_html_output(); require('../view/avatar.php'); diff --git a/src/messenger/webim/operator/index.php b/src/messenger/webim/operator/index.php index a98194c5..29c01d7b 100644 --- a/src/messenger/webim/operator/index.php +++ b/src/messenger/webim/operator/index.php @@ -22,7 +22,8 @@ $page = array( 'operator' => topage(get_operator_name($operator)), 'version' => $version, 'localeLinks' => get_locale_links("$webimroot/operator/index.php"), - 'showban' => $settings['enableban'] == "1" + 'showban' => $settings['enableban'] == "1", + 'showadmin' => is_capable($can_administrate, $operator), ); start_html_output(); diff --git a/src/messenger/webim/operator/operator.php b/src/messenger/webim/operator/operator.php index 41ea9fd8..e5945a64 100644 --- a/src/messenger/webim/operator/operator.php +++ b/src/messenger/webim/operator/operator.php @@ -54,12 +54,14 @@ if( isset($_POST['login']) && isset($_POST['password']) ) { if( count($errors) == 0 ) { if (!$opId) { - create_operator($login,$password,$localname,$commonname,""); + $newop = create_operator($login,$password,$localname,$commonname,""); + header("Location: $webimroot/operator/avatar.php?op=".$newop['operatorid']); + exit; } else { update_operator($opId,$login,$password,$localname,$commonname); + header("Location: $webimroot/operator/operators.php"); + exit; } - header("Location: $webimroot/operator/operators.php"); - exit; } else { $page['formlogin'] = topage($login); $page['formname'] = topage($localname); diff --git a/src/messenger/webim/operator/permissions.php b/src/messenger/webim/operator/permissions.php index b9b6992f..923f8464 100644 --- a/src/messenger/webim/operator/permissions.php +++ b/src/messenger/webim/operator/permissions.php @@ -50,6 +50,9 @@ if( !$op ) { if(count($errors) == 0) { update_operator_permissions($op['operatorid'],$new_permissions); + if ($opId && $_SESSION['operator'] && $operator['operatorid'] == $opId) { + $_SESSION['operator']['iperm'] = $new_permissions; + } header("Location: $webimroot/operator/operator.php?op=$opId"); exit; } @@ -64,6 +67,7 @@ $page['tabs'] = array( $page['permissionsList'] = get_permission_list(); $page['formpermissions'] = array(""); +$page['currentop'] = topage(get_operator_name($op))." (".$op['vclogin'].")"; foreach($permission_ids as $perm => $id) { if(is_capable($perm,$op)) { diff --git a/src/messenger/webim/operator/update.php b/src/messenger/webim/operator/update.php index ba5e5d24..aec7b75a 100644 --- a/src/messenger/webim/operator/update.php +++ b/src/messenger/webim/operator/update.php @@ -69,7 +69,9 @@ function get_useragent_version($userAgent) { } function thread_to_xml($thread,$link) { - global $threadstate_to_string, $threadstate_key, $webim_encoding, $operator, $settings; + global $state_chatting, $threadstate_to_string, $threadstate_key, + $webim_encoding, $operator, $settings, + $can_viewthreads, $can_takeover; $state = $threadstate_to_string[$thread['istate']]; $result = "

          - ${errors} + ${harderrors}

          diff --git a/src/messenger/webim/styles/original/templates/error.tpl b/src/messenger/webim/styles/original/templates/error.tpl index b7b84ce2..cf4c7b7f 100644 --- a/src/messenger/webim/styles/original/templates/error.tpl +++ b/src/messenger/webim/styles/original/templates/error.tpl @@ -30,7 +30,7 @@ - ${errors} + ${harderrors} diff --git a/src/messenger/webim/view/avatar.php b/src/messenger/webim/view/avatar.php index d704370e..9899f39d 100644 --- a/src/messenger/webim/view/avatar.php +++ b/src/messenger/webim/view/avatar.php @@ -71,6 +71,12 @@ $v) { if($v) { ?>
          + + + +
          + +
          diff --git a/src/messenger/webim/view/menu.php b/src/messenger/webim/view/menu.php index b4e20325..6fdeb125 100644 --- a/src/messenger/webim/view/menu.php +++ b/src/messenger/webim/view/menu.php @@ -46,17 +46,22 @@ + - + + + + + diff --git a/src/messenger/webim/view/permissions.php b/src/messenger/webim/view/permissions.php index a59d09f7..45017a4d 100644 --- a/src/messenger/webim/view/permissions.php +++ b/src/messenger/webim/view/permissions.php @@ -71,6 +71,12 @@





















          $v) { if($v) { ?>
          + + + +
          + +