performance fixes

This commit is contained in:
Roland Gruber 2013-04-20 15:14:03 +00:00
parent fb147e36a0
commit 8592d8da74
2 changed files with 6 additions and 3 deletions

View File

@ -962,7 +962,8 @@ class posixGroup extends baseModule implements passwordService {
}
$result = searchLDAPByAttribute('gidNumber', '*', 'posixAccount', array('uid', 'gidNumber', 'cn'), array('user'));
$this->cachedUserToGIDList = array();
for ($i = 0; $i < sizeof($result); $i++) {
$resultCount = sizeof($result);
for ($i = 0; $i < $resultCount; $i++) {
$this->cachedUserToGIDList[$result[$i]['uid'][0]] = array('gid' => $result[$i]['gidnumber'][0], 'cn' => $result[$i]['cn'][0]);
}
return $this->cachedUserToGIDList;

View File

@ -566,7 +566,8 @@ class lamUserList extends lamList {
$filter = "objectClass=posixGroup";
$attrs = array("cn", "gidNumber");
$entries = searchLDAPByAttribute(null, null, 'posixGroup', $attrs, array('group'));
for ($i = 0; $i < sizeof($entries); $i++) {
$entryCount = sizeof($entries);
for ($i = 0; $i < $entryCount; $i++) {
$this->trans_primary_hash[$entries[$i]['gidnumber'][0]] = $entries[$i]['cn'][0];
}
}
@ -758,7 +759,8 @@ class lamUserList extends lamList {
* Injects values for the virtual account status attribute to make it sortable.
*/
private function injectAccountStatusAttribute() {
for ($i = 0; $i < sizeof($this->entries); $i++) {
$entryCount = sizeof($this->entries);
for ($i = 0; $i < $entryCount; $i++) {
$status = 0;
if (!self::isUnixLocked($this->entries[$i])) {
$status++;