Ticket #1056: sieve_filters.diff
File sieve_filters.diff, 2.7 KB (added by amuller, 14 years ago) |
---|
-
inc/class.ScriptS.inc.php
60 60 61 61 $aux = $this->SieveS->putscript($this->scriptfile, $this->createScript()); 62 62 if(!$aux){ 63 // Caso de erro, grava dentro da variável errstr;64 $this->errstr = "O arquivo não foi criado";63 $this->errstr = "Error: file not created"; 64 return $this->errstr; 65 65 } 66 66 // Mata a variavel; 67 67 unset($aux); … … 69 69 $aux = $this->SieveS->activatescript($this->scriptfile); 70 70 71 71 if(!$aux){ 72 // Caso de erro, grava dentro da variavel errstr;73 $this->errstr = "O arquivo não foi ativado";72 $this->errstr = "Error: error to activate file"; 73 return $this->errstr; 74 74 } 75 75 else{ 76 76 $this->reply = $this->SieveS->getscript(); … … 83 83 //Fecha a conexao 84 84 $this->SieveS->close(); 85 85 86 if($this->rules) {86 if($this->rules) 87 87 return $this->rules; 88 }else{89 return $this->errstr;90 }91 88 92 89 } 93 90 … … 98 95 $newr3 = array(); 99 96 100 97 $var_decode = rawurldecode($params['arfilter']); 98 $var_decode = preg_replace('/\n\./', '.', $var_decode); 101 99 102 100 $narray = explode("_end_",$var_decode); 103 101 -
js/filter.js
10 10 11 11 function cfilter(){ 12 12 13 this.criticalError = false; 13 14 this.mode_in = ""; 14 15 this.rulest = new Array; 15 16 this.rulesVoip = new Array; … … 45 46 var _this = this; 46 47 var cont1 = parseInt(0); 47 48 var cont2 = parseInt(0); 48 49 49 50 if( _this.rulest.length == 0 ) 50 51 { 51 52 var handler_sieve = function(data) 52 53 { 54 if (data.indexOf('Error:') == 0) 55 { 56 _this.criticalError = true; 57 alert(data); 58 } 59 else 60 try{ 53 61 if(data.rule.length > 0){ 54 62 for(var i=0 ; i < data.rule.length; i++) 55 63 { … … 63 71 _this.out_officeR = data.vacation[0]; 64 72 _this.out_officeR = _this.out_officeR ? trim(_this.out_officeR.toString().replace("\n","")) : ""; 65 73 if(data.mode.length > 0){_this.mode_in = data.mode[0];} 74 } 75 catch(e){ 76 _this.criticalError = true; 77 alert("Expresso:"+e.description); 78 } 66 79 } 67 80 if(Element('form_status') != null) 68 81 Element('form_status').innerHTML = "<span style='background:#cc4444;'> <font color='WHITE'>Aguarde...</font> </span>"; … … 746 759 } 747 760 var args = "$this.ScriptS.rec_rules"; 748 761 var params = "arfilter="+aux_rul; 749 cExecute(args,h_filter,params); 762 if(!_this.criticalError) 763 cExecute(args,h_filter,params); 750 764 } 751 765 752 766 // build object