diff --git a/lam/lib/baseModule.inc b/lam/lib/baseModule.inc index 49d5be06..9dca1eb8 100644 --- a/lam/lib/baseModule.inc +++ b/lam/lib/baseModule.inc @@ -521,6 +521,25 @@ class baseModule { } } + /** + * This function is used to check if this module page can be displayed. + * It returns false if a module depends on data from other modules which was not yet entered. + * + * @return boolean true, if page can be displayed + */ + function module_ready() { + return true; + } + + /** + * This functions is used to check if all settings for this module have been made. + * + * @return boolean true, if settings are complete + */ + function module_complete() { + return true; + } + /** * Checks if the attribute values follow the LDAP syntax. * Not every LDAP attribute allows UTF-8 strings. Therefore we do a syntax check here diff --git a/lam/lib/modules/account.inc b/lam/lib/modules/account.inc index a7991613..56c966ee 100644 --- a/lam/lib/modules/account.inc +++ b/lam/lib/modules/account.inc @@ -105,20 +105,13 @@ class account extends baseModule { function load_Messages() { } - /* This function returns true if all required attributes from other - * modules are set. This is required to prevent undefined states - */ - function module_ready() { - return true; - } - /* This functions return true * if all needed settings are done */ function module_complete() { if (!$this->module_ready()) return false; return true; - } + } /* This function returns a list of all html-pages in module * This is usefull for mass upload and pdf-files diff --git a/lam/lib/modules/inetLocalMailRecipient.inc b/lam/lib/modules/inetLocalMailRecipient.inc index d7be2626..62e129cb 100644 --- a/lam/lib/modules/inetLocalMailRecipient.inc +++ b/lam/lib/modules/inetLocalMailRecipient.inc @@ -297,13 +297,6 @@ class inetLocalMailRecipient extends baseModule { return $this->inputCorrect; } - /** - * Returns true if all settings on module page are correct. - */ - function module_ready() { - return $this->inputCorrect; - } - /** * In this function the LDAP account is built up. * diff --git a/lam/lib/modules/inetOrgPerson.inc b/lam/lib/modules/inetOrgPerson.inc index ab446f15..c78ee67e 100644 --- a/lam/lib/modules/inetOrgPerson.inc +++ b/lam/lib/modules/inetOrgPerson.inc @@ -344,28 +344,10 @@ class inetOrgPerson extends baseModule { return $return; } - /** - * Initializes the module in its accountContainer - * - * @param string $base the name of account_container in session - */ - function init($base) { - // call parent init - parent::init($base); - } - - /* This function returns true if all required attributes from other - * modules are set. This is required to prevent undefined states - */ - function module_ready() { - return true; - } - /* This functions return true * if all needed settings are done */ function module_complete() { - if (!$this->module_ready()) return false; if ($this->attributes['sn'][0] == '') return false; return true; } diff --git a/lam/lib/modules/kolabUser.inc b/lam/lib/modules/kolabUser.inc index 7be96c8e..44852b74 100644 --- a/lam/lib/modules/kolabUser.inc +++ b/lam/lib/modules/kolabUser.inc @@ -617,13 +617,6 @@ class kolabUser extends baseModule { } } - /** - * Returns true if all settings on module page are correct. - */ - function module_ready() { - return true; - } - /** * In this function the LDAP account is built up. * diff --git a/lam/lib/modules/nisMailAlias.inc b/lam/lib/modules/nisMailAlias.inc index c596103e..adcc5b2d 100644 --- a/lam/lib/modules/nisMailAlias.inc +++ b/lam/lib/modules/nisMailAlias.inc @@ -247,13 +247,6 @@ class nisMailAlias extends baseModule { return $this->inputCorrect; } - /** - * Returns true if all settings on module page are correct. - */ - function module_ready() { - return $this->inputCorrect; - } - /** * In this function the LDAP account is built up. * diff --git a/lam/lib/modules/posixAccount.inc b/lam/lib/modules/posixAccount.inc index f5442f7c..c3d685ef 100644 --- a/lam/lib/modules/posixAccount.inc +++ b/lam/lib/modules/posixAccount.inc @@ -431,15 +431,10 @@ class posixAccount extends baseModule { var $groups_orig; var $createhomedir; - function module_ready() { - return true; - } - /* This functions return true * if all needed settings are done */ function module_complete() { - if (!$this->module_ready()) return false; if ($this->attributes['uid'][0] == '') return false; if ($this->attributes['uidNumber'][0] == '') return false; if ($this->attributes['gidNumber'][0] == '') return false; diff --git a/lam/lib/modules/posixGroup.inc b/lam/lib/modules/posixGroup.inc index d2d52601..535d71e7 100644 --- a/lam/lib/modules/posixGroup.inc +++ b/lam/lib/modules/posixGroup.inc @@ -504,18 +504,12 @@ class posixGroup extends baseModule { * if all needed settings are done */ function module_complete() { - if (!$this->module_ready()) return false; if ($this->attributes['cn'][0] == '') return false; if ($this->attributes['gidNumber'][0] == '') return false; return true; } - function module_ready() { - return true; - } - - /* This function returns a list of all html-pages in module * This is usefull for mass upload and pdf-files * because lam can walk trough all pages itself and do some diff --git a/lam/lib/modules/shadowAccount.inc b/lam/lib/modules/shadowAccount.inc index aafa313b..4a5ff350 100644 --- a/lam/lib/modules/shadowAccount.inc +++ b/lam/lib/modules/shadowAccount.inc @@ -47,8 +47,9 @@ class shadowAccount extends baseModule { parent::baseModule($scope); } - /** this functin fills the error message array with messages - **/ + /** + * This function builds up the message array. + */ function load_Messages() { // error messages for input checks $this->messages['shadowMin'][0] = array('ERROR', _('Password minage'), _('Password minimum age must be are natural number.')); @@ -211,25 +212,6 @@ class shadowAccount extends baseModule { return $return; } - // Constructor - function init($base) { - // call parent init - parent::init($base); - } - - - function module_ready() { - return true; - } - - /* This functions return true - * if all needed settings are done - */ - function module_complete() { - if (!$this->module_ready()) return false; - return true; - } - /* This function returns a list of all html-pages in module * This is usefull for mass upload and pdf-files * because lam can walk trough all pages itself and do some