Changeset 7655 for trunk/listAdmin


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

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

Location:
trunk/listAdmin
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/listAdmin/controller.php

    r3514 r7655  
    1515                        $count_files = $_POST['countFiles']; 
    1616                        $array_files = array();                  
    17                         for($idx = 1; $idx <= $count_files; $idx++) {            
     17                        for($idx = 1; $idx <= $count_files; ++$idx) { 
    1818                                if($_FILES['file_'.$idx] && !$_FILES['file_'.$idx]['error']) 
    1919                                        $array_files[] = $_FILES['file_'.$idx];                                           
  • trunk/listAdmin/docs/manageheader.php

    r5912 r7655  
    504504                                ); 
    505505 
    506                                 for($i=0; $i<30; $i++) 
     506                                for($i=0; $i<30; ++$i) 
    507507                                { 
    508508                                        $GLOBALS['phpgw_info']['server']['mcrypt_iv'] .= $random_char[rand(1,count($random_char))]; 
  • trunk/listAdmin/inc/class.db_functions.inc.php

    r3514 r7655  
    283283                        $user_app[] = $this->db->row(); 
    284284                 
    285                 for ($i=0; $i<count($user_app); $i++) 
     285                for ($i=0; $i<count($user_app); ++$i) 
    286286                        $return['groups'][] = $user_app[$i]['acl_location']; 
    287287                 
     
    505505                        $serverList[$i]['imapsieveserver']      = $this->db->f(2); 
    506506                        $serverList[$i]['imapsieveport']        = $this->db->f(3); 
    507                         $i++; 
     507                        ++$i; 
    508508                } 
    509509                 
     
    587587                        $users_ldap[$i]['cn']                   = $this->db->f(3); 
    588588                        $users_ldap[$i]['mail']                 = $this->db->f(5); 
    589                         $i++; 
     589                        ++$i; 
    590590                        }             
    591591                return $users_ldap; 
  • trunk/listAdmin/inc/class.functions.inc.php

    r6057 r7655  
    242242                                $i = 0; 
    243243                                $tmp = array(); 
    244                                 for ($i=0; $i < $info['count']; $i++) 
     244                                for ($i=0; $i < $info['count']; ++$i) 
    245245                                { 
    246246                                        $tmp[$i]['uid']                 = $info[$i]['uid'][0]; 
     
    271271                                $tmp = array(); 
    272272                                $ldap_found=false; 
    273                                 for ($i=0; $i < $info['count']; $i++) 
     273                                for ($i=0; $i < $info['count']; ++$i) 
    274274                                        { 
    275275                                        $tmp[$i][account_id]                    = $info[$i]['uidnumber'][0];  
     
    338338                                $i = 0; 
    339339                                $tmp = array(); 
    340                                 for ($i=0; $i < $info['count']; $i++) 
     340                                for ($i=0; $i < $info['count']; ++$i) 
    341341                                { 
    342342                                        $tmp[$i][cn]                    = $info[$i][cn][0]; 
     
    363363                                $i = 0; 
    364364                                $tmp = array(); 
    365                                 for ($i=0; $i < $info['count']; $i++) 
     365                                for ($i=0; $i < $info['count']; ++$i) 
    366366                                { 
    367367                                        $tmp[$i]['uid']                 = $info[$i]['uid'][0]; 
     
    381381                                ldap_close($ldap_conn); 
    382382                                $tmp = array(); 
    383                                 for ($i=0; $i < $info['count']; $i++) 
     383                                for ($i=0; $i < $info['count']; ++$i) 
    384384                                { 
    385385                                        $tmp[$i]['cn']                  = $info[$i]['cn'][0]; 
     
    416416                                { 
    417417                                        $sector_space = ''; 
    418                                         for ($i=1; $i < $sector->sector_level; $i++) 
     418                                        for ($i=1; $i < $sector->sector_level; ++$i) 
    419419                                                $sector_space = '---'.$sector_space; 
    420420                                        $sector->sector_name = $sector_space.' '.$sector->sector_name; 
     
    452452 
    453453                        // Retiro o count do array info e inverto o array para ordenaᅵᅵo. 
    454                 for ($i=0; $i<$info["count"]; $i++) 
     454                for ($i=0; $i<$info["count"]; ++$i) 
    455455            { 
    456456                                $dn = $info[$i]["dn"]; 
     
    486486                        $display .= '+'; 
    487487                else { 
    488                         for ($i=0; $i<$level; $i++) 
     488                        for ($i=0; $i<$level; ++$i) 
    489489                                $display .= '---'; 
    490490                } 
     
    567567                                ldap_sort($connection, $search, "ou"); 
    568568                                $info = ldap_get_entries($connection, $search); 
    569                                 for ($i=0; $i<$info["count"]; $i++) 
     569                                for ($i=0; $i<$info["count"]; ++$i) 
    570570                                { 
    571571                                        $this->level++; 
     
    607607 
    608608                        // Retiro o count do array info e inverto o array para ordenaᅵᅵo. 
    609                 for ($i=0; $i<$info["count"]; $i++) 
     609                for ($i=0; $i<$info["count"]; ++$i) 
    610610            { 
    611611                                $dn = $info[$i]["dn"]; 
     
    644644                else  
    645645                { 
    646                                         for ($i=0; $i<$level; $i++) 
     646                                        for ($i=0; $i<$level; ++$i) 
    647647                                                $display .= '---'; 
    648648                } 
     
    793793                                        $applications_list .= sprintf('<tr bgcolor="%s">%s%s%s</tr>','#DDDDDD', $app_col1, $app_col2, $app_col3);                                        
    794794                                } 
    795                                 $i++; 
     795                                ++$i; 
    796796                        } 
    797797                        return $applications_list; 
  • trunk/listAdmin/inc/class.ldap_functions.inc.php

    r3514 r7655  
    215215        $entries = ldap_get_entries($this->ldap, $groups_list); 
    216216         
    217                 for ($i=0; $i<$entries["count"]; $i++){ 
     217                for ($i=0; $i<$entries["count"]; ++$i){ 
    218218                        $u_tmp[$entries[$i]["uidnumber"][0]] = $entries[$i]["cn"][0]; 
    219219                } 
     
    266266                 
    267267                $lists_entries = ldap_get_entries($this->ldap, $lists_search); 
    268                 for ($i=0; $i<$lists_entries["count"]; $i++) 
     268                for ($i=0; $i<$lists_entries["count"]; ++$i) 
    269269                { 
    270270                        $l_tmp[$lists_entries[$i]["uidnumber"][0]] = $lists_entries[$i]["cn"][0]; 
     
    288288                 
    289289                $users_entries = ldap_get_entries($this->ldap, $users_search); 
    290                 for ($i=0; $i<$users_entries["count"]; $i++) 
     290                for ($i=0; $i<$users_entries["count"]; ++$i) 
    291291                { 
    292292                        $u_tmp[$users_entries[$i]["uidnumber"][0]] = $users_entries[$i]["cn"][0]; 
     
    336336                 
    337337                $users_entries = ldap_get_entries($this->ldap, $users_search); 
    338                 for ($i=0; $i<$users_entries["count"]; $i++) 
     338                for ($i=0; $i<$users_entries["count"]; ++$i) 
    339339                { 
    340340                        $u_tmp[$users_entries[$i]["uidnumber"][0]] = $users_entries[$i]["cn"][0]; 
     
    371371                $entry = ldap_get_entries($this->ldap, $search); 
    372372                $i = 0; 
    373                 for($i = 0; $i <= $entry[0]['memberuid']['count']; $i++) 
     373                for($i = 0; $i <= $entry[0]['memberuid']['count']; ++$i) 
    374374                { 
    375375                        if($entry[0]['memberuid'][$i] == $uid) 
     
    416416 
    417417                $users_entries = ldap_get_entries($this->ldap, $users_search); 
    418                 for ($i=0; $i<$users_entries["count"]; $i++) 
     418                for ($i=0; $i<$users_entries["count"]; ++$i) 
    419419                { 
    420420                                $u_tmp[$users_entries[$i]["uidnumber"][0]] = $users_entries[$i]["cn"][0] . " [" .$users_entries[$i]["mail"][0] . "]"; 
     
    454454        $entries = ldap_get_entries($this->ldap, $groups_list); 
    455455        $options = ''; 
    456         for ($i=0; $i<$entries['count']; $i++) 
     456        for ($i=0; $i<$entries['count']; ++$i) 
    457457                { 
    458458                $options .= "<option value=" . $entries[$i]['gidnumber'][0] . ">" . $entries[$i]['cn'][0] . "</option>"; 
     
    471471         
    472472                $options = '';                   
    473                 for ($i=0; $i<$entries['count']; $i++) 
     473                for ($i=0; $i<$entries['count']; ++$i) 
    474474                { 
    475475                        $options .= "<option value=" . $entries[$i]['uidnumber'][0] . ">" . $entries[$i]['uid'][0] . " </option>"; 
     
    715715                $entries = ldap_get_entries($this->ldap_write, $search); 
    716716                $result['status'] = true; 
    717                 for ($i=0; $i<$entries['count']; $i++) 
     717                for ($i=0; $i<$entries['count']; ++$i) 
    718718                { 
    719719                        $attrs['mailforwardingaddress'] = $old_mail; 
     
    746746                $entry[0]['dn'] = strtolower($entry[0]['dn']); 
    747747                $sector_dn_array = explode(",", $entry[0]['dn']); 
    748                 for($i=1; $i<count($sector_dn_array); $i++) 
     748                for($i=1; $i<count($sector_dn_array); ++$i) 
    749749                        $sector_dn .= $sector_dn_array[$i] . ','; 
    750750                //Retira ultimo pipe. 
     
    790790                 
    791791                // Samba 
    792                 for ($i=0; $i<$entry[0]['objectclass']['count']; $i++) 
     792                for ($i=0; $i<$entry[0]['objectclass']['count']; ++$i) 
    793793                { 
    794794                        if ($entry[0]['objectclass'][$i] == 'sambaSamAccount') 
     
    812812        $entries = ldap_get_entries($this->ldap, $search); 
    813813 
    814         for ($i=0; $i<$entries['count']; $i++) 
     814        for ($i=0; $i<$entries['count']; ++$i) 
    815815        { 
    816816                $result['maillists_info'][$i]['uidnumber'] = $entries[$i]['uidnumber'][0]; 
     
    826826        ldap_sort($this->ldap, $search, "cn"); 
    827827        $entries = ldap_get_entries($this->ldap, $search); 
    828         for ($i=0; $i<$entries['count']; $i++) 
     828        for ($i=0; $i<$entries['count']; ++$i) 
    829829        { 
    830830                $result['groups_ldap'][ $entries[$i]['gidnumber'][0] ] = $entries[$i]['cn'][0]; 
     
    844844                $entry[0]['dn'] = strtolower($entry[0]['dn']); 
    845845                $sector_dn_array = explode(",", $entry[0]['dn']); 
    846                 for($i=1; $i<count($sector_dn_array); $i++) 
     846                for($i=1; $i<count($sector_dn_array); ++$i) 
    847847                        $sector_dn .= $sector_dn_array[$i] . ','; 
    848848                //Retira ultimo pipe. 
     
    857857                 
    858858                //MemberUid 
    859                 for ($i=0; $i<$entry[0]['memberuid']['count']; $i++) 
     859                for ($i=0; $i<$entry[0]['memberuid']['count']; ++$i) 
    860860                { 
    861861                        $justthese = array("cn","uid","uidnumber"); 
     
    863863                        // Montagem dinamica do filtro 
    864864                        $filter="(&(phpgwAccountType=u)(|"; 
    865                         for ($k=0; (($k<10) && ($i<$entry[0]['memberuid']['count'])); $k++) 
     865                        for ($k=0; (($k<10) && ($i<$entry[0]['memberuid']['count'])); ++$k) 
    866866                        { 
    867867                                $filter .= "(uid=".$entry[0]['memberuid'][$i].")"; 
    868                                 $i++; 
     868                                ++$i; 
    869869                        } 
    870870                        $i--; 
     
    874874                        $user_entry = ldap_get_entries($this->ldap, $search); 
    875875 
    876                         for ($j=0; $j<$user_entry['count']; $j++) 
     876                        for ($j=0; $j<$user_entry['count']; ++$j) 
    877877                        { 
    878878                                $result['memberuid_info'][$user_entry[$j]['uid'][0]]['cn'] = $user_entry[$j]['cn'][0]; 
     
    903903                 
    904904                // Samba 
    905                 for ($i=0; $i<$entry[0]['objectclass']['count']; $i++) 
     905                for ($i=0; $i<$entry[0]['objectclass']['count']; ++$i) 
    906906                { 
    907907                        if ($entry[0]['objectclass'][$i] == 'sambaGroupMapping') 
     
    925925                $entry[0]['dn'] = strtolower($entry[0]['dn']); 
    926926                $sector_dn_array = explode(",", $entry[0]['dn']); 
    927                 for($i=1; $i<count($sector_dn_array); $i++) 
     927                for($i=1; $i<count($sector_dn_array); ++$i) 
    928928                        $sector_dn .= $sector_dn_array[$i] . ','; 
    929929                //Retira ultimo pipe. 
     
    944944                         
    945945                //Members 
    946                 for ($i=0; $i<$entry[0]['mailforwardingaddress']['count']; $i++) 
     946                for ($i=0; $i<$entry[0]['mailforwardingaddress']['count']; ++$i) 
    947947                { 
    948948                        $justthese = array("cn", "uidnumber", "uid", "phpgwaccounttype", "mail"); 
     
    950950                        // Montagem dinamica do filtro 
    951951                        $filter="(&(|(phpgwAccountType=u)(phpgwAccountType=l))(|"; 
    952                         for ($k=0; (($k<10) && ($i<$entry[0]['mailforwardingaddress']['count'])); $k++) 
     952                        for ($k=0; (($k<10) && ($i<$entry[0]['mailforwardingaddress']['count'])); ++$k) 
    953953                        { 
    954954                                $filter .= "(mail=".$entry[0]['mailforwardingaddress'][$i].")"; 
    955                                 $i++; 
     955                                ++$i; 
    956956                        } 
    957957                        $i--; 
     
    961961                        $user_entry = ldap_get_entries($this->ldap, $search); 
    962962                                 
    963                         for ($j=0; $j<$user_entry['count']; $j++) 
     963                        for ($j=0; $j<$user_entry['count']; ++$j) 
    964964                        { 
    965965                                $result['members_info'][$user_entry[$j]['uidnumber'][0]]['uid'] = $user_entry[$j]['uid'][0]; 
     
    10061006                $entry[0]['dn'] = strtolower($entry[0]['dn']); 
    10071007                $sector_dn_array = explode(",", $entry[0]['dn']); 
    1008                 for($i=1; $i<count($sector_dn_array); $i++) 
     1008                for($i=1; $i<count($sector_dn_array); ++$i) 
    10091009                        $sector_dn .= $sector_dn_array[$i] . ','; 
    10101010                //Retira ultimo pipe. 
     
    10231023 
    10241024                //Members 
    1025                 for ($i=0; $i<$entry[0]['admlista']['count']; $i++) 
     1025                for ($i=0; $i<$entry[0]['admlista']['count']; ++$i) 
    10261026                { 
    10271027                        $justthese = array("cn", "uidnumber", "uid", "phpgwaccounttype", "mail", "admlista"); 
     
    10291029                        // Montagem dinamica do filtro 
    10301030                        $filter="(&(|(phpgwAccountType=u)(phpgwAccountType=l))(|"; 
    1031                         for ($k=0; (($k<10) && ($i<$entry[0]['admlista']['count'])); $k++) 
     1031                        for ($k=0; (($k<10) && ($i<$entry[0]['admlista']['count'])); ++$k) 
    10321032                        { 
    10331033                                $filter .= "(mail=".$entry[0]['admlista'][$i].")"; 
    1034                                 $i++; 
     1034                                ++$i; 
    10351035                        } 
    10361036                        $i--; 
     
    10401040                        $user_entry = ldap_get_entries($this->ldap, $search); 
    10411041                                 
    1042                         for ($j=0; $j<$user_entry['count']; $j++) 
     1042                        for ($j=0; $j<$user_entry['count']; ++$j) 
    10431043                        { 
    10441044                                $result['members_info'][$user_entry[$j]['uidnumber'][0]]['uid'] = $user_entry[$j]['uid'][0]; 
     
    10861086                $entry[0]['dn'] = strtolower($entry[0]['dn']); 
    10871087                $sector_dn_array = explode(",", $entry[0]['dn']); 
    1088                 for($i=1; $i<count($sector_dn_array); $i++) 
     1088                for($i=1; $i<count($sector_dn_array); ++$i) 
    10891089                        $sector_dn .= $sector_dn_array[$i] . ','; 
    10901090                //Retira ultimo pipe. 
     
    11051105                 
    11061106                //Senders 
    1107                 //for ($i=0; $i<$entry[0]['mailsenderaddress']['count']; $i++) 
     1107                //for ($i=0; $i<$entry[0]['mailsenderaddress']['count']; ++$i) 
    11081108                //Recupera a relacao de usuario nao moderados no Mailman (podem enviar e-mails para uma lista de e-mail sem precisar da 
    11091109                //autorizacao do moderador; 
    1110                 for ($i=0; $i<$entry[0]['naomoderado']['count']; $i++) 
     1110                for ($i=0; $i<$entry[0]['naomoderado']['count']; ++$i) 
    11111111                { 
    11121112                        $justthese = array("cn", "uidnumber", "uid", "mail"); 
     
    11611161                                        $result['groups_info'][$i]['group_disabled'] = 'false'; 
    11621162                                 
    1163                                 $i++; 
     1163                                ++$i; 
    11641164                        } 
    11651165                } 
     
    14211421 
    14221422                $parent = array(); 
    1423                 for ($j=1; $j<(count($explode_dn)-1); $j++) 
     1423                for ($j=1; $j<(count($explode_dn)-1); ++$j) 
    14241424                        $parent[] = $explode_dn[$j]; 
    14251425                $parent = implode(",", $parent); 
     
    14411441        $array_mod_del['memberUid'] = $uid; 
    14421442 
    1443             for ($i=0; $i<=$entry['count']; $i++) 
     1443            for ($i=0; $i<=$entry['count']; ++$i) 
    14441444            { 
    14451445                $dn = $entry[$i]['dn']; 
     
    14641464 
    14651465                $parent = array(); 
    1466                 for ($j=1; $j<(count($explode_dn)-1); $j++) 
     1466                for ($j=1; $j<(count($explode_dn)-1); ++$j) 
    14671467                        $parent[] = $explode_dn[$j]; 
    14681468                $parent = implode(",", $parent); 
     
    14871487            $entry = ldap_get_entries($this->ldap, $search); 
    14881488                 
    1489             for ($i=0; $i<=$entry['count']; $i++) 
     1489            for ($i=0; $i<=$entry['count']; ++$i) 
    14901490            { 
    14911491                $dn = strtolower($entry[$i]['dn']); 
     
    15131513            $entry = ldap_get_entries($this->ldap, $search); 
    15141514                 
    1515             for ($i=0; $i<$entry['count']; $i++) 
     1515            for ($i=0; $i<$entry['count']; ++$i) 
    15161516            { 
    15171517                        $return['sambaDomains'][$i]['samba_domain_sid'] = $entry[$i]['sambasid'][0]; 
     
    15691569            $entry = ldap_get_entries($this->ldap_write, $search); 
    15701570             
    1571             for ($i=0; $i<$entry['count']; $i++) 
     1571            for ($i=0; $i<$entry['count']; ++$i) 
    15721572            { 
    15731573                        $return['sambaDomains'][$i] = $entry[$i]['sambadomainname'][0]; 
     
    16301630                $key='expresso-livre'; 
    16311631                $result = ''; 
    1632                 for($i=1; $i<=strlen($string); $i++) 
     1632                for($i=1; $i<=strlen($string); ++$i) 
    16331633                { 
    16341634                        $char = substr($string, $i-1, 1); 
  • trunk/listAdmin/inc/sieve-php.lib.php

    r6057 r7655  
    285285      $index = 0; 
    286286 
    287       for($ptr = 0; $ptr < strlen($string); $ptr++){ 
     287      for($ptr = 0; $ptr < strlen($string); ++$ptr){ 
    288288          if($string[$ptr] == '"' and $string[$ptr] != '\\'){ 
    289289              if($start == -1){ 
Note: See TracChangeset for help on using the changeset viewer.