From 3c434e072c5cee6940a462b1f4eb043c6bfc3aaa Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Sun, 30 Aug 2009 00:42:27 +0000 Subject: [PATCH] Moved from generic helper to concrete WebFormHelper due we only need these methods there --- .../main/helper/web/class_BaseWebHelper.php | 171 ------------------ .../helper/web/forms/class_WebFormHelper.php | 151 ++++++++++++++++ 2 files changed, 151 insertions(+), 171 deletions(-) diff --git a/inc/classes/main/helper/web/class_BaseWebHelper.php b/inc/classes/main/helper/web/class_BaseWebHelper.php index d9ba848a..00b99256 100644 --- a/inc/classes/main/helper/web/class_BaseWebHelper.php +++ b/inc/classes/main/helper/web/class_BaseWebHelper.php @@ -33,177 +33,6 @@ class BaseWebHelper extends BaseHelper { // Call parent constructor parent::__construct($className); } - - /** - * Checks wether the registration requires a valid email address - * - * @return $required Wether the email address is required - */ - public function ifRegisterRequiresEmailVerification () { - $required = ($this->getConfigInstance()->getConfigEntry('register_requires_email') == 'Y'); - return $required; - } - - /** - * Checks wether profile data shall be asked - * - * @return $required Wether profile shall be asked - */ - public function ifRegisterIncludesProfile () { - $required = ($this->getConfigInstance()->getConfigEntry('register_includes_profile') == 'Y'); - return $required; - } - - /** - * Checks wether personal data shall be asked - * - * @return $required Wether personal data shall be asked - */ - public function ifRegisterIncludesPersonaData () { - $required = ($this->getConfigInstance()->getConfigEntry('register_personal_data') == 'Y'); - return $required; - } - - /** - * Checks wether for birthday shall be asked - * - * @return $required Wether birthday shall be asked - */ - public function ifProfileIncludesBirthDay () { - $required = ($this->getConfigInstance()->getConfigEntry('profile_includes_birthday') == 'Y'); - return $required; - } - - /** - * Checks wether email addresses can only be once used - * - * @return $isUnique - */ - public function ifEmailMustBeUnique () { - $isUnique = ($this->getConfigInstance()->getConfigEntry('register_email_unique') == 'Y'); - return $isUnique; - } - - /** - * Checks wether the specified chat protocol is enabled in this form - * - * @return $required Wether the specified chat protocol is enabled - */ - public function ifChatEnabled ($chatProtocol) { - $required = ($this->getConfigInstance()->getConfigEntry('chat_enabled_' . $chatProtocol) == 'Y'); - return $required; - } - - /** - * Checks wether login is enabled or disabled - * - * @return $isEnabled Wether the login is enabled or disabled - */ - public function ifLoginIsEnabled () { - $isEnabled = ($this->getConfigInstance()->getConfigEntry('login_enabled') == 'Y'); - return $isEnabled; - } - - /** - * Checks wether login shall be done by username - * - * @return $isEnabled Wether the login shall be done by username - */ - public function ifLoginWithUsername () { - $isEnabled = ($this->getConfigInstance()->getConfigEntry('login_type') == "username"); - return $isEnabled; - } - - /** - * Checks wether login shall be done by email - * - * @return $isEnabled Wether the login shall be done by email - */ - public function ifLoginWithEmail () { - $isEnabled = ($this->getConfigInstance()->getConfigEntry('login_type') == "email"); - return $isEnabled; - } - - /** - * Checks wether guest login is allowed - * - * @return $isAllowed Wether guest login is allowed - */ - public function ifGuestLoginAllowed () { - $isAllowed = ($this->getConfigInstance()->getConfigEntry('guest_login_allowed') == 'Y'); - return $isAllowed; - } - - /** - * Checks wether the email address change must be confirmed - * - * @return $requireConfirm Wether email change must be confirmed - */ - public function ifEmailChangeRequireConfirmation () { - $requireConfirm = ($this->getConfigInstance()->getConfigEntry('email_change_confirmation') == 'Y'); - return $requireConfirm; - } - - /** - * Checks wether the rules has been updated - * - * @return $rulesUpdated Wether rules has been updated - * @todo Implement check if rules have been changed - */ - public function ifRulesHaveChanged () { - return false; - } - - /** - * Checks wether email change is allowed - * - * @return $emailChange Wether changing email address is allowed - */ - public function ifEmailChangeAllowed () { - $emailChange = ($this->getConfigInstance()->getConfigEntry('email_change_allowed') == 'Y'); - return $emailChange; - } - - /** - * Checks wether the user account is unconfirmed - * - * @return $isUnconfirmed Wether the user account is unconfirmed - */ - public function ifUserAccountUnconfirmed () { - $isUnconfirmed = ($this->getValueField(UserDatabaseWrapper::DB_COLUMN_USER_STATUS) === $this->getConfigInstance()->getConfigEntry('user_status_unconfirmed')); - return $isUnconfirmed; - } - - /** - * Checks wether the user account is locked - * - * @return $isUnconfirmed Wether the user account is locked - */ - public function ifUserAccountLocked () { - $isUnconfirmed = ($this->getValueField(UserDatabaseWrapper::DB_COLUMN_USER_STATUS) === $this->getConfigInstance()->getConfigEntry('user_status_locked')); - return $isUnconfirmed; - } - - /** - * Checks wether the user account is a guest - * - * @return $isUnconfirmed Wether the user account is a guest - */ - public function ifUserAccountGuest () { - $isUnconfirmed = ($this->getValueField(UserDatabaseWrapper::DB_COLUMN_USER_STATUS) === $this->getConfigInstance()->getConfigEntry('user_status_guest')); - return $isUnconfirmed; - } - - /** - * Checks wether the refill page is active which should be not the default - * on non-web applications. - * - * @return $refillActive Wether the refill page is active - */ - public function ifRefillPageActive () { - $refillActive = ($this->getConfigInstance()->getConfigEntry('refill_page_active') == 'Y'); - return $refillActive; - } } // [EOF] diff --git a/inc/classes/main/helper/web/forms/class_WebFormHelper.php b/inc/classes/main/helper/web/forms/class_WebFormHelper.php index adfe7be4..13f87bb3 100644 --- a/inc/classes/main/helper/web/forms/class_WebFormHelper.php +++ b/inc/classes/main/helper/web/forms/class_WebFormHelper.php @@ -755,6 +755,157 @@ class WebFormHelper extends BaseWebHelper implements HelpableTemplate { return $isSecured; } + /** + * Checks wether personal data shall be asked + * + * @return $required Wether personal data shall be asked + */ + public function ifRegisterIncludesPersonaData () { + $required = ($this->getConfigInstance()->getConfigEntry('register_personal_data') == 'Y'); + return $required; + } + + /** + * Checks wether for birthday shall be asked + * + * @return $required Wether birthday shall be asked + */ + public function ifProfileIncludesBirthDay () { + $required = ($this->getConfigInstance()->getConfigEntry('profile_includes_birthday') == 'Y'); + return $required; + } + + /** + * Checks wether email addresses can only be once used + * + * @return $isUnique + */ + public function ifEmailMustBeUnique () { + $isUnique = ($this->getConfigInstance()->getConfigEntry('register_email_unique') == 'Y'); + return $isUnique; + } + + /** + * Checks wether the specified chat protocol is enabled in this form + * + * @return $required Wether the specified chat protocol is enabled + */ + public function ifChatEnabled ($chatProtocol) { + $required = ($this->getConfigInstance()->getConfigEntry('chat_enabled_' . $chatProtocol) == 'Y'); + return $required; + } + + /** + * Checks wether login is enabled or disabled + * + * @return $isEnabled Wether the login is enabled or disabled + */ + public function ifLoginIsEnabled () { + $isEnabled = ($this->getConfigInstance()->getConfigEntry('login_enabled') == 'Y'); + return $isEnabled; + } + + /** + * Checks wether login shall be done by username + * + * @return $isEnabled Wether the login shall be done by username + */ + public function ifLoginWithUsername () { + $isEnabled = ($this->getConfigInstance()->getConfigEntry('login_type') == "username"); + return $isEnabled; + } + + /** + * Checks wether login shall be done by email + * + * @return $isEnabled Wether the login shall be done by email + */ + public function ifLoginWithEmail () { + $isEnabled = ($this->getConfigInstance()->getConfigEntry('login_type') == "email"); + return $isEnabled; + } + + /** + * Checks wether guest login is allowed + * + * @return $isAllowed Wether guest login is allowed + */ + public function ifGuestLoginAllowed () { + $isAllowed = ($this->getConfigInstance()->getConfigEntry('guest_login_allowed') == 'Y'); + return $isAllowed; + } + + /** + * Checks wether the email address change must be confirmed + * + * @return $requireConfirm Wether email change must be confirmed + */ + public function ifEmailChangeRequireConfirmation () { + $requireConfirm = ($this->getConfigInstance()->getConfigEntry('email_change_confirmation') == 'Y'); + return $requireConfirm; + } + + /** + * Checks wether the rules has been updated + * + * @return $rulesUpdated Wether rules has been updated + * @todo Implement check if rules have been changed + */ + public function ifRulesHaveChanged () { + return false; + } + + /** + * Checks wether email change is allowed + * + * @return $emailChange Wether changing email address is allowed + */ + public function ifEmailChangeAllowed () { + $emailChange = ($this->getConfigInstance()->getConfigEntry('email_change_allowed') == 'Y'); + return $emailChange; + } + + /** + * Checks wether the user account is unconfirmed + * + * @return $isUnconfirmed Wether the user account is unconfirmed + */ + public function ifUserAccountUnconfirmed () { + $isUnconfirmed = ($this->getValueField(UserDatabaseWrapper::DB_COLUMN_USER_STATUS) === $this->getConfigInstance()->getConfigEntry('user_status_unconfirmed')); + return $isUnconfirmed; + } + + /** + * Checks wether the user account is locked + * + * @return $isUnconfirmed Wether the user account is locked + */ + public function ifUserAccountLocked () { + $isUnconfirmed = ($this->getValueField(UserDatabaseWrapper::DB_COLUMN_USER_STATUS) === $this->getConfigInstance()->getConfigEntry('user_status_locked')); + return $isUnconfirmed; + } + + /** + * Checks wether the user account is a guest + * + * @return $isUnconfirmed Wether the user account is a guest + */ + public function ifUserAccountGuest () { + $isUnconfirmed = ($this->getValueField(UserDatabaseWrapper::DB_COLUMN_USER_STATUS) === $this->getConfigInstance()->getConfigEntry('user_status_guest')); + return $isUnconfirmed; + } + + /** + * Checks wether the refill page is active which should be not the default + * on non-web applications. + * + * @return $refillActive Wether the refill page is active + */ + public function ifRefillPageActive () { + $refillActive = ($this->getConfigInstance()->getConfigEntry('refill_page_active') == 'Y'); + return $refillActive; + } + /** * Flushs the content out (not yet secured against open forms, etc.!) or * close the form automatically -- 2.30.2