From 6044fa1f487284f9337a00f3d7e5542cdabbe97b Mon Sep 17 00:00:00 2001 From: Roland Gruber Date: Wed, 28 Jun 2006 15:10:02 +0000 Subject: [PATCH] fixed problem with message about missing password --- lam/lib/modules/kolabUser.inc | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/lam/lib/modules/kolabUser.inc b/lam/lib/modules/kolabUser.inc index 82e77a9c..b7392156 100644 --- a/lam/lib/modules/kolabUser.inc +++ b/lam/lib/modules/kolabUser.inc @@ -263,11 +263,15 @@ class kolabUser extends baseModule { */ 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())); + if (isset($_SESSION[$this->base]->module['posixAccount'])) { + if (!$_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())); + elseif (isset($_SESSION[$this->base]->module['inetOrgPerson'])) { + if (!$_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())); + } } } if (!$_SESSION[$this->base]->module['inetOrgPerson']->attributes['mail'][0]) { @@ -586,8 +590,12 @@ class kolabUser extends baseModule { function module_complete() { if (!$_SESSION[$this->base]->module['inetOrgPerson']->attributes['mail'][0]) return false; if ($_SESSION[$this->base]->isNewAccount) { - if (isset($_SESSION[$this->base]->module['posixAccount']) && !$_SESSION[$this->base]->module['posixAccount']->attributes['userPassword'][0]) return false; - if (isset($_SESSION[$this->base]->module['inetOrgPerson']) && !$_SESSION[$this->base]->module['inetOrgPerson']->attributes['userPassword'][0]) return false; + if (isset($_SESSION[$this->base]->module['posixAccount'])) { + if (!$_SESSION[$this->base]->module['posixAccount']->attributes['userPassword'][0]) return false; + } + elseif (isset($_SESSION[$this->base]->module['inetOrgPerson'])) { + if (!$_SESSION[$this->base]->module['inetOrgPerson']->attributes['userPassword'][0]) return false; + } } return true; }