Changeset 7655 for trunk/expressoAdmin1_2/inc/class.ldap_functions.inc.php
- Timestamp:
- 12/14/12 14:30:35 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/expressoAdmin1_2/inc/class.ldap_functions.inc.php
r6917 r7655 690 690 $entries = ldap_get_entries($ldap_connection, $search); 691 691 692 for ($i=0; $i<$entries['count']; $i++)692 for ($i=0; $i<$entries['count']; ++$i) 693 693 { 694 694 $users .= $entries[$i]['cn'][0] . ' - ' . $entries[$i]['mail'][0] . "\n"; … … 844 844 { 845 845 $result['question'] = $this->functions->lang('Field CPF used by') . ":\n"; 846 for ($i=0; $i<$entries['count']; $i++)846 for ($i=0; $i<$entries['count']; ++$i) 847 847 { 848 848 if (strcasecmp($uid, $entries[$i]['uid'][0]) != 0) … … 910 910 else 911 911 $login.=$i; 912 $i++;912 ++$i; 913 913 } 914 914 } … … 1260 1260 1261 1261 $options = ''; 1262 for ($i=0; $i<$entries['count']; $i++)1262 for ($i=0; $i<$entries['count']; ++$i) 1263 1263 { 1264 1264 $options .= "<option value=" . $entries[$i]['uid'][0] . ">" . $entries[$i]['uid'][0] . " (" . $entries[$i]['mail'][0] . ")" . "</option>"; … … 1283 1283 1284 1284 $options = ''; 1285 for ($i=0; $i<$entries['count']; $i++)1285 for ($i=0; $i<$entries['count']; ++$i) 1286 1286 { 1287 1287 $options .= "<option value=" . $entries[$i]['mail'][0] . ">" . $entries[$i]['mail'][0] . "</option>"; … … 1308 1308 1309 1309 $options = ''; 1310 for ($i=0; $i<$entries['count']; $i++)1310 for ($i=0; $i<$entries['count']; ++$i) 1311 1311 { 1312 1312 $options .= "<option value=" . $entries[$i]['mail'][0] . ">" . $entries[$i]['mail'][0] . "</option>"; … … 1541 1541 $entries = ldap_get_entries($this->ldap, $search); 1542 1542 $result['status'] = true; 1543 for ($i=0; $i<$entries['count']; $i++)1543 for ($i=0; $i<$entries['count']; ++$i) 1544 1544 { 1545 1545 $attrs['mailforwardingaddress'] = $old_mail; … … 1571 1571 $entry[0]['dn'] = strtolower($entry[0]['dn']); 1572 1572 $sector_dn_array = explode(",", $entry[0]['dn']); 1573 for($i=1; $i<count($sector_dn_array); $i++)1573 for($i=1; $i<count($sector_dn_array); ++$i) 1574 1574 $sector_dn .= $sector_dn_array[$i] . ','; 1575 1575 //Retira ultimo pipe. … … 1599 1599 1600 1600 // Samba 1601 for ($i=0; $i<$entry[0]['objectclass']['count']; $i++)1601 for ($i=0; $i<$entry[0]['objectclass']['count']; ++$i) 1602 1602 { 1603 1603 if ($entry[0]['objectclass'][$i] == 'sambaSamAccount') … … 1640 1640 ldap_sort($this->ldap, $search, "cn"); 1641 1641 $entries = ldap_get_entries($this->ldap, $search); 1642 for ($i=0; $i<$entries['count']; $i++)1642 for ($i=0; $i<$entries['count']; ++$i) 1643 1643 { 1644 1644 $result['groups_ldap'][ $entries[$i]['gidnumber'][0] ] = utf8_decode($entries[$i]['cn'][0]); … … 1698 1698 $entry[0]['dn'] = strtolower($entry[0]['dn']); 1699 1699 $sector_dn_array = explode(",", $entry[0]['dn']); 1700 for($i=1; $i<count($sector_dn_array); $i++)1700 for($i=1; $i<count($sector_dn_array); ++$i) 1701 1701 $sector_dn .= $sector_dn_array[$i] . ','; 1702 1702 //Retira ultimo pipe. … … 1727 1727 1728 1728 // Samba 1729 for ($i=0; $i<$entry[0]['objectclass']['count']; $i++)1729 for ($i=0; $i<$entry[0]['objectclass']['count']; ++$i) 1730 1730 { 1731 1731 if ($entry[0]['objectclass'][$i] == 'sambaSamAccount') … … 1768 1768 ldap_sort($this->ldap, $search, "cn"); 1769 1769 $entries = ldap_get_entries($this->ldap, $search); 1770 for ($i=0; $i<$entries['count']; $i++)1770 for ($i=0; $i<$entries['count']; ++$i) 1771 1771 { 1772 1772 $result['groups_ldap'][ $entries[$i]['gidnumber'][0] ] = utf8_decode($entries[$i]['cn'][0]); … … 1796 1796 $entries = ldap_get_entries($ldapMasterConnect, $search); 1797 1797 1798 for ($i=0; $i<$entries['count']; $i++)1798 for ($i=0; $i<$entries['count']; ++$i) 1799 1799 { 1800 1800 $result[ $entries[$i]['uid'][0] ]['uid'] = $entries[$i]['uid'][0]; … … 1831 1831 $entry[0]['dn'] = strtolower($entry[0]['dn']); 1832 1832 $sector_dn_array = explode(",", $entry[0]['dn']); 1833 for($i=1; $i<count($sector_dn_array); $i++)1833 for($i=1; $i<count($sector_dn_array); ++$i) 1834 1834 $sector_dn .= $sector_dn_array[$i] . ','; 1835 1835 //Retira ultimo pipe. … … 1844 1844 1845 1845 //MemberUid 1846 for ($i=0; $i<$entry[0]['memberuid']['count']; $i++)1846 for ($i=0; $i<$entry[0]['memberuid']['count']; ++$i) 1847 1847 { 1848 1848 $justthese = array("cn","uid","uidnumber"); … … 1850 1850 // Montagem dinamica do filtro 1851 1851 $filter="(&(|(phpgwAccountType=u)(phpgwAccountType=s))(|"; 1852 for ($k=0; (($k<10) && ($i<$entry[0]['memberuid']['count'])); $k++)1852 for ($k=0; (($k<10) && ($i<$entry[0]['memberuid']['count'])); ++$k) 1853 1853 { 1854 1854 $filter .= "(uid=".$entry[0]['memberuid'][$i].")"; 1855 $i++;1855 ++$i; 1856 1856 } 1857 1857 $i--; … … 1861 1861 $user_entry = ldap_get_entries($this->ldap, $search); 1862 1862 1863 for ($j=0; $j<$user_entry['count']; $j++)1863 for ($j=0; $j<$user_entry['count']; ++$j) 1864 1864 { 1865 1865 $result['memberuid_info'][$user_entry[$j]['uid'][0]]['cn'] = $user_entry[$j]['cn'][0]; … … 1891 1891 1892 1892 // Samba 1893 for ($i=0; $i<$entry[0]['objectclass']['count']; $i++)1893 for ($i=0; $i<$entry[0]['objectclass']['count']; ++$i) 1894 1894 { 1895 1895 if ($entry[0]['objectclass'][$i] == 'sambaGroupMapping') … … 1929 1929 $entry[0]['dn'] = strtolower($entry[0]['dn']); 1930 1930 $sector_dn_array = explode(",", $entry[0]['dn']); 1931 for($i=1; $i<count($sector_dn_array); $i++)1931 for($i=1; $i<count($sector_dn_array); ++$i) 1932 1932 $sector_dn .= $sector_dn_array[$i] . ','; 1933 1933 //Retira ultimo pipe. … … 1944 1944 1945 1945 //Members 1946 for ($i=0; $i<$entry[0]['mailforwardingaddress']['count']; $i++)1946 for ($i=0; $i<$entry[0]['mailforwardingaddress']['count']; ++$i) 1947 1947 { 1948 1948 $justthese = array("cn", "uidnumber", "uid", "phpgwaccounttype", "mail"); … … 1950 1950 // Montagem dinamica do filtro, para nao ter muitas conexoes com o ldap 1951 1951 $filter="(&(|(phpgwAccountType=u)(phpgwAccountType=l))(|"; 1952 for ($k=0; (($k<10) && ($i<$entry[0]['mailforwardingaddress']['count'])); $k++)1952 for ($k=0; (($k<10) && ($i<$entry[0]['mailforwardingaddress']['count'])); ++$k) 1953 1953 { 1954 1954 $filter .= "(mail=".$entry[0]['mailforwardingaddress'][$i].")"; 1955 $i++;1955 ++$i; 1956 1956 } 1957 1957 $i--; … … 1961 1961 $user_entry = ldap_get_entries($ldap_conn_following_ref, $search); 1962 1962 1963 for ($j=0; $j<$user_entry['count']; $j++)1963 for ($j=0; $j<$user_entry['count']; ++$j) 1964 1964 { 1965 1965 $result['mailForwardingAddress_info'][$user_entry[$j]['mail'][0]]['uid'] = $user_entry[$j]['uid'][0]; … … 2001 2001 $entry[0]['dn'] = strtolower($entry[0]['dn']); 2002 2002 $sector_dn_array = explode(",", $entry[0]['dn']); 2003 for($i=1; $i<count($sector_dn_array); $i++)2003 for($i=1; $i<count($sector_dn_array); ++$i) 2004 2004 $sector_dn .= $sector_dn_array[$i] . ','; 2005 2005 //Retira ultimo pipe. … … 2018 2018 2019 2019 //Senders 2020 for ($i=0; $i<$entry[0]['mailsenderaddress']['count']; $i++)2020 for ($i=0; $i<$entry[0]['mailsenderaddress']['count']; ++$i) 2021 2021 { 2022 2022 $justthese = array("cn", "uidnumber", "uid", "mail"); … … 2081 2081 } 2082 2082 2083 $i++;2083 ++$i; 2084 2084 } 2085 2085 } … … 2254 2254 $entries = ldap_get_entries($this->ldap, $search); 2255 2255 2256 for ($i=0; $i<$entries['count']; $i++)2256 for ($i=0; $i<$entries['count']; ++$i) 2257 2257 { 2258 2258 if ( !@ldap_mod_del($this->ldap, $entries[$i]['dn'], $attrs) ) … … 2325 2325 $entry = ldap_get_entries($this->ldap, $search); 2326 2326 $attrs['mailForwardingAddress'] = $mail; 2327 for ($i=0; $i<=$entry['count']; $i++)2327 for ($i=0; $i<=$entry['count']; ++$i) 2328 2328 { 2329 2329 $dn = $entry[$i]['dn']; … … 2410 2410 2411 2411 $parent = array(); 2412 for ($j=1; $j<(count($explode_dn)-1); $j++)2412 for ($j=1; $j<(count($explode_dn)-1); ++$j) 2413 2413 $parent[] = $explode_dn[$j]; 2414 2414 $parent = implode(",", $parent); … … 2430 2430 $array_mod_del['memberUid'] = $uid; 2431 2431 2432 for ($i=0; $i<=$entry['count']; $i++)2432 for ($i=0; $i<=$entry['count']; ++$i) 2433 2433 { 2434 2434 $dn = $entry[$i]['dn']; … … 2453 2453 2454 2454 $parent = array(); 2455 for ($j=1; $j<(count($explode_dn)-1); $j++)2455 for ($j=1; $j<(count($explode_dn)-1); ++$j) 2456 2456 $parent[] = $explode_dn[$j]; 2457 2457 $parent = implode(",", $parent); … … 2516 2516 $entry = ldap_get_entries($this->ldap, $search); 2517 2517 2518 for ($i=0; $i<$entry['count']; $i++)2518 for ($i=0; $i<$entry['count']; ++$i) 2519 2519 { 2520 2520 $return['sambaDomains'][$i] = $entry[$i]['sambadomainname'][0]; … … 2622 2622 $entries = ldap_get_entries($this->ldap, $institutional_accounts); 2623 2623 2624 for ($i=0; $i<$entries['count']; $i++)2624 for ($i=0; $i<$entries['count']; ++$i) 2625 2625 { 2626 2626 $tr = "<tr class='normal' onMouseOver=this.className='selected' onMouseOut=this.className='normal'><td onClick=edit_institutional_account('".$entries[$i]['uid'][0]."')>" . utf8_decode($entries[$i]['cn'][0]) . "</td><td onClick=edit_institutional_account('".$entries[$i]['uid'][0]."')>" . $entries[$i]['mail'][0] . "</td><td align='center' onClick=delete_institutional_accounts('".$entries[$i]['uid'][0]."')><img HEIGHT='16' WIDTH='16' src=./expressoAdmin1_2/templates/default/images/delete.png></td></tr>"; … … 2681 2681 { 2682 2682 $a_cn = array(); 2683 for ($i=0; $i<$entrie[0]['mailforwardingaddress']['count']; $i++)2683 for ($i=0; $i<$entrie[0]['mailforwardingaddress']['count']; ++$i) 2684 2684 { 2685 2685 $tmp = $this->mailforwardingaddress2uidnumber($entrie[0]['mailforwardingaddress'][$i]); … … 2716 2716 $entries = ldap_get_entries($this->ldap, $institutional_accounts); 2717 2717 2718 for ($i=0; $i<$entries['count']; $i++)2718 for ($i=0; $i<$entries['count']; ++$i) 2719 2719 { 2720 2720 $tr = "<tr class='normal' onMouseOver=this.className='selected' onMouseOut=this.className='normal'><td onClick=edit_shared_account('".$entries[$i]['uid'][0]."')>" . utf8_decode($entries[$i]['cn'][0]) . "</td><td onClick=edit_shared_account('".$entries[$i]['uid'][0]."')>" . utf8_decode($entries[$i]['cn'][0]). " (" . $entries[$i]['uid'][0] . ")" . "</td><td onClick=edit_shared_account('".$entries[$i]['uid'][0]."')>" . $entries[$i]['mail'][0] . "<td align='center' onClick=delete_shared_accounts('".$entries[$i]['uid'][0]."','".$entries[$i]['mail'][0]."')><img HEIGHT='16' WIDTH='16' src=./expressoAdmin1_2/templates/default/images/delete.png></td></tr>"; … … 2858 2858 $entries = ldap_get_entries($this->ldap, $search); 2859 2859 $result['status'] = true; 2860 for ($i=0; $i<$entries['count']; $i++)2860 for ($i=0; $i<$entries['count']; ++$i) 2861 2861 { 2862 2862 $attrs['mailforwardingaddress'] = $oldMail;
Note: See TracChangeset
for help on using the changeset viewer.