fixed homedir creation

This commit is contained in:
Roland Gruber 2005-10-21 13:48:30 +00:00
parent 7bba828706
commit 731692e511
3 changed files with 21 additions and 2 deletions

View File

@ -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

View File

@ -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]);
}

View File

@ -907,7 +907,7 @@ 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),