diff --git a/lam/HISTORY b/lam/HISTORY index debde7dc..8840294d 100644 --- a/lam/HISTORY +++ b/lam/HISTORY @@ -1,7 +1,9 @@ ??? 0.5.0 + - Samba 2/3: added display name in account pages - fixed bugs: -> fixed error message when creating new accounts with shadowAccount -> added missing help entries on main account page + -> Samba 3: fixed profile settings for password expiration, no password and deactivated account 08.09.2005 0.5.rc3 - INFO messages no longer prevent changing to subpages of a module diff --git a/lam/lib/modules/sambaAccount.inc b/lam/lib/modules/sambaAccount.inc index 869c85b5..7c3bed16 100644 --- a/lam/lib/modules/sambaAccount.inc +++ b/lam/lib/modules/sambaAccount.inc @@ -77,6 +77,7 @@ class sambaAccount extends baseModule { $this->messages['rid'][0] = array('ERROR', _('Special user'), _('There can be only one administrator per domain.')); $this->messages['rid'][1] = array('ERROR', _('Special user'), _('There can be only one guest per domain.')); $this->messages['displayName'][0] = array('ERROR', _('Account %s:') . ' sambaAccount_displayName', _('Please enter a valid display name!')); + $this->messages['displayName'][1] = array('ERROR', _('Display name'), _('Please enter a valid display name!')); $this->messages['pwdUnix'][0] = array('ERROR', _('Account %s:') . ' sambaAccount_pwdUnix', _('This value can only be \"true\" or \"false\"!')); $this->messages['noPassword'][0] = array('ERROR', _('Account %s:') . ' sambaAccount_noPassword', _('This value can only be \"true\" or \"false\"!')); $this->messages['noExpire'][0] = array('ERROR', _('Account %s:') . ' sambaAccount_noExpire', _('This value can only be \"true\" or \"false\"!')); @@ -535,6 +536,13 @@ class sambaAccount extends baseModule { $flag = $flag. "]"; $this->attributes['acctFlags'][0] = $flag; + // display name + $this->attributes['displayName'][0] = $post['displayName']; + if (!($this->attributes['displayName'][0] == '') && !(get_preg($this->attributes['displayName'][0], 'realname'))) { + $triggered_messages['displayName'][] = $this->messages['displayName'][1]; + } + + // host attributes if ($_SESSION[$this->base]->type=='host') { $this->attributes['primaryGroupID'][0] = $this->rids[_('Domain Computers')]; if ($post['ResetSambaPassword'] || (!$this->attributes['lmPassword'][0])) { @@ -545,7 +553,6 @@ class sambaAccount extends baseModule { $this->attributes['pwdLastSet'][0] = time(); } } - // check values for user account if ($this->scope == 'user') { $this->attributes['pwdCanChange'][0] = mktime($post['pwdCanChange_h'], $post['pwdCanChange_m'], $post['pwdCanChange_s'], @@ -688,6 +695,11 @@ class sambaAccount extends baseModule { * It will output a complete html-table */ function display_html_attributes(&$post) { + $return[] = array( + 0 => array('kind' => 'text', 'text' => _('Display name')), + 1 => array('kind' => 'input', 'type' => 'text', 'name' => 'displayName', 'size' => '20', 'value' => $this->attributes['displayName'][0]), + 2 => array('kind' => 'help', 'value' => 'displayName')); + // user attributes if ($_SESSION[$this->base]->type=='user') { $canchangedate = getdate($this->attributes['pwdCanChange'][0]); $mustchangedate = getdate($this->attributes['pwdMustChange'][0]); diff --git a/lam/lib/modules/sambaSamAccount.inc b/lam/lib/modules/sambaSamAccount.inc index 536dc307..bd1d2bc2 100644 --- a/lam/lib/modules/sambaSamAccount.inc +++ b/lam/lib/modules/sambaSamAccount.inc @@ -75,6 +75,7 @@ class sambaSamAccount extends baseModule { $this->messages['rid'][2] = array('ERROR', _('Account %s:') . ' sambaSamAccount_rid', _('Please enter a RID number or the name of a special account!')); $this->messages['rid'][3] = array('ERROR', _('Account %s:') . ' sambaSamAccount_rid', _('This is not a valid RID number!')); $this->messages['displayName'][0] = array('ERROR', _('Account %s:') . ' sambaSamAccount_displayName', _('Please enter a valid display name!')); + $this->messages['displayName'][1] = array('ERROR', _('Display name'), _('Please enter a valid display name!')); $this->messages['pwdUnix'][0] = array('ERROR', _('Account %s:') . ' sambaSamAccount_pwdUnix', _('This value can only be \"true\" or \"false\"!')); $this->messages['noPassword'][0] = array('ERROR', _('Account %s:') . ' sambaSamAccount_noPassword', _('This value can only be \"true\" or \"false\"!')); $this->messages['noExpire'][0] = array('ERROR', _('Account %s:') . ' sambaSamAccount_noExpire', _('This value can only be \"true\" or \"false\"!')); @@ -535,6 +536,13 @@ class sambaSamAccount extends baseModule { $flag = $flag. "]"; $this->attributes['sambaAcctFlags'][0] = $flag; + // display name + $this->attributes['displayName'][0] = $post['displayName']; + if (!($this->attributes['displayName'][0] == '') && !(get_preg($this->attributes['displayName'][0], 'realname'))) { + $triggered_messages['displayName'][] = $this->messages['displayName'][1]; + } + + // host attributes if ($_SESSION[$this->base]->type=='host') { $this->attributes['sambaPrimaryGroupSID'][0] = $SID."-".$this->rids[_('Domain Computers')]; if ($post['ResetSambaPassword'] || !$this->attributes['sambaLMPassword'][0]) { @@ -545,7 +553,7 @@ class sambaSamAccount extends baseModule { $this->attributes['sambaPwdLastSet'][0] = time(); } } - + // user attributes if ($_SESSION[$this->base]->type=='user') { $this->attributes['sambaPwdCanChange'][0] = mktime($post['sambaPwdCanChange_h'], $post['sambaPwdCanChange_m'], $post['sambaPwdCanChange_s'], $post['sambaPwdCanChange_mon'], $post['sambaPwdCanChange_day'], $post['sambaPwdCanChange_yea']); @@ -746,6 +754,10 @@ class sambaSamAccount extends baseModule { $canchangedate = getdate($this->attributes['sambaPwdCanChange'][0]); $mustchangedate = getdate($this->attributes['sambaPwdMustChange'][0]); + $return[] = array( + 0 => array('kind' => 'text', 'text' => _('Display name')), + 1 => array('kind' => 'input', 'type' => 'text', 'name' => 'displayName', 'size' => '20', 'value' => $this->attributes['displayName'][0]), + 2 => array('kind' => 'help', 'value' => 'displayName')); if ($_SESSION[$this->base]->type=='user') { $return[] = array ( 0 => array ( 'kind' => 'input', 'name' => 'sambaPwdCanChange_h', 'type' => 'hidden', 'value' => $canchangedate['hours']), 1 => array ( 'kind' => 'input', 'name' => 'sambaPwdCanChange_m', 'type' => 'hidden', 'value' => $canchangedate['minutes']), @@ -1088,24 +1100,24 @@ class sambaSamAccount extends baseModule { $this->useunixpwd = false; } // use no password - if ($profile['sambaSamAccount_acctFlagsN'][0] == "true") { + if ($profile['sambaSamAccount_sambaAcctFlagsN'][0] == "true") { $this->nopwd = true; } - elseif ($profile['sambaSamAccount_acctFlagsN'][0] == "false") { + elseif ($profile['sambaSamAccount_sambaAcctFlagsN'][0] == "false") { $this->nopwd = false; } // password expiration - if ($profile['sambaSamAccount_acctFlagsX'][0] == "true") { + if ($profile['sambaSamAccount_sambaAcctFlagsX'][0] == "true") { $this->noexpire = true; } - elseif ($profile['sambaSamAccount_acctFlagsX'][0] == "false") { + elseif ($profile['sambaSamAccount_sambaAcctFlagsX'][0] == "false") { $this->noexpire = false; } // use no password - if ($profile['sambaSamAccount_acctFlagsD'][0] == "true") { + if ($profile['sambaSamAccount_sambaAcctFlagsD'][0] == "true") { $this->deactivated = true; } - elseif ($profile['sambaSamAccount_acctFlagsD'][0] == "false") { + elseif ($profile['sambaSamAccount_sambaAcctFlagsD'][0] == "false") { $this->deactivated = false; } }