]> git.mxchange.org Git - hub.git/commitdiff
Code merged from ship-simu repository
authorRoland Häder <roland@mxchange.org>
Wed, 19 Nov 2008 22:36:54 +0000 (22:36 +0000)
committerRoland Häder <roland@mxchange.org>
Wed, 19 Nov 2008 22:36:54 +0000 (22:36 +0000)
158 files changed:
inc/classes.php
inc/classes/exceptions/actions/class_InvalidActionException.php
inc/classes/exceptions/auth/class_UserAuthorizationException.php
inc/classes/exceptions/class_FrameworkException.php
inc/classes/exceptions/compressor/class_MismatchingCompressorsException.php
inc/classes/exceptions/controller/class_InvalidControllerException.php
inc/classes/exceptions/database/general/class_SqlException.php
inc/classes/exceptions/database/local_file/class_SavePathIsNoDirectoryException.php
inc/classes/exceptions/database/local_file/class_SavePathReadProtectedException.php
inc/classes/exceptions/database/local_file/class_SavePathWriteProtectedException.php
inc/classes/exceptions/database/wrapper/class_WrapperUserNameNotFoundException.php
inc/classes/exceptions/helper/class_FormClosedException.php
inc/classes/exceptions/helper/class_FormGroupClosedException.php
inc/classes/exceptions/helper/class_HelperNoPreviousOpenedSubGroupException.php
inc/classes/exceptions/helper/class_NoGroupOpenedException.php
inc/classes/exceptions/helper/class_UserInstanceMissingException.php
inc/classes/exceptions/io/class_DirPointerNotOpenedException.php
inc/classes/exceptions/io/class_FileNotFoundException.php
inc/classes/exceptions/io/class_FilePointerNotOpenedException.php
inc/classes/exceptions/io/class_FileReadProtectedException.php
inc/classes/exceptions/io/class_InvalidDataLengthException.php
inc/classes/exceptions/io/class_InvalidMD5ChecksumException.php
inc/classes/exceptions/io/class_PathIsNoDirectoryException.php
inc/classes/exceptions/io/class_PathReadProtectedException.php
inc/classes/exceptions/language/class_InvalidLanguagePathStringException.php
inc/classes/exceptions/language/class_LanguagePathIsNoDirectoryException.php
inc/classes/exceptions/language/class_LanguagePathReadProtectedException.php
inc/classes/exceptions/main/class_ClassMismatchException.php
inc/classes/exceptions/main/class_ClassNotFoundException.php
inc/classes/exceptions/main/class_ConfigEntryNotFoundException.php
inc/classes/exceptions/main/class_DimNotFoundInArrayException.php
inc/classes/exceptions/main/class_EmptyVariableException.php
inc/classes/exceptions/main/class_ExceptionNotFoundException.php
inc/classes/exceptions/main/class_GetterNotFoundException.php
inc/classes/exceptions/main/class_InvalidArrayCountException.php
inc/classes/exceptions/main/class_InvalidCommandException.php
inc/classes/exceptions/main/class_InvalidCommandInstanceException.php
inc/classes/exceptions/main/class_InvalidInterfaceException.php
inc/classes/exceptions/main/class_MissingArrayElementsException.php
inc/classes/exceptions/main/class_NoArrayCreatedException.php
inc/classes/exceptions/main/class_NoArrayException.php
inc/classes/exceptions/main/class_NoObjectException.php
inc/classes/exceptions/main/class_VariableIsNotSetException.php
inc/classes/exceptions/result/class_InvalidDatabaseResultException.php
inc/classes/exceptions/result/class_ResultUpdateException.php
inc/classes/exceptions/template/class_BasePathIsNoDirectoryException.php
inc/classes/exceptions/template/class_BasePathReadProtectedException.php
inc/classes/exceptions/template/class_InvalidBasePathStringException.php
inc/classes/exceptions/template/class_UnexpectedTemplateTypeException.php
inc/classes/exceptions/template/class_ViewHelperNotFoundException.php
inc/classes/exceptions/user/class_UserEmailMissingException.php
inc/classes/exceptions/user/class_UserPasswordMismatchException.php
inc/classes/exceptions/user/class_UsernameMissingException.php
inc/classes/interfaces/crypto/class_Cryptable.php
inc/classes/interfaces/registration/class_UserRegister.php
inc/classes/interfaces/registry/class_Register.php
inc/classes/interfaces/request/class_Requestable.php
inc/classes/interfaces/resolver/actions/class_ActionResolver.php
inc/classes/interfaces/resolver/commands/class_CommandResolver.php
inc/classes/interfaces/result/class_SearchableResult.php
inc/classes/interfaces/user/class_ManageableAccount.php
inc/classes/main/actions/class_BaseAction.php
inc/classes/main/actions/post_registration/class_LoginAfterRegistrationAction.php
inc/classes/main/actions/web/class_WebLoginProfileAction.php
inc/classes/main/cache/class_MemoryCache.php
inc/classes/main/class_BaseFrameworkSystem.php
inc/classes/main/class_FrameworkArrayObject.php
inc/classes/main/commands/web/class_WebConfirmCommand.php
inc/classes/main/commands/web/class_WebHomeCommand.php
inc/classes/main/commands/web/class_WebLoginAreaCommand.php
inc/classes/main/commands/web/class_WebLoginCommand.php
inc/classes/main/commands/web/class_WebLoginFailedCommand.php
inc/classes/main/commands/web/class_WebLogoutCommand.php
inc/classes/main/commands/web/class_WebLogoutDoneCommand.php
inc/classes/main/commands/web/class_WebRegisterCommand.php
inc/classes/main/commands/web/class_WebResendLinkCommand.php
inc/classes/main/console/class_ConsoleTools.php
inc/classes/main/controller/captcha/class_ImageCodeCaptchaController.php
inc/classes/main/controller/class_BaseController.php
inc/classes/main/controller/form/class_WebDoFormController.php
inc/classes/main/controller/login/class_WebLoginAreaController.php
inc/classes/main/controller/web/class_WebConfirmController.php
inc/classes/main/controller/web/class_WebDefaultNewsController.php
inc/classes/main/controller/web/class_WebLogoutController.php
inc/classes/main/criteria/class_SearchCriteria.php
inc/classes/main/crypto/class_CryptoHelper.php
inc/classes/main/database/databases/class_LocalFileDatabase.php
inc/classes/main/database/wrapper/class_UserDatabaseWrapper.php
inc/classes/main/debug/class_DebugConsoleOutput.php
inc/classes/main/debug/class_DebugWebOutput.php
inc/classes/main/factories/objects/class_ObjectFactory.php
inc/classes/main/factories/web/class_WebNewsFactory.php
inc/classes/main/filter/auth/class_UserAuthFilter.php
inc/classes/main/filter/change/class_EmailChangeFilter.php
inc/classes/main/filter/change/class_PasswordChangeFilter.php
inc/classes/main/filter/checkboxes/class_RulesAcceptedFilter.php
inc/classes/main/filter/class_
inc/classes/main/filter/class_AbstractFilterDecorator.php
inc/classes/main/filter/crypto/class_CaptchaEncryptFilter.php
inc/classes/main/filter/guest/class_UserNameIsGuestFilter.php
inc/classes/main/filter/news/class_NewsDownloadFilter.php
inc/classes/main/filter/news/class_NewsProcessFilter.php
inc/classes/main/filter/null/class_NullFilter.php
inc/classes/main/filter/update/class_UserStatusConfimedUpdateFilter.php
inc/classes/main/filter/update/class_UserUpdateFilter.php
inc/classes/main/filter/validator/class_EmailValidatorFilter.php
inc/classes/main/filter/validator/class_PasswordValidatorFilter.php
inc/classes/main/filter/validator/class_UserNameValidatorFilter.php
inc/classes/main/filter/verifier/class_AccountPasswordVerifierFilter.php
inc/classes/main/filter/verifier/class_ConfirmCodeVerifierFilter.php
inc/classes/main/filter/verifier/class_GraphicalCodeCaptchaVerifierFilter.php
inc/classes/main/filter/verifier/class_PasswordGuestVerifierFilter.php
inc/classes/main/filter/verifier/class_PasswordVerifierFilter.php
inc/classes/main/filter/verifier/class_UserGuestVerifierFilter.php
inc/classes/main/filter/verifier/class_UserNameVerifierFilter.php
inc/classes/main/filter/verifier/class_UserStatusVerifierFilter.php
inc/classes/main/filter/verifier/class_UserUnconfirmedVerifierFilter.php
inc/classes/main/helper/captcha/images/class_ImageHelper.php
inc/classes/main/helper/class_BaseHelper.php
inc/classes/main/helper/web/class_BaseWebHelper.php
inc/classes/main/helper/web/forms/class_WebFormHelper.php
inc/classes/main/helper/web/links/class_WebLinkHelper.php
inc/classes/main/io/class_FrameworkDirectoryPointer.php
inc/classes/main/io/class_FrameworkFileInputPointer.php
inc/classes/main/io/class_FrameworkFileOutputPointer.php
inc/classes/main/mailer/debug/class_DebugMailer.php
inc/classes/main/output/class_ConsoleOutput.php
inc/classes/main/output/class_WebOutput.php
inc/classes/main/points/class_UserPoints.php
inc/classes/main/reader/class_DefaultNewsReader.php
inc/classes/main/registration/class_BaseRegistration.php
inc/classes/main/registry/class_Registry.php
inc/classes/main/request/class_HttpRequest.php
inc/classes/main/resolver/action/class_BaseActionResolver.php
inc/classes/main/resolver/action/web/class_WebActionResolver.php
inc/classes/main/resolver/command/class_BaseCommandResolver.php
inc/classes/main/resolver/command/image/class_ImageCommandResolver.php
inc/classes/main/resolver/command/web/class_WebCommandResolver.php
inc/classes/main/resolver/controller/class_BaseControllerResolver.php
inc/classes/main/resolver/controller/image/class_ImageControllerResolver.php
inc/classes/main/resolver/controller/web/class_WebControllerResolver.php
inc/classes/main/response/class_BaseResponse.php
inc/classes/main/result/class_DatabaseResult.php
inc/classes/main/template/class_BaseTemplateEngine.php
inc/classes/main/user/class_BaseUser.php
inc/classes/main/user/guest/class_Guest.php
inc/classes/main/user/member/class_Member.php
inc/classes/middleware/compressor/class_CompressorChannel.php
inc/classes/middleware/database/class_DatabaseConnection.php
inc/config.php
inc/config/class_FrameworkConfiguration.php
inc/database.php
inc/database/lib-local.php
inc/file_io.php
inc/includes.php
inc/language.php
inc/selector.php
index.php

