no longer update Samba 2 attributes

This commit is contained in:
Roland Gruber 2007-07-08 10:59:00 +00:00
parent f1dda8d924
commit 5bb84b5e70
1 changed files with 6 additions and 23 deletions

View File

@ -687,29 +687,12 @@ class posixGroup extends baseModule {
// Change gids of users and hosts?
if ($this->changegids) {
// get gidNumber
$line=-1;
for ($i=0; $i<count($_SESSION['ldap']->objectClasses) || $i==-1; $i++) {
if (strpos($_SESSION['ldap']->objectClasses[$i], "NAME 'posixAccount'")) $line = $i;
}
if ($line!=-1) {
$result = $_SESSION['cache']->get_cache('gidNumber', 'posixAccount', array('user', 'host'));
if (is_array($result)) {
$DNs = array_keys($result);
for ($i=0; $i<count($DNs); $i++)
if ($result[$DNs[$i]][0] == $this->orig['gidNumber'][0]) $return[$DNs[$i]]['modify']['gidNumber'][0] = $this->attributes['gidNumber'][0];
}
}
// change primaryGroupID
$line=-1;
for ($i=0; $i<count($_SESSION['ldap']->objectClasses) || $i==-1; $i++) {
if (strpos($_SESSION['ldap']->objectClasses[$i], "NAME 'sambaAccount'")) $line = $i;
}
if ($line!=-1) {
$result = $_SESSION['cache']->get_cache('primaryGroupID', 'sambaAccount', array('user', 'host'));
if (is_array($result)) {
$DNs = array_keys($result);
for ($i=0; $i<count($DNs); $i++) {
if ($result[$DNs[$i]][0] == $this->orig['gidNumber'][0]*2+1001 ) $return[$DNs[$i]]['modify']['PrimaryGroupID'][0] = $this->attributes['gidNumber'][0]*2+1001;
$result = $_SESSION['cache']->get_cache('gidNumber', 'posixAccount', array('user', 'host'));
if (is_array($result)) {
$DNs = array_keys($result);
for ($i=0; $i<count($DNs); $i++) {
if ($result[$DNs[$i]][0] == $this->orig['gidNumber'][0]) {
$return[$DNs[$i]]['modify']['gidNumber'][0] = $this->attributes['gidNumber'][0];
}
}
}