Changeset 4614 for branches


Ignore:
Timestamp:
06/15/11 16:48:00 (13 years ago)
Author:
alexandrecorreia
Message:

Ticket #1808 - Corrigido para que o tipo da busca seja configurada na administracao do expresso

Location:
branches/2.2
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/2.2/expressoMail1_2/inc/class.ldap_functions.inc.php

    r3909 r4614  
    676676        function get_available_users2($params) 
    677677        { 
    678                 $this->ldapRootConnect(); 
    679  
    680                 $context= $params['context']; 
    681                 $justthese = array("cn", "uid", "cn"); 
    682                 $filter = "(&(phpgwaccounttype=u)(!(phpgwaccountvisible=-1)))"; 
    683  
    684             if ($this->ds) 
     678            $this->ldapRootConnect(); 
     679            $context    = $params['context']; 
     680            $justthese  = array("cn", "uid", "cn"); 
     681            $filter     = ( isset($params['cn']) ) ? "(&(cn=*".$params['cn']."*)(phpgwaccounttype=u)(!(phpgwaccountvisible=-1)))" :  
     682                                "(&(phpgwaccounttype=u)(!(phpgwaccountvisible=-1)))";  
     683             
     684            if ($this->ds) 
    685685            { 
    686                         $sr=ldap_search($this->ds, $context, $filter, $justthese); 
    687                         $entries = ldap_get_entries($this->ds, $sr); 
    688  
    689                         for ($i=0; $i<$entries["count"]; $i++){ 
    690                                 if($_SESSION['phpgw_info']['expressomail']['user']['account_lid'] != $entries[$i]["uid"][0]){ 
    691                                         $u_tmp[$entries[$i]["uid"][0]] = $entries[$i]["cn"][0]; 
    692                                 } 
    693                         } 
    694  
    695                         natcasesort($u_tmp); 
    696  
    697                         $i = 0; 
    698                         $users = array(); 
    699  
    700                         if (count($u_tmp)) 
    701                         { 
    702                                 foreach ($u_tmp as $uidnumber => $cn) 
    703                                 { 
    704                                         $options .= "<option value=$uidnumber>$cn</option>"; 
    705                                 } 
    706                                 unset($u_tmp); 
    707                         } 
    708  
    709                         ldap_close($this->ds); 
    710                 return $options; 
    711                 } 
     686                $sr = ldap_search($this->ds, $context, $filter, $justthese); 
     687                 
     688                $entries = ldap_get_entries($this->ds, $sr); 
     689 
     690                for ($i=0; $i<$entries["count"]; $i++) 
     691                { 
     692                    if($_SESSION['phpgw_info']['expressomail']['user']['account_lid'] != $entries[$i]["uid"][0]) 
     693                    { 
     694                        $u_tmp[$entries[$i]["uid"][0]] = $entries[$i]["cn"][0]; 
     695                    } 
     696                } 
     697 
     698                natcasesort($u_tmp); 
     699 
     700                $i = 0; 
     701                $users = array(); 
     702 
     703                if (count($u_tmp)) 
     704                { 
     705                    foreach ($u_tmp as $uidnumber => $cn) 
     706                    { 
     707                        $options .= "<option value=$uidnumber>$cn</option>"; 
     708                    } 
     709                     
     710                    unset($u_tmp); 
     711                } 
     712 
     713                ldap_close($this->ds); 
     714                return $options; 
     715            } 
    712716        } 
    713717 
  • branches/2.2/expressoMail1_2/index.php

    r4449 r4614  
    2424        echo '<script type="text/javascript" src="../phpgwapi/js/wz_dragdrop/wz_dragdrop.js?'.$update_version.'"></script> 
    2525                <script type="text/javascript" src="../phpgwapi/js/dJSWin/dJSWin.js?'.$update_version.'"></script>'; 
    26  
    27  
    2826 
    2927         
     
    5755    $c->read_repository(); 
    5856    $current_config = $c->config_data;     
     57     
    5958 
    6059        $_SESSION['phpgw_info']['expressomail']['email_server'] = $boemailadmin->getProfile($emailadmin_profile[0]['profileID']); 
     
    138137    $_SESSION['phpgw_info']['server']['expressomail']['expressoMail_command_for_spam'] = $current_config['expressoMail_command_for_spam']; 
    139138    $_SESSION['phpgw_info']['server']['expressomail']['expressoMail_use_spam_filter'] = $current_config['expressoMail_use_spam_filter'];    
    140     echo '<script> var use_spam_filter = \''.$current_config['expressoMail_use_spam_filter'].'\' 
    141            var sieve_forward_domains = \''.$current_config['expressoMail_sieve_forward_domains'].'\' </script>'; 
    142         // End Set Anti-Spam options. 
     139     
     140    echo '<script> var use_spam_filter = "'.$current_config['expressoMail_use_spam_filter'].'"</script>';  
     141    echo '<script> var sieve_forward_domains = "'.$current_config['expressoMail_sieve_forward_domains'].'"</script>'; 
     142    // End Set Anti-Spam options. 
     143     
     144    // Begin Search Users characteres shared folders. 
     145    echo '<script> var sharedFolders_min_num_characters = "'.$current_config['expressoMail_min_num_characters'].'"</script>'; 
     146    echo '<script> var sharedFolders_users_auto_search  = "'.$current_config['expressoMail_users_auto_search'].'"</script>'; 
     147    // End Search Users characteres shared folders. 
     148     
    143149 
    144150    // Set Imap Folder names options 
  • branches/2.2/expressoMail1_2/js/sharemailbox.js

    r4610 r4614  
    44                this.el; 
    55                this.alert = false; 
    6         } 
    7  
    8         cShareMailbox.prototype.get_available_users = function(context) 
    9         { 
    10                 var handler_get_available_users = function(data) 
    11                 { 
    12                         select_available_users = document.getElementById('em_select_available_users'); 
    13                  
    14                         //Limpa o select 
    15                         for(var i=0; i<select_available_users.options.length; i++) 
    16                         { 
    17                                 select_available_users.options[i] = null; 
    18                                 i--; 
    19                         } 
    20  
    21                         if ((data) && (data.length > 0)) 
    22                         { 
    23                                 // Necessario, pois o IE6 tem um bug que retira o primeiro options se o innerHTML estiver vazio. 
    24                                 select_available_users.innerHTML = '#' + data; 
    25                                 select_available_users.outerHTML = select_available_users.outerHTML; 
    26                          
    27                                 select_available_users.disabled = false; 
    28                                 select_available_users_clone = document.getElementById('em_select_available_users').cloneNode(true); 
    29                                 document.getElementById('em_input_searchUser').value = ''; 
    30                         } 
    31                 } 
    32                 cExecute ("$this.ldap_functions.get_available_users2&context="+context, handler_get_available_users); 
     6                this.context = ""; 
     7        } 
     8         
     9        cShareMailbox.prototype.get_available_users = function(context) 
     10        { 
     11            if( sharedFolders_users_auto_search.toString() === "true" ) 
     12            {     
     13                this.get_available_users2(context); 
     14            } 
     15        } 
     16 
     17        cShareMailbox.prototype.get_available_users2 = function() 
     18        { 
     19            var context = ""; 
     20            var cn      = ""; 
     21             
     22            var handler_get_available_users = function(data) 
     23            { 
     24                    select_available_users = document.getElementById('em_select_available_users'); 
     25 
     26                    //Limpa o select 
     27                    for(var i=0; i<select_available_users.options.length; i++) 
     28                    { 
     29                            select_available_users.options[i] = null; 
     30                            i--; 
     31                    } 
     32 
     33                    if ((data) && (data.length > 0)) 
     34                    { 
     35                            // Necessario, pois o IE6 tem um bug que retira o primeiro options se o innerHTML estiver vazio. 
     36                            select_available_users.innerHTML = '#' + data; 
     37                            select_available_users.outerHTML = select_available_users.outerHTML; 
     38 
     39                            select_available_users.disabled = false; 
     40                            select_available_users_clone = document.getElementById('em_select_available_users').cloneNode(true); 
     41                            document.getElementById('em_input_searchUser').value = ''; 
     42                    } 
     43            } 
     44 
     45            if( arguments.length > 1 ) 
     46            { 
     47                context = arguments[0]; 
     48                cn      = arguments[1]; 
     49                cExecute ("$this.ldap_functions.get_available_users2&context="+context+"&cn="+cn, handler_get_available_users); 
     50            }    
     51            else 
     52            { 
     53                context = arguments[0]; 
     54                cExecute ("$this.ldap_functions.get_available_users2&context="+context, handler_get_available_users); 
     55            } 
     56             
    3357        } 
    3458 
     
    166190                                                '<br/><br/>'+ 
    167191                                                '<label>'+get_lang('Search user')+'<span style="margin-left:10px; color:red;" id="em_span_searching">&nbsp;</span><br></label>'+ 
    168                                                 '<input id="em_input_searchUser" size="30" autocomplete="off"  onkeyup="javascript:sharemailbox.optionFinderTimeout(this)">'+ 
     192                                                '<input id="em_input_searchUser" size="30" autocomplete="off"  onkeyup="javascript:sharemailbox.optionFinderTimeout(this, event)">'+ 
    169193                                                '<div style="margin-top:17px;"><label>'+get_lang('Users')+':</label></div>'+ 
    170194                                                '<select id="em_select_available_users" style="width:250px; height:150px" multiple></select></td>'+ 
     
    197221                } 
    198222 
    199                 var handler_organizations = function(data){ 
     223                var handler_organizations = function(data) 
     224                { 
    200225                        var user_organization = Element('user_organization').value; 
    201226                         
    202                         for(i = 0; i < data.length; i++) { 
     227                        for(i = 0; i < data.length; i++) 
     228                        { 
    203229                                Element('em_combo_org').options[i] = new Option(data[i].ou,data[i].dn); 
    204230                                if(data[i].ou.indexOf("dc=") != -1 || user_organization.toUpperCase() == data[i].ou.toUpperCase()) 
     
    299325         
    300326        var finderTimeout = ''; 
    301         cShareMailbox.prototype.optionFinderTimeout = function(obj) 
    302         { 
    303                 clearTimeout(finderTimeout);     
    304                 var oWait = document.getElementById("em_span_searching"); 
    305                 oWait.innerHTML = get_lang('Searching')+"..."; 
    306                 var finderTimeout = setTimeout("sharemailbox.optionFinder('"+obj.id+"')",500); 
     327 
     328        cShareMailbox.prototype.optionFinderTimeout = function(Obj, Event ) 
     329        { 
     330                var minNumChar  = sharedFolders_min_num_characters; 
     331                var oWait       = document.getElementById("em_span_searching"); 
     332                this.context    = document.getElementById('em_combo_org').value; 
     333                 
     334                if( ( parseInt(minNumChar) > 0 && minNumChar.toString() != "" ) && 
     335                        sharedFolders_users_auto_search.toString() === "false" ) 
     336                { 
     337                        var key             = [8,27,37,38,39,40]; 
     338                        var ev              = Event; 
     339                        var _inputSearch    = Obj; 
     340                         
     341                        var cleanLabel = function(obj) 
     342                        { 
     343                                obj.innerHTML = ""; 
     344                        } 
     345                         
     346                        var getUsers = function( _input, obj ) 
     347                        { 
     348                            var context = sharemailbox.context; 
     349                            var cn      = _input.value; 
     350                             
     351                            finderTimeout = setTimeout(function() 
     352                            { 
     353                                sharemailbox.get_available_users2( context, cn ); 
     354                            }, 500); 
     355                             
     356                            cleanLabel(obj); 
     357                        } 
     358 
     359                        for( var i in key ) 
     360                        { 
     361                            if( ev.keyCode == key[i]) 
     362                            {     
     363                                return false; 
     364                            } 
     365                        } 
     366 
     367                        if( _inputSearch.value.length < parseInt(minNumChar) ) 
     368                        { 
     369                                oWait.innerHTML = " ( Digite mais " + ( parseInt(minNumChar) - _inputSearch.value.length ) + " )"; 
     370                                setTimeout(function(){cleanLabel(oWait);}, 2000); 
     371                        } 
     372                        else 
     373                        { 
     374                                oWait.innerHTML = " ( Buscando aguarde .... )"; 
     375                                 
     376                                if( finderTimeout ) 
     377                                        clearTimeout(finderTimeout); 
     378 
     379                                finderTimeout = setTimeout(function(){ getUsers( _inputSearch, oWait); }, 1000); 
     380                        }        
     381                } 
     382                else 
     383                { 
     384                    clearTimeout(finderTimeout);         
     385                    oWait.innerHTML = get_lang('Searching')+"..."; 
     386                    var finderTimeout = setTimeout("sharemailbox.optionFinder('"+Obj.id+"')",500); 
     387                } 
    307388        } 
    308389         
     
    331412                        } 
    332413                } 
    333                 oWait.innerHTML = '&nbsp;'; 
     414                 
     415                oWait.innerHTML = ''; 
    334416        } 
    335417         
  • branches/2.2/jabberit_messenger/jmessenger/js/strophe.mini.js

    r4481 r4614  
    109109{var xhr=null;if(window.XMLHttpRequest){xhr=new XMLHttpRequest();if(xhr.overrideMimeType){xhr.overrideMimeType("text/xml");}}else if(window.ActiveXObject){xhr=new ActiveXObject("Microsoft.XMLHTTP");} 
    110110xhr.onreadystatechange=this.func.prependArg(this);return xhr;}};Strophe.Connection=function(service) 
    111 {this.service=service;this.jid="";this.rid=Math.floor(Math.random()*4294967295);this.sid=null;this.streamId=null;this.do_session=false;this.do_bind=false;this.timedHandlers=[];this.handlers=[];this.removeTimeds=[];this.removeHandlers=[];this.addTimeds=[];this.addHandlers=[];this._idleTimeout=null;this._disconnectTimeout=null;this.authenticated=false;this.disconnecting=false;this.connected=false;this.errors=0;this.paused=false;this.hold=1;this.wait=60;this.window=5;this._data=[];this._requests=[];this._uniqueId=Math.round(Math.random()*10000);this._sasl_success_handler=null;this._sasl_failure_handler=null;this._sasl_challenge_handler=null;this._idleTimeout=setTimeout(this._onIdle.bind(this),100);for(var k in Strophe._connectionPlugins){if(Strophe._connectionPlugins.hasOwnProperty(k)){var ptype=Strophe._connectionPlugins[k];var F=function(){};F.prototype=ptype;this[k]=new F();this[k].init(this);}}};Strophe.Connection.prototype={reset:function() 
     111{this.service=service;this.jid="";this.rid=Math.floor(Math.random()*4294967295);this.sid=null;this.streamId=null;this.do_session=false;this.do_bind=false;this.timedHandlers=[];this.handlers=[];this.removeTimeds=[];this.removeHandlers=[];this.addTimeds=[];this.addHandlers=[];this._idleTimeout=null;this._disconnectTimeout=null;this.authenticated=false;this.disconnecting=false;this.connected=false;this.errors=0;this.paused=false;this.hold=2;this.wait=20;this.window=5;this._data=[];this._requests=[];this._uniqueId=Math.round(Math.random()*10000);this._sasl_success_handler=null;this._sasl_failure_handler=null;this._sasl_challenge_handler=null;this._idleTimeout=setTimeout(this._onIdle.bind(this),100);for(var k in Strophe._connectionPlugins){if(Strophe._connectionPlugins.hasOwnProperty(k)){var ptype=Strophe._connectionPlugins[k];var F=function(){};F.prototype=ptype;this[k]=new F();this[k].init(this);}}};Strophe.Connection.prototype={reset:function() 
    112112{this.rid=Math.floor(Math.random()*4294967295);this.sid=null;this.streamId=null;this.do_session=false;this.do_bind=false;this.timedHandlers=[];this.handlers=[];this.removeTimeds=[];this.removeHandlers=[];this.addTimeds=[];this.addHandlers=[];this.authenticated=false;this.disconnecting=false;this.connected=false;this.errors=0;this._requests=[];this._uniqueId=Math.round(Math.random()*10000);},pause:function() 
    113113{this.paused=true;},resume:function() 
Note: See TracChangeset for help on using the changeset viewer.