diff --git a/lam/HISTORY b/lam/HISTORY index fa981aaa..d1edb518 100644 --- a/lam/HISTORY +++ b/lam/HISTORY @@ -1,5 +1,7 @@ ??? 0.5.2 - New module for SSH public keys + - fixed bugs: + -> creation of home directories did not work 19.10.2005 0.5.1 - Samba 3: added support for account expiration diff --git a/lam/lib/modules.inc b/lam/lib/modules.inc index 44f47fc9..284fde80 100644 --- a/lam/lib/modules.inc +++ b/lam/lib/modules.inc @@ -1525,6 +1525,23 @@ class accountContainer { $errors[] = array('ERROR', sprintf(_('Was unable to create DN: %s.'), $this->dn), ldap_error($_SESSION['ldap']->server())); $stopprocessing = true; } + // lamdaemon commands for the new account + if (!$stopprocessing) { + $DN = $attributes[$this->dn]; + if (is_array($DN['lamdaemon']['command'])) $result = lamdaemon($DN['lamdaemon']['command']); + // Error somewhere in lamdaemon + if (is_array($result)) { + foreach ($result as $singleresult) { + if (is_array($singleresult)) { + if ($singleresult[0] == 'ERROR') $stopprocessing = true; + $temparray[0] = $singleresult[0]; + $temparray[1] = _($singleresult[1]); + $temparray[2] = _($singleresult[2]); + $errors[] = $temparray; + } + } + } + } } unset($attributes[$this->dn]); } diff --git a/lam/lib/modules/posixAccount.inc b/lam/lib/modules/posixAccount.inc index 641f07a0..2ad3c7e7 100644 --- a/lam/lib/modules/posixAccount.inc +++ b/lam/lib/modules/posixAccount.inc @@ -907,12 +907,12 @@ class posixAccount extends baseModule { 0 => array('kind' => 'text', 'text' => _('Home directory').'*'), 1 => array('kind' => 'input', 'name' => 'homeDirectory', 'type' => 'text', 'size' => '30', 'maxlength' => '255', 'value' => $this->attributes['homeDirectory'][0]), 2 => array('kind' => 'help', 'value' => 'homeDirectory')); - if ($this->orig['homeDirectory']=='' && isset($_SESSION['config']->scriptPath)) { + if ($_SESSION[$this->base]->isNewAccount && isset($_SESSION['config']->scriptPath)) { $return[] = array( 0 => array('kind' => 'text', 'text' => _('Create home directory')), 1 => array('kind' => 'input', 'name' => 'createhomedir', 'type' => 'checkbox', 'checked' => $this->createhomedir), 2 => array('kind' => 'help', 'value' => 'createhomedir')); - } + } if ($_SESSION[$this->base]->isNewAccount) { $return[] = array( 0 => array('kind' => 'text', 'text' => _('Password') ),