fixed some cache calls
This commit is contained in:
parent
5316b23971
commit
8da59685fa
|
@ -568,10 +568,10 @@ class posixGroup extends baseModule {
|
|||
else $this->changegids=false;
|
||||
if ($this->attributes['gidNumber'][0]!=$post['gidNumber'] || ($this->triggered_messages['gidNumber'][0]='ERROR')) {
|
||||
// Check if GID is valid. If none value was entered, the next useable value will be inserted
|
||||
// load min and may uidNumber
|
||||
// load min and max GID number
|
||||
$minID = intval($this->moduleSettings['posixGroup_minGID'][0]);
|
||||
$maxID = intval($this->moduleSettings['posixGroup_maxGID'][0]);
|
||||
$dn_gids = $_SESSION['cache']->get_cache('gidNumber', 'posixGroup', '*');
|
||||
$dn_gids = $_SESSION['cache']->get_cache('gidNumber', 'posixGroup', 'group');
|
||||
// get_cache will return an array ( dn1 => array(uidnumber1), dn2 => array(uidnumber2), ... )
|
||||
if(is_array($dn_gids)) {
|
||||
foreach ($dn_gids as $gid) $gids[] = $gid[0];
|
||||
|
@ -618,11 +618,11 @@ class posixGroup extends baseModule {
|
|||
// Create automatic useraccount with number if original user already exists
|
||||
// Reset name to original name if new name is in use
|
||||
// Set username back to original name if new username is in use
|
||||
if ($_SESSION['cache']->in_cache($this->attributes['cn'][0],'cn', '*')!=false && ($this->orig['cn'][0]!='')) {
|
||||
if ($_SESSION['cache']->in_cache($this->attributes['cn'][0],'cn', 'group')!=false && ($this->orig['cn'][0]!='')) {
|
||||
$this->attributes['cn'][0] = $this->orig['cn'][0];
|
||||
}
|
||||
// Change gid to a new gid until a free gid is found
|
||||
else while ($_SESSION['cache']->in_cache($this->attributes['cn'][0], 'cn', '*')) {
|
||||
else while ($_SESSION['cache']->in_cache($this->attributes['cn'][0], 'cn', 'group')) {
|
||||
// get last character of username
|
||||
$lastchar = substr($this->attributes['cn'][0], strlen($this->attributes['cn'][0])-1, 1);
|
||||
// Last character is no number
|
||||
|
|
Loading…
Reference in New Issue