]> git.mxchange.org Git - shipsimu.git/blobdiff - inc/classes/main/helper/web/class_WebFormHelper.php
Account status page partly implemented, backtrace now without own saveBacktrace(...
[shipsimu.git] / inc / classes / main / helper / web / class_WebFormHelper.php
index 1369fe4595cbc3b3c33633d551df363f64088986..645740938148c1c736e49b81adf3c82210961829 100644 (file)
@@ -200,7 +200,7 @@ class WebFormHelper extends BaseHelper {
                } // END - if
 
                // Generate the content
-               $inputContent = sprintf("<input type=\"text\" class=\"textfield\" id=\"%s\" name=\"%s\" value=\"%s\" />",
+               $inputContent = sprintf("<input type=\"text\" class=\"textfield\" id=\"%s_field\" name=\"%s\" value=\"%s\" />",
                        $fieldName,
                        $fieldName,
                        $fieldValue
@@ -242,7 +242,7 @@ class WebFormHelper extends BaseHelper {
                } // END - if
 
                // Generate the content
-               $inputContent = sprintf("<input type=\"password\" class=\"password\" id=\"%s\" name=\"%s\" value=\"%s\" />",
+               $inputContent = sprintf("<input type=\"password\" class=\"password\" id=\"%s_field\" name=\"%s\" value=\"%s\" />",
                        $fieldName,
                        $fieldName,
                        $fieldValue
@@ -299,7 +299,7 @@ class WebFormHelper extends BaseHelper {
                if ($fieldChecked === false) $checked = " ";
 
                // Generate the content
-               $inputContent = sprintf("<input type=\"checkbox\" name=\"%s\" class=\"checkbox\" id=\"%s\" value=\"1\"%s/>",
+               $inputContent = sprintf("<input type=\"checkbox\" name=\"%s\" class=\"checkbox\" id=\"%s_field\" value=\"1\"%s/>",
                        $fieldName,
                        $fieldName,
                        $checked
@@ -675,9 +675,39 @@ class WebFormHelper extends BaseHelper {
                return $emailChange;
        }
 
+       /**
+        * Checks wether the user account is unconfirmed
+        *
+        * @return      $isUnconfirmed  Wether the user account is unconfirmed
+        */
+       public function ifUserAccountUnconfirmed () {
+               $isUnconfirmed = ($this->getField('user_status') === $this->getConfigInstance()->readConfig('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->getField('user_status') === $this->getConfigInstance()->readConfig('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->getField('user_status') === $this->getConfigInstance()->readConfig('user_status_guest'));
+               return $isUnconfirmed;
+       }
+
        /**
         * Flushs the content out (not yet secured against open forms, etc.!) or
-        * throw an exception if it is not yet closed
+        * close the form automatically
         *
         * @return      void
         * @throws      FormOpenedException             If the form is still open
@@ -685,8 +715,8 @@ class WebFormHelper extends BaseHelper {
        public function flushContent () {
                // Is the form still open?
                if ($this->formOpened === true) {
-                       // Throw an exception
-                       throw new FormOpenedException ($this, self::EXCEPTION_OPENED_FORM);
+                       // Close the form automatically
+                       $this->addFormTag();
                } // END - if
 
                // Send content to template engine