From 68a6a9445460eca585b6f8595e4c01ae13e140af Mon Sep 17 00:00:00 2001 From: Roland Gruber Date: Thu, 5 May 2005 13:53:27 +0000 Subject: [PATCH] use new cache functionality --- lam/lib/modules/sambaSamAccount.inc | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/lam/lib/modules/sambaSamAccount.inc b/lam/lib/modules/sambaSamAccount.inc index 64cf011b..55e0c931 100644 --- a/lam/lib/modules/sambaSamAccount.inc +++ b/lam/lib/modules/sambaSamAccount.inc @@ -1013,18 +1013,16 @@ class sambaSamAccount extends baseModule { // get list of Samba 3 domains $domains = search_domains($_SESSION['config']->get_Suffix('domain')); // get list of Unix groups and their sambaSID + gidNumber - $groups = $_SESSION['cache']->get_cache('cn', 'posixGroup', 'group'); - $groups_SID = $_SESSION['cache']->get_cache('sambaSID', 'sambaGroupMapping', 'group'); - $groups_gid = $_SESSION['cache']->get_cache('gidNumber', 'posixGroup', 'group'); + $groups = $_SESSION['cache']->get_cache(array('cn', 'sambaSID', 'gidNumber'), 'posixGroup', 'group'); $groups_k = array_keys($groups); - for ($i = 0; $i < sizeof($groups_k); $i++) { - $groups[$groups_k[$i]] = array('cn' => $groups[$groups_k[$i]][0]); - if (isset($groups_SID[$groups_k[$i]][0])) $groups[$groups_k[$i]]['SID'] = $groups_SID[$groups_k[$i]][0]; - if (isset($groups_gid[$groups_k[$i]][0])) $groups[$groups_k[$i]]['gid'] = $groups_gid[$groups_k[$i]][0]; - } $groups_cn = array(); for ($i = 0; $i < sizeof($groups_k); $i++) { - $groups_cn[$groups[$groups_k[$i]]['cn']] = $groups[$groups_k[$i]]; + if (isset($groups[$groups_k[$i]]['sambaSID'][0])) { + $groups_cn[$groups[$groups_k[$i]]['cn'][0]]['SID'] = $groups[$groups_k[$i]]['sambaSID'][0]; + } + if (isset($groups[$groups_k[$i]]['gidNumber'][0])) { + $groups_cn[$groups[$groups_k[$i]]['cn'][0]]['gid'] = $groups[$groups_k[$i]]['gidNumber'][0]; + } } if ($this->get_scope() == 'user') { for ($i = 0; $i < sizeof($rawAccounts); $i++) { @@ -1241,7 +1239,7 @@ class sambaSamAccount extends baseModule { } else { // default domain users - $partialAccounts[$i]['sambaPrimaryGroupSID'] = $domains[$domIndex]->SID . '-' . $this->rids['Domain Users']; + $partialAccounts[$i]['sambaPrimaryGroupSID'] = $domains[$domIndex]->SID . '-' . $this->rids[_('Domain Users')]; } // special user if ($rawAccounts[$i][$ids['sambaSamAccount_rid']] != "") {