Ignore:
Timestamp:
12/14/12 14:30:35 (11 years ago)
Author:
douglasz
Message:

Ticket #3236 - Melhorias de performance no codigo do Expresso.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/reports/inc/class.ldap_functions.inc.php

    r5291 r7655  
    6161        $entries = ldap_get_entries($this->ldap, $groups_list); 
    6262         
    63                 for ($i=0; $i<$entries["count"]; $i++){ 
     63                for ($i=0; $i<$entries["count"]; ++$i){ 
    6464                        $u_tmp[$entries[$i]["uidnumber"][0]] = $entries[$i]["cn"][0]; 
    6565                } 
     
    9393                 
    9494                $options = ''; 
    95                 for ($i=0; $i<$entries['count']; $i++) 
     95                for ($i=0; $i<$entries['count']; ++$i) 
    9696                { 
    9797                        $options .= "<option value=" . $entries[$i]['gidnumber'][0] . ">" . $entries[$i]['cn'][0] . "</option>"; 
     
    114114         
    115115                $options = '';                   
    116                 for ($i=0; $i<$entries['count']; $i++) 
     116                for ($i=0; $i<$entries['count']; ++$i) 
    117117                { 
    118118                        $options .= "<option value=" . $entries[$i]['uid'][0] . ">" . $entries[$i]['uid'][0] . " (" . $entries[$i]['mail'][0] . ")" . "</option>"; 
     
    136136                                $entry[0]['dn'] = strtolower($entry[0]['dn']); 
    137137                                $sector_dn_array = explode(",", $entry[0]['dn']); 
    138                                 for($i=1; $i<count($sector_dn_array); $i++) 
     138                                for($i=1; $i<count($sector_dn_array); ++$i) 
    139139                                        $sector_dn .= $sector_dn_array[$i] . ','; 
    140140                                //Retira ultimo pipe. 
     
    164164                 
    165165                                // Samba 
    166                                 for ($i=0; $i<$entry[0]['objectclass']['count']; $i++) 
     166                                for ($i=0; $i<$entry[0]['objectclass']['count']; ++$i) 
    167167                                { 
    168168                                        if ($entry[0]['objectclass'][$i] == 'sambaSamAccount') 
     
    205205                        ldap_sort($this->ldap, $search, "cn"); 
    206206                        $entries = ldap_get_entries($this->ldap, $search); 
    207                         for ($i=0; $i<$entries['count']; $i++) 
     207                        for ($i=0; $i<$entries['count']; ++$i) 
    208208                        { 
    209209                                $result['groups_ldap'][ $entries[$i]['gidnumber'][0] ] = $entries[$i]['cn'][0]; 
     
    233233                $entries = ldap_get_entries($ldapMasterConnect, $search); 
    234234                 
    235                 for ($i=0; $i<$entries['count']; $i++) 
     235                for ($i=0; $i<$entries['count']; ++$i) 
    236236                { 
    237237                                $result[ $entries[$i]['uid'][0] ]['uid']                = $entries[$i]['uid'][0]; 
     
    268268                                $entry[0]['dn'] = strtolower($entry[0]['dn']); 
    269269                                $sector_dn_array = explode(",", $entry[0]['dn']); 
    270                                 for($i=1; $i<count($sector_dn_array); $i++) 
     270                                for($i=1; $i<count($sector_dn_array); ++$i) 
    271271                                        $sector_dn .= $sector_dn_array[$i] . ','; 
    272272                                //Retira ultimo pipe. 
     
    281281                 
    282282                                //MemberUid 
    283                                 for ($i=0; $i<$entry[0]['memberuid']['count']; $i++) 
     283                                for ($i=0; $i<$entry[0]['memberuid']['count']; ++$i) 
    284284                                { 
    285285                                        $justthese = array("cn","uid","uidnumber"); 
     
    287287                                        // Montagem dinamica do filtro 
    288288                                        $filter="(&(phpgwAccountType=u)(|"; 
    289                                         for ($k=0; (($k<10) && ($i<$entry[0]['memberuid']['count'])); $k++) 
     289                                        for ($k=0; (($k<10) && ($i<$entry[0]['memberuid']['count'])); ++$k) 
    290290                                        { 
    291291                                                $filter .= "(uid=".$entry[0]['memberuid'][$i].")"; 
    292                                                 $i++; 
     292                                                ++$i; 
    293293                                        } 
    294294                                        $i--; 
     
    298298                                        $user_entry = ldap_get_entries($this->ldap, $search); 
    299299 
    300                                         for ($j=0; $j<$user_entry['count']; $j++) 
     300                                        for ($j=0; $j<$user_entry['count']; ++$j) 
    301301                                        { 
    302302                                                $result['memberuid_info'][$user_entry[$j]['uid'][0]]['cn'] = $user_entry[$j]['cn'][0]; 
     
    328328                 
    329329                                // Samba 
    330                                 for ($i=0; $i<$entry[0]['objectclass']['count']; $i++) 
     330                                for ($i=0; $i<$entry[0]['objectclass']['count']; ++$i) 
    331331                                { 
    332332                                        if ($entry[0]['objectclass'][$i] == 'sambaGroupMapping') 
     
    366366                                $entry[0]['dn'] = strtolower($entry[0]['dn']); 
    367367                                $sector_dn_array = explode(",", $entry[0]['dn']); 
    368                                 for($i=1; $i<count($sector_dn_array); $i++) 
     368                                for($i=1; $i<count($sector_dn_array); ++$i) 
    369369                                        $sector_dn .= $sector_dn_array[$i] . ','; 
    370370                                //Retira ultimo pipe. 
     
    381381                         
    382382                                //Members 
    383                                 for ($i=0; $i<$entry[0]['mailforwardingaddress']['count']; $i++) 
     383                                for ($i=0; $i<$entry[0]['mailforwardingaddress']['count']; ++$i) 
    384384                                { 
    385385                                        $justthese = array("cn", "uidnumber", "uid", "phpgwaccounttype", "mail"); 
     
    387387                                        // Montagem dinamica do filtro, para nao ter muitas conexoes com o ldap 
    388388                                        $filter="(&(|(phpgwAccountType=u)(phpgwAccountType=l))(|"; 
    389                                         for ($k=0; (($k<10) && ($i<$entry[0]['mailforwardingaddress']['count'])); $k++) 
     389                                        for ($k=0; (($k<10) && ($i<$entry[0]['mailforwardingaddress']['count'])); ++$k) 
    390390                                        { 
    391391                                                $filter .= "(mail=".$entry[0]['mailforwardingaddress'][$i].")"; 
    392                                                 $i++; 
     392                                                ++$i; 
    393393                                        } 
    394394                                        $i--; 
     
    398398                                        $user_entry = ldap_get_entries($ldap_conn_following_ref, $search); 
    399399                                                                         
    400                                         for ($j=0; $j<$user_entry['count']; $j++) 
     400                                        for ($j=0; $j<$user_entry['count']; ++$j) 
    401401                                        { 
    402402                                                $result['mailForwardingAddress_info'][$user_entry[$j]['mail'][0]]['uid'] = $user_entry[$j]['uid'][0]; 
     
    471471                                } 
    472472 
    473                                 $i++; 
     473                                ++$i; 
    474474                        } 
    475475                } 
     
    513513                 
    514514                $options = ''; 
    515                 for ($i=0; $i<$entries['count']; $i++) 
     515                for ($i=0; $i<$entries['count']; ++$i) 
    516516                { 
    517517                        $options .= "<option value=" . $entries[$i]['uid'][0] . ">" . $entries[$i]['cn'][0] . " (".$entries[$i]['mail'][0].")" . "</option>"; 
Note: See TracChangeset for help on using the changeset viewer.