index 5a541c9d0605c1130f9096886c51ad3b832bc3e9..78bafebbf89cbc5e23f319f9d811473ca73c0f6b 100644 (file)
@@ -35,19 +35,19 @@ foreach ($lowerClasses as $className) {
        try {
                ClassLoader::getInstance()->loadClasses(sprintf("inc/classes/%s/", $className));
        } catch (PathIsNoDirectoryException $e) {
-               ApplicationEntryPoint::app_die(sprintf("[Main:] Could not load framework classes from path <strong>%s</strong> for the follwing reason: <strong>%s</strong>",
+               ApplicationEntryPoint::app_die(sprintf("[Main:] Could not load framework classes from path <span class=\"exception_data\">%s</span> for the follwing reason: <span class=\"exception_reason\">%s</span>",
                        $className
                ));
        } catch (PathIsEmptyException $e) {
-               ApplicationEntryPoint::app_die(sprintf("[Main:] Could not load framework classes from path <strong>%s</strong> for the follwing reason: <strong>%s</strong>",
+               ApplicationEntryPoint::app_die(sprintf("[Main:] Could not load framework classes from path <span class=\"exception_data\">%s</span> for the follwing reason: <span class=\"exception_reason\">%s</span>",
                        $className
                ));
        } catch (PathReadProtectedException $e) {
-               ApplicationEntryPoint::app_die(sprintf("[Main:] Could not load framework classes from path <strong>%s</strong> for the follwing reason: <strong>%s</strong>",
+               ApplicationEntryPoint::app_die(sprintf("[Main:] Could not load framework classes from path <span class=\"exception_data\">%s</span> for the follwing reason: <span class=\"exception_reason\">%s</span>",
                        $className
                ));
        } catch (DirPointerNotOpenedException $e) {
-               ApplicationEntryPoint::app_die(sprintf("[Main:] Could not load framework classes from path <strong>%s</strong> for the follwing reason: <strong>%s</strong>",
+               ApplicationEntryPoint::app_die(sprintf("[Main:] Could not load framework classes from path <span class=\"exception_data\">%s</span> for the follwing reason: <span class=\"exception_reason\">%s</span>",
                        $className
                ));
        }
index 3f6df3099aafd375e5693b80ccac4a524d344a2d..96c1b73aeca5d35462cfce80edd09c11712cc184 100644 (file)
@@ -31,10 +31,11 @@ class InvalidActionException extends FrameworkException {
         */
        public function __construct(array $msgArray, $code) {
                // Prepare the message
-               $message = sprintf("[%s:%d] Cannot resolve action <span id=\"exception_reason\">%s</span>.",
+               $message = sprintf("[%s:%d] Cannot resolve action <span class=\"exception_reason\">%s (%s)</span>.",
                        $msgArray[0]->__toString(),
                        $this->getLine(),
-                       $msgArray[1]
+                       $msgArray[1],
+                       $msgArray[0]->getClassName()
                );
 
                // Call parent contructor with message
index a5ab08bdc78736bff25eb2db1cab0110abebf6f5..a07bf453c46997ef9eefa1ff5ef5e8f689f55381 100644 (file)
@@ -31,7 +31,7 @@ class UserAuthorizationException extends FrameworkException {
         */
        public function __construct(Filterable $filterInstance, $code) {
                // Construct the message
-               $message = sprintf("[%s:%d] Authorization has failed. Error code <span id=\"exception_reason\">%s</span>",
+               $message = sprintf("[%s:%d] Authorization has failed. Error code <span class=\"exception_reason\">%s</span>",
                        $filterInstance->__toString(),
                        $this->getLine(),
                        $this->getHexCode($code)
index 3ba2fbec919d38e660886c3750cb5d3a21bef662..c3a2c1a38ff395788fb3eb187d1038ba6b0e217c 100644 (file)
@@ -59,11 +59,20 @@ abstract class FrameworkException extends ReflectionException {
                        );
 
                        // End here
-                       exit;
+                       exit();
                } // END - if
-
                // Make sure everything is assigned properly
                parent::__construct($message, $code);
+
+               // Log it away if DEBUG_ALL is set
+               if (defined('DEBUG_ALL')) {
+                       // Log the error
+                       error_log(sprintf("[%s:] %s (%s)",
+                               $this->__toString(),
+                               $message,
+                               $this->getHexCode()
+                       ));
+               } // END - if
        }
 
        /**
@@ -121,7 +130,7 @@ abstract class FrameworkException extends ReflectionException {
                        } // END - if
 
                        // Prepare argument infos
-                       $info = "<em id=\"debug_args\">{$info}</em>";
+                       $info = "<em id=\"debug_args_".$dbgIndex."\">{$info}</em>";
 
                        // File detection
                        $file = "Unknown file";
@@ -136,7 +145,7 @@ abstract class FrameworkException extends ReflectionException {
                        } // END - if
 
                        // The message
-                       $dbgMsg .= "\t at <em id=\"debug_id\">".$dbgIndex."</em> <em id=\"debug_file\">".$file."</em> (<em id=\"debug_line\">".$line."</em>) -&gt; ".$dbgInfo['function']."(".$info.")<br />\n";
+                       $dbgMsg .= "\t at <em id=\"debug_id_".$dbgIndex."\">".$dbgIndex."</em> <em id=\"debug_file_".$dbgIndex."\">".$file."</em> (<em id=\"debug_line_".$dbgIndex."\">".$line."</em>) -&gt; ".$dbgInfo['function']."(".$info.")<br />\n";
                } // END - if
                $dbgMsg .= "Debug backtrace end<br />\n";
 
index 1d0acb482dc2a75242361920de236c1eaf01b8b5..dfba485b6d11587c467d2a4bea17cb3260ca28a7 100644 (file)
@@ -31,7 +31,7 @@ class MismatchingCompressorsException extends FrameworkException {
         */
        public function __construct (array $array, $code) {
                // Add a message around the missing class
-               $message = sprintf("[%s:%d] Der Kompressor <span id=\"exception_reason\">%s</span> zu den geladenen Daten aus <span id=\"exception_reason\">%s</span> und der aktuell verwendete Kompressor <span id=\"exception_reason\">%s</span> stimmen nicht &uuml;berein!",
+               $message = sprintf("[%s:%d] Der Kompressor <span class=\"exception_reason\">%s</span> zu den geladenen Daten aus <span class=\"exception_reason\">%s</span> und der aktuell verwendete Kompressor <span class=\"exception_reason\">%s</span> stimmen nicht &uuml;berein!",
                        $array[0]->__toString(),
                        $this->getLine(),
                        strtoupper($array[1]),
index b166455a12134f55a0e4cbe184e31b9902105911..7fec632003cfacaa936f68c60cb2484a26b6f310 100644 (file)
@@ -31,7 +31,7 @@ class InvalidControllerException extends FrameworkException {
         */
        public function __construct(array $msgArray, $code) {
                // Prepare the message
-               $message = sprintf("[%s:%d] Cannot resolve controller <span id=\"exception_reason\">%s (class name: %s)</span>.",
+               $message = sprintf("[%s:%d] Cannot resolve controller <span class=\"exception_reason\">%s (class name: %s)</span>.",
                        $msgArray[0]->__toString(),
                        $this->getLine(),
                        $msgArray[1],
index 6270e9ce446c48b973c307cc0b04e3191920d7b1..06349288193adb6233661890b8ee0f173ffad8f3 100644 (file)
@@ -31,7 +31,7 @@ class SqlException extends DatabaseException {
         */
        public function __construct (array $msgArray, $code) {
                // Construct the message
-               $message = sprintf("[%s:%d] SQL error detected. Message from database: <span id=\"exception_reason\">%s</span>, code: <span id=\"exception_reason\">%s</span>.",
+               $message = sprintf("[%s:%d] SQL error detected. Message from database: <span class=\"exception_reason\">%s</span>, code: <span class=\"exception_reason\">%s</span>.",
                        $msgArray[0]->__toString(),
                        $this->getLine(),
                        $msgArray[1],
index a8fb42b6299f17fe0afb6933b1a15b8d268c5535..b14fa973452fa96ad254b95b077404e9846643ab 100644 (file)
@@ -31,7 +31,7 @@ class SavePathIsNoDirectoryException extends DatabaseException {
         */
        public function __construct ($path, $code) {
                // Add a message around the missing class
-               $message = sprintf("Der angegebene Speicherpfad <span id=\"exception_reason\">%s</span> ist ung&uuml;tig (kein Pfad).", $path);
+               $message = sprintf("Der angegebene Speicherpfad <span class=\"exception_reason\">%s</span> ist ung&uuml;tig (kein Pfad).", $path);
 
                // Call parent constructor
                parent::__construct($message, $code);
index 7a0534b22b4b7a183d9583cad7915da3bfc4a2b1..ce0ffa6b46f1527c6c59e2cb93dfdbe974488c4e 100644 (file)
@@ -31,7 +31,7 @@ class SavePathReadProtectedException extends DatabaseException {
         */
        public function __construct ($path, $code) {
                // Add a message around the missing class
-               $message = sprintf("Der Pfad <span id=\"exception_reason\">%s</span> ist lese-gesch&uuml;tzt. Bitte Zugriffsrechte (CHMOD) zum Lesen setzen.", $path);
+               $message = sprintf("Der Pfad <span class=\"exception_reason\">%s</span> ist lese-gesch&uuml;tzt. Bitte Zugriffsrechte (CHMOD) zum Lesen setzen.", $path);
 
                // Call parent constructor
                parent::__construct($message, $code);
index 9d7f699348e975052d38e51dda66a5ffc0df437e..81a1067e3ed934d8220acedeabbe5c62d925dde9 100644 (file)
@@ -31,7 +31,7 @@ class SavePathWriteProtectedException extends DatabaseException {
         */
        public function __construct ($path, $code) {
                // Add a message around the missing class
-               $message = sprintf("Der angegebene Speicherpfad <span id=\"exception_reason\">%s</span> ist schreibgesch&uuml;tzt. Bitte Zugriffsrechte (CHMOD) entsprechend setzen.", $path);
+               $message = sprintf("Der angegebene Speicherpfad <span class=\"exception_reason\">%s</span> ist schreibgesch&uuml;tzt. Bitte Zugriffsrechte (CHMOD) entsprechend setzen.", $path);
 
                // Call parent constructor
                parent::__construct($message, $code);
index bf3aa4c10713a6ebfdc19038a070062f0de4f238..819b388fe89411ea734064d4850c03f3b24cf67e 100644 (file)
@@ -7,7 +7,9 @@
  * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
- * 
+ * @todo               This class is no longer used
+ * @deprecated
+ *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation, either version 3 of the License, or
@@ -31,7 +33,7 @@ class WrapperUserNameNotFoundException extends DatabaseException {
         */
        public function __construct (array $msgArray, $code) {
                // Add a message around the missing class
-               $message = sprintf("[%s:%d] Username <span id=\"exception_reason\">%s</span> was not found. Requesting class: <span id=\"exception_reason\">%s</span>",
+               $message = sprintf("[%s:%d] Username <span class=\"exception_reason\">%s</span> was not found. Requesting class: <span class=\"exception_reason\">%s</span>",
                        $msgArray[0]->__toString(),
                        $this->getLine(),
                        $msgArray[1]->getUserName(),
index 59a52ad18fd0cf497921a5e227f4fcab2a6dd32e..9978e5e5a831582bb6328cb80355e953f7206088 100644 (file)
@@ -32,7 +32,7 @@ class FormClosedException extends FrameworkException {
         */
        public function __construct (array $classArray, $code) {
                // Add a message around the missing class
-               $message = sprintf("[%s:%d] Could not add form element <span id=\"exception_reason\">%s</span> because form is closed.",
+               $message = sprintf("[%s:%d] Could not add form element <span class=\"exception_reason\">%s</span> because form is closed.",
                        $classArray[0]->__toString(),
                        $this->getLine(),
                        $classArray[1]
index a1e88020cf9bb23a3d55c2ad1eb878f1b4308755..92a6e43896b538c871572c1e48eb0d732e82d4fc 100644 (file)
@@ -31,7 +31,7 @@ class FormGroupClosedException extends FrameworkException {
         */
        public function __construct (array $classArray, $code) {
                // Add a message around the missing class
-               $message = sprintf("[%s:%d] Could not add sub group <span id=\"exception_reason\">%s</span> because no form group has been opened before.",
+               $message = sprintf("[%s:%d] Could not add sub group <span class=\"exception_reason\">%s</span> because no form group has been opened before.",
                        $classArray[0]->__toString(),
                        $this->getLine(),
                        $classArray[1]
index 6c257c0b51b91b9b2e5b750f55494af820c67a10..b6b78f61d48118d3bbb4bb4e316ad1b7765c5cdf 100644 (file)
@@ -31,7 +31,7 @@ class HelperNoPreviousOpenedSubGroupException extends FrameworkException {
         */
        public function __construct (array $msgArray, $code) {
                // Add a message around the missing class
-               $message = sprintf("[%s:%d] Sub group not opened before. Raw text follows: <span id=\"exception_reason\">%s</span>",
+               $message = sprintf("[%s:%d] Sub group not opened before. Raw text follows: <span class=\"exception_reason\">%s</span>",
                        $msgArray[0]->__toString(),
                        $this->getLine(),
                        $msgArray[1]
index c650070d3c994f8315525d7a14f017763bbfcd5e..2946a8b51920fa9f7d67bde96a463e47ec5e70b0 100644 (file)
@@ -31,7 +31,7 @@ class NoGroupOpenedException extends FrameworkException {
         */
        public function __construct (array $msgArray, $code) {
                // Add a message around the missing class
-               $message = sprintf("[%s:%d] Group not opened before. Raw text follows: <span id=\"exception_reason\">%s</span>",
+               $message = sprintf("[%s:%d] Group not opened before. Raw text follows: <span class=\"exception_reason\">%s</span>",
                        $msgArray[0]->__toString(),
                        $this->getLine(),
                        $msgArray[1]
index e68e8f0f470c4931763cd246b2e30158f1562dba..218968bcfa300052660ef58b0dc53ef358437d67 100644 (file)
@@ -31,7 +31,7 @@ class UserInstanceMissingException extends FrameworkException {
         */
        public function __construct (array $classArray, $code) {
                // Add a message around the missing class
-               $message = sprintf("[%s:%d] Registry key <span id=\"exception_reason\">%s</span> does not include a class with implemented interface <u>Manageable(User|Guest)</u>.",
+               $message = sprintf("[%s:%d] Registry key <span class=\"exception_reason\">%s</span> does not include a class with implemented interface <u>Manageable(User|Guest)</u>.",
                        $classArray[0]->__toString(),
                        $this->getLine(),
                        $classArray[1]
index 6dc16a4c929ddc2a7214044e59eb3b02a7c98301..5b0293ee696546ad5985769d71b268fa405b2809 100644 (file)
@@ -31,7 +31,7 @@ class DirPointerNotOpenedException extends FrameworkException {
         */
        public function __construct ($path, $code) {
                // Add a message around the missing class
-               $message = sprintf("F&uuml;r den Pfad <span id=\"exception_reason\">%s</span> konnte kein Pointer initialisiert werden.", $path);
+               $message = sprintf("F&uuml;r den Pfad <span class=\"exception_reason\">%s</span> konnte kein Pointer initialisiert werden.", $path);
 
                // Call parent constructor
                parent::__construct($message, $code);
index a0719448b891ce45656b8d34e1d955e7f2911eca..ea31a49f3315cfb2347373ceed7b1fba20de593d 100644 (file)
@@ -7,7 +7,9 @@
  * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
- * 
+ * @todo               Rename this class to FileIoException
+ * @deprecated
+ *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation, either version 3 of the License, or
@@ -31,7 +33,7 @@ class FileNotFoundException extends FrameworkException {
         */
        public function __construct ($fqfn, $code) {
                // Add a message around the missing class
-               $message = sprintf("The requested file <span id=\"exception_reason\">%s</span> was not found.",
+               $message = sprintf("The requested file <span class=\"exception_reason\">%s</span> was not found.",
                        $fqfn
                );
 
index e7e8bde8f61f58a2822346c4ae3e127ce3f500ef..37300a52cff14f60baffeaefec365ea4d6cf7f66 100644 (file)
@@ -31,7 +31,7 @@ class FilePointerNotOpenedException extends FrameworkException {
         */
        public function __construct ($fqfn, $code) {
                // Add a message around the missing class
-               $message = sprintf("Not able to initialize a pointer for the file <span id=\"exception_reason\">%s</span>. Maybe the file is missing.", $fqfn);
+               $message = sprintf("Not able to initialize a pointer for the file <span class=\"exception_reason\">%s</span>. Maybe the file is missing.", $fqfn);
 
                // Call parent constructor
                parent::__construct($message, $code);
index f68aebe384b107bdaa2469da281808b137f42c33..4e8a0e667b5c22af712f03a4fe948ad256f07fd7 100644 (file)
@@ -31,7 +31,7 @@ class FileReadProtectedException extends FrameworkException {
         */
        public function __construct ($fileName, $code) {
                // Add a message around the missing class
-               $message = sprintf("File <span id=\"exception_reason\">%s</span> is read-protected. Please set read access rights (CHMOD).", $fileName);
+               $message = sprintf("File <span class=\"exception_reason\">%s</span> is read-protected. Please set read access rights (CHMOD).", $fileName);
 
                // Call parent constructor
                parent::__construct($message, $code);
index 47fd5fbcc29b510547dfe10e612cfa5dfda186c0..a1ef85ad25b0b59808cefac60e172b88fc7105c9 100644 (file)
@@ -31,7 +31,7 @@ class InvalidDataLengthException extends FrameworkException {
         */
        public function __construct (array $msgArray, $code) {
                // Add a message around the missing class
-               $message = sprintf("[%s:%d] Eine unerwartete Datenl&auml;nge von <span id=\"exception_reason\">%s</span> Byte ist aufgetreten. <span id=\"exception_reason\">%s</span> wurden erwartet!",
+               $message = sprintf("[%s:%d] Eine unerwartete Datenl&auml;nge von <span class=\"exception_reason\">%s</span> Byte ist aufgetreten. <span class=\"exception_reason\">%s</span> wurden erwartet!",
                        $msgArray[0]->__toString(),
                        $this->getLine(),
                        $msgArray[1],
index 26a1270a06732f91e22efb13a3cb96b48bdf72b9..2e5104a0d8478538e1fcca738122e6387ce5abfe 100644 (file)
@@ -31,7 +31,7 @@ class InvalidMD5ChecksumException extends FrameworkException {
         */
        public function __construct (array $msgArray, $code) {
                // Add a message around the missing class
-               $message = sprintf("[%s:%d] Die MD5-Pr&uuml;fsummen <span id=\"exception_reason\">%s</span> und <span id=\"exception_reason\">%s</span> stimmen nicht &uuml;berein!",
+               $message = sprintf("[%s:%d] Die MD5-Pr&uuml;fsummen <span class=\"exception_reason\">%s</span> und <span class=\"exception_reason\">%s</span> stimmen nicht &uuml;berein!",
                        $msgArray[0]->__toString(),
                        $this->getLine(),
                        $msgArray[1],
index 51222ebc458143921abb1821673969e112cfb119..7f908b108596fe0c7a0baf945ad29efe29f6a244 100644 (file)
@@ -31,7 +31,7 @@ class PathIsNoDirectoryException extends FrameworkException {
         */
        public function __construct ($path, $code) {
                // Add a message around the missing class
-               $message = sprintf("Der angegebene Pfad <span id=\"exception_reason\">%s</span> ist ung&uuml;tig (kein Pfad).", $path);
+               $message = sprintf("Der angegebene Pfad <span class=\"exception_reason\">%s</span> ist ung&uuml;tig (kein Pfad).", $path);
 
                // Call parent constructor
                parent::__construct($message, $code);
index 09fed2bf781c27b98b68446ca61b1ac63a1d29b8..b5dd9355d530e2f3d064aa218360d09b3b220fc8 100644 (file)
@@ -31,7 +31,7 @@ class PathReadProtectedException extends FrameworkException {
         */
        public function __construct ($path, $code) {
                // Add a message around the missing class
-               $message = sprintf("Der Pfad <span id=\"exception_reason\">%s</span> ist lese-gesch&uuml;tzt. Bitte Zugriffsrechte (CHMOD) zum Lesen setzen.", $path);
+               $message = sprintf("Der Pfad <span class=\"exception_reason\">%s</span> ist lese-gesch&uuml;tzt. Bitte Zugriffsrechte (CHMOD) zum Lesen setzen.", $path);
 
                // Call parent constructor
                parent::__construct($message, $code);
index 9265b3391797933f9c99d9afa4b28e6e20ba54ac..19be0cdcf9cd79adf55e6dfdae93513477d756aa 100644 (file)
@@ -31,7 +31,7 @@ class InvalidLanguagePathStringException extends FrameworkException {
         */
        public function __construct (array $classArray, $code) {
                // Add a message around the missing class
-               $message = sprintf("[%s:%d] <span id=\"exception_reason\">%s</span> is not a string with path!",
+               $message = sprintf("[%s:%d] <span class=\"exception_reason\">%s</span> is not a string with path!",
                        $classArray[0]->__toString(),
                        $this->getLine(),
                        $classArray[1]
index 858e73730478962e579ca7a647061d970b0e61a9..b17823d201ea28e71a89dae43b36736b6e8a8048 100644 (file)
@@ -31,7 +31,7 @@ class LanguagePathIsNoDirectoryException extends FrameworkException {
         */
        public function __construct (array $classArray, $code) {
                // Add a message around the missing class
-               $message = sprintf("[%s:%d] Der Sprach-Basispfad <span id=\"exception_reason\">%s</span> existiert nicht oder ist eine Datei!",
+               $message = sprintf("[%s:%d] Der Sprach-Basispfad <span class=\"exception_reason\">%s</span> existiert nicht oder ist eine Datei!",
                        $classArray[0]->__toString(),
                        $this->getLine(),
                        $classArray[1]
index 2fc786696ddbb00cd07da7fb1964e0a19aa8d1e6..0938f77866fd4ba963b83c06c2cf35bae4a06c1e 100644 (file)
@@ -31,7 +31,7 @@ class LanguagePathReadProtectedException extends FrameworkException {
         */
        public function __construct (array $classArray, $code) {
                // Add a message around the missing class
-               $message = sprintf("[%s:%d] Base language path <span id=\"exception_reason\">%s</span> is read-protected. Please change access rights (CHMOD).",
+               $message = sprintf("[%s:%d] Base language path <span class=\"exception_reason\">%s</span> is read-protected. Please change access rights (CHMOD).",
                        $classArray[0]->__toString(),
                        $this->getLine(),
                        $classArray[1]
index 32499e3e088b8f83f6593ed69d9922164432300c..51497b46a69b04773aeef7d7c44872f5797ca39c 100644 (file)
@@ -31,7 +31,7 @@ class ClassMismatchException extends FrameworkException {
         */
        public function __construct (array $classArray, $code) {
                // Add a message around the missing class
-               $message = sprintf("The class <span id=\"exception_reason\">%s</span> does not match class <span id=\"exception_reason\">%s</span>.",
+               $message = sprintf("The class <span class=\"exception_reason\">%s</span> does not match class <span class=\"exception_reason\">%s</span>.",
                        $classArray[0],
                        $classArray[1]
                );
index 29f13f24bc75f2eb5b794a9ef5eab9f1dbcbe32d..3a7b995cf00a213049ce14da8223521d0aa6d75a 100644 (file)
@@ -7,7 +7,9 @@
  * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
- * 
+ * @todo               Rename this class to NoClassException
+ * @deprecated
+ *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation, either version 3 of the License, or
@@ -31,7 +33,7 @@ class ClassNotFoundException extends FrameworkException {
         */
        public function __construct (array $msgArray, $code) {
                // Add a message around the missing class
-               $message = sprintf("[%s:%d] Internal class <span id=\"exception_reason\">%s</span> not found.",
+               $message = sprintf("[%s:%d] Internal class <span class=\"exception_reason\">%s</span> not found.",
                        $msgArray[0]->__toString(),
                        $this->getLine(),
                        $msgArray[1]
index e4ec1b7737dab39054240332303db18337d05afb..76be0f13700803e29e92991642361b32d1229c85 100644 (file)
@@ -7,7 +7,9 @@
  * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
- * 
+ * @todo               Rename this class to NoFoundEntryException
+ * @deprecated
+ *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation, either version 3 of the License, or
@@ -31,7 +33,7 @@ class ConfigEntryNotFoundException extends FrameworkException {
         */
        public function __construct (array $classArray, $code) {
                // Add a message around the missing class
-               $message = sprintf("[%s:%d] Configuration entry <span id=\"exception_reason\">%s</span> not found.",
+               $message = sprintf("[%s:%d] Configuration entry <span class=\"exception_reason\">%s</span> not found.",
                        $classArray[0],
                        $this->getLine(),
                        $classArray[1]
index 7806f9b81e6b9e3ea2baa5e3eb4e768bf3ff4284..1e11cceb2bbe7b984e575d4e554f4ba4cf1ab464 100644 (file)
@@ -38,7 +38,7 @@ class DimNotFoundInArrayException extends FrameworkException {
                        );
                } else {
                        // No class given
-                       $message = sprintf("Please provide a class for <span id=\"exception_reason\">%s</span>", __CLASS__);
+                       $message = sprintf("Please provide a class for <span class=\"exception_reason\">%s</span>", __CLASS__);
                }
 
                // Call parent constructor
index 1fae65454c27e0b4692e1e20248668b571c065b3..188969cff68c7cc2bc810dba4b85f9316bb4fb94 100644 (file)
@@ -31,7 +31,7 @@ class EmptyVariableException extends FrameworkException {
         */
        public function __construct (array $msgArray, $code) {
                // Add a message around the missing class
-               $message = sprintf("[%s:%d] Variable <span id=\"exception_reason\">%s</span> is not set.",
+               $message = sprintf("[%s:%d] Variable <span class=\"exception_reason\">%s</span> is not set.",
                        $msgArray[0]->__toString(),
                        $this->getLine(),
                        $msgArray[1]
index d3b37c8a4f181858bd6f3d9e3c70f2ece2d21c5a..42dc611e3521a4084b77fe8c488246889362e6be 100644 (file)
@@ -7,7 +7,9 @@
  * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
- * 
+ * @todo               Is this exception still needed???
+ * @deprecated
+ *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation, either version 3 of the License, or
@@ -31,7 +33,7 @@ class ExceptionNotFoundException extends FrameworkException {
         */
        public function __construct (array $classArray, $code) {
                // Add a message around the missing class
-               $message = sprintf("[%s:%d] Exception <span id=\"exception_reason\">%s</span> not found.",
+               $message = sprintf("[%s:%d] Exception <span class=\"exception_reason\">%s</span> not found.",
                        $classArray[0],
                        $this->getLine(),
                        $classArray[1]
index 5291b059466ee0519e969100bbd8ddbab24c901d..9a918c3e6a92ce4f72f75e9d9b6f6c03ff25cbfb 100644 (file)
@@ -7,7 +7,9 @@
  * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
- * 
+ * @todo               This class is no longer needed!
+ * @deprecated
+ *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation, either version 3 of the License, or
@@ -29,12 +31,9 @@ class GetterNotFoundException extends FrameworkException {
         * @param       $code           Code number for the exception
         * @return      void
         */
-       public function __construct ($dataArray, $code) {
-               // Cast the array
-               $dataArray = (array) $dataArray;
-
+       public function __construct (array $dataArray, $code) {
                // Add a message around the missing class
-               $message = sprintf("[%s:%d] Getter-Methode f&uuml;r Attribut <span id=\"exception_reason\">%s</span> nicht gefunden.",
+               $message = sprintf("[%s:%d] Getter-Methode f&uuml;r Attribut <span class=\"exception_reason\">%s</span> nicht gefunden.",
                        $dataArray[0]->__toString(),
                        $this->getLine(),
                        $dataArray[1]
index a85bebfc90c14173ae9bf72fe68fe337df00bf66..3703f1ad1ee090467ee7e9c47363c881bce035d4 100644 (file)
@@ -31,7 +31,7 @@ class InvalidArrayCountException extends FrameworkException {
         */
        public function __construct (array $array, $code) {
                // Add a message around the missing class
-               $message = sprintf("[%s:%d] <span id=\"exception_reason\">%s</span> hat <u>%d</u> Elemente, soll aber <u>%d</u> enthalten!",
+               $message = sprintf("[%s:%d] <span class=\"exception_reason\">%s</span> hat <u>%d</u> Elemente, soll aber <u>%d</u> enthalten!",
                        $array[0]->__toString(),
                        $this->getLine(),
                        $array[1],
index d546cc1e27822b39d747b053022dd683cd85685f..d55a167f90963b7a1a4dd1e81af171d620f1c3b3 100644 (file)
@@ -31,7 +31,7 @@ class InvalidCommandException extends FrameworkException {
         */
        public function __construct (array $msgArray, $code) {
                // Add a message around the missing class
-               $message = sprintf("[%s:%d] Invalid command <span id=\"exception_reason\">%s (class %s)</span> detected.",
+               $message = sprintf("[%s:%d] Invalid command <span class=\"exception_reason\">%s (class %s)</span> detected.",
                        $msgArray[0]->__toString(),
                        $this->getLine(),
                        $msgArray[1],
index 93cc03a560435fc16fe934ea02909a1f7ac581e3..34a4d2495d386db94482c3a58e5e0ddcfe2313bd 100644 (file)
@@ -31,7 +31,7 @@ class InvalidCommandInstanceException extends FrameworkException {
         */
        public function __construct (array $msgArray, $code) {
                // Add a message around the missing class
-               $message = sprintf("[%s:%d] Invalid command <span id=\"exception_reason\">%s</span> detected.",
+               $message = sprintf("[%s:%d] Invalid command <span class=\"exception_reason\">%s</span> detected.",
                        $msgArray[0]->__toString(),
                        $this->getLine(),
                        $msgArray[1]
index a7fc71e4d5d75fed5520cf91a5087ff711b2901c..93958ed29eb9e581358492de873a36a25ca1d2dc 100644 (file)
@@ -31,7 +31,7 @@ class InvalidInterfaceException extends FrameworkException {
         */
        public function __construct (array $classArray, $code) {
                // Add a message around the missing class
-               $message = sprintf("[%s:%d] Object does not implement expected interface <span id=\"exception_reason\">.",
+               $message = sprintf("[%s:%d] Object does not implement expected interface <span class=\"exception_reason\">%s</span>.",
                        $classArray[0]->__toString(),
                        $this->getLine(),
                        $classArray[1]
index a59b514329a6312439c6d916cf334ac9b9b2d7cb..5c3547bc2277a3582645bf39e7060f2737a2da1e 100644 (file)
@@ -41,7 +41,7 @@ class MissingArrayElementsException extends FrameworkException {
                }
 
                // Add a message around the missing class
-               $message = sprintf("[%s:%d] Array <u>%s()</u> Does not have these elements: <span id=\"exception_reason\">%s</span>",
+               $message = sprintf("[%s:%d] Array <u>%s()</u> Does not have these elements: <span class=\"exception_reason\">%s</span>",
                        $classArray[0]->__toString(),
                        $this->getLine(),
                        $classArray[1],
index 36dcbba9961482898bd144e9843e4deef3c5877a..77072fa46c4095ba3492c8d23e74040ee306d7a8 100644 (file)
@@ -7,6 +7,8 @@
  * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
+ * @todo               This class is no longer needed
+ * @deprecated
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -31,7 +33,7 @@ class NoArrayCreatedException extends FrameworkException {
         */
        public function __construct (array $array, $code) {
                // Add a message around the missing class
-               $message = sprintf("[%s:%d] <span id=\"exception_reason\">%s</span> ist kein erstelltes Objekt.",
+               $message = sprintf("[%s:%d] <span class=\"exception_reason\">%s</span> ist kein erstelltes Objekt.",
                        $array[0]->__toString(),
                        $this->getLine(),
                        $array[1]
index 2f0c557b761e822e6b4457f1647dbd4768745987..30d312f15ee8f1f952328e219767f770e30881ec 100644 (file)
@@ -29,7 +29,7 @@ class NoArrayException extends FrameworkException {
         */
        public function __construct ($string, $code) {
                // Add a message around the missing class
-               $message = sprintf("<span id=\"exception_reason\">%s</span> ist kein Array!",
+               $message = sprintf("<span class=\"exception_reason\">%s</span> ist kein Array!",
                        $string
                );
 
index 20f6870f408706bc15e8e15a75294ff576e5b67e..541b849889977010daef4b8d054a3f925e04abb5 100644 (file)
@@ -33,7 +33,7 @@ class NoObjectException extends FrameworkException {
         */
        public function __construct ($string, $code) {
                // Add a message around the missing class
-               $message = sprintf("<span id=\"exception_reason\">%s</span> ist kein Objekt!",
+               $message = sprintf("<span class=\"exception_reason\">%s</span> ist kein Objekt!",
                        $string
                );
 
index 57000be1e3c7b4150a4744831e0438622ce505aa..ddcad580339ff6d5acb37e3292899cb1a7260345 100644 (file)
@@ -31,7 +31,7 @@ class VariableIsNotSetException extends FrameworkException {
         */
        public function __construct (array $array, $code) {
                // Add a message around the missing class
-               $message = sprintf("[%s:%d] Bei der Initialisierung der Applikation <span id=\"exception_reason\">%s</span> wurde keine Variable <span id=\"exception_reason\">%s</span> erzeugt.",
+               $message = sprintf("[%s:%d] Bei der Initialisierung der Applikation <span class=\"exception_reason\">%s</span> wurde keine Variable <span class=\"exception_reason\">%s</span> erzeugt.",
                        $array[0]->__toString(),
                        $this->getLine(),
                        $array[1],
index be1ab5d37e4ee0c97fd064ac852a02274005eb84..762eb8265818b660eb127ea365f5f6d1b370c5e0 100644 (file)
@@ -31,7 +31,7 @@ class InvalidDatabaseResultException extends FrameworkException {
         */
        public function __construct(array $msgArray, $code) {
                // Construct the message
-               $message = sprintf("[%s:%d] Database instance <span id=\"exception_reason\">%s</span> contains invalid entries.",
+               $message = sprintf("[%s:%d] Database instance <span class=\"exception_reason\">%s</span> contains invalid entries.",
                        $msgArray[0]->__toString(),
                        $this->getLine(),
                        $msgArray[1]->__toString()
index da2ec8f5f4425e110a952b4229884f93d80a7717..e58ab045c5347772a8924040fbd25ed1ca67ab23 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * An exception thrown if the result was not updated
+ * An exception thrown if result was not updated.
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
index 5a109fb6a04645137d935dce32eb4b2d5e4552ae..04d510a05becde4af1a4c401ac9b0fc098702253 100644 (file)
@@ -31,7 +31,7 @@ class BasePathIsNoDirectoryException extends FrameworkException {
         */
        public function __construct (array $classArray, $code) {
                // Add a message around the missing class
-               $message = sprintf("[%s:%d] Der Template-Basispfad <span id=\"exception_reason\">%s</span> existiert nicht oder ist eine Datei!",
+               $message = sprintf("[%s:%d] Der Template-Basispfad <span class=\"exception_reason\">%s</span> existiert nicht oder ist eine Datei!",
                        $classArray[0]->__toString(),
                        $this->getLine(),
                        $classArray[1]
index c66fd7b29102ddb23fa30566bd94103774750525..6a4d956e584e67cc0bb699cfbf2a8c5fe7f9b387 100644 (file)
@@ -31,7 +31,7 @@ class BasePathReadProtectedException extends FrameworkException {
         */
        public function __construct (array $classArray, $code) {
                // Add a message around the missing class
-               $message = sprintf("[%s:%d] Der Template-Basispfad <span id=\"exception_reason\">%s</span> ist lesegesch&uuml;tzt! Bitte Zugriffsrechte (CHMOD) &auml;ndern.",
+               $message = sprintf("[%s:%d] Der Template-Basispfad <span class=\"exception_reason\">%s</span> ist lesegesch&uuml;tzt! Bitte Zugriffsrechte (CHMOD) &auml;ndern.",
                        $classArray[0]->__toString(),
                        $this->getLine(),
                        $classArray[1]
index c52a5847bf2234d2babed19591e6fcd729c78e39..93f875e97e74cce0578774ca12c0510c2d8ab6f8 100644 (file)
@@ -31,7 +31,7 @@ class InvalidBasePathStringException extends FrameworkException {
         */
        public function __construct (array $classArray, $code) {
                // Add a message around the missing class
-               $message = sprintf("[%s:%d] <span id=\"exception_reason\">%s</span> is not a string with a base path!",
+               $message = sprintf("[%s:%d] <span class=\"exception_reason\">%s</span> is not a string with a base path!",
                        $classArray[0]->__toString(),
                        $this->getLine(),
                        $classArray[1]
index 9a7eb05568e803bb32e0c9284f8456d4571290ef..9394348aabcca5a7431c38836f13eb5f3dfb9296 100644 (file)
@@ -31,7 +31,7 @@ class UnexpectedTemplateTypeException extends FrameworkException {
         */
        public function __construct (array $msgArray, $code) {
                // Add a message around the missing class
-               $message = sprintf("[%s:%d] Der Template-Typ <span id=\"exception_reason\">%s</span> entspricht nicht dem erwartetem Template-Typ <span id=\"exception_reason\">%s</span>.",
+               $message = sprintf("[%s:%d] Der Template-Typ <span class=\"exception_reason\">%s</span> entspricht nicht dem erwartetem Template-Typ <span class=\"exception_reason\">%s</span>.",
                        $msgArray[0]->__toString(),
                        $this->getLine(),
                        $msgArray[1],
index 0af17cd21ac89a1e1cde21f9a6cf0c55000b487f..37b33427deb643b5d12474b6513ae06e1996533f 100644 (file)
@@ -7,6 +7,8 @@
  * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
+ * @todo               Rename this class to NoViewHelperException
+ * @deprecated
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -31,7 +33,7 @@ class ViewHelperNotFoundException extends FrameworkException {
         */
        public function __construct (array $msgArray, $code) {
                // Add a message around the missing class
-               $message = sprintf("[%s:] View-Helper <span id=\"exception_reason\">%s</span> ist ung&uuml;ltig.",
+               $message = sprintf("[%s:] View-Helper <span class=\"exception_reason\">%s</span> ist ung&uuml;ltig.",
                        $msgArray[0]->__toString(),
                        $msgArray[1]
                );
index 27dbf51b1f245bbf3421ff263614f13c9fd4f842..dcef3708c4e8c03da336976759b8137cf3e415a7 100644 (file)
@@ -31,7 +31,7 @@ class UserEmailMissingException extends FrameworkException {
         */
        public function __construct(array $msgArray, $code = 0) {
                // Create the message
-               $message = sprintf("[%s:%d] User email <span id=\"exception_reason\">%s</span> was not found.",
+               $message = sprintf("[%s:%d] User email <span class=\"exception_reason\">%s</span> was not found.",
                        $msgArray[0]->__toString(),
                        $this->getLine(),
                        $msgArray[1]
index a5184b37c0eeebf1eeb4f0033437729b43c8c470..0457930784e51133664d4c4a314a8b5b245b6074 100644 (file)
@@ -31,7 +31,7 @@ class UserPasswordMismatchException extends FrameworkException {
         */
        public function __construct(array $msgArray, $code = 0) {
                // Create the message
-               $message = sprintf("[%s:%d] Supplied password for user <span id=\"exception_reason\">%s</span> did not match with stored password.",
+               $message = sprintf("[%s:%d] Supplied password for user <span class=\"exception_reason\">%s</span> did not match with stored password.",
                        $msgArray[0]->__toString(),
                        $this->getLine(),
                        $msgArray[1]->getUserName()
index 0ab7e9e5470ddd7493b234b7d17af15c61b7e6ad..9f5e52dd0f71d8d3e6784ac2431d71676716cc6b 100644 (file)
@@ -31,7 +31,7 @@ class UsernameMissingException extends FrameworkException {
         */
        public function __construct(array $msgArray, $code = 0) {
                // Create the message
-               $message = sprintf("[%s:%d] Username <span id=\"exception_reason\">%s</span> was not found.",
+               $message = sprintf("[%s:%d] Username <span class=\"exception_reason\">%s</span> was not found.",
                        $msgArray[0]->__toString(),
                        $this->getLine(),
                        $msgArray[1]
index 3d6f600006866c9308d21aa4d641b0865a9b647e..9bb607587d9ee0b9e212714f0cab056ce885a3f4 100644 (file)
@@ -25,8 +25,8 @@ interface Cryptable extends FrameworkInterface {
        /**
         * Hashes a string with salt and returns the hash. If an old previous hash
         * is supplied the method will use the first X chars of that hash for hashing
-        * the password. This is useful if you want to check if the password is
-        * identical for authorization purposes.
+        * the password. This is useful if you want to check if password is identical
+        * for authorization purposes.
         *
         * @param       $str            Unhashed string
         * @param       $oldHash        A hash from previous hashed string
index aa29b1acb047ad1f09793f2f0dc3102cbbf29383..cc15f8e244d7d7d91f6505a0bc13b34b530eead2 100644 (file)
@@ -23,8 +23,8 @@
  */
 interface UserRegister extends FrameworkInterface {
        /**
-        * Encrypt the given request key or throws an exception if the key was not
-        * found in the request
+        * Encrypt given request key or throws an exception if key was not found in
+        * request.
         *
         * @param       $requestKey             Key in request class
         * @return      void
index 37da8761893c5a5a9c9a6a6faf32adec0b20ac3e..d59051f39215af151e0da364500898b2baab252f 100644 (file)
@@ -25,8 +25,8 @@ interface Register extends FrameworkInterface {
        /**
         * Checks wether an instance key was found
         *
-        * @param       $instanceKey    The key holding an instance in the registry
-        * @return      $exists                 Wether the key exists in the registry
+        * @param       $instanceKey    The key holding an instance in registry
+        * @return      $exists                 Wether the key exists in registry
         */
        function instanceExists ($instanceKey);
 
index 5be733c818327fd758cc726ffb3db0bc6579e5ef..e5f9fa641b9ae50a0bc5e222b00b91a4541c19de 100644 (file)
@@ -40,7 +40,7 @@ interface Requestable extends FrameworkInterface {
        function isRequestElementSet ($element);
 
        /**
-        * Getter for request element or 'null' if the element was not found
+        * Getter for request element or 'null' if element was not found
         *
         * @param       $element        Name of the request element we want to check
         * @return      $value          Value of the found request element or 'null' if the
@@ -56,7 +56,7 @@ interface Requestable extends FrameworkInterface {
        function getParameterNames ();
 
        /**
-        * Getter for a header element or 'null' if the header was not found
+        * Getter for a header element or 'null' if header was not found
         *
         * @param       $headerName             Name of the header
         * @return      $headerValue    Value of the header or 'null' if not found
index 956d2b8cc2f84620495e53615b7e5f196295ec3d..7a12f3d0c94518c8fc626b33bc2eaf3307d120a8 100644 (file)
@@ -42,7 +42,7 @@ interface ActionResolver extends Resolver {
         *
         * @param       $actionName             The default action we shall execute
         * @return      $isValid                Wether the given action is valid
-        * @throws      EmptyVariableException  Thrown if the given action is not set
+        * @throws      EmptyVariableException  Thrown if given action is not set
         */
        function isActionValid ($actionName);
 }
index dd2ff064182896331a52777a7c0ed00002bf1441..d7f3976a655a752f1ed473d3bee73b213d00ca0e 100644 (file)
@@ -35,7 +35,7 @@ interface CommandResolver extends Resolver {
         *
         * @param       $commandName    The default command we shall execute
         * @return      $isValid                Wether the given command is valid
-        * @throws      EmptyVariableException  Thrown if the given command is not set
+        * @throws      EmptyVariableException  Thrown if given command is not set
         */
        function isCommandValid ($commandName);
 }
index c2c78239e0c7d3c4d6b8ddf038694dc98b992f7c..c3bf26bf764ca256ef605401d06b4ce2617a4cc0 100644 (file)
@@ -29,6 +29,15 @@ interface SearchableResult extends FrameworkInterface {
         * @return      $result                         Found result entry
         */
        function searchEntry (LocalSearchCriteria $criteriaInstance);
+
+       /**
+        * Solver for result index value with call-back method
+        *
+        * @param       $databaseColumn         Database column where the index might be found
+        * @para        $callBack                       Call-back object for setting the index
+        * @return      void
+        */
+       function solveResultIndex ($databaseColumn, BaseDatabaseWrapper $wrapperInstance, array $callBack);
 }
 
 // [EOF]
index 3e88853898be460170b5506a1655e807d507b61e..2dd07067be760c533a928f945b95cec21a880295 100644 (file)
@@ -37,8 +37,8 @@ interface ManageableAccount extends FrameworkInterface {
        function ifEmailAddressExists ();
 
        /**
-        * Checks if the supplied password hash in request matches with the stored
-        * in database.
+        * Checks if supplied password hash in request matches with stored in
+        * database.
         *
         * @param       $requestInstance        A requestable class instance
         * @return      $matches                        Wether the supplied password hash matches
index 0b2cd81865c9eb044f01d8a4ca2a023199ca80f0..a2b1665bb200983936a2532a192828b221e72576 100644 (file)
@@ -1,6 +1,8 @@
 <?php
 /**
- * A general action class
+ * A general action class. You shall extend this class if you are going to write
+ * your own action classes even when this class has no real content in it. We
+ * just handle the removal of some attributed here which you really don't need.
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
index 068090ed36a7bb800e6660a8c4c40bd34639c3bd..15fd499af9c85d75ec7bc9931f9dbcb35c535212 100644 (file)
@@ -63,7 +63,11 @@ class LoginAfterRegistrationAction extends BaseAction implements PerformableActi
                if ($loginInstance->ifLoginWasSuccessfull()) {
                        // Try to redirect here
                        try {
+                               // Redirect...
                                $responseInstance->redirectToConfiguredUrl('app_login_url');
+
+                               // Stop here
+                               exit();
                        } catch (FrameworkException $e) {
                                // Something went wrong here!
                                $responseInstance->addFatalMessage($e->getMessage());
index 3ed47c0a8d062c6dcc1a762670463f5b1f401d04..09998865be0672c674fd4481a9c875a510b83e37 100644 (file)
@@ -69,7 +69,7 @@ class WebLoginProfileAction extends BaseAction implements Commandable, Registera
         */
        public function addExtraFilters (Controller $controllerInstance, Requestable $requestInstance) {
                // Add user status filter here
-               $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_status_class'));
+               $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_status_filter', array($controllerInstance)));
        }
 }
 
index 840519d37fb3523c5c1c8bbdc02d7b0448f8542d..7e0dfd0014034b76dbe49dca186362131d551b2b 100644 (file)
@@ -82,7 +82,7 @@ class MemoryCache extends BaseFrameworkSystem implements Cacheable {
         * Setter for cache offset
         *
         * @param       $offset         The offset we shall set
-        * @param       $data           Data to store in the cache
+        * @param       $data           Data to store in cache
         * @return      void
         */
        public final function offsetSet ($offset, $data) {
@@ -93,7 +93,7 @@ class MemoryCache extends BaseFrameworkSystem implements Cacheable {
         * Getter for cache offset or "null" if not found
         *
         * @param       $offset         The offset we shall set
-        * @return      $data           Data to store in the cache
+        * @return      $data           Data to store in cache
         */
        public final function offsetGet ($offset) {
                // Default is offset not found
index 7e461ac820071fde42e846ae1b7f2e79adf211be..d4eabd793f3564724250b78ec9e669c6f592b56e 100644 (file)
@@ -78,6 +78,11 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
         */
        private $userInstance = null;
 
+       /**
+        * A controller instance
+        */
+       private $controllerInstance = null;
+
        /**
         * The real class name
         */
@@ -192,8 +197,9 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
                // Set real class
                $this->setRealClass($className);
 
-               // Initialize the class if the registry is there
+               // Initialize the class if class Registry is there
                if ((class_exists('Registry')) && (Registry::isInitialized() === false)) {
+                       // Initialize the registry automatically
                        $this->initInstance();
                } // END - if
        }
@@ -211,7 +217,7 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
                        $this->setRealClass('DestructedObject');
                } elseif ((defined('DEBUG_DESTRUCTOR')) && (is_object($this->getDebugInstance()))) {
                        // Already destructed object
-                       $this->debugOutput(sprintf("[%s:] The object <strong>%s</strong> is already destroyed.",
+                       $this->debugOutput(sprintf("[%s:] The object <span class=\"object_name\">%s</span> is already destroyed.",
                                __CLASS__, $this->__toString()
                        ));
                }
@@ -269,6 +275,9 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
        private final function initInstance () {
                // Is this a system class?
                if (!in_array($this->__toString(), $this->systemClasses)) {
+                       // Set configuration instance
+                       $this->setConfigInstance(FrameworkConfiguration::getInstance());
+
                        // Add application helper to our class
                        $this->systemclasses[] = $this->getConfigInstance()->readConfig('app_helper_class');
 
@@ -289,7 +298,7 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
                        Registry::isInitialized('OK');
                } elseif ($this->__toString() == 'DebugMiddleware') {
                        // Set configuration instance
-                       $this->setConfigInstance(FrameworkConfiguration::createFrameworkConfiguration());
+                       $this->setConfigInstance(FrameworkConfiguration::getInstance());
                }
        }
 
@@ -571,6 +580,7 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
         * Stub method (only real cabins shall override it)
         *
         * @return      boolean false = is no cabin, true = is a cabin
+        * @deprecated
         */
        public function isCabin () {
                return false;
@@ -581,6 +591,7 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
         *
         * @return      boolean false = is not tradeable by the Merchant class,
         *                                      true  = is a tradeable object
+        * @deprecated
         */
        public function isTradeable () {
                return false;
@@ -743,14 +754,24 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
        /**
         * Debugs this instance by putting out it's full content
         *
+        * @param       $message        Optional message to show in debug output
         * @return      void
         */
-       public final function debugInstance () {
+       public final function debugInstance ($message = "") {
                // Restore the error handler to avoid trouble with missing array elements or undeclared variables
                restore_error_handler();
 
+               // Init content
+               $content = "";
+
+               // Is a message set?
+               if (!empty($message)) {
+                       // Construct message
+                       $content = sprintf("<div class=\"debug_message\">Message: %s</div>\n", $message);
+               } // END - if
+
                // Generate the output
-               $content = sprintf("<pre>%s</pre>",
+               $content .= sprintf("<pre>%s</pre>",
                        trim(
                                htmlentities(
                                        print_r($this, true)
@@ -759,7 +780,7 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
                );
 
                // Output it
-               ApplicationEntryPoint::app_die(sprintf("<strong>%s debug output:</strong><div id=\"debug_content\">%s</div>\nLoaded includes: <div id=\"debug_include_list\">%s</div>",
+               ApplicationEntryPoint::app_die(sprintf("<div class=\"debug_header\">%s debug output:</div><div class=\"debug_content\">%s</div>\nLoaded includes: <div class=\"debug_include_list\">%s</div>",
                        $this->__toString(),
                        $content,
                        ClassLoader::getInstance()->getPrintableIncludeList()
@@ -810,10 +831,10 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
         */
        public function debugBackTrace () {
                // Sorry, there is no other way getting this nice backtrace
-               print "<pre>\n";
+               print("<pre>\n");
                debug_print_backtrace();
-               print "</pre>";
-               exit;
+               print("</pre>");
+               exit();
        }
 
        /**
@@ -831,7 +852,7 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
                if (is_object($debugInstance)) {
                        // Use debug output handler
                        $debugInstance->output($message);
-                       if (!$doPrint) die(); // Die here if not printed
+                       if ($doPrint === false) die(); // Die here if not printed
                } else {
                        // Put directly out
                        if ($doPrint) {
@@ -966,7 +987,7 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
                $this->getResultInstance()->rewind();
 
                // Do we have an entry?
-               if (!$this->getResultInstance()->valid()) {
+               if ($this->getResultInstance()->valid() === false) {
                        throw new InvalidDatabaseResultException(array($this, $this->getResultInstance()), DatabaseResult::EXCEPTION_INVALID_DATABASE_RESULT);
                } // END - if
 
@@ -1031,6 +1052,25 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
        public final function getUserInstance () {
                return $this->userInstance;
        }
+
+       /**
+        * Setter for controller instance (this surely breaks a bit the MVC patterm)
+        *
+        * @param       $controllerInstance             An instance of the controller
+        * @return      void
+        */
+       public final function setControllerInstance (Controller $controllerInstance) {
+               $this->controllerInstance = $controllerInstance;
+       }
+
+       /**
+        * Getter for controller instance (this surely breaks a bit the MVC patterm)
+        *
+        * @return      $controllerInstance             An instance of the controller
+        */
+       public final function getControllerInstance () {
+               return $this->controllerInstance;
+       }
 }
 
 // [EOF]
index e7becaee4fa6b5149141001f8b8b031fab02bb93..167423cf5cfe485331bfb0e35195679c6ca200c2 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 /**
  * Class for saving arrays as an object. We need this little extension for
- * some common methods used in the whole application. Please see below if you
+ * some common methods used in whole application. Please see below if you
  * need more details.
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
index db15067cc0e8306c3f37da4ab7f06aa5f8074f81..ca44f8b619a91f4d2fb107b5e7241e397b7fecab 100644 (file)
@@ -109,7 +109,7 @@ class WebConfirmCommand extends BaseCommand implements Commandable {
                // these two calls to cache compiled templates.
                $templateInstance->compileVariables();
 
-               // Get the content back from the template engine and put it in the response class
+               // Get the content back from the template engine and put it in response class
                $templateInstance->transferToResponse($responseInstance);
        }
 
index 14a7a9c6ff69029d31875c0b292b043753500d7c..6aad8cfb7f91b926bd8e2b3476141d8e8e324356 100644 (file)
@@ -100,7 +100,7 @@ class WebHomeCommand extends BaseCommand implements Commandable {
                // these two calls to cache compiled templates.
                $templateInstance->compileVariables();
 
-               // Get the content back from the template engine and put it in the response class
+               // Get the content back from the template engine and put it in response class
                $templateInstance->transferToResponse($responseInstance);
        }
 
index 9f2c1cfa3390a2cf116b93569e205328ba2aabf3..749de17491a02c983d10bdf7ae17423844da1b83 100644 (file)
@@ -137,12 +137,12 @@ class WebLoginAreaCommand extends BaseCommand implements Commandable {
                // these two calls to cache compiled templates.
                $templateInstance->compileVariables();
 
-               // Get the content back from the template engine and put it in the response class
+               // Get the content back from the template engine and put it in response class
                $templateInstance->transferToResponse($responseInstance);
        }
 
        /**
-        * Adds extra filters to the given controller instance
+        * Adds extra filters to the given controller instance. An corresponding action class must now exist!
         *
         * @param       $controllerInstance             A controller instance
         * @param       $requestInstance                An instance of a class with an Requestable interface
@@ -152,8 +152,17 @@ class WebLoginAreaCommand extends BaseCommand implements Commandable {
                // Default is no action
                $actionInstance = null;
 
+               // Get registry
+               $registryInstance = Registry::getRegistry();
+
+               // Get our application instance from the registry
+               $appInstance = $registryInstance->getInstance('application');
+
                // Default action is the one from configuration
-               $this->actionName = sprintf("login_%s", $this->getConfigInstance()->readConfig('login_default_action'));
+               $this->actionName = sprintf("%s_login_%s",
+                       str_replace("-", "_", $appInstance->getAppShortName()),
+                       $this->getConfigInstance()->readConfig('login_default_action')
+               );
 
                // Get "action" from request
                $actReq = $requestInstance->getRequestElement('action');
@@ -161,28 +170,26 @@ class WebLoginAreaCommand extends BaseCommand implements Commandable {
                // Do we have a "action" parameter set?
                if ((is_string($actReq)) && (!empty($actReq))) {
                        // Then use it with prefix
-                       $this->actionName = sprintf("login_%s", $actReq);
+                       $this->actionName = sprintf("%s_login_%s",
+                               str_replace("-", "_", $appInstance->getAppShortName()),
+                               $actReq
+                       );
                } // END - if
 
                // Get application instance
                $applicationInstance = $this->getResolverInstance()->getApplicationInstance();
 
-               // Try to get an action resolver for the given action
-               try {
-                       // Get a resolver
-                       $actionResolver = WebActionResolver::createWebActionResolver($this->actionName, $applicationInstance);
+               // Get a resolver
+               $actionResolver = WebActionResolver::createWebActionResolver($this->actionName, $applicationInstance);
 
-                       // Resolve the action
-                       $actionInstance = $actionResolver->resolveAction();
+               // Resolve the action
+               $actionInstance = $actionResolver->resolveAction();
 
-                       // Add more action-specific filters
-                       $actionInstance->addExtraFilters($controllerInstance, $requestInstance);
+               // Add more action-specific filters
+               $actionInstance->addExtraFilters($controllerInstance, $requestInstance);
 
-                       // Remember this action in registry
-                       Registry::getRegistry()->addInstance('action', $actionInstance);
-               } catch (InvalidActionException $e) {
-                       // Silently ignored because no special action was found
-               }
+               // Remember this action in registry
+               Registry::getRegistry()->addInstance('action', $actionInstance);
        }
 }
 
index e02e2b5b8435dd1c0cec7e121cd9b3d2a9b7c918..9726e847897f836ebd31443cbfa97771a613f6b8 100644 (file)
@@ -103,7 +103,7 @@ class WebLoginCommand extends BaseCommand implements Commandable {
                // these two calls to cache compiled templates.
                $templateInstance->compileVariables();
 
-               // Get the content back from the template engine and put it in the response class
+               // Get the content back from the template engine and put it in response class
                $templateInstance->transferToResponse($responseInstance);
        }
 
index 7c74d7bd2735a999fe68dcf75743a5834f1b9c3d..f2b6b81017c1d6d68078a8b10f42acbe099436b4 100644 (file)
@@ -103,7 +103,7 @@ class WebLoginFailedCommand extends BaseCommand implements Commandable {
                // these two calls to cache compiled templates.
                $templateInstance->compileVariables();
 
-               // Get the content back from the template engine and put it in the response class
+               // Get the content back from the template engine and put it in response class
                $templateInstance->transferToResponse($responseInstance);
        }
 
index e220c51474da2cb6a783926a25a0e184e1ebe0e1..91a9d518d788934d1213bc0fcbd0c076e7107e5d 100644 (file)
@@ -68,6 +68,9 @@ class WebLogoutCommand extends BaseCommand implements Commandable {
 
                // Redirect to "logout done" page
                $responseInstance->redirectToConfiguredUrl('logout_done_url');
+
+               // Exit here
+               exit();
        }
 
        /**
index bbb7f2f702f93e2afe91c0a63dc9f62b7394af2c..8dfdee365d72be677b3365bcce3f2a77fbed74e4 100644 (file)
@@ -103,7 +103,7 @@ class WebLogoutDoneCommand extends BaseCommand implements Commandable {
                // these two calls to cache compiled templates.
                $templateInstance->compileVariables();
 
-               // Get the content back from the template engine and put it in the response class
+               // Get the content back from the template engine and put it in response class
                $templateInstance->transferToResponse($responseInstance);
        }
 
index 42f9379bb4d80ffc97131c4919a59006b40b1528..c23b6476ea84b27982ca5408ebdec5e8694d04bc 100644 (file)
@@ -107,7 +107,7 @@ class WebRegisterCommand extends BaseCommand implements Commandable, Registerabl
                // these two calls to cache compiled templates.
                $templateInstance->compileVariables();
 
-               // Get the content back from the template engine and put it in the response class
+               // Get the content back from the template engine and put it in response class
                $templateInstance->transferToResponse($responseInstance);
        }
 
index c6ba2a6c825fae30852167d326c488bc1f075ff4..c66a39b5963ee27dbb6afb4c99a76e3fa4311a5e 100644 (file)
@@ -134,7 +134,7 @@ class WebResendLinkCommand extends BaseCommand implements Commandable {
         */
        public function addExtraFilters (Controller $controllerInstance, Requestable $requestInstance) {
                // Filter for checking if account is unconfirmed
-               $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_unconfirmed_class'));
+               $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_unconfirmed_filter', array($controllerInstance)));
        }
 }
 
index 3b49f721685f3ce64e13ab9121f8d76eda3fba0f..d037d40494e9636d43ea1fd2d2d6dd0409224b3d 100644 (file)
@@ -50,7 +50,7 @@ class ConsoleTools extends BaseFrameworkSystem {
 
                        // Read the file
                        $hostname = trim($io->readFromFile());
-                       $helper->debugOutput(sprintf("[%s:] Our host name is: <strong>%s</strong>",
+                       $helper->debugOutput(sprintf("[%s:] Our host name is: <span class=\"data\">%s</span>",
                                $helper->__toString(),
                                $hostname
                        ));
@@ -65,7 +65,7 @@ class ConsoleTools extends BaseFrameworkSystem {
                                $ip = $ipResolved;
 
                                // Debug message
-                               $helper->debugOutput(sprintf("[%s:] Resolved IP address is: <strong>%s</strong>\n",
+                               $helper->debugOutput(sprintf("[%s:] Resolved IP address is: <span class=\"data\">%s</span>\n",
                                        $helper->__toString(),
                                        $ip
                                ));
index e84fca7a34d20cf73021acb3064d66d5229ebdde..64e1a1a5c7400b0f554f613a5ba4e6dfcd86dfb8 100644 (file)
@@ -46,7 +46,7 @@ class ImageCodeCaptchaController extends BaseController implements Controller {
                $controllerInstance->setResolverInstance($resolverInstance);
 
                // Add filter for checking the "encrypt" string
-               $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('captcha_encrypt_validator_class'));
+               $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('captcha_encrypt_validator_filter', array($controllerInstance)));
 
                // Return the prepared instance
                return $controllerInstance;
index 1c4d442f5aca51619ce255e8394867e3d39e1185..69fa4d154669961f2f8b39156ccfea78c1bfa20b 100644 (file)
  */
 class BaseController extends BaseFrameworkSystem implements Registerable {
        /**
-        * Pre filter chain instance
+        * Generic filter chains
         */
-       private $preFilterChain = null;
-
-       /**
-        * Post filter chain instance
-        */
-       private $postFilterChain = null;
+       private $filterChains = array();
 
        /**
         * Protected constructor
@@ -49,13 +44,23 @@ class BaseController extends BaseFrameworkSystem implements Registerable {
                $this->removeSystemArray();
 
                // Initialize both filter chains
-               $this->preFilterChain  = ObjectFactory::createObjectByConfiguredName('filter_chain_class');
-               $this->postFilterChain = ObjectFactory::createObjectByConfiguredName('filter_chain_class');
+               $this->initFilterChain('pre');
+               $this->initFilterChain('post');
 
                // Add this controller to the registry
                Registry::getRegistry()->addInstance('controller', $this);
        }
 
+       /**
+        * Private method to initialize a given filter chain
+        *
+        * @param       $filterChain    Name of the filter chain
+        * @return      void
+        */
+       private function initFilterChain ($filterChain) {
+               $this->filterChains[$filterChain] = ObjectFactory::createObjectByConfiguredName('filter_chain_class');
+       }
+
        /**
         * Adds a filter to the pre filter chain
         *
@@ -64,7 +69,7 @@ class BaseController extends BaseFrameworkSystem implements Registerable {
         */
        public function addPreFilter (Filterable $filterInstance) {
                // Add the pre filter
-               $this->preFilterChain->addFilter($filterInstance);
+               $this->filterChains['pre']->addFilter($filterInstance);
        }
 
        /**
@@ -75,7 +80,7 @@ class BaseController extends BaseFrameworkSystem implements Registerable {
         */
        public function addPostFilter (Filterable $filterInstance) {
                // Add the post filter
-               $this->postFilterChain->addFilter($filterInstance);
+               $this->filterChains['post']->addFilter($filterInstance);
        }
 
        /**
@@ -87,7 +92,7 @@ class BaseController extends BaseFrameworkSystem implements Registerable {
         */
        protected function executePreFilters (Requestable $requestInstance, Responseable $responseInstance) {
                // Execute all pre filters
-               $this->preFilterChain->processFilters($requestInstance, $responseInstance);
+               $this->filterChains['pre']->processFilters($requestInstance, $responseInstance);
        }
 
        /**
@@ -99,7 +104,7 @@ class BaseController extends BaseFrameworkSystem implements Registerable {
         */
        protected function executePostFilters (Requestable $requestInstance, Responseable $responseInstance) {
                // Execute all post filters
-               $this->postFilterChain->processFilters($requestInstance, $responseInstance);
+               $this->filterChains['post']->processFilters($requestInstance, $responseInstance);
        }
 }
 
index e760492fcbfa4b8dd3addb09320826f256836f5b..8691c3d29da2bbf80bb7688278126adc81e14e57 100644 (file)
@@ -45,7 +45,7 @@ class WebDoFormController extends BaseController implements Controller {
                // Set resolver instance
                $controllerInstance->setResolverInstance($resolverInstance);
 
-               // We need the controller instance in the resolver class so set it here
+               // We need the controller instance in resolver class so set it here
                $resolverInstance->setControllerInstance($controllerInstance);
 
                // Return the prepared instance
@@ -76,6 +76,9 @@ class WebDoFormController extends BaseController implements Controller {
                } catch (UserAuthorizationException $e) {
                        // Redirect to main page
                        $responseInstance->redirectToConfiguredUrl('login_failed_url');
+
+                       // Exit here
+                       exit();
                }
 
                // Is the request still valid? Post filters shall only be executed of
index 1a1900c3692c141fe04fb1a5ddb224542a84135f..0ad97f05cd9a7ab083e4c6ce6b3f15d07255c089 100644 (file)
@@ -37,6 +37,7 @@ class WebLoginAreaController extends BaseController implements Controller {
         *
         * @param       $resolverInstance               An instance of a command resolver class
         * @return      $controllerInstance             A prepared instance of this class
+        * @todo        Add some morer filters to this controller
         */
        public final static function createWebLoginAreaController (CommandResolver $resolverInstance) {
                // Create the instance
@@ -46,18 +47,16 @@ class WebLoginAreaController extends BaseController implements Controller {
                $controllerInstance->setResolverInstance($resolverInstance);
 
                // User auth filter
-               $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_auth_class'));
+               $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_auth_filter', array($controllerInstance)));
 
                // User update filter
-               $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_update_class'));
+               $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_update_filter', array($controllerInstance)));
 
                // News fetcher filter
-               $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('news_download_class'));
+               $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('news_download_filter', array($controllerInstance)));
 
                // News proccess/display-preparation
-               $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('news_process_class'));
-
-               /* @todo: Add some filters to this controller */
+               $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('news_process_filter', array($controllerInstance)));
 
                // Return the prepared instance
                return $controllerInstance;
@@ -84,6 +83,9 @@ class WebLoginAreaController extends BaseController implements Controller {
                } catch (UserAuthorizationException $e) {
                        // Redirect to main page
                        $responseInstance->redirectToConfiguredUrl('login_failed_url');
+
+                       // Exit here
+                       exit();
                }
 
                // This request was valid! :-D
index 64c845d01911ae57930e40b38cb2d92d62633ea0..ebdd15084cfe17c8785cc6d127ba13816cb25c4f 100644 (file)
@@ -47,10 +47,10 @@ class WebConfirmController extends BaseController implements Controller {
                $controllerInstance->setResolverInstance($resolverInstance);
 
                // Add filters for handling confirmation code and username
-               $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('username_verifier_class'));
-               $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_unconfirmed_class'));
-               $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('confirm_code_verifier_class'));
-               $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_status_confirmed_class'));
+               $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('username_verifier_filter', array($controllerInstance)));
+               $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_unconfirmed_filter', array($controllerInstance)));
+               $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('confirm_code_verifier_filter', array($controllerInstance)));
+               $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_status_confirmed_filter', array($controllerInstance)));
 
                // Return the prepared instance
                return $controllerInstance;
index 1f6c0cc28a69f3988f70f1bfb5904464b9f56fd3..8d7255d0205404e37468c7c7b61f41ddf4ca35a9 100644 (file)
@@ -46,8 +46,8 @@ class WebDefaultNewsController extends BaseController implements Controller {
                $controllerInstance->setResolverInstance($resolverInstance);
 
                // Add news filters to this controller
-               $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('news_download_class'));
-               $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('news_process_class'));
+               $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('news_download_filter', array($controllerInstance)));
+               $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('news_process_filter', array($controllerInstance)));
 
                // Return the prepared instance
                return $controllerInstance;
index 00b020a1df617047b3f646c0af2e1e8afd8a7dd1..258d199595105d40c0186768e5f6a9e7705a1520 100644 (file)
@@ -47,10 +47,10 @@ class WebLogoutController extends BaseController implements Controller {
                $controllerInstance->setResolverInstance($resolverInstance);
 
                // Add user auth filter (we don't need an update of the user here because it will be redirected)
-               $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_auth_class'));
+               $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_auth_filter', array($controllerInstance)));
 
                // User status filter
-               $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_status_class'));
+               $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_status_filter', array($controllerInstance)));
 
                // Return the prepared instance
                return $controllerInstance;
index c95d853bfd07b67bbc7f518317300b1b3208cfe0..faeb8be698188dfb71d383405a4c2bee9b24d3ea 100644 (file)
@@ -73,8 +73,8 @@ class SearchCriteria extends BaseFrameworkSystem implements LocalSearchCriteria
         * @param       $criteriaValue  Criteria value
         * @return      void
         */
-       public function addCriteria ($criteriaKey, $criteriaValue) {
-               $this->searchCriteria[$criteriaKey] = $criteriaValue;
+       public final function addCriteria ($criteriaKey, $criteriaValue) {
+               $this->searchCriteria[(string)$criteriaKey] = (string)$criteriaValue;
        }
 
        /**
@@ -84,7 +84,7 @@ class SearchCriteria extends BaseFrameworkSystem implements LocalSearchCriteria
         * @param       $configEntry    Configuration entry
         * @return      void
         */
-       public function addConfiguredCriteria ($criteriaKey, $configEntry) {
+       public final function addConfiguredCriteria ($criteriaKey, $configEntry) {
                // Add the configuration entry as a criteria
                $value = $this->getConfigInstance()->readConfig($configEntry);
                $this->addCriteria($criteriaKey, $value);
@@ -95,6 +95,7 @@ class SearchCriteria extends BaseFrameworkSystem implements LocalSearchCriteria
         *
         * @param       $limit  Search limit
         * @return      void
+        * @todo        Find a nice casting here. (int) allows until and including 32766.
         */
        public final function setLimit ($limit) {
                $this->limit = $limit;
@@ -114,6 +115,7 @@ class SearchCriteria extends BaseFrameworkSystem implements LocalSearchCriteria
         *
         * @param       $skip   Search skip
         * @return      void
+        * @todo        Find a nice casting here. (int) allows until and including 32766.
         */
        public final function setSkip ($skip) {
                $this->skip = $skip;
@@ -199,7 +201,7 @@ class SearchCriteria extends BaseFrameworkSystem implements LocalSearchCriteria
                        } // END - foreach
                } // END - foreach
 
-               // Now check if the criteria matches
+               // Now check if expected criteria counts match
                $matches = ($counted == count($this->searchCriteria));
 
                // Return the result
index 2ebafd8ed9c9dfdeffcda10ef4473645e620ccbc..0456e10dae2e1f8cb3c5a0929f9a1d7e66def337 100644 (file)
@@ -119,8 +119,8 @@ class CryptoHelper extends BaseFrameworkSystem implements Cryptable {
        /**
         * Hashes a string with salt and returns the hash. If an old previous hash
         * is supplied the method will use the first X chars of that hash for hashing
-        * the password. This is useful if you want to check if the password is
-        * identical for authorization purposes.
+        * the password. This is useful if you want to check if password is identical
+        * for authorization purposes.
         *
         * @param       $str            Unhashed string
         * @param       $oldHash        A hash from previous hashed string
@@ -241,6 +241,11 @@ class CryptoHelper extends BaseFrameworkSystem implements Cryptable {
 
                // Get the real string out
                $strArray = explode("|", $garbageString);
+
+               // Does the element count match?
+               assert(count($strArray) == 3);
+
+               // Decode the string
                $str = base64_decode($strArray[1]);
 
                // Trim trailing nulls away
index 25cf9389f68b7708182e3767fedece739e04d8ec..dc4371efd13fcb5a08bbb64a1bb185ddcd5726fd 100644 (file)
@@ -70,6 +70,11 @@ class LocalFileDatabase extends BaseDatabaseFrontend implements DatabaseFrontend
         */
        private $tableInfo = array();
 
+       /**
+        * Element for index
+        */
+       private $indexKey = "__idx";
+
        /**
         * The protected constructor. Do never instance from outside! You need to
         * set a local file path. The class will then validate it.
@@ -153,13 +158,12 @@ class LocalFileDatabase extends BaseDatabaseFrontend implements DatabaseFrontend
        /**
         * Setter for the last read file
         *
-        * @param               $fqfn   The FQFN of the last read file
+        * @param       $fqfn   The FQFN of the last read file
         * @return      void
         */
        private final function setLastFile ($fqfn) {
-               // Cast string
-               $fqfn = (string) $fqfn;
-               $this->lastFile = $fqfn;
+               // Cast string and set it
+               $this->lastFile = (string) $fqfn;
        }
 
        /**
@@ -188,9 +192,8 @@ class LocalFileDatabase extends BaseDatabaseFrontend implements DatabaseFrontend
         * @param               $contents               An array with header and data elements
         * @return      void
         */
-       private final function setLastFileContents ($contents) {
-               // Cast array
-               $contents = (array) $contents;
+       private final function setLastFileContents (array $contents) {
+               // Set array
                $this->lastContents = $contents;
        }
 
@@ -212,6 +215,15 @@ class LocalFileDatabase extends BaseDatabaseFrontend implements DatabaseFrontend
                return $this->fileExtension;
        }
 
+       /**
+        * Getter for index key
+        *
+        * @return      $indexKey       Index key
+        */
+       public final function getIndexKey () {
+               return $this->indexKey;
+       }
+
        /**
         * Reads a local data file  and returns it's contents in an array
         *
@@ -261,7 +273,7 @@ class LocalFileDatabase extends BaseDatabaseFrontend implements DatabaseFrontend
        }
 
        /**
-        * Getter for table information file contents or an empty if the info file was not created
+        * Getter for table information file contents or an empty if info file was not created
         *
         * @param       $dataSetInstance        An instance of a database set class
         * @return      $infoArray                      An array with all table informations
@@ -370,6 +382,7 @@ class LocalFileDatabase extends BaseDatabaseFrontend implements DatabaseFrontend
                        // Initialize limit/skip
                        $limitFound = 0;
                        $skipFound = 0;
+                       $idx = 1;
 
                        // Read the directory with some exceptions
                        while (($dataFile = $directoryInstance->readDirectoryExcept(array(".", "..", ".htaccess", ".svn", "info." . $this->getFileExtension()))) && ($limitFound < $criteriaInstance->getLimit())) {
@@ -377,7 +390,7 @@ class LocalFileDatabase extends BaseDatabaseFrontend implements DatabaseFrontend
                                if (substr($dataFile, -(strlen($this->getFileExtension()))) !== $this->getFileExtension()) {
                                        // Skip this file!
                                        continue;
-                               }
+                               } // END - if
 
                                // Read the file
                                $dataArray = $this->getDataArrayFromFile($pathName . $dataFile);
@@ -402,8 +415,13 @@ class LocalFileDatabase extends BaseDatabaseFrontend implements DatabaseFrontend
                                                                } // END - if
                                                        } // END - if
 
+                                                       // Set id number
+                                                       $dataArray[$this->getIndexKey()] = $idx;
+
                                                        // Entry found!
                                                        $resultData['rows'][] = $dataArray;
+
+                                                       // Count found entries up
                                                        $limitFound++;
                                                        break;
                                                } // END - if
@@ -412,6 +430,9 @@ class LocalFileDatabase extends BaseDatabaseFrontend implements DatabaseFrontend
                                        // Throw an exception here
                                        throw new SqlException(array($this, sprintf("File &#39;%s&#39; contains invalid data.", $dataFile), self::DB_CODE_DATA_FILE_CORRUPT), self::EXCEPTION_SQL_QUERY);
                                }
+
+                               // Count entry up
+                               $idx++;
                        } // END - while
 
                        // Close directory and throw the instance away
index 1bbbf0315c7365b83e2233e92c47c2ecb12c7466..503fbadb02089e2e2f0007fec6b077d5e406135a 100644 (file)
@@ -26,6 +26,7 @@ class UserDatabaseWrapper extends BaseDatabaseWrapper {
        const EXCEPTION_CLIENT_USERNAME_NOT_FOUND = 0x180;
 
        // Constants for database columns
+       const DB_COLUMN_USERID       = "userid";
        const DB_COLUMN_USERNAME     = "username";
        const DB_COLUMN_EMAIL        = "email";
        const DB_COLUMN_CONFIRM_HASH = "confirm_hash";
@@ -48,8 +49,6 @@ class UserDatabaseWrapper extends BaseDatabaseWrapper {
         * Creates an instance of this database wrapper by a provided user class
         *
         * @return      $wrapperInstance        An instance of the created wrapper class
-        * @throws      WrapperUserNameNotFoundException        If the supplied username
-        *                                                                                              does not exist
         */
        public final static function createUserDatabaseWrapper () {
                // Get a new instance
@@ -62,6 +61,15 @@ class UserDatabaseWrapper extends BaseDatabaseWrapper {
                return $wrapperInstance;
        }
 
+       /**
+        * Getter for index key
+        *
+        * @return      $indexKey       Index key
+        */
+       public final function getIndexKey () {
+               return $this->getDatabaseInstance()->getIndexKey();
+       }
+
        /**
         * Handles inserting the registration data from a registration instance into the database
         *
index b9db256800dea703a3c677aafa3f0a7c9f281099..08e6d426a892387e3107303f28d6afd0a7c0a78e 100644 (file)
@@ -52,7 +52,7 @@ class DebugConsoleOutput extends BaseFrameworkSystem implements Debugger, Output
         * @return      void
         */
        public final function outputStream ($output) {
-               print(html_entity_decode(strip_tags($output)));
+               print(html_entity_decode(strip_tags(stripslashes($output))));
        }
 
        /**
index 268738a7a1ef4928ffc148f0eab7aaa42233a631..433f68e8b66d3505b622dcb12ad2900217ce7d21 100644 (file)
@@ -54,7 +54,7 @@ class DebugWebOutput extends BaseFrameworkSystem implements Debugger, OutputStre
        public final function outputStream ($output) {
                // Strip out <br />
                $output = str_replace("<br />", "", $output);
-               print($output."<br />\n");
+               print(stripslashes($output)."<br />\n");
        }
 
        /**
index 06c73d89c4e1e09a9143743ffdca642cbac5db8a..0848e79fabd832f0405555e47de65481b1629c57 100644 (file)
@@ -64,14 +64,13 @@ class ObjectFactory extends BaseFactory {
                        throw new ClassNotFoundException(array($factoryInstance, $className), self::EXCEPTION_CLASS_NOT_FOUND);
                }
 
-               // Then Prepare the call-back function
-               $callback = sprintf("%s::create%s",
-                       $className,
+               // Create method name
+               $methodName = sprintf("create%s",
                        $className
                );
 
                // Run the user function
-               $objectInstance = call_user_func_array($callback, $args);
+               $objectInstance = call_user_func_array(array($className, $methodName), $args);
 
                // Count generated objects up
                self::$total++;
index d7307ec37279af64146de0f4867c6879fcea606b..1dace4e9592cabd166f2636b95e1e96a40325cc6 100644 (file)
@@ -45,8 +45,29 @@ class WebNewsFactory extends BaseFactory {
         * @return      $factoryInstance        An instance of a WebNewsFactory class
         */
        public final static function createFactoryByRequest (Requestable $requestInstance) {
+               // Set default news reader class
+               $configEntry = "news_reader_class";
+
+               // Get "page"
+               $page = $requestInstance->getRequestElement('page');
+
+               // Is "page" used?
+               if (!empty($page)) {
+                       // Then add it
+                       $configEntry = sprintf("news_reader_%s_class", $page);
+
+                       // Get "action"
+                       $action = $requestInstance->getRequestElement('action');
+
+                       // Is it also there?
+                       if (!empty($action)) {
+                               // Then use both for config entry
+                               $configEntry = sprintf("news_reader_%s_%s_class", $page, $action);
+                       } // END - if
+               } // END - if
+
                // Get the news reader class name from config
-               $className = $requestInstance->getConfigInstance()->readConfig('news_reader_class');
+               $className = $requestInstance->getConfigInstance()->readConfig($configEntry);
 
                // Once we have that name, try to load initialize it
                $newsInstance = ObjectFactory::createObjectByName($className, array($requestInstance));
index b08d0c2b8df659c5d601d4db0e4051a3daba740d..c2b0ac4287164c49e3ac59dae1f57565b6483f85 100644 (file)
@@ -43,12 +43,16 @@ class UserAuthFilter extends BaseFilter implements Filterable {
        /**
         * Creates an instance of this filter class
         *
-        * @return      $filterInstance         An instance of this filter class
+        * @param       $controllerInstance             An instance of a Controller class
+        * @return      $filterInstance                 An instance of this filter class
         */
-       public final static function createUserAuthFilter () {
+       public final static function createUserAuthFilter (Controller $controllerInstance) {
                // Get a new instance
                $filterInstance = new UserAuthFilter();
 
+               // Set the controller
+               $filterInstance->setControllerInstance($controllerInstance);
+
                // Set default auth method
                $filterInstance->setDefaultAuthMethod();
 
index 4e75421e1832f566291a11263478f47440a832b4..bc481dd709fa8af868cdc17017f58f4e535b882b 100644 (file)
@@ -21,7 +21,7 @@
  * You should have received a copy of the GNU General Public License
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
  */
-class EmailChangeFilter extends BaseFrameworkSystem implements Filterable {
+class EmailChangeFilter extends BaseFilter implements Filterable {
        /**
         * Protected constructor
         *
@@ -35,12 +35,16 @@ class EmailChangeFilter extends BaseFrameworkSystem implements Filterable {
        /**
         * Creates an instance of this filter class
         *
-        * @return      $filterInstance         An instance of this filter class
+        * @param       $controllerInstance             An instance of a Controller class
+        * @return      $filterInstance                 An instance of this filter class
         */
-       public final static function createEmailChangeFilter () {
+       public final static function createEmailChangeFilter (Controller $controllerInstance) {
                // Get a new instance
                $filterInstance = new EmailChangeFilter();
 
+               // Set the controller
+               $filterInstance->setControllerInstance($controllerInstance);
+
                // Return the instance
                return $filterInstance;
        }
@@ -94,6 +98,12 @@ class EmailChangeFilter extends BaseFrameworkSystem implements Filterable {
                        return false;
                } // END - if
 
+               // Are email and confirmation empty?
+               if ((empty($email1)) && (empty($email2))) {
+                       // No email change required!
+                       return true;
+               } // END - if
+
                // Now, get a user instance for comparison
                $userInstance = Registry::getRegistry()->getInstance('user');
 
@@ -101,10 +111,13 @@ class EmailChangeFilter extends BaseFrameworkSystem implements Filterable {
                $userEmail = $userInstance->getField('email');
 
                // Are they different?
-               if ($userEmail != $email1) {
-                       // Update the "new_email" field
-                       $this->partialStub("Unfinished part.");
+               if ($userEmail == $email1) {
+                       // Nothing has been changed is fine...
+                       return true;
                } // END - if
+
+               // Update the "new_email" field
+               $this->partialStub("Unfinished part.");
        }
 }
 
index 078d2944f921408f94520582d5a5b9ad5703208b..e7b8b50556ee3899294a85808ca6c37839c48ae1 100644 (file)
@@ -21,7 +21,7 @@
  * You should have received a copy of the GNU General Public License
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
  */
-class PasswordChangeFilter extends BaseFrameworkSystem implements Filterable {
+class PasswordChangeFilter extends BaseFilter implements Filterable {
        /**
         * Protected constructor
         *
@@ -35,12 +35,16 @@ class PasswordChangeFilter extends BaseFrameworkSystem implements Filterable {
        /**
         * Creates an instance of this filter class
         *
-        * @return      $filterInstance         An instance of this filter class
+        * @param       $controllerInstance             An instance of a controller class
+        * @return      $filterInstance                 An instance of this filter class
         */
-       public final static function createPasswordChangeFilter () {
+       public final static function createPasswordChangeFilter (Controller $controllerInstance) {
                // Get a new instance
                $filterInstance = new PasswordChangeFilter();
 
+               // Set the controller
+               $filterInstance->setControllerInstance($controllerInstance);
+
                // Return the instance
                return $filterInstance;
        }
@@ -82,6 +86,12 @@ class PasswordChangeFilter extends BaseFrameworkSystem implements Filterable {
                        return false;
                } // END - if
 
+               // Are password and confirmation empty?
+               if ((empty($pass1)) && (empty($pass2))) {
+                       // Don't change password here
+                       return true;
+               } // END - if
+
                // Do both match?
                if ($pass1 != $pass2) {
                        // Request is invalid!
index 85e945e8bc66da5ee0a643a49f8a31904069a8ef..03b769a270c13fe0f6742c94e438c10668d80fff 100644 (file)
@@ -37,12 +37,16 @@ class RulesAcceptedFilter extends BaseFilter implements Filterable {
        /**
         * Creates an instance of this filter class
         *
-        * @return      $filterInstance         An instance of this filter class
+        * @param       $controllerInstance             An instance of a Controller class
+        * @return      $filterInstance                 An instance of this filter class
         */
-       public final static function createRulesAcceptedFilter () {
+       public final static function createRulesAcceptedFilter (Controller $controllerInstance) {
                // Get a new instance
                $filterInstance = new RulesAcceptedFilter();
 
+               // Set the controller
+               $filterInstance->setControllerInstance($controllerInstance);
+
                // Return the instance
                return $filterInstance;
        }
index 4aff5132a1362edf52e2e151f0fd68a69f8bbd4b..bd14a20d0255ebc56ac27aa784a7140679b90f0d 100644 (file)
@@ -30,21 +30,21 @@ class ???Filter extends BaseFrameworkSystem implements Filterable {
        protected function __construct () {
                // Call parent constructor
                parent::__construct(__CLASS__);
-
-               // Clean up a little
-               $this->removeNumberFormaters();
-               $this->removeSystemArray();
        }
 
        /**
         * Creates an instance of this filter class
         *
-        * @return      $filterInstance         An instance of this filter class
+        * @param       $controllerInstance             An instance of a Controller class
+        * @return      $filterInstance                 An instance of this filter class
         */
-       public final static function create???Filter () {
+       public final static function create???Filter (Controller $controllerInstance) {
                // Get a new instance
                $filterInstance = new ???Filter();
 
+               // Set the controller
+               $filterInstance->setControllerInstance($controllerInstance);
+
                // Return the instance
                return $filterInstance;
        }
index e11b970ddefc54f63223fef505f8ee259f827d92..e003ce266867c6367c14b39808b699ce4693bcae 100644 (file)
@@ -64,8 +64,8 @@ abstract class AbstractFilterDecorator extends BaseFrameworkSystem implements Fi
        /**
         * Execute the inner filter
         *
-        * @param<->$requestInstance<-->An instance of a request class
-        * @param<->$responseInstance<->An instance of a response class
+        * @param       $requestInstance        An instance of a request class
+        * @param       $responseInstance       An instance of a response class
         * @return      void
         */
        public final function execute (Requestable $requestInstance, Responseable $responseInstance) {
@@ -76,8 +76,8 @@ abstract class AbstractFilterDecorator extends BaseFrameworkSystem implements Fi
        /**
         * Do the execution of the filter
         *
-        * @param<->$requestInstance<-->An instance of a request class
-        * @param<->$responseInstance<->An instance of a response class
+        * @param       $requestInstance        An instance of a request class
+        * @param       $responseInstance       An instance of a response class
         * @return      void
         */
        abstract public function doExecute (Requestable $requestInstance, Responseable $responseInstance);
index b399a8917ccef5358e2fbf19385c17942dee14c5..3a20eb2929e248358629cb47a37f7e704f8dec07 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * A filter for checking if the "encrypt" value is set and fine
+ * A filter for checking if value "encrypt" is set and fine
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
@@ -21,7 +21,7 @@
  * You should have received a copy of the GNU General Public License
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
  */
-class CaptchaEncryptFilter extends BaseFrameworkSystem implements Filterable {
+class CaptchaEncryptFilter extends BaseFilter implements Filterable {
        /**
         * Protected constructor
         *
@@ -35,12 +35,16 @@ class CaptchaEncryptFilter extends BaseFrameworkSystem implements Filterable {
        /**
         * Creates an instance of this filter class
         *
-        * @return      $filterInstance         An instance of this filter class
+        * @param       $controllerInstance             An instance of a Controller class
+        * @return      $filterInstance                 An instance of this filter class
         */
-       public final static function createCaptchaEncryptFilter () {
+       public final static function createCaptchaEncryptFilter (Controller $controllerInstance) {
                // Get a new instance
                $filterInstance = new CaptchaEncryptFilter();
 
+               // Set the controller
+               $filterInstance->setControllerInstance($controllerInstance);
+
                // Return the instance
                return $filterInstance;
        }
index fc11b737f34b588f5a5fd6209ed456a66c7b8585..20155ac3d92bfe70a741b88dfc8df7c0f07dfb00 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 /**
- * A filter for checking if the username "guest" has been choosen as configured.
- * If so the password will be set to the configured password.
+ * A filter for checking if username "guest" has been choosen as configured. If
+ * so the password will be set to the configured password.
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
@@ -36,12 +36,16 @@ class UserNameIsGuestFilter extends BaseFilter implements Filterable {
        /**
         * Creates an instance of this filter class
         *
-        * @return      $filterInstance         An instance of this filter class
+        * @param       $controllerInstance             An instance of a Controller class
+        * @return      $filterInstance                 An instance of this filter class
         */
-       public final static function createUserNameIsGuestFilter () {
+       public final static function createUserNameIsGuestFilter (Controller $controllerInstance) {
                // Get a new instance
                $filterInstance = new UserNameIsGuestFilter();
 
+               // Set the controller
+               $filterInstance->setControllerInstance($controllerInstance);
+
                // Return the instance
                return $filterInstance;
        }
index 1b57940f231d49d3523c212655fc6f7678ec96d3..8799398e325ac9cda4730ba4a294b18d9de3dc3d 100644 (file)
@@ -37,12 +37,16 @@ class NewsDownloadFilter extends BaseFilter implements Filterable {
        /**
         * Creates an instance of this filter class
         *
-        * @return      $filterInstance         An instance of this filter class
+        * @param       $controllerInstance             An instance of a Controller class
+        * @return      $filterInstance                 An instance of this filter class
         */
-       public final static function createNewsDownloadFilter () {
+       public final static function createNewsDownloadFilter (Controller $controllerInstance) {
                // Get a new instance
                $filterInstance = new NewsDownloadFilter();
 
+               // Set the controller
+               $filterInstance->setControllerInstance($controllerInstance);
+
                // Return the instance
                return $filterInstance;
        }
index 76ebf3df5f49b8a6a54c41fde1e3ddc4f305e0a2..5ecb0960553438b91c580cf0738833fced24584a 100644 (file)
@@ -36,12 +36,16 @@ class NewsProcessFilter extends BaseFilter implements Filterable {
        /**
         * Creates an instance of this filter class
         *
-        * @return      $filterInstance         An instance of this filter class
+        * @param       $controllerInstance             An instance of a Controller class
+        * @return      $filterInstance                 An instance of this filter class
         */
-       public final static function createNewsProcessFilter () {
+       public final static function createNewsProcessFilter (Controller $controllerInstance) {
                // Get a new instance
                $filterInstance = new NewsProcessFilter();
 
+               // Set the controller
+               $filterInstance->setControllerInstance($controllerInstance);
+
                // Return the instance
                return $filterInstance;
        }
index 9b145bab808fad9b901e87b63a3dc3283c68d3e6..3dd83829b2013d9e4c1ad6e06cd6c1b2feee9da2 100644 (file)
@@ -36,12 +36,16 @@ class NullFilter extends BaseFilter implements Filterable {
        /**
         * Creates an instance of this filter class
         *
-        * @return      $filterInstance         An instance of this filter class
+        * @param       $controllerInstance             An instance of a Controller class
+        * @return      $filterInstance                 An instance of this filter class
         */
-       public final static function createNullFilter () {
+       public final static function createNullFilter (Controller $controllerInstance) {
                // Get a new instance
                $filterInstance = new NullFilter();
 
+               // Set the controller
+               $filterInstance->setControllerInstance($controllerInstance);
+
                // Return the instance
                return $filterInstance;
        }
index 7e301484ca5dca78e7eebd2cdb46dd5f8f5af4aa..a7e409b0a16327391e5d3e982e097ab674ded7fe 100644 (file)
@@ -21,7 +21,7 @@
  * You should have received a copy of the GNU General Public License
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
  */
-class UserStatusConfimedUpdateFilter extends BaseFrameworkSystem implements Filterable {
+class UserStatusConfimedUpdateFilter extends BaseFilter implements Filterable {
        /**
         * Protected constructor
         *
@@ -35,12 +35,16 @@ class UserStatusConfimedUpdateFilter extends BaseFrameworkSystem implements Filt
        /**
         * Creates an instance of this filter class
         *
-        * @return      $filterInstance         An instance of this filter class
+        * @param       $controllerInstance             An instance of a Controller class
+        * @return      $filterInstance                 An instance of this filter class
         */
-       public final static function createUserStatusConfimedUpdateFilter () {
+       public final static function createUserStatusConfimedUpdateFilter (Controller $controllerInstance) {
                // Get a new instance
                $filterInstance = new UserStatusConfimedUpdateFilter();
 
+               // Set the controller
+               $filterInstance->setControllerInstance($controllerInstance);
+
                // Return the instance
                return $filterInstance;
        }
index be0c9a8bf7f74cd5cee0f919c68c55728c87f99d..69c62d80a81ce2b9d33bc9043e77df3340267f59 100644 (file)
@@ -22,7 +22,7 @@
  * You should have received a copy of the GNU General Public License
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
  */
-class UserUpdateFilter extends BaseFrameworkSystem implements Filterable {
+class UserUpdateFilter extends BaseFilter implements Filterable {
        /**
         * Protected constructor
         *
@@ -36,12 +36,16 @@ class UserUpdateFilter extends BaseFrameworkSystem implements Filterable {
        /**
         * Creates an instance of this filter class
         *
-        * @return      $filterInstance         An instance of this filter class
+        * @param       $controllerInstance             An instance of a Controller class
+        * @return      $filterInstance                 An instance of this filter class
         */
-       public final static function createUserUpdateFilter () {
+       public final static function createUserUpdateFilter (Controller $controllerInstance) {
                // Get a new instance
                $filterInstance = new UserUpdateFilter();
 
+               // Set the controller
+               $filterInstance->setControllerInstance($controllerInstance);
+
                // Return the instance
                return $filterInstance;
        }
index feb819e9915d0741da16188e6e58354017e3317d..6183b33b265066b17fe5d9cf5babaa7e86e3b599 100644 (file)
@@ -1,9 +1,9 @@
 <?php
 /**
  * A concrete filter for validating the email address. This filter may intercept
- * the filter chain if no email address is given or if the supplied email has an
- * invalid form. It could also intercept the filter chain if the email address
- * is already used by some one if configuration requires this.
+ * the filter chain if no email address is given or if supplied email has an
+ * invalid form. It could also intercept our filter chain if email address is
+ * already used by some one if configuration requires this.
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
@@ -38,12 +38,16 @@ class EmailValidatorFilter extends BaseFilter implements Filterable {
        /**
         * Creates an instance of this filter class
         *
-        * @return      $filterInstance         An instance of this filter class
+        * @param       $controllerInstance             An instance of a Controller class
+        * @return      $filterInstance                 An instance of this filter class
         */
-       public final static function createEmailValidatorFilter () {
+       public final static function createEmailValidatorFilter (Controller $controllerInstance) {
                // Get a new instance
                $filterInstance = new EmailValidatorFilter();
 
+               // Set the controller
+               $filterInstance->setControllerInstance($controllerInstance);
+
                // Return the instance
                return $filterInstance;
        }
@@ -154,7 +158,7 @@ class EmailValidatorFilter extends BaseFilter implements Filterable {
                }
 
                // Does the email exist?
-               if (!$userInstance->ifEmailAddressExists()) {
+               if ($userInstance->ifEmailAddressExists() === false) {
                        // This email has not being used yet
                        $alreadyTaken = false;
                }
index 8944f35886976861c65ac6e5f6cadc19320d2cb8..2591f1ea78efc2a4af1a0e65c452dcbeb9b11118 100644 (file)
@@ -36,12 +36,16 @@ class PasswordValidatorFilter extends BaseFilter implements Filterable {
        /**
         * Creates an instance of this filter class
         *
-        * @return      $filterInstance         An instance of this filter class
+        * @param       $controllerInstance             An instance of a Controller class
+        * @return      $filterInstance                 An instance of this filter class
         */
-       public final static function createPasswordValidatorFilter () {
+       public final static function createPasswordValidatorFilter (Controller $controllerInstance) {
                // Get a new instance
                $filterInstance = new PasswordValidatorFilter();
 
+               // Set the controller
+               $filterInstance->setControllerInstance($controllerInstance);
+
                // Return the instance
                return $filterInstance;
        }
index 522e77a82b426052be9ebf3f55ed3433edcede99..8d0445feb4696d5fe43ea9b68edeb3729a358104 100644 (file)
@@ -1,9 +1,8 @@
 <?php
 /**
  * A concrete filter for validating the username. This filter may intercept the
- * filter chain if no username is given or if the supplied username has an
- * invalid form. It could also intercept the filter chain if the username is
- * already taken.
+ * filter chain if no username is given or if supplied username has an invalid
+ * form. It could also intercept our filter chain if username is already taken.
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
@@ -38,12 +37,16 @@ class UserNameValidatorFilter extends BaseFilter implements Filterable {
        /**
         * Creates an instance of this filter class
         *
-        * @return      $filterInstance         An instance of this filter class
+        * @param       $controllerInstance             An instance of a Controller class
+        * @return      $filterInstance                 An instance of this filter class
         */
-       public final static function createUserNameValidatorFilter () {
+       public final static function createUserNameValidatorFilter (Controller $controllerInstance) {
                // Get a new instance
                $filterInstance = new UserNameValidatorFilter();
 
+               // Set the controller
+               $filterInstance->setControllerInstance($controllerInstance);
+
                // Return the instance
                return $filterInstance;
        }
@@ -125,7 +128,7 @@ class UserNameValidatorFilter extends BaseFilter implements Filterable {
                }
 
                // Does the username exist?
-               if ((is_null($userInstance)) || (!$userInstance->ifUsernameExists())) {
+               if ((is_null($userInstance)) || ($userInstance->ifUsernameExists() === false)) {
                        // This username is still available
                        $alreadyTaken = false;
                } // END - if
index eab77bdeaa0fe50df4273a147f1c257aff079313..44fdcfc9f574399893f43ec11cc18f04f0cf71ed 100644 (file)
@@ -36,12 +36,16 @@ class AccountPasswordVerifierFilter extends BaseFilter implements Filterable {
        /**
         * Creates an instance of this filter class
         *
-        * @return      $filterInstance         An instance of this filter class
+        * @param       $controllerInstance             An instance of a Controller class
+        * @return      $filterInstance                 An instance of this filter class
         */
-       public final static function createAccountPasswordVerifierFilter () {
+       public final static function createAccountPasswordVerifierFilter (Controller $controllerInstance) {
                // Get a new instance
                $filterInstance = new AccountPasswordVerifierFilter();
 
+               // Set the controller
+               $filterInstance->setControllerInstance($controllerInstance);
+
                // Return the instance
                return $filterInstance;
        }
@@ -53,6 +57,7 @@ class AccountPasswordVerifierFilter extends BaseFilter implements Filterable {
         * @param       $responseInstance       An instance of a class with an Responseable interface
         * @return      void
         * @throws      AccountPasswordMismatchException        If the account password does not match
+        * @todo        Rewrite handling of different password fields
         */
        public function execute (Requestable $requestInstance, Responseable $responseInstance) {
                // Get password
@@ -60,20 +65,28 @@ class AccountPasswordVerifierFilter extends BaseFilter implements Filterable {
 
                // Is the password still not set?
                if (is_null($password)) {
-                       // Not found in form so stop the filtering process
-                       $requestInstance->requestIsValid(false);
+                       // Get password from alternative location
+                       $password = $requestInstance->getRequestElement('password');
 
-                       // Add a message to the response
-                       $responseInstance->addFatalMessage('pass_old_unset');
+                       // Is the password still not set?
+                       if (is_null($password)) {
+                               // Not found in form so stop the filtering process
+                               $requestInstance->requestIsValid(false);
 
-                       // Abort here
-                       return false;
-               } elseif (empty($password)) {
+                               // Add a message to the response
+                               $responseInstance->addFatalMessage('password_unset');
+
+                               // Abort here
+                               return false;
+                       } // END - if
+               } // END - if
+
+               if (empty($password)) {
                        // Password is empty
                        $requestInstance->requestIsValid(false);
 
                        // Add a message to the response
-                       $responseInstance->addFatalMessage('pass_old_empty');
+                       $responseInstance->addFatalMessage('password_empty');
 
                        // Abort here
                        return false;
@@ -82,14 +95,14 @@ class AccountPasswordVerifierFilter extends BaseFilter implements Filterable {
                // Get a user instance
                $userInstance = Registry::getRegistry()->getInstance('user');
 
-               // Get old hash
-               $oldHash = $userInstance->getField('pass_hash');
+               // Get current hash
+               $currentHash = $userInstance->getField('pass_hash');
 
                // Get an encryption helper and encrypt the password
-               $passHash = ObjectFactory::createObjectByConfiguredName('crypto_class')->hashString($password, $oldHash);
+               $passHash = ObjectFactory::createObjectByConfiguredName('crypto_class')->hashString($password, $currentHash);
 
                // Does it match?
-               if ($oldHash != $passHash) {
+               if ($currentHash != $passHash) {
                        // Throw an exception here to stop the proccessing
                        throw new AccountPasswordMismatchException($this, BaseUser::EXCEPTION_USER_PASS_MISMATCH);
                } // END - if
index 98fc1e67ce0a66798950b822aa1d221270048441..09a13d0134fe78ae68b0e776ca8e0f8704c49c2f 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * A filter for checking if the the supplied confirmation code is valid
+ * A filter for checking if supplied confirmation code is valid.
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
@@ -35,12 +35,16 @@ class ConfirmCodeVerifierFilter extends BaseFilter implements Filterable {
        /**
         * Creates an instance of this filter class
         *
-        * @return      $filterInstance         An instance of this filter class
+        * @param       $controllerInstance             An instance of a Controller class
+        * @return      $filterInstance                 An instance of this filter class
         */
-       public final static function createConfirmCodeVerifierFilter () {
+       public final static function createConfirmCodeVerifierFilter (Controller $controllerInstance) {
                // Get a new instance
                $filterInstance = new ConfirmCodeVerifierFilter();
 
+               // Set the controller
+               $filterInstance->setControllerInstance($controllerInstance);
+
                // Return the instance
                return $filterInstance;
        }
@@ -99,7 +103,7 @@ class ConfirmCodeVerifierFilter extends BaseFilter implements Filterable {
                        $responseInstance->redirectToConfiguredUrl('confirm_code_invalid_url');
 
                        // Stop processing here
-                       exit;
+                       exit();
                } // END - if
        }
 }
index 8bb65a44d39fdeb2c7fd0b319a2284c4f20a53e7..27fe8a357a64cb3db09d990062d1596730200190 100644 (file)
@@ -35,12 +35,16 @@ class GraphicalCodeCaptchaVerifierFilter extends BaseFilter implements Filterabl
        /**
         * Creates an instance of this filter class
         *
-        * @return      $filterInstance         An instance of this filter class
+        * @param       $controllerInstance             An instance of a Controller class
+        * @return      $filterInstance                 An instance of this filter class
         */
-       public final static function createGraphicalCodeCaptchaVerifierFilter () {
+       public final static function createGraphicalCodeCaptchaVerifierFilter (Controller $controllerInstance) {
                // Get a new instance
                $filterInstance = new GraphicalCodeCaptchaVerifierFilter();
 
+               // Set the controller
+               $filterInstance->setControllerInstance($controllerInstance);
+
                // Return the instance
                return $filterInstance;
        }
index f2a15202e6eb80429601595f4e737e93f14052ea..abe338d3e47a7b346797e8793a0b72d7ab7a0d13 100644 (file)
@@ -36,12 +36,16 @@ class PasswordGuestVerifierFilter extends BaseFilter implements Filterable {
        /**
         * Creates an instance of this filter class
         *
-        * @return      $filterInstance         An instance of this filter class
+        * @param       $controllerInstance             An instance of a Controller class
+        * @return      $filterInstance                 An instance of this filter class
         */
-       public final static function createPasswordGuestVerifierFilter () {
+       public final static function createPasswordGuestVerifierFilter (Controller $controllerInstance) {
                // Get a new instance
                $filterInstance = new PasswordGuestVerifierFilter();
 
+               // Set the controller
+               $filterInstance->setControllerInstance($controllerInstance);
+
                // Return the instance
                return $filterInstance;
        }
index 0bd5ccebac88dda533130de8ab6a2bcc290b70e7..cea7d2109c46d63ffca2f2f7395bfe642bdc39c1 100644 (file)
@@ -36,12 +36,16 @@ class PasswordVerifierFilter extends BaseFilter implements Filterable {
        /**
         * Creates an instance of this filter class
         *
-        * @return      $filterInstance         An instance of this filter class
+        * @param       $controllerInstance             An instance of a Controller class
+        * @return      $filterInstance                 An instance of this filter class
         */
-       public final static function createPasswordVerifierFilter () {
+       public final static function createPasswordVerifierFilter (Controller $controllerInstance) {
                // Get a new instance
                $filterInstance = new PasswordVerifierFilter();
 
+               // Set the controller
+               $filterInstance->setControllerInstance($controllerInstance);
+
                // Return the instance
                return $filterInstance;
        }
index 839b1eb96536330476500fdf9dedde17f0e5e056..8e2b952fdeb3715ad461a11719c00dffd4660a70 100644 (file)
@@ -1,9 +1,8 @@
 <?php
 /**
  * A concrete filter for verfying the guest username. This filter may intercept the
- * filter chain if no username is given or if the supplied username has an
- * invalid form. It could also intercept the filter chain if the username was
- * not found.
+ * filter chain if no username is given or if supplied username has an invalid
+ * form. It could also intercept our filter chain if username was not found.
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
@@ -38,12 +37,16 @@ class UserGuestVerifierFilter extends BaseFilter implements Filterable {
        /**
         * Creates an instance of this filter class
         *
-        * @return      $filterInstance         An instance of this filter class
+        * @param       $controllerInstance             An instance of a Controller class
+        * @return      $filterInstance                 An instance of this filter class
         */
-       public final static function createUserGuestVerifierFilter () {
+       public final static function createUserGuestVerifierFilter (Controller $controllerInstance) {
                // Get a new instance
                $filterInstance = new UserGuestVerifierFilter();
 
+               // Set the controller
+               $filterInstance->setControllerInstance($controllerInstance);
+
                // Return the instance
                return $filterInstance;
        }
@@ -65,7 +68,7 @@ class UserGuestVerifierFilter extends BaseFilter implements Filterable {
                        $requestInstance->requestIsValid(false);
 
                        // Add a message to the response
-                       $responseInstance->addFatalMessage('username_unset');
+                       $responseInstance->addFatalMessage('username_guest_unset');
 
                        // Abort here
                        return false;
@@ -74,16 +77,16 @@ class UserGuestVerifierFilter extends BaseFilter implements Filterable {
                        $requestInstance->requestIsValid(false);
 
                        // Add a message to the response
-                       $responseInstance->addFatalMessage('username_empty');
+                       $responseInstance->addFatalMessage('username_guest_empty');
 
                        // Abort here
                        return false;
-               } elseif (!$this->ifUserGuestIsTaken($userName)) {
+               } elseif ($this->ifUserGuestIsTaken($userName) === false) {
                        // Username is already taken
                        $requestInstance->requestIsValid(false);
 
                        // Add a message to the response
-                       $responseInstance->addFatalMessage('username_not_found');
+                       $responseInstance->addFatalMessage('username_guest_not_found');
 
                        // Abort here
                        return false;
@@ -128,7 +131,7 @@ class UserGuestVerifierFilter extends BaseFilter implements Filterable {
                }
 
                // Does the username exist?
-               if ((is_null($userInstance)) || (!$userInstance->ifUsernameExists())) {
+               if ((is_null($userInstance)) || ($userInstance->ifUsernameExists() === false)) {
                        // This username is still available
                        $alreadyTaken = false;
                }
index 7d0bde9e05b283eb83d8a17957b4fd780b187903..a3b12a985d918ab261529d3060d17b3108504296 100644 (file)
@@ -1,9 +1,8 @@
 <?php
 /**
  * A concrete filter for verfying the username. This filter may intercept the
- * filter chain if no username is given or if the supplied username has an
- * invalid form. It could also intercept the filter chain if the username was
- * not found.
+ * filter chain if no username is given or if supplied username has an invalid
+ * form. It could also intercept our filter chain if username was not found.
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
@@ -38,12 +37,16 @@ class UserNameVerifierFilter extends BaseFilter implements Filterable {
        /**
         * Creates an instance of this filter class
         *
-        * @return      $filterInstance         An instance of this filter class
+        * @param       $controllerInstance             An instance of a Controller class
+        * @return      $filterInstance                 An instance of this filter class
         */
-       public final static function createUserNameVerifierFilter () {
+       public final static function createUserNameVerifierFilter (Controller $controllerInstance) {
                // Get a new instance
                $filterInstance = new UserNameVerifierFilter();
 
+               // Set the controller
+               $filterInstance->setControllerInstance($controllerInstance);
+
                // Return the instance
                return $filterInstance;
        }
@@ -78,7 +81,7 @@ class UserNameVerifierFilter extends BaseFilter implements Filterable {
 
                        // Abort here
                        return false;
-               } elseif (!$this->ifUserNameIsTaken($userName)) {
+               } elseif ($this->ifUserNameIsTaken($userName) === false) {
                        // Username is already taken
                        $requestInstance->requestIsValid(false);
 
@@ -125,7 +128,7 @@ class UserNameVerifierFilter extends BaseFilter implements Filterable {
                }
 
                // Does the username exist?
-               if ((is_null($userInstance)) || (!$userInstance->ifUsernameExists())) {
+               if ((is_null($userInstance)) || ($userInstance->ifUsernameExists() === false)) {
                        // This username is still available
                        $alreadyTaken = false;
                } // END - if
index 79e0aceb2b48efec86154b404258b188afdb0803..a058aa04ab555bad87274d2ff119ef3a20da1568 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * A filter for checking if the user status is GUEST or CONFIRMED
+ * A filter for checking if user status is GUEST or CONFIRMED.
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
@@ -21,7 +21,7 @@
  * You should have received a copy of the GNU General Public License
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
  */
-class UserStatusVerifierFilter extends BaseFrameworkSystem implements Filterable {
+class UserStatusVerifierFilter extends BaseFilter implements Filterable {
        /**
         * Protected constructor
         *
@@ -35,12 +35,16 @@ class UserStatusVerifierFilter extends BaseFrameworkSystem implements Filterable
        /**
         * Creates an instance of this filter class
         *
-        * @return      $filterInstance         An instance of this filter class
+        * @param       $controllerInstance             An instance of a Controller class
+        * @return      $filterInstance                 An instance of this filter class
         */
-       public final static function createUserStatusVerifierFilter () {
+       public final static function createUserStatusVerifierFilter (Controller $controllerInstance) {
                // Get a new instance
                $filterInstance = new UserStatusVerifierFilter();
 
+               // Set the controller
+               $filterInstance->setControllerInstance($controllerInstance);
+
                // Return the instance
                return $filterInstance;
        }
index e36fa389882b2162e18ed3ea70ef82403ab0fc73..0845c85bcf66c2af7712538958e3094ef3492b3b 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * A filter for checking if the user status is UNCONFIRMED
+ * A filter for checking if user status is UNCONFIRMED.
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
@@ -21,7 +21,7 @@
  * You should have received a copy of the GNU General Public License
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
  */
-class UserUnconfirmedVerifierFilter extends BaseFrameworkSystem implements Filterable {
+class UserUnconfirmedVerifierFilter extends BaseFilter implements Filterable {
        /**
         * Protected constructor
         *
@@ -35,12 +35,16 @@ class UserUnconfirmedVerifierFilter extends BaseFrameworkSystem implements Filte
        /**
         * Creates an instance of this filter class
         *
-        * @return      $filterInstance         An instance of this filter class
+        * @param       $controllerInstance             An instance of a Controller class
+        * @return      $filterInstance                 An instance of this filter class
         */
-       public final static function createUserUnconfirmedVerifierFilter () {
+       public final static function createUserUnconfirmedVerifierFilter (Controller $controllerInstance) {
                // Get a new instance
                $filterInstance = new UserUnconfirmedVerifierFilter();
 
+               // Set the controller
+               $filterInstance->setControllerInstance($controllerInstance);
+
                // Return the instance
                return $filterInstance;
        }
@@ -60,7 +64,7 @@ class UserUnconfirmedVerifierFilter extends BaseFrameworkSystem implements Filte
                $userInstance = call_user_func_array(array($userClass, 'createMemberByRequest'), array($requestInstance));
 
                // Is the email address valid?
-               if (!$userInstance->ifEmailAddressExists()) {
+               if ($userInstance->ifEmailAddressExists() === false) {
                        // Request is invalid!
                        $requestInstance->requestIsValid(false);
 
index 0b5a76f03f45a4ecfee238f4bdab3d75b6d32a53..fa8bd8591e2d48f11cd7b44efdd8c1c71216a377 100644 (file)
@@ -270,7 +270,7 @@ class ImageHelper extends BaseCaptcha implements HelpableTemplate {
        /**
         * Setter for image message string
         *
-        * @param       $imageString    A message to display in the image
+        * @param       $imageString    A message to display in image
         * @return      void
         */
        public final function setImageString ($imageString) {
@@ -280,7 +280,7 @@ class ImageHelper extends BaseCaptcha implements HelpableTemplate {
        /**
         * Getter for image message string
         *
-        * @return      $imageString    A message to display in the image
+        * @return      $imageString    A message to display in image
         */
        public final function getImageString () {
                return $this->imageStrings[$this->currString]['string'];
index 94f4ed5f1940e597282f0b9689b157f1dbc7d293..b4e893f4bcee531260a179f4cf0b54fde375cbcc 100644 (file)
@@ -226,11 +226,12 @@ class BaseHelper extends BaseFrameworkSystem {
         *
         * @param       $groupId        Group id to open
         * @param       $content        Initial content to add to the group
+        * @param       $tag            HTML tag used to open this group
         * @return      void
         * @throws      HelperGroupAlreadyCreatedException      If the group was already created before
         */
-       protected function openGroupByIdContent ($groupId, $content) {
-               //* DEBUG: */ echo "OPEN:groupId={$groupId}<br />\n";
+       protected function openGroupByIdContent ($groupId, $content, $tag) {
+               //* DEBUG: */ echo "OPEN:groupId={$groupId},content=<pre>".htmlentities($content)."</pre>\n";
                // Is the group already there?
                if (isset($this->groups[$groupId])) {
                        // Then throw an exception here
@@ -243,7 +244,8 @@ class BaseHelper extends BaseFrameworkSystem {
                // Add the group to the stack
                $this->groups[$this->totalCounter] = $groupId;
                $this->groups[$groupId]['opened']  = true;
-               $this->groups[$groupId]['content'] = $content."\n";
+               $this->groups[$groupId]['content'] = sprintf("<!-- group %s opened (length: %s, tag: %s) //-->%s\n", $groupId, strlen($content), $tag, $content);
+               $this->groups[$groupId]['tag'] = $tag;
 
                // Mark this group as previously opened
                $this->setPreviousGroupId($groupId);
@@ -253,13 +255,19 @@ class BaseHelper extends BaseFrameworkSystem {
         * Closes the previously opened group by added given content to it or
         * throws an exception if no previous group was opened
         *
-        * @param       $content        Content for previously opened grouop
+        * @param       $content        Content for previously opened group, or empty to use tag of opener
         * @return      void
         * @throws      HelperNoPreviousOpenedGroupException    If no previously opened group was found
         */
-       public function closePreviousGroupByContent ($content) {
+       public function closePreviousGroupByContent ($content = "") {
+               // Check if any sub group was opened before
+               if ($this->ifSubGroupOpenedPreviously()) {
+                       // Close it automatically
+                       $this->closePreviousSubGroupByContent();
+               } // END - if
+
                // Check if any group was opened before
-               if (!$this->ifGroupOpenedPreviously()) {
+               if ($this->ifGroupOpenedPreviously() === false) {
                        // Then throw an exception
                        throw new HelperNoPreviousOpenedGroupException(array($this, $content), self::EXCEPTION_NO_PREVIOUS_SUB_GROUP_OPENED);
                } // END - if
@@ -267,8 +275,14 @@ class BaseHelper extends BaseFrameworkSystem {
                // Get previous group
                $groupId = $this->getPreviousGroupId();
 
+               // Is the content empty?
+               if ((empty($content)) && (!empty($this->groups[$groupId]['tag']))) {
+                       // Get it from opener
+                       $content = sprintf("<!-- group %s auto-closed //--></%s>", $groupId, $this->groups[$groupId]['tag']);
+               } // END - if
+
                // Add content to it and mark it as closed
-               $this->groups[$groupId]['content'] .= $content."\n";
+               $this->groups[$groupId]['content'] .= sprintf("<!-- group %s closed (length: %s, tag: %s) //-->%s\n", $groupId, strlen($content), $this->groups[$groupId]['tag'], $content);
                $this->groups[$groupId]['opened'] = false;
 
                // Mark previous group as closed
@@ -283,10 +297,11 @@ class BaseHelper extends BaseFrameworkSystem {
         *
         * @param       $subGroupId             Sub group id to open
         * @param       $content                Initial content to add to the sub group
+        * @param       $tag                    HTML tag used to open this group
         * @return      void
         * @throws      HelperSubGroupAlreadyCreatedException   If the sub group was already created before
         */
-       protected function openSubGroupByIdContent ($subGroupId, $content) {
+       protected function openSubGroupByIdContent ($subGroupId, $content, $tag) {
                //* DEBUG: */ echo "OPEN:subGroupId={$subGroupId},content=".htmlentities($content)."<br />\n";
                // Is the group already there?
                if (isset($this->subGroups[$subGroupId])) {
@@ -300,7 +315,8 @@ class BaseHelper extends BaseFrameworkSystem {
                // Add the group to the stack
                $this->subGroups[$this->totalCounter] = $subGroupId;
                $this->subGroups[$subGroupId]['opened']  = true;
-               $this->subGroups[$subGroupId]['content'] = $content."\n";
+               $this->subGroups[$subGroupId]['content'] = sprintf("<!-- sub-group %s opened (length: %s, tag: %s) //-->%s\n", $subGroupId, strlen($content), $tag, $content);
+               $this->subGroups[$subGroupId]['tag'] = $tag;
 
                // Mark this group as previously opened
                $this->setPreviousSubGroupId($subGroupId);
@@ -310,13 +326,13 @@ class BaseHelper extends BaseFrameworkSystem {
         * Closes the previously opened sub group by added given content to it or
         * throws an exception if no previous sub group was opened
         *
-        * @param       $content        Content for previously opened sub grouop
+        * @param       $content        Content for previously opened sub group, or leave empty to use div/span of openener
         * @return      void
         * @throws      HelperNoPreviousOpenedSubGroupException If no previously opened sub group was found
         */
-       public function closePreviousSubGroupByContent ($content) {
+       public function closePreviousSubGroupByContent ($content = "") {
                // Check if any sub group was opened before
-               if (!$this->ifSubGroupOpenedPreviously()) {
+               if ($this->ifSubGroupOpenedPreviously() === false) {
                        // Then throw an exception
                        throw new HelperNoPreviousOpenedSubGroupException(array($this, $content), self::EXCEPTION_NO_PREVIOUS_SUB_GROUP_OPENED);
                } // END - if
@@ -324,8 +340,14 @@ class BaseHelper extends BaseFrameworkSystem {
                // Get previous sub group
                $subGroupId = $this->getPreviousSubGroupId();
 
+               // Is the content empty?
+               if ((empty($content)) && (!empty($this->subGroups[$subGroupId]['tag']))) {
+                       // Get it from opener
+                       $content = sprintf("<!-- sub-group %s auto-closed //--></%s>", $subGroupId, $this->subGroups[$subGroupId]['tag']);
+               } // END - if
+
                // Add content to it and mark it as closed
-               $this->subGroups[$subGroupId]['content'] .= $content."\n";
+               $this->subGroups[$subGroupId]['content'] .= sprintf("<!-- sub-group %s closed (length: %s, tag: %s) //-->%s\n", $subGroupId, strlen($content), $this->subGroups[$subGroupId]['tag'], $content);
                $this->subGroups[$subGroupId]['opened'] = false;
 
                // Mark previous sub group as closed
@@ -356,19 +378,18 @@ class BaseHelper extends BaseFrameworkSystem {
                        // Is this a group and is it closed?
                        if ((isset($this->groups[$idx])) && ($this->groups[$this->groups[$idx]]['opened'] === false)) {
                                // Then add it's content
-                               $groupContent = $this->groups[$this->groups[$idx]]['content'];
+                               $groupContent = trim($this->groups[$this->groups[$idx]]['content']);
                                //* DEBUG: */ echo "group={$this->groups[$idx]},content=<pre>".htmlentities($groupContent)."</pre><br />\n";
                                $content .= $groupContent;
                        } elseif ((isset($this->subGroups[$idx])) && ($this->subGroups[$this->subGroups[$idx]]['opened'] === false)) {
                                // Then add it's content
                                $subGroupContent = $this->subGroups[$this->subGroups[$idx]]['content'];
                                //* DEBUG: */ echo "subgroup={$this->subGroups[$idx]},content=<pre>".htmlentities($subGroupContent)."</pre><br />\n";
-                               $content .= $subGroupContent;
+                               $content .= trim($subGroupContent);
                        } else {
                                // Something went wrong
-                               $this->debugInstance();
+                               $this->debugInstance(__METHOD__."(): Something unexpected happened here.");
                        }
-
                } // END - for
 
                // Is footer content there?
index 19b5be3d85f46a04222ecec06db4552e9b948702..0da3e0a103f26a09b07ed7a2a71488de776c4024 100644 (file)
@@ -64,6 +64,16 @@ class BaseWebHelper extends BaseHelper {
                return $required;
        }
 
+       /**
+        * Checks wether for birthday shall be asked
+        *
+        * @return      $required       Wether birthday shall be asked
+        */
+       public function ifProfileIncludesBirthDay () {
+               $required = ($this->getConfigInstance()->readConfig('profile_includes_birthday') === "Y");
+               return $required;
+       }
+
        /**
         * Checks wether email addresses can only be once used
         *
index 2f3502c9e75632ca396cb00c2dbee2e2052b7295..1fffb7af1d9c215d0de1850bce4190ee0bf92aa6 100644 (file)
@@ -378,7 +378,7 @@ class WebFormHelper extends BaseWebHelper implements HelpableTemplate {
                } // END - if
 
                // At least the group name should be set
-               if ((empty($groupId)) && (!$this->ifGroupOpenedPreviously())) {
+               if ((empty($groupId)) && ($this->ifGroupOpenedPreviously() === false)) {
                        // Throw exception here
                        throw new EmptyVariableException(array($this, 'groupId'), self::EXCEPTION_UNEXPECTED_EMPTY_STRING);
                } elseif (empty($groupId)) {
@@ -387,7 +387,7 @@ class WebFormHelper extends BaseWebHelper implements HelpableTemplate {
                }
 
                // Same group to open?
-               if ((!$this->ifGroupOpenedPreviously()) && ($groupId == $this->getPreviousGroupId())) {
+               if (($this->ifGroupOpenedPreviously() === false) && ($groupId === $this->getPreviousGroupId())) {
                        // Abort here silently
                        return false;
                } // END - if
@@ -396,7 +396,7 @@ class WebFormHelper extends BaseWebHelper implements HelpableTemplate {
                $content = "    </div>\n</div><!-- Group - CLOSE //-->";
 
                // Is this group opened?
-               if (!$this->ifGroupOpenedPreviously()) {
+               if ($this->ifGroupOpenedPreviously() === false) {
                        // Begin the div/span blocks
                        $content = sprintf("<!-- Group %s - OPEN //-->
 <div class=\"group_box\" id=\"%s_group_box\">
@@ -412,7 +412,7 @@ class WebFormHelper extends BaseWebHelper implements HelpableTemplate {
                        );
 
                        // Switch the state
-                       $this->openGroupByIdContent($groupId, $content);
+                       $this->openGroupByIdContent($groupId, $content, "div");
                } else {
                        // Is a sub group opened?
                        if ($this->ifSubGroupOpenedPreviously()) {
@@ -426,7 +426,7 @@ class WebFormHelper extends BaseWebHelper implements HelpableTemplate {
                        // Switch the state
                        $this->closePreviousGroupByContent($content);
 
-                       // All call it again if the group name is not empty
+                       // All call it again if group name is not empty
                        if ((!empty($groupId)) && ($groupId != $prevGroupId)) {
                                //* DEBUG: */ echo $groupId."/".$prevGroupId."<br />\n";
                                $this->addFormGroup($groupId, $groupText);
@@ -436,8 +436,8 @@ class WebFormHelper extends BaseWebHelper implements HelpableTemplate {
 
        /**
         * Add a form sub group or close an already opened and open a new one or
-        * throws an exception if no group has been opened before or if the sub
-        * group name is empty.
+        * throws an exception if no group has been opened before or if sub group
+        * name is empty.
         *
         * @param       $subGroupId             Name of the group or last opened if empty
         * @param       $subGroupText   Text including HTML to show above this group
@@ -447,13 +447,13 @@ class WebFormHelper extends BaseWebHelper implements HelpableTemplate {
         */
        public function addFormSubGroup ($subGroupId = "", $subGroupText = "") {
                // Is a group opened?
-               if (!$this->ifGroupOpenedPreviously()) {
+               if ($this->ifGroupOpenedPreviously() === false) {
                        // Throw exception here
                        throw new FormFormClosedException(array($this, $subGroupId), self::EXCEPTION_UNEXPECTED_CLOSED_GROUP);
                } // END - if
 
                // At least the sub group name should be set
-               if ((empty($subGroupId)) && (!$this->ifSubGroupOpenedPreviously())) {
+               if ((empty($subGroupId)) && ($this->ifSubGroupOpenedPreviously() === false)) {
                        // Throw exception here
                        throw new EmptyVariableException(array($this, 'subGroupId'), self::EXCEPTION_UNEXPECTED_EMPTY_STRING);
                } elseif (empty($subGroupId)) {
@@ -462,7 +462,7 @@ class WebFormHelper extends BaseWebHelper implements HelpableTemplate {
                }
 
                // Same sub group to open?
-               if ((!$this->ifSubGroupOpenedPreviously()) && ($subGroupId == $this->getPreviousSubGroupId())) {
+               if (($this->ifSubGroupOpenedPreviously() === false) && ($subGroupId == $this->getPreviousSubGroupId())) {
                        // Abort here silently
                        return false;
                } // END - if
@@ -471,7 +471,7 @@ class WebFormHelper extends BaseWebHelper implements HelpableTemplate {
                $content = "    </div>\n</div><!-- Sub group- CLOSE //-->";
 
                // Is this group opened?
-               if (!$this->ifSubGroupOpenedPreviously()) {
+               if ($this->ifSubGroupOpenedPreviously() === false) {
                        // Begin the span block
                        $content = sprintf("<!-- Sub group %s - OPEN //-->
 <div class=\"subgroup_box\" id=\"%s_subgroup_box\">
@@ -487,7 +487,7 @@ class WebFormHelper extends BaseWebHelper implements HelpableTemplate {
                        );
 
                        // Switch the state and remeber the name
-                       $this->openSubGroupByIdContent($subGroupId, $content);
+                       $this->openSubGroupByIdContent($subGroupId, $content, "div");
                } else {
                        // Get previous sub group id
                        $prevSubGroupId = $this->getPreviousSubGroupId();
@@ -552,12 +552,6 @@ class WebFormHelper extends BaseWebHelper implements HelpableTemplate {
                        throw new FormClosedException (array($this, "form_notes"), self::EXCEPTION_CLOSED_FORM);
                } // END - if
 
-               // Is a group open?
-               if ($this->ifGroupOpenedPreviously()) {
-                       // Then automatically close it here
-                       $this->addFormGroup();
-               } // END - if
-
                // Generate the content
                $inputContent = sprintf("       <div id=\"form_note_%s\">
                %s
@@ -587,7 +581,7 @@ class WebFormHelper extends BaseWebHelper implements HelpableTemplate {
                } // END - if
 
                // Shall we close or open the sub group?
-               if ((!$this->ifSubGroupOpenedPreviously()) && ($this->getPreviousSubGroupId() !== $selectId)) {
+               if (($this->ifSubGroupOpenedPreviously() === false) && ($this->getPreviousSubGroupId() !== $selectId)) {
                        // Initialize first entry (which might be non-selectable if content is provided
                        if (!empty($firstEntry)) {
                                // Add selection around it
@@ -605,10 +599,10 @@ class WebFormHelper extends BaseWebHelper implements HelpableTemplate {
                        );
 
                        // Open the sub group
-                       $this->openSubGroupByIdContent($selectId, $content);
+                       $this->openSubGroupByIdContent($selectId, $content, "select");
                } elseif ($this->getPreviousSubGroupId() != $selectId) {
                        // Something went wrong!
-                       $this->debugInstance();
+                       $this->debugInstance(__METHOD__."(): Previous sub group id {$this->getPreviousSubGroupId()} does not match current id {$selectId}.");
                } else {
                        // Close the sub group
                        $this->closePreviousSubGroupByContent("</select>");
@@ -628,14 +622,13 @@ class WebFormHelper extends BaseWebHelper implements HelpableTemplate {
         */
        public function addSelectSubOption ($subName, $subValue) {
                // Is there a sub group (shall be a selection box!)
-               if (!$this->ifSubGroupOpenedPreviously()) {
+               if ($this->ifSubGroupOpenedPreviously() === false) {
                        // Then throw an exception here
                        throw new HelperNoPreviousOpenedSubGroupException(array($this, $content), self::EXCEPTION_NO_PREVIOUS_SUB_GROUP_OPENED);
                } // END - if
 
                // Render the content
-               $content = sprintf("<option value=\"%s\" class=\"suboption suboption_%s\" disabled=\"disabled\">%s</option>\n",
-                       $subName,
+               $content = sprintf("<option value=\"invalid\" class=\"suboption suboption_%s\" disabled=\"disabled\">%s</option>\n",
                        $subName,
                        $subValue
                );
@@ -657,7 +650,7 @@ class WebFormHelper extends BaseWebHelper implements HelpableTemplate {
         */
        public function addSelectOption ($optionName, $optionValue) {
                // Is there a sub group (shall be a selection box!)
-               if (!$this->ifSubGroupOpenedPreviously()) {
+               if ($this->ifSubGroupOpenedPreviously() === false) {
                        // Then throw an exception here
                        throw new HelperNoPreviousOpenedSubGroupException(array($this, $content), self::EXCEPTION_NO_PREVIOUS_SUB_GROUP_OPENED);
                } // END - if
index 40d9c6666b0995bbb0210c120fab7070c75ae3bb..1a238a6d2c2239d732363c50b371719a81ce6cf1 100644 (file)
@@ -63,6 +63,9 @@ class WebLinkHelper extends BaseWebHelper implements HelpableTemplate {
                // Set link base
                $helperInstance->setLinkBase($linkBase);
 
+               // Add default group
+               $helperInstance->openGroupByIdContent('main', "", "");
+
                // Return the prepared instance
                return $helperInstance;
        }
@@ -136,7 +139,7 @@ class WebLinkHelper extends BaseWebHelper implements HelpableTemplate {
                // Is a previous opened group still open?
                if ($this->ifGroupOpenedPreviously()) {
                        // Then close it
-                       $this->closePreviousGroupByContent("</div>");
+                       $this->closePreviousGroupByContent("");
                } // END - if
 
                // Get the content
@@ -155,49 +158,59 @@ class WebLinkHelper extends BaseWebHelper implements HelpableTemplate {
         *
         * @param       $groupId        Id string of the group
         * @param       $groupText      Text for this group to add
+        * @param       $groupCode      Code to open and close groups
         * @return      void
         */
-       public function addLinkGroup ($groupId, $groupText) {
+       public function addLinkGroup ($groupId, $groupText, $groupCode = "div") {
                // Is a group with that name open?
-               if ($this->ifGroupIsOpened($groupId)) {
+               if ($this->ifGroupOpenedPreviously()) {
                        // Then close it here
-                       $this->closePreviousGroupByContent("</div>");
-               } else {
-                       // Is a previous opened group still open?
-                       if ($this->ifGroupOpenedPreviously()) {
-                               // Then close it
-                               $this->closePreviousGroupByContent("</div>");
-                       } // END - if
-
-                       // Generate the group content
-                       $content = sprintf("<div id=\"group_%s_%s\">%s",
-                               $this->getLinkName(),
-                               $groupId,
-                               $groupText
-                       );
-
-                       // Open the new group
-                       $this->openGroupByIdContent($groupId, $content);
-               }
+                       $this->closePreviousGroupByContent("");
+               } // END - if
+
+               // Generate the group content
+               $content = sprintf("<{$groupCode} id=\"group_%s_%s\">%s",
+                       $this->getLinkName(),
+                       $groupId,
+                       $groupText
+               );
+
+               // Open the new group
+               $this->openGroupByIdContent($groupId, $content, $groupCode);
        }
 
        /**
         * Adds text (note) to the previously opened group or throws an exception
         * if no previous group was opened.
         *
+        * @param       $groupId        Group id to set
         * @param       $groupNote      Note to be added to a group
+        * @param       $groupCode      Code to open and close groups
         * @return      void
         * @throws      NoGroupOpenedException  If no previous group was opened
         */
-       public function addLinkNote ($groupNote) {
+       public function addLinkNote ($groupId, $groupNote, $groupCode = "div") {
                // Check if a previous group was opened
-               if (!$this->ifGroupOpenedPreviously()) {
+               if ($this->ifGroupOpenedPreviously() === false) {
                        // No group was opened before!
                        throw new NoGroupOpenedException(array($this, $groupNote), self::EXCEPTION_GROUP_NOT_OPENED);
                } // END - if
 
-               // Add the content to the previous group
-               $this->addContentToPreviousGroup($groupNote);
+               // Is a previous sub group open?
+               if ($this->ifSubGroupOpenedPreviously()) {
+                       // Then close it
+                       $this->closePreviousSubGroupByContent("</{$groupCode}>");
+               } // END - if
+
+               // Generate the group content
+               $content = sprintf("<{$groupCode} id=\"subgroup_%s_%s\">%s",
+                       $this->getLinkName(),
+                       $groupId,
+                       $groupNote
+               );
+
+               // Open the sub group
+               $this->openSubGroupByIdContent($groupId, $content, $groupCode);
        }
 
        /**
@@ -210,7 +223,7 @@ class WebLinkHelper extends BaseWebHelper implements HelpableTemplate {
         */
        public function addActionLink ($linkAction, $linkText) {
                // Check if a previous group was opened
-               if (!$this->ifGroupOpenedPreviously()) {
+               if ($this->ifGroupOpenedPreviously() === false) {
                        // No group was opened before!
                        throw new NoGroupOpenedException(array($this, $linkAction."(".$linkText.")"), self::EXCEPTION_GROUP_NOT_OPENED);
                } // END - if
@@ -238,6 +251,21 @@ class WebLinkHelper extends BaseWebHelper implements HelpableTemplate {
                $this->addContentToPreviousGroup($linkContent);
        }
 
+       /**
+        * Adds a link to the previously opened group with a text from language system
+        *
+        * @param       $linkAction             Action (action=xxx) value for the link
+        * @param       $languageId             Language id string to use
+        * @return      void
+        */
+       public function addActionLinkById ($linkAction, $languageId) {
+               // Resolve the language string
+               $languageResolved = $this->getLanguageInstance()->getMessage($languageId);
+
+               // Add the action link
+               $this->addActionLink($linkAction, $languageResolved);
+       }
+
        /**
         * Adds a default link (no extra parameters) to the content with specified
         * language id string.
index e19b0675bee732ca2deb47affbe8f8990404a4e6..ccbb545e276c32227c1c2a4925728cf8257bbad2 100644 (file)
@@ -195,7 +195,7 @@ class FrameworkDirectoryPointer extends BaseFrameworkSystem {
         * @return      void
         */
        public final function setPointer ($dirPointer) {
-               // Sanity-check if the pointer is a valid directory resource
+               // Sanity-check if pointer is a valid directory resource
                if (is_resource($dirPointer) || is_null($dirPointer)) {
                        // Is a valid resource
                        $this->dirPointer = $dirPointer;
index 172c02f700c366475b4d51eb89a53c1c5ef180aa..35376e96c5f561072e2225fd39a7223a275d9efc 100644 (file)
@@ -178,7 +178,7 @@ class FrameworkFileInputPointer extends BaseFrameworkSystem {
         * @return      void
         */
        public final function setPointer ($filePointer) {
-               // Sanity-check if the pointer is a valid file resource
+               // Sanity-check if pointer is a valid file resource
                if (is_resource($filePointer) || is_null($filePointer)) {
                        // Is a valid resource
                        $this->filePointer = $filePointer;
index 37c2285ead758a95e3dbebcd3e8cc3c167c754f5..84c8ed4078b30080b7cf05ebb135d4ff0df4e167 100644 (file)
@@ -148,7 +148,7 @@ class FrameworkFileOutputPointer extends BaseFrameworkSystem {
         * @return      void
         */
        public final function setPointer ($filePointer) {
-               // Sanity-check if the pointer is a valid file resource
+               // Sanity-check if pointer is a valid file resource
                if (is_resource($filePointer) || is_null($filePointer)) {
                        // Is a valid resource
                        $this->filePointer = $filePointer;
index 042ee69194122982abbf123343e0e495f9a0bfd4..14bdd412db4a536714a6ac233d0be29f3cd2c0fc 100644 (file)
@@ -101,7 +101,7 @@ class DebugMailer extends BaseMailer implements DeliverableMail {
                                        // Get the field from the value instance
                                        $fieldValue = $recipientList['values'][$variable]->getField($variable);
 
-                                       // Set it in the template engine
+                                       // Set it in template engine
                                        $templateInstance->assignVariable($variable, $fieldValue);
                                }
 
index bcc1fc5eb8d91bc0674fcb25c0b58a2c1c73e3a0..51f5dcaf18abf6b15e64bec13b2954b6e4a0ad43 100644 (file)
@@ -95,7 +95,7 @@ class ConsoleOutput extends BaseFrameworkSystem implements OutputStreamer {
                        }
                } else {
                        // Output it to the console
-                       printf("%s\n", trim(html_entity_decode(strip_tags($outStream))));
+                       printf("%s\n", trim(html_entity_decode(strip_tags(stripslashes($outStream)))));
                }
        }
 
index 7a508058ddd1cc90acd210e9b8f0f82b80cbf612..e82c0b7af1e265543e91ce0351c825806b1b560a 100644 (file)
@@ -84,7 +84,7 @@ class WebOutput extends BaseFrameworkSystem implements OutputStreamer, Registera
         * @return      void
         */
        public final function output ($outStream=false) {
-               print($outStream);
+               print(stripslashes($outStream));
        }
 }
 
index 17c22e2548842fb4eccf3ee72bafe3b68f04cc87..e7b636f4fa51244a8d73bbcc14061d41d6ae4dea 100644 (file)
@@ -72,7 +72,7 @@ class UserPoints extends BaseFrameworkSystem implements Registerable {
 
                // Now get a search criteria and set the user's name as criteria
                $criteriaInstance = ObjectFactory::createObjectByConfiguredName('search_criteria_class');
-               $criteriaInstance->addCriteria('points_uid', $this->getUserInstance()->getUserName());
+               $criteriaInstance->addCriteria("points_uid", $this->getUserInstance()->getUserName());
                $criteriaInstance->setLimit(1);
 
                // Get result back
@@ -80,7 +80,7 @@ class UserPoints extends BaseFrameworkSystem implements Registerable {
 
                // Do we have an entry?
                if ($resultInstance->next()) {
-                       // Load points here - TODO!
+                       // @TODO Load points here
                        $this->partialStub("Load points here for comparison.");
                } // END - if
 
index 4e5dbb10573b4548d617b4100cdf478ec3c19811..b0dbac671522f27e7c59cfcd5acb18fae4aeda2c 100644 (file)
@@ -70,7 +70,7 @@ class DefaultNewsReader extends BaseFrameworkSystem implements ReadableNews, Reg
                $criteriaInstance = ObjectFactory::createObjectByConfiguredName('search_criteria_class');
 
                // Add the page as criteria to it at lease
-               $criteriaInstance->addCriteria('page', $page);
+               $criteriaInstance->addCriteria("page", $page);
 
                // Add limitation from config
                $criteriaInstance->setLimit($this->getConfigInstance()->readConfig("news_{$page}_limit"));
index 0cc004045eaa29f768ced529fe417ddc8b324c3e..1ebf7e5b8d52eba657c6c8d6fc1481a823a01e40 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * A general registration class
+ * A general registration class.
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
@@ -21,7 +21,7 @@
  * You should have received a copy of the GNU General Public License
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
  */
-abstract class BaseRegistration extends BaseFrameworkSystem implements UserRegister {
+class BaseRegistration extends BaseFrameworkSystem {
        /**
         * Pre-registration filter chain
         */
index 2ca0382d328a447891e68a4ff7295ef6606bed2a..9a8b648376ab6db4770ef4f0d3ff14a098e45e1c 100644 (file)
@@ -86,8 +86,8 @@ class Registry extends BaseFrameworkSystem implements Register {
        /**
         * Checks wether an instance key was found
         *
-        * @param       $instanceKey    The key holding an instance in the registry
-        * @return      $exists                 Wether the key exists in the registry
+        * @param       $instanceKey    The key holding an instance in registry
+        * @return      $exists                 Wether the key exists in registry
         */
        public function instanceExists ($instanceKey) {
                // Does this key exists?
@@ -115,7 +115,7 @@ class Registry extends BaseFrameworkSystem implements Register {
         * @return      $objectInstance         An instance we shall store
         */
        public function getInstance ($instanceKey) {
-               // By default the instance is not in the registry
+               // By default the instance is not in registry
                $objectInstance = null;
 
                // Is the instance there?
index 0241cfc19f92e29a1cb4b20c268369883780b9cb..0538512a324aa43dde466f516aa23875728566f6 100644 (file)
@@ -83,17 +83,14 @@ class HttpRequest extends BaseFrameworkSystem implements Requestable {
         */
        public function isRequestElementSet ($element) {
                // Is this element found?
-               if (!isset($this->requestData[$element])) {
-                       // Then return false
-                       return false;
-               } // END - if
+               $isSet = isset($this->requestData[$element]);
 
-               // All clear
-               return true;
+               // Return result
+               return $isSet;
        }
 
        /**
-        * Getter for request element or 'null' if the element was not found
+        * Getter for request element or 'null' if element was not found
         *
         * @param       $element        Name of the request element we want to check
         * @return      $value          Value of the found request element or 'null' if the
@@ -124,7 +121,6 @@ class HttpRequest extends BaseFrameworkSystem implements Requestable {
         * @return      void
         */
        public function setRequestElement ($element, $value) {
-               error_log(__METHOD__.":{$element}={$value}");
                $this->requestData[$element] = $value;
        }
 
@@ -138,7 +134,7 @@ class HttpRequest extends BaseFrameworkSystem implements Requestable {
        }
 
        /**
-        * Getter for a header element or 'null' if the header was not found
+        * Getter for a header element or 'null' if header was not found
         *
         * @param       $headerName             Name of the header
         * @return      $headerValue    Value of the header or 'null' if not found
index 0c7f268faf88de2a449f14377ad7180325da9865..7e462cc5c29f0013d6564a05d433d8a4b5befb92 100644 (file)
@@ -60,7 +60,7 @@ class BaseActionResolver extends BaseResolver {
         * @return      void
         */
        protected final function setActionName ($actionName) {
-               $this->actionName = $actionName;
+               $this->actionName = (string) $actionName;
        }
 
        /**
@@ -68,7 +68,7 @@ class BaseActionResolver extends BaseResolver {
         *
         * @return      $actionName     Last validated action name
         */
-       protected final function getActionName () {
+       public final function getActionName () {
                return $this->actionName;
        }
 
@@ -77,7 +77,7 @@ class BaseActionResolver extends BaseResolver {
         *
         * @param       $actionName     The default action we shall execute
         * @return      $isValid                Wether the given action is valid
-        * @throws      EmptyVariableException  Thrown if the given action is not set
+        * @throws      EmptyVariableException  Thrown if given action is not set
         */
        public function isActionValid ($actionName) {
                // By default nothing shall be valid
@@ -112,8 +112,6 @@ class BaseActionResolver extends BaseResolver {
         * "Loads" current action and instances it if not yet cached
         *
         * @return      $actionInstance                 A loaded action instance
-        * @throws      InvalidActionException  Thrown if even the default
-        *                                                                      action class is missing (bad!)
         */
        protected function loadAction () {
                // Init action instance
index 83f5ddd772dd573c3b2e6389debaf90079ea36ca..6276b11d694e39e28b24f2f89751f38442acc917 100644 (file)
@@ -46,8 +46,8 @@ class WebActionResolver extends BaseActionResolver implements ActionResolver {
         * @param       $actionName                             The default action we shall execute
         * @param       $appInstance                    An instance of a manageable application helper class
         * @return      $resolverInstance               The prepared action resolver instance
-        * @throws      EmptyVariableException  Thrown if the default action is not set
-        * @throws      InvalidActionException  Thrown if the default action is invalid
+        * @throws      EmptyVariableException  Thrown if default action is not set
+        * @throws      InvalidActionException  Thrown if default action is invalid
         */
        public final static function createWebActionResolver ($actionName, ManageableApplication $appInstance) {
                // Create the new instance
@@ -57,7 +57,7 @@ class WebActionResolver extends BaseActionResolver implements ActionResolver {
                if (empty($actionName)) {
                        // Then thrown an exception here
                        throw new EmptyVariableException(array($resolverInstance, 'defaultAction'), self::EXCEPTION_UNEXPECTED_EMPTY_STRING);
-               } elseif (!$resolverInstance->isActionValid($actionName)) {
+               } elseif ($resolverInstance->isActionValid($actionName) === false) {
                        // Invalid action found
                        throw new InvalidActionException(array($resolverInstance, $actionName), self::EXCEPTION_INVALID_ACTION);
                }
@@ -91,8 +91,8 @@ class WebActionResolver extends BaseActionResolver implements ActionResolver {
                // Is the action empty? Then fall back to default action
                if (empty($actionName)) $actionName = $this->getConfigInstance()->readConfig('default_action');
 
-               // Check if the action is valid
-               if (!$this->isActionValid($actionName)) {
+               // Check if action is valid
+               if ($this->isActionValid($actionName) === false) {
                        // This action is invalid!
                        throw new InvalidActionException(array($this, $actionName), self::EXCEPTION_INVALID_ACTION);
                } // END - if
@@ -129,8 +129,8 @@ class WebActionResolver extends BaseActionResolver implements ActionResolver {
                // Is the action empty? Then fall back to default action
                if (empty($actionName)) $actionName = $this->getConfigInstance()->readConfig('default_action');
 
-               // Check if the action is valid
-               if (!$this->isActionValid($actionName)) {
+               // Check if action is valid
+               if ($this->isActionValid($actionName) === false) {
                        // This action is invalid!
                        throw new InvalidActionException(array($this, $actionName), self::EXCEPTION_INVALID_ACTION);
                }
index d1fa003a380d07015beb28a2dd86ef061f271449..4900c617a5336fb822077017559a89b36a792290 100644 (file)
@@ -32,11 +32,6 @@ class BaseCommandResolver extends BaseResolver {
         */
        private $commandName = "";
 
-       /**
-        * A controller instance
-        */
-       private $controllerInstance = null;
-
        /**
         * Protected constructor
         *
@@ -77,31 +72,12 @@ class BaseCommandResolver extends BaseResolver {
                return $this->commandName;
        }
 
-       /**
-        * Setter for controller instance (this surely breaks a bit the MVC patterm)
-        *
-        * @param       $controllerInstance             An instance of the controller
-        * @return      void
-        */
-       public final function setControllerInstance (Controller $controllerInstance) {
-               $this->controllerInstance = $controllerInstance;
-       }
-
-       /**
-        * Getter for controller instance (this surely breaks a bit the MVC patterm)
-        *
-        * @return      $controllerInstance             An instance of the controller
-        */
-       public final function getControllerInstance () {
-               return $this->controllerInstance;
-       }
-
        /**
         * Checks wether the given command is valid
         *
         * @param       $commandName    The default command we shall execute
         * @return      $isValid                Wether the given command is valid
-        * @throws      EmptyVariableException  Thrown if the given command is not set
+        * @throws      EmptyVariableException  Thrown if given command is not set
         */
        public function isCommandValid ($commandName) {
                // By default nothing shall be valid
index ed8492c75ae8ba49e57021a1f755f053b97e8be4..dc104e6a387fb68f1c48cd0b15140a16ef0317ec 100644 (file)
@@ -46,8 +46,8 @@ class ImageCommandResolver extends BaseCommandResolver implements CommandResolve
         * @param       $commandName                            The default command we shall execute
         * @param       $appInstance                            An instance of a manageable application helper class
         * @return      $resolverInstance                       The prepared command resolver instance
-        * @throws      EmptyVariableException          Thrown if the default command is not set
-        * @throws      InvalidCommandException         Thrown if the default command is invalid
+        * @throws      EmptyVariableException          Thrown if default command is not set
+        * @throws      InvalidCommandException         Thrown if default command is invalid
         */
        public final static function createImageCommandResolver ($commandName, ManageableApplication $appInstance) {
                // Create the new instance
@@ -57,7 +57,7 @@ class ImageCommandResolver extends BaseCommandResolver implements CommandResolve
                if (empty($commandName)) {
                        // Then thrown an exception here
                        throw new EmptyVariableException(array($resolverInstance, 'commandName'), self::EXCEPTION_UNEXPECTED_EMPTY_STRING);
-               } elseif (!$resolverInstance->isCommandValid($commandName)) {
+               } elseif ($resolverInstance->isCommandValid($commandName) === false) {
                        // Invalid command found
                        throw new InvalidCommandException(array($resolverInstance, $commandName), self::EXCEPTION_INVALID_COMMAND);
                }
@@ -91,8 +91,8 @@ class ImageCommandResolver extends BaseCommandResolver implements CommandResolve
                // Is the command empty? Then fall back to default command
                if (empty($commandName)) $commandName = $this->getConfigInstance()->readConfig('default_image_command');
 
-               // Check if the command is valid
-               if (!$this->isCommandValid($commandName)) {
+               // Check if command is valid
+               if ($this->isCommandValid($commandName) === false) {
                        // This command is invalid!
                        throw new InvalidCommandException(array($this, $commandName), self::EXCEPTION_INVALID_COMMAND);
                } // END - if
@@ -127,8 +127,8 @@ class ImageCommandResolver extends BaseCommandResolver implements CommandResolve
                // Is the command empty? Then fall back to default command
                if (empty($commandName)) $commandName = $this->getConfigInstance()->readConfig('default_image_command');
 
-               // Check if the command is valid
-               if (!$this->isCommandValid($commandName)) {
+               // Check if command is valid
+               if ($this->isCommandValid($commandName) === false) {
                        // This command is invalid!
                        throw new InvalidCommandException(array($this, $commandName), self::EXCEPTION_INVALID_COMMAND);
                }
index 165d2f788cf2c1251fc2e2d4614b8c9639931606..42ae37a845abc678fac4d93699f19f5e6c3d3a41 100644 (file)
@@ -46,8 +46,8 @@ class WebCommandResolver extends BaseCommandResolver implements CommandResolver
         * @param       $commandName                            The default command we shall execute
         * @param       $appInstance                            An instance of a manageable application helper class
         * @return      $resolverInstance                       The prepared command resolver instance
-        * @throws      EmptyVariableException          Thrown if the default command is not set
-        * @throws      InvalidCommandException         Thrown if the default command is invalid
+        * @throws      EmptyVariableException          Thrown if default command is not set
+        * @throws      InvalidCommandException         Thrown if default command is invalid
         */
        public final static function createWebCommandResolver ($commandName, ManageableApplication $appInstance) {
                // Create the new instance
@@ -57,7 +57,7 @@ class WebCommandResolver extends BaseCommandResolver implements CommandResolver
                if (empty($commandName)) {
                        // Then thrown an exception here
                        throw new EmptyVariableException(array($resolverInstance, 'commandName'), self::EXCEPTION_UNEXPECTED_EMPTY_STRING);
-               } elseif (!$resolverInstance->isCommandValid($commandName)) {
+               } elseif ($resolverInstance->isCommandValid($commandName) === false) {
                        // Invalid command found
                        throw new InvalidCommandException(array($resolverInstance, $commandName), self::EXCEPTION_INVALID_COMMAND);
                }
@@ -91,8 +91,8 @@ class WebCommandResolver extends BaseCommandResolver implements CommandResolver
                // Is the command empty? Then fall back to default command
                if (empty($commandName)) $commandName = $this->getConfigInstance()->readConfig('default_web_command');
 
-               // Check if the command is valid
-               if (!$this->isCommandValid($commandName)) {
+               // Check if command is valid
+               if ($this->isCommandValid($commandName) === false) {
                        // This command is invalid!
                        throw new InvalidCommandException(array($this, $commandName), self::EXCEPTION_INVALID_COMMAND);
                } // END - if
@@ -127,8 +127,8 @@ class WebCommandResolver extends BaseCommandResolver implements CommandResolver
                // Is the command empty? Then fall back to default command
                if (empty($commandName)) $commandName = $this->getConfigInstance()->readConfig('default_web_command');
 
-               // Check if the command is valid
-               if (!$this->isCommandValid($commandName)) {
+               // Check if command is valid
+               if ($this->isCommandValid($commandName) === false) {
                        // This command is invalid!
                        throw new InvalidCommandException(array($this, $commandName), self::EXCEPTION_INVALID_COMMAND);
                }
index ec61d4e1cbc6e85676c0cf63f1ab68f8952fe4eb..a667fe6cf2724fb5d52a5a2fbda87db5b8f2e3e9 100644 (file)
@@ -77,8 +77,8 @@ class BaseControllerResolver extends BaseResolver {
         *
         * @param       $controllerName         The default controller we shall execute
         * @return      $isValid                        Wether the given controller is valid
-        * @throws      EmptyVariableException  Thrown if the given controller is not set
-        * @throws      DefaultControllerException      If the default controller was not found
+        * @throws      EmptyVariableException          Thrown if given controller is not set
+        * @throws      DefaultControllerException      Thrown if default controller was not found
         */
        public function isControllerValid ($controllerName) {
                // By default nothing shall be valid
@@ -97,7 +97,7 @@ class BaseControllerResolver extends BaseResolver {
                ));
 
                // Try it hard to get an controller
-               while (!$isValid) {
+               while ($isValid === false) {
                        // Is this class already loaded?
                        if (class_exists($this->getClassName())) {
                                // This class does exist. :-)
index b2f4fcd815eb755996b572a0a13c85e07927df08..39d88d16728dc4dd3067e504e2a4940c33111ef6 100644 (file)
@@ -51,8 +51,8 @@ class ImageControllerResolver extends BaseControllerResolver implements Controll
         * @param       $controllerName                         The controller we shall resolve
         * @param       $appInstance                            An instance of a manageable application helper class
         * @return      $resolverInstance                       The prepared controller resolver instance
-        * @throws      EmptyVariableException          Thrown if the default command is not set
-        * @throws      InvalidControllerException      Thrown if the default controller is invalid
+        * @throws      EmptyVariableException          Thrown if default command is not set
+        * @throws      InvalidControllerException      Thrown if default controller is invalid
         */
        public final static function createImageControllerResolver ($controllerName, ManageableApplication $appInstance) {
                // Create the new instance
@@ -62,7 +62,7 @@ class ImageControllerResolver extends BaseControllerResolver implements Controll
                if (empty($controllerName)) {
                        // Then thrown an exception here
                        throw new EmptyVariableException(array($resolverInstance, 'commandName'), self::EXCEPTION_UNEXPECTED_EMPTY_STRING);
-               } elseif (!$resolverInstance->isControllerValid($controllerName)) {
+               } elseif ($resolverInstance->isControllerValid($controllerName) === false) {
                        // Invalid command found
                        throw new InvalidControllerException(array($resolverInstance, $controllerName), self::EXCEPTION_INVALID_CONTROLLER);
                }
index da09dca315e5e2e3cde48a959fd50146c3801d0f..5378006099a8c964f98d01ab13826f24133866bb 100644 (file)
@@ -51,8 +51,8 @@ class WebControllerResolver extends BaseControllerResolver implements Controller
         * @param       $controllerName                         The controller we shall resolve
         * @param       $appInstance                            An instance of a manageable application helper class
         * @return      $resolverInstance                       The prepared controller resolver instance
-        * @throws      EmptyVariableException          Thrown if the default command is not set
-        * @throws      InvalidControllerException      Thrown if the default controller is invalid
+        * @throws      EmptyVariableException          Thrown if default command is not set
+        * @throws      InvalidControllerException      Thrown if default controller is invalid
         */
        public final static function createWebControllerResolver ($controllerName, ManageableApplication $appInstance) {
                // Create the new instance
@@ -62,7 +62,7 @@ class WebControllerResolver extends BaseControllerResolver implements Controller
                if (empty($controllerName)) {
                        // Then thrown an exception here
                        throw new EmptyVariableException(array($resolverInstance, 'commandName'), self::EXCEPTION_UNEXPECTED_EMPTY_STRING);
-               } elseif (!$resolverInstance->isControllerValid($controllerName)) {
+               } elseif ($resolverInstance->isControllerValid($controllerName) === false) {
                        // Invalid command found
                        throw new InvalidControllerException(array($resolverInstance, $controllerName), self::EXCEPTION_INVALID_CONTROLLER);
                }
@@ -151,11 +151,26 @@ class WebControllerResolver extends BaseControllerResolver implements Controller
                        throw new InvalidControllerException(array($this, $controllerName), self::EXCEPTION_INVALID_CONTROLLER);
                } // END - if
 
+               // Set default resolver config name
+               $resolverConfigEntry = "";
+
+               // Try to read a config entry for our resolver including controller name... ;-)
+               try {
+                       // Create the resolver name
+                       $resolverConfigEntry = sprintf("web_cmd_%s_resolver_class", strtolower($controllerName));
+
+                       // Get the config, this will throw an exception if there is no special command resolver
+                       $resolverClass = $this->getConfigInstance()->readConfig($resolverConfigEntry);
+               } catch (ConfigEntryNotFoundException $e) {
+                       // Use default resolver entry
+                       $resolverConfigEntry = "web_cmd_resolver_class";
+               }
+
                // Initiate the resolver and controller
-               $resolverInstance = ObjectFactory::createObjectByConfiguredName('web_cmd_resolver_class', array($controllerName, $this->getApplicationInstance()));
+               $resolverInstance = ObjectFactory::createObjectByConfiguredName($resolverConfigEntry, array($controllerName, $this->getApplicationInstance()));
                $controllerInstance = ObjectFactory::createObjectByName($this->getClassName(), array($resolverInstance));
 
-               // Remove resolver
+               // Remove resolver (we don't need it anymore)
                unset($resolverInstance);
 
                // Return the result
index 2ecfaa2baee1121ffb69eeb071e3cd4fd0c0a6fb..1bbf57483465cb006eaf66ceb4538295f7c3425a 100644 (file)
@@ -132,6 +132,17 @@ class BaseResponse extends BaseFrameworkSystem {
                $this->fatalMessages[] = $this->getApplicationInstance()->getLanguageInstance()->getMessage($messageId);
        }
 
+       /**
+        * Adds a plain fatal message id to the response
+        *
+        * @param       $message        The plain message we shall add
+        * @return      void
+        */
+       public final function addFatalMessagePlain ($message) {
+               // Adds the resolved message id to the fatal message list
+               $this->fatalMessages[] = $message;
+       }
+
        /**
         * Flushs the cached HTTP response to the outer world
         *
@@ -142,7 +153,7 @@ class BaseResponse extends BaseFrameworkSystem {
         *                                                                                                      already sent
         */
        public function flushBuffer ($force = false) {
-               if ((headers_sent()) && (!$force)) {
+               if ((headers_sent()) && ($force === false)) {
                        // Headers are already sent!
                        throw new ResponseHeadersAlreadySentException($this, self::EXCEPTION_HEADERS_ALREADY_SENT);
                } elseif (!headers_sent()) {
index 3f8918b79da8c54dc29f1dfad2ddde98cb5857f5..94fe3b5deff55a2f96fac4aaba5bde59197b32a0 100644 (file)
@@ -51,6 +51,11 @@ class DatabaseResult extends BaseFrameworkSystem implements SearchableResult, Up
         */
        private $affectedRows = 0;
 
+       /**
+        * Found value
+        */
+       private $foundValue = "";
+
        /**
         * Protected constructor
         *
@@ -114,7 +119,7 @@ class DatabaseResult extends BaseFrameworkSystem implements SearchableResult, Up
 
        /**
         * "Iterator" method next() to advance to the next valid entry. This method
-        * does also check if the result is invalid
+        * does also check if result is invalid
         *
         * @return      $nextValid      Wether the next entry is valid
         */
@@ -208,16 +213,17 @@ class DatabaseResult extends BaseFrameworkSystem implements SearchableResult, Up
        }
 
        /**
-        * Rewind to the beginning
+        * Rewind to the beginning and clear array $currentRow
         *
         * @return      void
         */
        public function rewind () {
                $this->currentPos = -1;
+               $this->currentRow = array();
        }
 
        /**
-        * Searches for an entry in the data result and returns it
+        * Searches for an entry in data result and returns it
         *
         * @param       $criteriaInstance       The criteria to look inside the data set
         * @return      $result                         Found result entry
@@ -291,6 +297,15 @@ class DatabaseResult extends BaseFrameworkSystem implements SearchableResult, Up
                return $this->affectedRows;
        }
 
+       /**
+        * Getter for found value of previous found() call
+        *
+        * @return      $foundValue             Found value of previous found() call
+        */
+       public final function getFoundValue () {
+               return $this->foundValue;
+       }
+
        /**
         * Checks wether we have out-dated entries or not
         *
@@ -308,25 +323,80 @@ class DatabaseResult extends BaseFrameworkSystem implements SearchableResult, Up
         * @return      void
         */
        public function addElementsToDataSet (StoreableCriteria $criteriaInstance) {
+               // Walk only through out-dated columns
+               foreach ($this->outDated as $key => $dummy) {
+                       // Does this key exist?
+                       //* DEBUG: */ echo "outDated: {$key}<br />\n";
+                       if ($this->find($key)) {
+                               // Then update it
+                               $criteriaInstance->addCriteria($key, $this->getFoundValue());
+                       } // END - if
+               } // END - foreach
+       }
+
+       /**
+        * Find a key inside the result array
+        *
+        * @param       $key    The key we shall find
+        * @return      $found  Wether the key was found or not
+        */
+       public function find ($key) {
+               // By default nothing is found
+               $found = false;
+
                // Rewind the pointer
                $this->rewind();
 
                // Walk through all entries
                while ($this->valid()) {
-                       // Get next entry
+                       // Advance to next entry
                        $this->next();
+
+                       // Get the whole array
                        $currentEntry = $this->current();
 
-                       // Walk only through out-dated columns
-                       foreach ($this->outDated as $key => $dummy) {
-                               // Does this key exist?
-                               //* DEBUG: */ echo "outDated: {$key}<br />\n";
-                               if (isset($currentEntry[$key])) {
-                                       // Then update it
-                                       $criteriaInstance->addCriteria($key, $currentEntry[$key]);
-                               } // END - foreach
-                       } // END - foreach
+                       // Is the element there?
+                       if (isset($currentEntry[$key])) {
+                               // Okay, found!
+                               $found = true;
+
+                               // So "cache" it
+                               $this->foundValue = $currentEntry[$key];
+
+                               // And stop searching
+                               break;
+                       } // END - if
                } // END - while
+
+               // Return the result
+               return $found;
+       }
+
+       /**
+        * Solver for result index value with call-back method
+        *
+        * @param       $databaseColumn         Database column where the index might be found
+        * @param       $wrapperInstance        The wrapper instance to ask for array element
+        * @para        $callBack                       Call-back object for setting the index;
+        *                                                              0=object instance,1=method name
+        * @return      void
+4       * @todo        Find a caching way without modifying the result array
+        */
+       public function solveResultIndex ($databaseColumn, BaseDatabaseWrapper $wrapperInstance, array $callBack) {
+               // By default nothing is found
+               $indexValue = 0;
+
+               // Is the element in result itself found?
+               if ($this->find($databaseColumn)) {
+                       // Use this value
+                       $indexValue = $this->getFoundValue();
+               } elseif ($this->find($wrapperInstance->getIndexKey())) {
+                       // Use this value
+                       $indexValue = $this->getFoundValue();
+               }
+
+               // Set the index
+               call_user_func_array($callBack, array($indexValue));
        }
 }
 
index 7e1aa7c194f0fb6d1a015e4b640aa3f104396b3b..8690db6fe519d8f038307dbe7684e8712eb56d71 100644 (file)
@@ -1098,7 +1098,7 @@ class BaseTemplateEngine extends BaseFrameworkSystem {
 
                default: // Unknown type found
                        // Construct message
-                       $msg = sprintf("[%s-&gt;%s] Unknown/unsupported template type <strong>%s</strong> detected.",
+                       $msg = sprintf("[%s-&gt;%s] Unknown/unsupported template type <span class=\"data\">%s</span> detected.",
                                $this->__toString(),
                                __FUNCTION__,
                                $this->getTemplateType()
@@ -1172,7 +1172,7 @@ class BaseTemplateEngine extends BaseFrameworkSystem {
         * @return      void
         */
        public function transferToResponse (Responseable $responseInstance) {
-               // Get the content and set it in the response class
+               // Get the content and set it in response class
                $responseInstance->writeToBody($this->getCompiledData());
        }
 
index 0a3432de390c06c6729bc4ff4760a5f6009b6071..b00a0730f4cfe6b1d4da5cc1057e25730e8f87bf 100644 (file)
@@ -32,6 +32,11 @@ class BaseUser extends BaseFrameworkSystem {
         */
        private $userName = "";
 
+       /**
+        * User id of current user
+        */
+       private $userId = 0;
+
        /**
         * Email of current user
         */
@@ -59,26 +64,46 @@ class BaseUser extends BaseFrameworkSystem {
         * @return      void
         */
        public final function setUserName ($userName) {
-               $this->userName = $userName;
+               $this->userName = (string) $userName;
        }
 
        /**
-        * Setter for email
+        * Getter for username
         *
-        * @param       $email  The email to set
+        * @return      $userName       The username to get
+        */
+       public final function getUserName () {
+               return $this->userName;
+       }
+
+       /**
+        * Setter for user id
+        *
+        * @param       $userId         The user id to set
         * @return      void
+        * @todo        Find a way of casting here. "(int)" might destroy the user id > 32766
         */
-       protected final function setEmail ($email) {
-               $this->email = $email;
+       public final function setUserId ($userId) {
+               $this->userId = $userId;
        }
 
        /**
-        * Getter for username
+        * Getter for user id
         *
-        * @return      $userName       The username to get
+        * @return      $userId The user id to get
         */
-       public final function getUsername () {
-               return $this->userName;
+       public final function getUserId () {
+               return $this->userId;
+       }
+
+       /**
+        * Setter for email
+        *
+        * @param       $email  The email to set
+        * @return      void
+        */
+       protected final function setEmail ($email) {
+               $this->email = (string) $email;
        }
 
        /**
@@ -108,15 +133,21 @@ class BaseUser extends BaseFrameworkSystem {
                        $criteriaInstance = ObjectFactory::createObjectByConfiguredName('search_criteria_class');
 
                        // Add the username as a criteria and set limit to one entry
-                       $criteriaInstance->addCriteria(UserDatabaseWrapper::DB_COLUMN_USERNAME, $this->getUsername());
+                       $criteriaInstance->addCriteria(UserDatabaseWrapper::DB_COLUMN_USERNAME, $this->getUserName());
                        $criteriaInstance->setLimit(1);
 
                        // Get a search result
-                       $this->setResultInstance($wrapperInstance->doSelectByCriteria($criteriaInstance));
-               } else {
-                       // Rewind it
-                       $this->getResultInstance()->rewind();
-               }
+                       $resultInstance = $wrapperInstance->doSelectByCriteria($criteriaInstance);
+
+                       // Set the index "solver"
+                       $resultInstance->solveResultIndex(UserDatabaseWrapper::DB_COLUMN_USERID, $wrapperInstance, array($this, 'setUserId'));
+
+                       // And finally set it
+                       $this->setResultInstance($resultInstance);
+               } // END - if
+
+               // Rewind it
+               $this->getResultInstance()->rewind();
 
                // Search for it
                if ($this->getResultInstance()->next()) {
@@ -149,12 +180,18 @@ class BaseUser extends BaseFrameworkSystem {
                        $criteriaInstance->addCriteria(UserDatabaseWrapper::DB_COLUMN_EMAIL, $this->getEmail());
                        $criteriaInstance->setLimit(1);
 
-                       // Get a search resultInstance
-                       $this->setResultInstance($wrapperInstance->doSelectByCriteria($criteriaInstance));
-               } else {
-                       // Rewind it
-                       $this->getResultInstance()->rewind();
-               }
+                       // Get a search result
+                       $resultInstance = $wrapperInstance->doSelectByCriteria($criteriaInstance);
+
+                       // Set the index "solver"
+                       $resultInstance->solveResultIndex(UserDatabaseWrapper::DB_COLUMN_USERID, $wrapperInstance, array($this, 'setUserId'));
+
+                       // And finally set it
+                       $this->setResultInstance($resultInstance);
+               } // END - if
+
+               // Rewind it
+               $this->getResultInstance()->rewind();
 
                // Search for it
                if ($this->getResultInstance()->next()) {
@@ -176,8 +213,8 @@ class BaseUser extends BaseFrameworkSystem {
        }
 
        /**
-        * Checks if the supplied password hash in request matches with the stored
-        * in database.
+        * Checks if supplied password hash in request matches with the stored in
+        * database.
         *
         * @param       $requestInstance        A requestable class instance
         * @return      $matches                        Wether the supplied password hash matches
@@ -186,27 +223,36 @@ class BaseUser extends BaseFrameworkSystem {
                // By default nothing matches... ;)
                $matches = false;
 
-               // Get a UserDatabaseWrapper instance
-               $wrapperInstance = ObjectFactory::createObjectByConfiguredName('user_db_wrapper_class');
+               // Is a previous result there?
+               if (is_null($this->getResultInstance())) {
+                       // Get a UserDatabaseWrapper instance
+                       $wrapperInstance = ObjectFactory::createObjectByConfiguredName('user_db_wrapper_class');
+
+                       // Create a search criteria
+                       $criteriaInstance = ObjectFactory::createObjectByConfiguredName('search_criteria_class');
+
+                       // Add the username as a criteria and set limit to one entry
+                       $criteriaInstance->addCriteria(UserDatabaseWrapper::DB_COLUMN_USERNAME, $this->getUserName());
+                       $criteriaInstance->setLimit(1);
+
+                       // Get a search result
+                       $resultInstance = $wrapperInstance->doSelectByCriteria($criteriaInstance);
 
-               // Create a search criteria
-               $criteriaInstance = ObjectFactory::createObjectByConfiguredName('search_criteria_class');
+                       // Set the index "solver"
+                       $resultInstance->solveResultIndex(UserDatabaseWrapper::DB_COLUMN_USERID, $wrapperInstance, array($this, 'setUserId'));
 
-               // Add the username as a criteria and set limit to one entry
-               $criteriaInstance->addCriteria(UserDatabaseWrapper::DB_COLUMN_USERNAME, $this->getUserName());
-               $criteriaInstance->setLimit(1);
+                       // And finally set it
+                       $this->setResultInstance($resultInstance);
+               } // END - if
 
-               // Get a search resultInstance
-               $this->setResultInstance($wrapperInstance->doSelectByCriteria($criteriaInstance));
+               // Rewind it
+               $this->getResultInstance()->rewind();
 
                // Search for it
-               if ($this->getResultInstance()->next()) {
-                       // Get the current entry (can only be one!)
-                       $entry = $this->getResultInstance()->current();
-
+               if ($this->getResultInstance()->find('pass_hash')) {
                        // So does the hashes match?
                        //* DEBUG: */ echo $requestInstance->getRequestElement('pass_hash')."/".$entry['pass_hash'];
-                       $matches = ($requestInstance->getRequestElement('pass_hash') === $entry['pass_hash']);
+                       $matches = ($requestInstance->getRequestElement('pass_hash') === $this->getResultInstance()->getFoundValue());
                } // END - if
 
                // Return the status
index 84405dc47a9ba8fcb7daf77d6eb579b1c1eb71bf..2362921bea088be66907c83b6f8c8a2161dbaddc 100644 (file)
@@ -39,8 +39,8 @@ class Guest extends BaseUser implements ManageableGuest, Registerable {
 
        /**
         * Creates an instance of this user class by a provided username. This
-        * factory method will check if the username is already taken and if not
-        * so it will throw an exception.
+        * factory method will check if username is already taken and if not so it
+        * will throw an exception.
         *
         * @param       $userName               Username we need a class instance for
         * @return      $userInstance   An instance of this user class
@@ -53,11 +53,11 @@ class Guest extends BaseUser implements ManageableGuest, Registerable {
                // Set the username
                $userInstance->setUserName($userName);
 
-               // Check if the username exists
-               if (!$userInstance->ifUsernameExists()) {
+               // Check if username exists
+               if ($userInstance->ifUsernameExists() === false) {
                        // Throw an exception here
                        throw new UsernameMissingException(array($userInstance, $userName), self::EXCEPTION_USERNAME_NOT_FOUND);
-               }
+               } // END - if
 
                // Return the instance
                return $userInstance;
@@ -65,7 +65,7 @@ class Guest extends BaseUser implements ManageableGuest, Registerable {
 
        /**
         * Creates an instance of this user class by a provided email address. This
-        * factory method will not check if the email address is there.
+        * factory method will not check if email address is there.
         *
         * @param       $email                  Email address of the user
         * @return      $userInstance   An instance of this user class
index 141f1de389c874dbe39fb034a83b4ca55ed1d351..b67ad88b9274bbc1f2ebc48759a49ab2ac47663f 100644 (file)
@@ -47,8 +47,8 @@ class Member extends BaseUser implements ManageableMember, Registerable, Updatea
 
        /**
         * Creates an instance of this user class by a provided username. This
-        * factory method will check if the username is already taken and if not
-        * so it will throw an exception.
+        * factory method will check if username is already taken and if not so it
+        * will throw an exception.
         *
         * @param       $userName               Username we need a class instance for
         * @return      $userInstance   An instance of this user class
@@ -61,11 +61,11 @@ class Member extends BaseUser implements ManageableMember, Registerable, Updatea
                // Set the username
                $userInstance->setUserName($userName);
 
-               // Check if the username exists
-               if (!$userInstance->ifUsernameExists()) {
+               // Check if username exists
+               if ($userInstance->ifUsernameExists() === false) {
                        // Throw an exception here
                        throw new UsernameMissingException(array($userInstance, $userName), self::EXCEPTION_USERNAME_NOT_FOUND);
-               }
+               } // END - if
 
                // Return the instance
                return $userInstance;
@@ -73,7 +73,7 @@ class Member extends BaseUser implements ManageableMember, Registerable, Updatea
 
        /**
         * Creates an instance of this user class by a provided email address. This
-        * factory method will not check if the email address is there.
+        * factory method will not check if email address is there.
         *
         * @param       $email                  Email address of the user
         * @return      $userInstance   An instance of this user class
@@ -144,8 +144,8 @@ class Member extends BaseUser implements ManageableMember, Registerable, Updatea
                $updateInstance = ObjectFactory::createObjectByConfiguredName('update_criteria_class');
 
                // And add our both entries
-               $updateInstance->addCriteria('last_activity', date("Y-m-d H:i:s", time()));
-               $updateInstance->addCriteria('last_action', $lastAction);
+               $updateInstance->addCriteria("last_activity", date("Y-m-d H:i:s", time()));
+               $updateInstance->addCriteria("last_action", $lastAction);
 
                // Add the search criteria for searching for the right entry
                $updateInstance->setSearchInstance($searchInstance);
index 266cf6facd10b54b5bc1f88a78ab0f7b4011529d..6d3ede2569da9a7066427c042b6a64de4681ef87 100644 (file)
@@ -61,7 +61,7 @@ class CompressorChannel extends BaseMiddleware implements Registerable {
                        // Read all directories but no sub directories
                        while ($dir = $dirPointer->readDirectoryExcept(array("..", ".", ".htaccess", ".svn"))) {
                                // Is this a class file?
-                               if ((substr($dir, 0, 6) == "class_") && (substr($dir, -4, 4) == FrameworkConfiguration::getInstance()->readConfig('php_extension'))) {
+                               if ((substr($dir, 0, 6) == "class_") && (substr($dir, -4, 4) == ".php")) {
                                        // Get the compressor's name. That's why you must name
                                        // your files like your classes and also that's why you
                                        // must keep on class in one file.
index 736ea4b501c14eb7261912180802c355d49049e1..6f0a4e1ef2660a5b0664689a5aaf11feb749b591 100644 (file)
@@ -98,6 +98,15 @@ class DatabaseConnection extends BaseMiddleware implements DatabaseConnector, Re
                $this->dbLayer = $dbLayer;
        }
 
+       /**
+        * Getter for index key
+        *
+        * @return      $indexKey       Index key
+        */
+       public final function getIndexKey () {
+               return $this->dbLayer->getIndexKey();
+       }
+
        /**
         * Runs a "select" statement on the database layer with given table name
         * and criteria. If this doesn't fail the result will be returned
index d50782a1daac0c90a0eb5d57dd1d1ec9749ee8fe..143ad06ca61c3ff5924f5cef4edab64540d59c44 100644 (file)
 @require_once(dirname(__FILE__) . '/config/class_FrameworkConfiguration.php');
 
 // Get a new configuration instance
-$cfg = FrameworkConfiguration::createFrameworkConfiguration();
+$cfg = FrameworkConfiguration::getInstance();
 
 // CFG: SERVER-PATH
-$cfg->setConfigEntry('base_path', (dirname(dirname(__FILE__)) . '/')); // DON'T MISS THE TRAILING SLASH!!!
+$cfg->setConfigEntry('base_path', (dirname(dirname(__FILE__)) . '/'));
 
 // CFG: BASE-URL
 $cfg->setConfigEntry('base_url', $cfg->detectBaseUrl());
@@ -50,9 +50,6 @@ $cfg->setDefaultTimezone("Europe/Berlin");
 // CFG: MAGIC-QUOTES-RUNTIME
 $cfg->setMagicQuotesRuntime(false);
 
-// CFG: PHP-SCRIPT-EXTENSION
-$cfg->setConfigEntry('php_extension', ".php");
-
 // CFG: CLASS-PREFIX
 $cfg->setConfigEntry('class_prefix', "class_");
 
@@ -75,19 +72,19 @@ $cfg->setConfigEntry('app_helper_class', "ApplicationHelper");
 $cfg->setConfigEntry('entry_method', "entryPoint");
 
 // CFG: TEMPLATE-BASE-PATH
-$cfg->setConfigEntry('tpl_base_path', "templates/"); // DON'T MISS THE TRAILING SLASH!
+$cfg->setConfigEntry('tpl_base_path', "templates/");
 
 // CFG: LANGUAGE-BASE-PATH
-$cfg->setConfigEntry('lang_base_path', "inc/language/"); // DON'T MISS THE TRAILING SLASH!
+$cfg->setConfigEntry('lang_base_path', "inc/language/");
 
 // CFG: COMPRESSOR-BASE-PATH
-$cfg->setConfigEntry('compressor_base_path', "inc/classes/main/compressor/"); // DON'T MISS THE TRAILING SLASH!
+$cfg->setConfigEntry('compressor_base_path', "inc/classes/main/compressor/");
 
 // CFG: APPLICATION-PATH
 $cfg->setConfigEntry('application_path', $cfg->readConfig('base_path') . "application/");
 
 // CFG: COMPILE-OUTPUT-PATH
-$cfg->setConfigEntry('compile_output_path', "templates/_compiled/"); // DON'T MISS THE TRAILING SLASH!
+$cfg->setConfigEntry('compile_output_path', "templates/_compiled/");
 
 // CFG: TEMPLATE-ENGINE
 $cfg->setConfigEntry('template_class', "WebTemplateEngine");
@@ -170,50 +167,50 @@ $cfg->setConfigEntry('file_input_class', "FileIoStream");
 // CFG: FILE-OUTPUT-STREAM
 $cfg->setConfigEntry('file_output_class', "FileIoStream");
 
-// CFG: EMAIL-VALIDATOR
-$cfg->setConfigEntry('email_validator_class', "EmailValidatorFilter");
+// CFG: EMAIL-VALIDATOR-FILTER
+$cfg->setConfigEntry('email_validator_filter', "EmailValidatorFilter");
 
-// CFG: USERNAME-VALIDATOR
-$cfg->setConfigEntry('username_validator_class', "UserNameValidatorFilter");
+// CFG: USERNAME-VALIDATOR-FILTER
+$cfg->setConfigEntry('username_validator_filter', "UserNameValidatorFilter");
 
-// CFG: USERNAME-IS-GUEST
-$cfg->setConfigEntry('username_is_guest_class', "UserNameIsGuestFilter");
+// CFG: USERNAME-IS-GUEST-FILTER
+$cfg->setConfigEntry('username_is_guest_filter', "UserNameIsGuestFilter");
 
-// CFG: PASSWORD-VALIDATOR
-$cfg->setConfigEntry('password_validator_class', "PasswordValidatorFilter");
+// CFG: PASSWORD-VALIDATOR-FILTER
+$cfg->setConfigEntry('password_validator_filter', "PasswordValidatorFilter");
 
-// CFG: RULES-ACCEPTED-CLASS
-$cfg->setConfigEntry('rules_accepted_class', "RulesAcceptedFilter");
+// CFG: RULES-ACCEPTED-FILTER
+$cfg->setConfigEntry('rules_accepted_filter', "RulesAcceptedFilter");
 
-// CFG: USERNAME-VERIFIER-CLASS
-$cfg->setConfigEntry('username_verifier_class', "UserNameVerifierFilter");
+// CFG: USERNAME-VERIFIER-FILTER
+$cfg->setConfigEntry('username_verifier_filter', "UserNameVerifierFilter");
 
-// CFG: USER-GUEST-VERIFIER-CLASS
-$cfg->setConfigEntry('user_guest_verifier_class', "UserGuestVerifierFilter");
+// CFG: USER-GUEST-VERIFIER-FILTER
+$cfg->setConfigEntry('user_guest_verifier_filter', "UserGuestVerifierFilter");
 
-// CFG: EMAIL-VERIFIER
-$cfg->setConfigEntry('email_verifier_class', "EmailVerifierFilter");
+// CFG: EMAIL-VERIFIER-FILTER
+$cfg->setConfigEntry('email_verifier_filter', "EmailVerifierFilter");
 
-// CFG: PASSWORD-VERIFIER-CLASS
-$cfg->setConfigEntry('password_verifier_class', "PasswordVerifierFilter");
+// CFG: PASSWORD-VERIFIER-FILTER
+$cfg->setConfigEntry('password_verifier_filter', "PasswordVerifierFilter");
 
-// CFG: PASSWD-GUEST-VERIFIER-CLASS
-$cfg->setConfigEntry('passwd_guest_verifier_class', "PasswordGuestVerifierFilter");
+// CFG: PASSWD-GUEST-VERIFIER-FILTER
+$cfg->setConfigEntry('passwd_guest_verifier_filter', "PasswordGuestVerifierFilter");
 
-// CFG: EMAIL-CHANGE-CLASS
-$cfg->setConfigEntry('email_change_class', "EmailChangeFilter");
+// CFG: EMAIL-CHANGE-FILTER
+$cfg->setConfigEntry('email_change_filter', "EmailChangeFilter");
 
-// CFG: PASSWORD-CHANGE-CLASS
-$cfg->setConfigEntry('password_change_class', "PasswordChangeFilter");
+// CFG: PASSWORD-CHANGE-FILTER
+$cfg->setConfigEntry('password_change_filter', "PasswordChangeFilter");
 
-// CFG: ACCOUNT-PASSWORD-CLASS
-$cfg->setConfigEntry('account_password_class', "AccountPasswordVerifierFilter");
+// CFG: ACCOUNT-PASSWORD-FILTER
+$cfg->setConfigEntry('account_password_filter', "AccountPasswordVerifierFilter");
 
-// CFG: USER-STATUS-CLASS
-$cfg->setConfigEntry('user_status_class', "UserStatusVerifierFilter");
+// CFG: USER-STATUS-FILTER
+$cfg->setConfigEntry('user_status_filter', "UserStatusVerifierFilter");
 
-// CFG: USER-UNCONFIRMED-CLASS
-$cfg->setConfigEntry('user_unconfirmed_class', "UserUnconfirmedVerifierFilter");
+// CFG: USER-UNCONFIRMED-FILTER
+$cfg->setConfigEntry('user_unconfirmed_filter', "UserUnconfirmedVerifierFilter");
 
 // CFG: CRYPTO-CLASS
 $cfg->setConfigEntry('crypto_class', "CryptoHelper");
@@ -267,7 +264,7 @@ $cfg->setConfigEntry('guest_class', "Guest");
 $cfg->setConfigEntry('cookie_expire', (60*60*2)); // Two hours!
 
 // CFG: COOKIE-PATH
-$cfg->setConfigEntry('cookie_path', dirname($_SERVER['SCRIPT_NAME']) . "/");
+$cfg->setConfigEntry('cookie_path', $cfg->detectScriptPath() . "/");
 
 // CFG: COOKIE-DOMAIN
 $cfg->setConfigEntry('cookie_domain', $cfg->detectDomain()); // Is mostly the same...
@@ -284,5 +281,8 @@ $cfg->setConfigEntry('db_update_primary_forced', "Y");
 // CFG: GERMAN-DATE-TIME
 $cfg->setConfigEntry('german_date_time', "%3\$s.%2\$s.%1\$s, %4\$s:%5\$s:%6\$s");
 
+// CFG: PRODUCT-INSTALL-MODE
+$cfg->setConfigEntry('product_install_mode', "debug");
+
 // [EOF]
 ?>
index 8f6fa15f45cd254137a917bb7744bd481a3974f8..e3202603aba1317a735a0bfbf02dcc37b2206f3a 100644 (file)
@@ -2,8 +2,8 @@
 /**
  * A class for the configuration stuff implemented in a singleton design paddern
  *
- * NOTE: We cannot put this in inc/classes/ because it would be loaded (again)
- * in the class loader. See inc/loader/class_ClassLoader.php for instance
+ * NOTE: We cannot put this in inc/classes/ because it would be loaded (again) in
+ * class loader. See inc/loader/class_ClassLoader.php for instance
  *
  * @see                        ClassLoader
  * @author             Roland Haeder <webmaster@ship-simu.org>
@@ -51,46 +51,18 @@ class FrameworkConfiguration implements Registerable {
                // Empty for now
        }
 
-       /**
-        * "Create" a configuration instance
-        *
-        * @param       $enableDebug    Wether enable debug mode (default: off)
-        * @return      $cfgInstance    An instance of this configuration class
-        */
-       public final static function createFrameworkConfiguration ($enableDebug = false) {
-               /**
-                * For singleton design pattern because we only need a one-time-run
-                * through the initial configuration.
-                */
-               if (is_null(self::$cfgInstance))  {
-                       // CFG: ERROR-REPORTING
-                       @error_reporting(E_ALL | E_STRICT);
-
-                       /**
-                        * Shall we enable the debug mode?
-                        */
-                       if ($enableDebug) {
-                               define('DEBUG_MODE', true);
-                       }
-
-                       /**
-                        * Crate a config instance
-                        */
-                       self::$cfgInstance = new FrameworkConfiguration();
-               }
-
-               /**
-                * Return the instance
-                */
-               return self::$cfgInstance;
-       }
-
        /**
         * Getter for an instance of this class
         *
         * @return      $cfgInstance    An instance of this class
         */
        public final static function getInstance () {
+               // is the instance there?
+               if (is_null(self::$cfgInstance))  {
+                       // Create a config instance
+                       self::$cfgInstance = new FrameworkConfiguration();
+               } // END - if
+
                return self::$cfgInstance;
        }
 
@@ -231,7 +203,7 @@ class FrameworkConfiguration implements Registerable {
                } // END - if
 
                // Construct the full URL now and secure it against CSRF attacks
-               $baseUrl = $baseUrl . "://" . $this->detectDomain() . dirname($_SERVER['SCRIPT_NAME']);
+               $baseUrl = $baseUrl . "://" . $this->detectDomain() . $this->detectScriptPath();
 
                // Return the URL
                return $baseUrl;
@@ -256,6 +228,24 @@ class FrameworkConfiguration implements Registerable {
                return $fullDomain;
        }
 
+       /**
+        * Detect safely the script path without trailing slash which is the part
+        * between "http://your-domain.invalid/" and "script-name.php"
+        */
+       public function detectScriptPath () {
+               // Default is empty
+               $scriptPath = "";
+
+               // Is the scriptname set?
+               if (isset($_SERVER['SCRIPT_NAME'])) {
+                       // Get dirname of it
+                       $scriptPath = dirname($_SERVER['SCRIPT_NAME']);
+               } // END - if
+
+               // Return it
+               return $scriptPath;
+       }
+
        /**
         * Getter for field name
         *
index 03bc377ac5d781427711d319ddd2a873b9f8202a..de0c7d88443a68397395c1838d609cb3d05622a6 100644 (file)
@@ -29,10 +29,9 @@ $layerInstance = null;
 $cfg = FrameworkConfiguration::getInstance();
 
 // Generate FQFN for the database layer
-$INC = sprintf("%sinc/database/lib-%s%s",
+$INC = sprintf("%sinc/database/lib-%s.php",
        $cfg->readConfig('base_path'),
-       $cfg->readConfig('db_type'),
-       $cfg->readConfig('php_extension')
+       $cfg->readConfig('db_type')
 );
 
 // Load the database layer include
@@ -53,31 +52,34 @@ unset($INC);
 try {
        $db = DatabaseConnection::createDatabaseConnection(DebugMiddleware::getInstance(), $layerInstance);
 } catch (NullPointerException $e) {
-       ApplicationEntryPoint::app_die(sprintf("[Main:] Database sub-system not initialized for the follwing reason: <strong>%s</strong><br />\n",
+       ApplicationEntryPoint::app_die(sprintf("[Main:] Database sub-system not initialized for the follwing reason: <span class=\"exception_reason\">%s</span><br />\n",
                $e->getMessage()
        ));
 } catch (InvalidDirectoryResourceException $e) {
-       ApplicationEntryPoint::app_die(sprintf("[Main:] Database sub-system not initialized for the follwing reason: <strong>%s</strong><br />\n",
+       ApplicationEntryPoint::app_die(sprintf("[Main:] Database sub-system not initialized for the follwing reason: <span class=\"exception_reason\">%s</span><br />\n",
                $e->getMessage()
        ));
 } catch (PathIsEmptyException $e) {
-       ApplicationEntryPoint::app_die(sprintf("[Main:] Database sub-system not initialized for the follwing reason: <strong>%s</strong><br />\n",
+       ApplicationEntryPoint::app_die(sprintf("[Main:] Database sub-system not initialized for the follwing reason: <span class=\"exception_reason\">%s</span><br />\n",
                $e->getMessage()
        ));
 } catch (PathIsNoDirectoryException $e) {
-       ApplicationEntryPoint::app_die(sprintf("[Main:] Database sub-system not initialized for the follwing reason: <strong>%s</strong><br />\n",
+       ApplicationEntryPoint::app_die(sprintf("[Main:] Database sub-system not initialized for the follwing reason: <span class=\"exception_reason\">%s</span><br />\n",
                $e->getMessage()
        ));
 } catch (PathReadProtectedException $e) {
-       ApplicationEntryPoint::app_die(sprintf("[Main:] Database sub-system not initialized for the follwing reason: <strong>%s</strong><br />\n",
+       ApplicationEntryPoint::app_die(sprintf("[Main:] Database sub-system not initialized for the follwing reason: <span class=\"exception_reason\">%s</span><br />\n",
                $e->getMessage()
        ));
 } catch (DirPointerNotOpenedException $e) {
-       ApplicationEntryPoint::app_die(sprintf("[Main:] Database sub-system not initialized for the follwing reason: <strong>%s</strong><br />\n",
+       ApplicationEntryPoint::app_die(sprintf("[Main:] Database sub-system not initialized for the follwing reason: <span class=\"exception_reason\">%s</span><br />\n",
                $e->getMessage()
        ));
 }
 
+// Is the app variable there and valid?
+if (is_object($app)) $app->setDatabaseInstance($db);
+
 // Datenbankobjekt debuggen
 if (defined('DEBUG_DATABASE_OBJ')) {
        DebugMiddleware::getInstance()->output(sprintf("The database sub-system does now look like this:<br />
index ae748c5de1024d95682c0a906b1dbaed43bfa884..9e9d5a663c480a62991ae66cf96027ef5bb1b494 100644 (file)
 try {
        $layerInstance = LocalFileDatabase::createLocalFileDatabase(FrameworkConfiguration::getInstance()->readConfig('local_db_path'), FileIoHandler::getInstance());
 } catch (SavePathIsEmptyException $e) {
-       ApplicationEntryPoint::app_die(sprintf("[Main:] Database layer could not be initialized. Reason: <strong>%s</strong>",
+       ApplicationEntryPoint::app_die(sprintf("[Main:] Database layer could not be initialized. Reason: <span class=\"exception_reason\">%s</span>",
                $e->getMessage()
        ));
 } catch (SavePathNotFoundException $e) {
-       ApplicationEntryPoint::app_die(sprintf("[Main:] Database layer could not be initialized. Reason: <strong>%s</strong>",
+       ApplicationEntryPoint::app_die(sprintf("[Main:] Database layer could not be initialized. Reason: <span class=\"exception_reason\">%s</span>",
                $e->getMessage()
        ));
 } catch (SavePathIsNoDirectoryException $e) {
-       ApplicationEntryPoint::app_die(sprintf("[Main:] Database layer could not be initialized. Reason: <strong>%s</strong>",
+       ApplicationEntryPoint::app_die(sprintf("[Main:] Database layer could not be initialized. Reason: <span class=\"exception_reason\">%s</span>",
                $e->getMessage()
        ));
 } catch (SavePathReadProtectedException $e) {
-       ApplicationEntryPoint::app_die(sprintf("[Main:] Database layer could not be initialized. Reason: <strong>%s</strong>",
+       ApplicationEntryPoint::app_die(sprintf("[Main:] Database layer could not be initialized. Reason: <span class=\"exception_reason\">%s</span>",
                $e->getMessage()
        ));
 } catch (SavePathWriteProtectedException $e) {
-       ApplicationEntryPoint::app_die(sprintf("[Main:] Database layer could not be initialized. Reason: <strong>%s</strong>",
+       ApplicationEntryPoint::app_die(sprintf("[Main:] Database layer could not be initialized. Reason: <span class=\"exception_reason\">%s</span>",
                $e->getMessage()
        ));
 }
index 0a5ec9b4c36f4cd86e7c1d1343700a9c5f914a78..c141feabd932d109637b53179e53cdfb3ef88fdb 100644 (file)
@@ -27,5 +27,8 @@
 // Get the instance
 $io = ObjectFactory::createObjectByConfiguredName('file_io_class');
 
+// Is the app variable there and valid?
+if (is_object($app)) $app->setFileIoInstance($io);
+
 // [EOF]
 ?>
index 54bd39be01546f744b9cb064b576ab3cc833377f..7e3f5c9ffc6bf37b059d87261772ff30b4e29bc6 100644 (file)
@@ -26,7 +26,7 @@
 $cfg = FrameworkConfiguration::getInstance();
 
 // Include the class loader function
-require(sprintf("%sinc/loader/class_ClassLoader%s", $cfg->readConfig('base_path'), $cfg->readConfig('php_extension')));
+require(sprintf("%sinc/loader/class_ClassLoader.php", $cfg->readConfig('base_path')));
 
 // Does the user has an application specified?
 if (!empty($_GET['app'])) {
index 6db17c0ba7bb4ec55caf0da4b4ad868de3734dbf..fe8847a3cb3bbd09633d347d5a3aad2b3689867b 100644 (file)
@@ -26,22 +26,25 @@ try {
                FrameworkConfiguration::getInstance()->readConfig('lang_base_path')
        ));
 } catch (LanguagePathIsEmptyException $e) {
-       ApplicationEntryPoint::app_die(sprintf("[Main:] The language sub-system could not be initialized for the following reason: <strong>%s</strong>",
+       ApplicationEntryPoint::app_die(sprintf("[Main:] The language sub-system could not be initialized for the following reason: <span class=\"exception_reason\">%s</span>",
                $e->getMessage()
        ));
 } catch (InvalidLanguagePathStringException $e) {
-       ApplicationEntryPoint::app_die(sprintf("[Main:] The language sub-system could not be initialized for the following reason: <strong>%s</strong>",
+       ApplicationEntryPoint::app_die(sprintf("[Main:] The language sub-system could not be initialized for the following reason: <span class=\"exception_reason\">%s</span>",
                $e->getMessage()
        ));
 } catch (LanguagePathIsNoDirectoryException $e) {
-       ApplicationEntryPoint::app_die(sprintf("[Main:] The language sub-system could not be initialized for the following reason: <strong>%s</strong>",
+       ApplicationEntryPoint::app_die(sprintf("[Main:] The language sub-system could not be initialized for the following reason: <span class=\"exception_reason\">%s</span>",
                $e->getMessage()
        ));
 } catch (LanguagePathReadProtectedException $e) {
-       ApplicationEntryPoint::app_die(sprintf("[Main:] The language sub-system could not be initialized for the following reason: <strong>%s</strong>",
+       ApplicationEntryPoint::app_die(sprintf("[Main:] The language sub-system could not be initialized for the following reason: <span class=\"exception_reason\">%s</span>",
                $e->getMessage()
        ));
 }
 
+// Is the app variable there and valid?
+if (is_object($app)) $app->setLanguageInstance($lang);
+
 // [EOF]
 ?>
index ddab76926ef76f12dcc80b111927c49d7f854c08..d20cbcb04abcd0c14fa5a5b6fa182142a5395d43 100644 (file)
@@ -29,6 +29,7 @@ $cfg = FrameworkConfiguration::getInstance();
 $configAppIncludes = array(
        sprintf("class_%s", $cfg->readConfig('app_helper_class')), // The ApplicationHelper class
        "config",               // The application's own configuration
+       "data",                 // Application data
        "init",                 // The application initializer
        "loader",               // The application's class loader
        "debug",                // Some debugging stuff
@@ -45,11 +46,10 @@ foreach ($configAppIncludes as $inc) {
        }
 
        // Generate a FQFN for the helper class
-       $fqfn = sprintf("%s%s/%s%s",
+       $fqfn = sprintf("%s%s/%s.php",
                $cfg->readConfig('application_path'),
                $cfg->readConfig('app_name'),
-               $inc,
-               $cfg->readConfig('php_extension')
+               $inc
        );
 
        // Does the include file exists?
@@ -58,8 +58,8 @@ foreach ($configAppIncludes as $inc) {
                require_once($fqfn);
        } elseif ($cfg->readConfig('verbose_level') > 0) {
                // File is missing
-               trigger_error(sprintf("Cannot load application script %s! File is missing or read-protected.",
-                       $inc . $cfg->readConfig('php_extension')
+               trigger_error(sprintf("Cannot load application script %s.php! File is missing or read-protected.",
+                       $inc
                ));
        }
 }
index 0d709cb81e3225c397d592082632e47ff9f21187..a6846bf8cc21ee7690c5a8bcf949a348311b1bdf 100644 (file)
--- a/index.php
+++ b/index.php
@@ -49,12 +49,13 @@ class ApplicationEntryPoint {
        /**
         * The application's emergency exit
         *
-        * @param       $message        The optional message we shall output on exit
-        * @param       $code           Error code from exception
-        * @param       $extraData      Extra information from exceptions
+        * @param       $message                The optional message we shall output on exit
+        * @param       $code                   Error code from exception
+        * @param       $extraData              Extra information from exceptions
+        * @param       $silentMode             Wether not silent mode is turned on
         * @return      void
         */
-       public static function app_die ($message = "", $code = false, $extraData = "") {
+       public static function app_die ($message = "", $code = false, $extraData = "", $silentMode = false) {
                // Is this method already called?
                if (defined('EMERGENCY_EXIT_CALLED')) {
                        // Then output the text directly
@@ -68,7 +69,16 @@ class ApplicationEntryPoint {
                if (empty($message)) {
                        // No message provided
                        $message = "No message provided!";
-               }
+               } // END - if
+
+               // Get config instance
+               $configInstance = FrameworkConfiguration::getInstance();
+
+               // Do we have debug installation?
+               if (($configInstance->readConfig('product_install_mode') == "productive") || ($silentMode === true)) {
+                       // Abort here
+                       die();
+               } // END - if
 
                // Get some instances
                $tpl = FrameworkConfiguration::getInstance()->readConfig('template_class');
@@ -85,7 +95,7 @@ class ApplicationEntryPoint {
                                // Get the template instance from our object factory
                                $templateInstance = ObjectFactory::createObjectByName($tpl, array(FrameworkConfiguration::getInstance()->readConfig('tpl_base_path'), $lang, $io));
                        } catch (FrameworkException $e) {
-                               die(sprintf("[Main:] Could not initialize template engine for reason: <strong>%s</strong>",
+                               die(sprintf("[Main:] Could not initialize template engine for reason: <span class=\"exception_reason\">%s</span>",
                                        $e->getMessage()
                                ));
                        }
@@ -93,13 +103,25 @@ class ApplicationEntryPoint {
                        // Get and prepare backtrace for output
                        $backtraceArray = debug_backtrace();
                        $backtrace = "";
-                       foreach ($backtraceArray as $key=>$trace) {
+                       foreach ($backtraceArray as $key => $trace) {
                                if (!isset($trace['file'])) $trace['file'] = __FILE__;
                                if (!isset($trace['line'])) $trace['line'] = __LINE__;
                                if (!isset($trace['args'])) $trace['args'] = array();
                                $backtrace .= "<span class=\"backtrace_file\">".basename($trace['file'])."</span>:".$trace['line'].", <span class=\"backtrace_function\">".$trace['function']."(".count($trace['args']).")</span><br />";
                        } // END - foreach
 
+                       // Init application instance
+                       $appInstance = null;
+
+                       // Is the class there?
+                       if (class_exists('ApplicationHelper')) {
+                               // Get application instance
+                               $appInstance = ApplicationHelper::getInstance();
+
+                               // Assign application data
+                               $templateInstance->assignApplicationData($appInstance);
+                       } // END - if
+
                        // Assign variables
                        $templateInstance->assignVariable('message', $message);
                        $templateInstance->assignVariable('code', $code);