force setting a password

This commit is contained in:
Roland Gruber 2005-08-16 12:06:13 +00:00
parent 0bc5a03b66
commit a06115e7db
1 changed files with 12 additions and 0 deletions

View File

@ -293,6 +293,14 @@ class kolabUser extends baseModule {
* @param array $post HTTP-POST values * @param array $post HTTP-POST values
*/ */
function display_html_attributes(&$post) { function display_html_attributes(&$post) {
if ($_SESSION[$this->base]->isNewAccount) {
if (isset($_SESSION[$this->base]->module['posixAccount']) && !$_SESSION[$this->base]->module['posixAccount']->attributes['userPassword'][0]) {
StatusMessage('ERROR', _("Please enter a user password on this page: %s"), '', array($_SESSION[$this->base]->module['posixAccount']->get_alias()));
}
elseif (isset($_SESSION[$this->base]->module['inetOrgPerson']) && !$_SESSION[$this->base]->module['inetOrgPerson']->attributes['userPassword'][0]) {
StatusMessage('ERROR', _("Please enter a user password on this page: %s"), '', array($_SESSION[$this->base]->module['inetOrgPerson']->get_alias()));
}
}
$return = array(); $return = array();
// check if account is marked for deletion // check if account is marked for deletion
if (isset($this->attributes['kolabDeleteflag'])) { if (isset($this->attributes['kolabDeleteflag'])) {
@ -607,9 +615,13 @@ class kolabUser extends baseModule {
/** /**
* This function returns true if all needed settings are done. * This function returns true if all needed settings are done.
*
* @return true, if account can be saved
*/ */
function module_complete() { function module_complete() {
if ($_SESSION[$this->base]->isNewAccount) { if ($_SESSION[$this->base]->isNewAccount) {
if (isset($_SESSION[$this->base]->module['posixAccount']) && !$_SESSION[$this->base]->module['posixAccount']->attributes['userPassword'][0]) return false;
elseif (isset($_SESSION[$this->base]->module['inetOrgPerson']) && !$_SESSION[$this->base]->module['inetOrgPerson']->attributes['userPassword'][0]) return false;
return $this->inputCorrect; return $this->inputCorrect;
} }
else { else {