Code sync from ship-simu code (all class config entries must end with _class!)
authorRoland Häder <roland@mxchange.org>
Sun, 15 Jun 2008 19:25:32 +0000 (19:25 +0000)
committerRoland Häder <roland@mxchange.org>
Sun, 15 Jun 2008 19:25:32 +0000 (19:25 +0000)
192 files changed:
.gitattributes
inc/classes/exceptions/auth/.htaccess [new file with mode: 0644]
inc/classes/exceptions/auth/class_UserAuthorizationException.php [new file with mode: 0644]
inc/classes/exceptions/class_ [new file with mode: 0644]
inc/classes/exceptions/class_FrameworkException.php
inc/classes/exceptions/compressor/class_MismatchingCompressorsException.php
inc/classes/exceptions/container/class_ContainerItemIsNoArrayException.php
inc/classes/exceptions/container/class_ContainerItemIsNullException.php
inc/classes/exceptions/container/class_ContainerMaybeDamagedException.php
inc/classes/exceptions/controller/class_DefaultControllerException.php
inc/classes/exceptions/database/class_DatabaseException.php
inc/classes/exceptions/database/general/class_SqlException.php
inc/classes/exceptions/database/local_file/class_SavePathIsEmptyException.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/filter/.htaccess [new file with mode: 0644]
inc/classes/exceptions/filter/class_FilterChainException.php [new file with mode: 0644]
inc/classes/exceptions/helper/class_FormClosedException.php
inc/classes/exceptions/helper/class_FormGroupClosedException.php
inc/classes/exceptions/helper/class_FormOpenedException.php
inc/classes/exceptions/helper/class_InvalidFormNameException.php
inc/classes/exceptions/helper/class_UserInstanceMissingException.php [new file with mode: 0644]
inc/classes/exceptions/io/class_DirPointerNotOpenedException.php
inc/classes/exceptions/io/class_FilePointerNotOpenedException.php
inc/classes/exceptions/io/class_InvalidDataLengthException.php
inc/classes/exceptions/io/class_InvalidDirectoryResourceException.php
inc/classes/exceptions/io/class_InvalidMD5ChecksumException.php
inc/classes/exceptions/io/class_PathIsEmptyException.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_LanguagePathIsEmptyException.php
inc/classes/exceptions/language/class_LanguagePathIsNoDirectoryException.php
inc/classes/exceptions/language/class_LanguagePathReadProtectedException.php
inc/classes/exceptions/language/class_MissingFileIoHandlerException.php
inc/classes/exceptions/language/class_MissingLanguageHandlerException.php
inc/classes/exceptions/main/class_ClassMismatchException.php
inc/classes/exceptions/main/class_ClassNotFoundException.php
inc/classes/exceptions/main/class_ConfigEntryIsEmptyException.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_ExceptionNotChangedException.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_InvalidControllerException.php
inc/classes/exceptions/main/class_InvalidObjectException.php
inc/classes/exceptions/main/class_MissingArrayElementsException.php
inc/classes/exceptions/main/class_MissingDecimalsThousandsSeperatorException.php
inc/classes/exceptions/main/class_MissingMethodException.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_NullPointerException.php
inc/classes/exceptions/main/class_ResponseHeadersAlreadySentException.php
inc/classes/exceptions/main/class_VariableIsNotSetException.php
inc/classes/exceptions/template/class_BasePathIsEmptyException.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_InvalidTemplateVariableNameException.php
inc/classes/exceptions/template/class_UnexpectedTemplateTypeException.php
inc/classes/exceptions/template/class_UnsupportedTemplateEngineException.php
inc/classes/exceptions/template/class_ViewHelperNotFoundException.php
inc/classes/exceptions/user/class_UserEmailMissingException.php
inc/classes/exceptions/user/class_UserPasswordMismatchException.php [new file with mode: 0644]
inc/classes/exceptions/user/class_UsernameMissingException.php
inc/classes/interfaces/application/class_ManageableApplication.php
inc/classes/interfaces/auth/.htaccess [new file with mode: 0644]
inc/classes/interfaces/auth/class_Authorizeable.php [new file with mode: 0644]
inc/classes/interfaces/cache/class_Cacheable.php
inc/classes/interfaces/class_
inc/classes/interfaces/class_FrameworkInterface.php
inc/classes/interfaces/commands/class_Commandable.php
inc/classes/interfaces/compressor/class_Compressor.php
inc/classes/interfaces/controller/class_Controller.php
inc/classes/interfaces/criteria/class_Criteria.php
inc/classes/interfaces/criteria/extended/class_LocalSearchCriteria.php
inc/classes/interfaces/criteria/extended/class_StoreableCriteria.php
inc/classes/interfaces/database/class_FrameworkDatabaseInterface.php
inc/classes/interfaces/database/frontend/class_DatabaseFrontendInterface.php
inc/classes/interfaces/database/middleware/class_DatabaseConnector.php
inc/classes/interfaces/debug/class_Debugger.php
inc/classes/interfaces/extended/class_LimitableObject.php
inc/classes/interfaces/filter/class_Filterable.php
inc/classes/interfaces/helper/.htaccess [new file with mode: 0644]
inc/classes/interfaces/helper/class_HelpableLogin.php [new file with mode: 0644]
inc/classes/interfaces/io/class_Streamable.php
inc/classes/interfaces/io/file/class_FileInputStreamer.php
inc/classes/interfaces/io/file/class_FileOutputStreamer.php
inc/classes/interfaces/io/output/class_OutputStreamer.php
inc/classes/interfaces/language/class_ManageableLanguage.php
inc/classes/interfaces/login/class_LoginableUser.php
inc/classes/interfaces/reader/.htaccess [new file with mode: 0644]
inc/classes/interfaces/reader/class_ReadableNews.php [new file with mode: 0644]
inc/classes/interfaces/registration/class_UserRegister.php
inc/classes/interfaces/registry/class_Register.php
inc/classes/interfaces/registry/class_Registerable.php
inc/classes/interfaces/request/class_Requestable.php
inc/classes/interfaces/resolver/class_CommandResolver.php
inc/classes/interfaces/resolver/class_ControllerResolver.php
inc/classes/interfaces/response/class_Responseable.php
inc/classes/interfaces/result/.htaccess [new file with mode: 0644]
inc/classes/interfaces/result/class_SearchableResult.php [new file with mode: 0644]
inc/classes/interfaces/template/class_CompileableTemplate.php
inc/classes/interfaces/template/view/class_ViewHelper.php
inc/classes/interfaces/user/class_ManageableUser.php
inc/classes/main/actions/class_BaseAction.php
inc/classes/main/actions/post_registration/class_LoginAfterRegistrationAction.php
inc/classes/main/auth/.htaccess [new file with mode: 0644]
inc/classes/main/auth/class_CookieAuth.php [new file with mode: 0644]
inc/classes/main/cache/class_MemoryCache.php
inc/classes/main/class_BaseFrameworkSystem.php
inc/classes/main/class_FrameworkArrayObject.php
inc/classes/main/commands/class_
inc/classes/main/commands/web/class_WebDoFormCommand.php
inc/classes/main/commands/web/class_WebHomeCommand.php
inc/classes/main/commands/web/class_WebLoginAreaCommand.php [new file with mode: 0644]
inc/classes/main/commands/web/class_WebRegisterCommand.php
inc/classes/main/console/class_ConsoleTools.php
inc/classes/main/controller/class_BaseController.php
inc/classes/main/controller/default/class_WebDefaultNewsController.php
inc/classes/main/controller/login/.htaccess [new file with mode: 0644]
inc/classes/main/controller/login/class_WebLoginAreaController.php [new file with mode: 0644]
inc/classes/main/criteria/class_DataSetCriteria.php
inc/classes/main/criteria/class_SearchCriteria.php
inc/classes/main/crypto/class_CryptoHelper.php
inc/classes/main/database/class_
inc/classes/main/database/class_BaseDatabaseFrontend.php
inc/classes/main/database/class_BaseDatabaseWrapper.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_DebugErrorLogOutput.php
inc/classes/main/debug/class_DebugWebOutput.php
inc/classes/main/extended/class_ObjectLimits.php
inc/classes/main/extended/class_SerializationContainer.php
inc/classes/main/factories/cache/class_CacheFactory.php
inc/classes/main/factories/objects/class_ObjectFactory.php
inc/classes/main/factories/web/class_WebNewsFactory.php
inc/classes/main/filter/auth/.htaccess [new file with mode: 0644]
inc/classes/main/filter/auth/class_UserAuthFilter.php [new file with mode: 0644]
inc/classes/main/filter/checkboxes/class_RulesAcceptedFilter.php
inc/classes/main/filter/class_BaseFilter.php [new file with mode: 0644]
inc/classes/main/filter/class_FilterChain.php
inc/classes/main/filter/news/.htaccess [new file with mode: 0644]
inc/classes/main/filter/news/class_NewsDownloadFilter.php [new file with mode: 0644]
inc/classes/main/filter/news/class_NewsProcessFilter.php [new file with mode: 0644]
inc/classes/main/filter/null/class_NullFilter.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/helper/login/.htaccess [new file with mode: 0644]
inc/classes/main/helper/login/class_BaseLoginHelper.php [new file with mode: 0644]
inc/classes/main/helper/web/class_WebFormHelper.php
inc/classes/main/io/class_FileIoStream.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/language/class_LanguageSystem.php
inc/classes/main/output/class_ConsoleOutput.php
inc/classes/main/output/class_WebOutput.php
inc/classes/main/reader/.htaccess [new file with mode: 0644]
inc/classes/main/reader/class_DefaultNewsReader.php [new file with mode: 0644]
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/web/class_WebCommandResolver.php
inc/classes/main/resolver/web/class_WebControllerResolver.php
inc/classes/main/response/class_HttpResponse.php
inc/classes/main/result/class_DatabaseResult.php
inc/classes/main/rng/class_RandomNumberGenerator.php
inc/classes/main/template/class_TemplateEngine.php
inc/classes/main/user/class_User.php
inc/classes/middleware/class_BaseMiddleware.php
inc/classes/middleware/compressor/class_CompressorChannel.php
inc/classes/middleware/database/class_DatabaseConnection.php
inc/classes/middleware/debug/class_DebugMiddleware.php
inc/classes/middleware/io/class_FileIoHandler.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/loader/class_ClassLoader.php
inc/output.php

index 80ba33608ce4ca7b05557f9c3b864de44d186e73..18588002350f7a356798485c14ced15b25abba66 100644 (file)
@@ -26,6 +26,9 @@ inc/.htaccess -text
 inc/classes.php -text
 inc/classes/.htaccess -text
 inc/classes/exceptions/.htaccess -text
+inc/classes/exceptions/auth/.htaccess -text
+inc/classes/exceptions/auth/class_UserAuthorizationException.php -text
+inc/classes/exceptions/class_ -text
 inc/classes/exceptions/class_FrameworkException.php -text
 inc/classes/exceptions/compressor/.htaccess -text
 inc/classes/exceptions/compressor/class_MismatchingCompressorsException.php -text
@@ -48,11 +51,14 @@ inc/classes/exceptions/database/local_file/class_SavePathReadProtectedException.
 inc/classes/exceptions/database/local_file/class_SavePathWriteProtectedException.php -text
 inc/classes/exceptions/database/wrapper/.htaccess -text
 inc/classes/exceptions/database/wrapper/class_WrapperUserNameNotFoundException.php -text
+inc/classes/exceptions/filter/.htaccess -text
+inc/classes/exceptions/filter/class_FilterChainException.php -text
 inc/classes/exceptions/helper/.htaccess -text
 inc/classes/exceptions/helper/class_FormClosedException.php -text
 inc/classes/exceptions/helper/class_FormGroupClosedException.php -text
 inc/classes/exceptions/helper/class_FormOpenedException.php -text
 inc/classes/exceptions/helper/class_InvalidFormNameException.php -text
+inc/classes/exceptions/helper/class_UserInstanceMissingException.php -text
 inc/classes/exceptions/io/.htaccess -text
 inc/classes/exceptions/io/class_DirPointerNotOpenedException.php -text
 inc/classes/exceptions/io/class_FilePointerNotOpenedException.php -text
@@ -104,10 +110,13 @@ inc/classes/exceptions/template/class_UnsupportedTemplateEngineException.php -te
 inc/classes/exceptions/template/class_ViewHelperNotFoundException.php -text
 inc/classes/exceptions/user/.htaccess -text
 inc/classes/exceptions/user/class_UserEmailMissingException.php -text
+inc/classes/exceptions/user/class_UserPasswordMismatchException.php -text
 inc/classes/exceptions/user/class_UsernameMissingException.php -text
 inc/classes/interfaces/.htaccess -text
 inc/classes/interfaces/application/.htaccess -text
 inc/classes/interfaces/application/class_ManageableApplication.php -text
+inc/classes/interfaces/auth/.htaccess -text
+inc/classes/interfaces/auth/class_Authorizeable.php -text
 inc/classes/interfaces/cache/.htaccess -text
 inc/classes/interfaces/cache/class_Cacheable.php -text
 inc/classes/interfaces/class_ -text
@@ -136,6 +145,8 @@ inc/classes/interfaces/extended/.htaccess -text
 inc/classes/interfaces/extended/class_LimitableObject.php -text
 inc/classes/interfaces/filter/.htaccess -text
 inc/classes/interfaces/filter/class_Filterable.php -text
+inc/classes/interfaces/helper/.htaccess -text
+inc/classes/interfaces/helper/class_HelpableLogin.php -text
 inc/classes/interfaces/io/.htaccess -text
 inc/classes/interfaces/io/class_Streamable.php -text
 inc/classes/interfaces/io/file/.htaccess -text
@@ -147,6 +158,8 @@ inc/classes/interfaces/language/.htaccess -text
 inc/classes/interfaces/language/class_ManageableLanguage.php -text
 inc/classes/interfaces/login/.htaccess -text
 inc/classes/interfaces/login/class_LoginableUser.php -text
+inc/classes/interfaces/reader/.htaccess -text
+inc/classes/interfaces/reader/class_ReadableNews.php -text
 inc/classes/interfaces/registration/.htaccess -text
 inc/classes/interfaces/registration/class_UserRegister.php -text
 inc/classes/interfaces/registry/.htaccess -text
@@ -159,6 +172,8 @@ inc/classes/interfaces/resolver/class_CommandResolver.php -text
 inc/classes/interfaces/resolver/class_ControllerResolver.php -text
 inc/classes/interfaces/response/.htaccess -text
 inc/classes/interfaces/response/class_Responseable.php -text
+inc/classes/interfaces/result/.htaccess -text
+inc/classes/interfaces/result/class_SearchableResult.php -text
 inc/classes/interfaces/template/.htaccess -text
 inc/classes/interfaces/template/class_CompileableTemplate.php -text
 inc/classes/interfaces/template/view/class_ViewHelper.php -text
@@ -170,6 +185,8 @@ inc/classes/main/actions/class_ -text
 inc/classes/main/actions/class_BaseAction.php -text
 inc/classes/main/actions/post_registration/.htaccess -text
 inc/classes/main/actions/post_registration/class_LoginAfterRegistrationAction.php -text
+inc/classes/main/auth/.htaccess -text
+inc/classes/main/auth/class_CookieAuth.php -text
 inc/classes/main/cache/.htaccess -text
 inc/classes/main/cache/class_MemoryCache.php -text
 inc/classes/main/class_ -text
@@ -181,6 +198,7 @@ inc/classes/main/commands/class_BaseCommand.php -text
 inc/classes/main/commands/web/.htaccess -text
 inc/classes/main/commands/web/class_WebDoFormCommand.php -text
 inc/classes/main/commands/web/class_WebHomeCommand.php -text
+inc/classes/main/commands/web/class_WebLoginAreaCommand.php -text
 inc/classes/main/commands/web/class_WebRegisterCommand.php -text
 inc/classes/main/compressor/.htaccess -text
 inc/classes/main/compressor/class_Bzip2Compressor.php -text
@@ -196,6 +214,8 @@ inc/classes/main/controller/default/class_WebDefaultController.php -text
 inc/classes/main/controller/default/class_WebDefaultNewsController.php -text
 inc/classes/main/controller/form/.htaccess -text
 inc/classes/main/controller/form/class_WebDoFormController.php -text
+inc/classes/main/controller/login/.htaccess -text
+inc/classes/main/controller/login/class_WebLoginAreaController.php -text
 inc/classes/main/criteria/.htaccess -text
 inc/classes/main/criteria/class_DataSetCriteria.php -text
 inc/classes/main/criteria/class_SearchCriteria.php -text
@@ -225,12 +245,18 @@ inc/classes/main/factories/objects/class_ObjectFactory.php -text
 inc/classes/main/factories/web/.htaccess -text
 inc/classes/main/factories/web/class_WebNewsFactory.php -text
 inc/classes/main/filter/.htaccess -text
+inc/classes/main/filter/auth/.htaccess -text
+inc/classes/main/filter/auth/class_UserAuthFilter.php -text
 inc/classes/main/filter/checkboxes/.htaccess -text
 inc/classes/main/filter/checkboxes/class_RulesAcceptedFilter.php -text
 inc/classes/main/filter/class_ -text
 inc/classes/main/filter/class_AbstractFilterDecorator.php -text
+inc/classes/main/filter/class_BaseFilter.php -text
 inc/classes/main/filter/class_FilterChain.php -text
 inc/classes/main/filter/decorator/.htaccess -text
+inc/classes/main/filter/news/.htaccess -text
+inc/classes/main/filter/news/class_NewsDownloadFilter.php -text
+inc/classes/main/filter/news/class_NewsProcessFilter.php -text
 inc/classes/main/filter/null/.htaccess -text
 inc/classes/main/filter/null/class_NullFilter.php -text
 inc/classes/main/filter/validator/.htaccess -text
@@ -240,6 +266,8 @@ inc/classes/main/filter/validator/class_UserNameValidatorFilter.php -text
 inc/classes/main/helper/.htaccess -text
 inc/classes/main/helper/class_ -text
 inc/classes/main/helper/class_BaseHelper.php -text
+inc/classes/main/helper/login/.htaccess -text
+inc/classes/main/helper/login/class_BaseLoginHelper.php -text
 inc/classes/main/helper/web/.htaccess -text
 inc/classes/main/helper/web/class_WebFormHelper.php -text
 inc/classes/main/io/.htaccess -text
@@ -252,6 +280,8 @@ inc/classes/main/language/class_LanguageSystem.php -text
 inc/classes/main/output/.htaccess -text
 inc/classes/main/output/class_ConsoleOutput.php -text
 inc/classes/main/output/class_WebOutput.php -text
+inc/classes/main/reader/.htaccess -text
+inc/classes/main/reader/class_DefaultNewsReader.php -text
 inc/classes/main/registration/.htaccess -text
 inc/classes/main/registration/class_BaseRegistration.php -text
 inc/classes/main/registry/.htaccess -text
diff --git a/inc/classes/exceptions/auth/.htaccess b/inc/classes/exceptions/auth/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/inc/classes/exceptions/auth/class_UserAuthorizationException.php b/inc/classes/exceptions/auth/class_UserAuthorizationException.php
new file mode 100644 (file)
index 0000000..5fedd40
--- /dev/null
@@ -0,0 +1,46 @@
+<?php
+/**
+ * 
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @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
+ *
+ * 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
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * 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 UserAuthorizationException extends FrameworkException {
+       /**
+        * The super constructor for all exceptions
+        *
+        * @param               $filterInstance         An instance of the filter throwing this exception
+        * @param               $code                           Error code
+        * @return      void
+        */
+       public function __construct(Filterable $filterInstance, $code) {
+               // Construct the message
+               $message = sprintf("[%s:%d] Authorization has failed. Error code <u>%s</u>",
+                       $filterInstance->__toString(),
+                       $this->getLine(),
+                       $this->getHexCode($code)
+               );
+
+               // Call parent exception constructor
+               parent::__construct($message, $code);
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/exceptions/class_ b/inc/classes/exceptions/class_
new file mode 100644 (file)
index 0000000..3001d84
--- /dev/null
@@ -0,0 +1,39 @@
+<?php
+/**
+ * 
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @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
+ *
+ * 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
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * 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 ???Exception extends FrameworkException {
+       /**
+        * The super constructor for all exceptions
+        *
+        * @param               $message        Error message
+        * @param               $code           Error code
+        * @return      void
+        */
+       public function __construct($message, $code) {
+               // Call parent exception constructor
+               parent::__construct($message, $code);
+       }
+}
+
+// [EOF]
+?>
index b7db9a34d639f6d45751144c9f0821de1391cd30..2c403966037f736c9be75a5e2a37870ee8a6f04f 100644 (file)
@@ -8,7 +8,7 @@
  * @version            0.0.0
  * @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
+ * @link               http://www.ship-simu.org
  *
  * 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
@@ -44,7 +44,7 @@ abstract class FrameworkException extends ReflectionException {
                $message = (string) $message;
                $code    = (int)    $code;
 
-               // make sure everything is assigned properly
+               // Make sure everything is assigned properly
                parent::__construct($message, $code);
        }
 
@@ -78,11 +78,12 @@ abstract class FrameworkException extends ReflectionException {
        /**
         * Getter for hex-decimal code
         *
+        * @param       $code           Integer code to encode in hex
         * @return      $hexCode        The exception code in hex-decimal format
         */
-       public final function getHexCode () {
+       public final function getHexCode ($code = null) {
                // Get the decimal code
-               $code = $this->getCode();
+               if (is_null($code)) $code = $this->getCode();
 
                // Format it to hex-decimal, 0x as prefix and 3 chars
                $hexCode = sprintf("0x%03s", dechex($code));
index 8e8d7d985bcc1688115ace8c9d22f485fa37659b..97c95adc7de15460834de35457ec24a39836a230 100644 (file)
@@ -6,7 +6,7 @@
  * @version            0.0.0
  * @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
+ * @link               http://www.ship-simu.org
  *
  * 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
index dca689ec85840749cc5f9cbf412db791c909ca27..06220529832e1a8c10bd56c7963f2657afca52bb 100644 (file)
@@ -6,7 +6,7 @@
  * @version            0.0.0
  * @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
+ * @link               http://www.ship-simu.org
  * 
  * 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
index 9effef81b9659c3082f2302dcfd69199e773882c..05334ed1d62a3f1778f999a4128c251b8e8eca8e 100644 (file)
@@ -6,7 +6,7 @@
  * @version            0.0.0
  * @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
+ * @link               http://www.ship-simu.org
  * 
  * 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
index 9217d80bb04e20a52d4bef9c9b48b5ff6208f4ad..33232c08a9a24168876fb8712a4da8f8cc6fca1f 100644 (file)
@@ -6,7 +6,7 @@
  * @version            0.0.0
  * @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
+ * @link               http://www.ship-simu.org
  * 
  * 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
index 11189697fac76a9e962da69a58afa3163d6286d5..5a93a29cf0c91c520eea73bcd6ecdb4c8ac9f40c 100644 (file)
@@ -6,7 +6,7 @@
  * @version            0.0.0
  * @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
+ * @link               http://www.ship-simu.org
  *
  * 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
index 6b713d2e6c4612c24c153619f60b1919b4bc2935..3ff2e019eef771a8d404263cf574b34deb88483f 100644 (file)
@@ -6,7 +6,7 @@
  * @version            0.0.0
  * @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
+ * @link               http://www.ship-simu.org
  * 
  * 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
index 542764aad8717dba9dcb63477a7898efe15ce6ef..5cd4385c616543bd0e421ebeae0a49f04b025803 100644 (file)
@@ -6,7 +6,7 @@
  * @version            0.0.0
  * @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
+ * @link               http://www.ship-simu.org
  * 
  * 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
index dc5ed66beb0def355566d6652b9a1affa8b0883d..d9de2eef94fa05aa81f7b45728b968a7a1649581 100644 (file)
@@ -6,7 +6,7 @@
  * @version            0.0.0
  * @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
+ * @link               http://www.ship-simu.org
  * 
  * 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
index a8bcc6ed236a8d9a2ca89dd90e2b3b2cd5f6f552..a3be62a189227c7e8e31e590c648a68fa128b612 100644 (file)
@@ -6,7 +6,7 @@
  * @version            0.0.0
  * @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
+ * @link               http://www.ship-simu.org
  * 
  * 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
index ee1da7f48742b589fc1ce5d76df11c3dc35f4c9c..06ef4b4cd1affbc0dc20ffeaf16dd330ac0fa75f 100644 (file)
@@ -6,7 +6,7 @@
  * @version            0.0.0
  * @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
+ * @link               http://www.ship-simu.org
  * 
  * 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
index eb5417fe9611318cec346d88cbd8d0f0297eec5f..a5c57f482a5c4a966233b263c7102800f6843627 100644 (file)
@@ -6,7 +6,7 @@
  * @version            0.0.0
  * @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
+ * @link               http://www.ship-simu.org
  * 
  * 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
index 6b38482df1a9df5d598a9035eea643dee179fd7b..c6014b123cc3b6040c5a3180bc5990d4826b1d84 100644 (file)
@@ -6,7 +6,7 @@
  * @version            0.0.0
  * @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
+ * @link               http://www.ship-simu.org
  * 
  * 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
diff --git a/inc/classes/exceptions/filter/.htaccess b/inc/classes/exceptions/filter/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/inc/classes/exceptions/filter/class_FilterChainException.php b/inc/classes/exceptions/filter/class_FilterChainException.php
new file mode 100644 (file)
index 0000000..e1bfe10
--- /dev/null
@@ -0,0 +1,45 @@
+<?php
+/**
+ * An exception thrown in a filter chain to stop processing further filters
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @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
+ *
+ * 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
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * 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 FilterChainException extends FrameworkException {
+       /**
+        * The super constructor for all exceptions
+        *
+        * @param               $filterInstance         Instance of a filter class
+        * @param               $code                           Exception code for better debugging
+        * @return      void
+        */
+       public function __construct(Filterable $filterInstance, $code) {
+               // Construct the message
+               $message = sprintf("[%s:%d] Filter chain interruppted by fatal error in filter.",
+                       $filterInstance->__toString(),
+                       $this->getLine()
+               );
+
+               // Call the parent exception
+               parent::__construct($message, $code);
+       }
+}
+
+// [EOF]
+?>
index b7acb6fcf118953a3176b6e39f5d71393de5037f..dd012eb045c7afa92af642c9cafbb5d80540409c 100644 (file)
@@ -7,7 +7,7 @@
  * @version            0.0.0
  * @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
+ * @link               http://www.ship-simu.org
  *
  * 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
index ff951fee6a74fe086ac3ef5ff245add5911f82e7..8c56a5d2ecb457d5cedc43d61dccfd2ddfeb2e31 100644 (file)
@@ -6,7 +6,7 @@
  * @version            0.0.0
  * @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
+ * @link               http://www.ship-simu.org
  *
  * 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
index 6a95cd991ee8d28e9fd43692f0ef76c402d3b6ea..c2aafbd207d7219ea2669bd45b8562f9da8dd48f 100644 (file)
@@ -7,7 +7,7 @@
  * @version            0.0.0
  * @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
+ * @link               http://www.ship-simu.org
  *
  * 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
index b45e7a1c9b8d582615ec133c37f3e991c16f24be..00c36a25f10c5080a8342d42cd348344ca36df63 100644 (file)
@@ -6,7 +6,7 @@
  * @version            0.0.0
  * @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
+ * @link               http://www.ship-simu.org
  *
  * 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
diff --git a/inc/classes/exceptions/helper/class_UserInstanceMissingException.php b/inc/classes/exceptions/helper/class_UserInstanceMissingException.php
new file mode 100644 (file)
index 0000000..a109572
--- /dev/null
@@ -0,0 +1,46 @@
+<?php
+/**
+ * An exception thrown when a user instance is invalid
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @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
+ *
+ * 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
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * 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 UserInstanceMissingException extends FrameworkException {
+       /**
+        * The constructor
+        *
+        * @param               $classArray             Array with class instance and registry key
+        * @param               $code                   Code number for the exception
+        * @return      void
+        */
+       public function __construct (array $classArray, $code) {
+               // Add a message around the missing class
+               $message = sprintf("[%s:%d] Registry key <u>%s</u> does not include a class with implemented interface <u>ManageableUser</u>.",
+                       $classArray[0]->__toString(),
+                       $this->getLine(),
+                       $classArray[1]
+               );
+
+               // Call parent constructor
+               parent::__construct($message, $code);
+       }
+}
+
+// [EOF]
+?>
index 9527dbc1aecb7e1a43985c17423e42a6a67ddecf..12b4d2668ae2ed95dd51242d70eb7f5f673a85a9 100644 (file)
@@ -6,7 +6,7 @@
  * @version            0.0.0
  * @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
+ * @link               http://www.ship-simu.org
  * 
  * 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
index 8fb500192bef900bf03e00be6b90a597c65858cd..760fca2f96402393e161fbff3e53c0c28be2eb3a 100644 (file)
@@ -6,7 +6,7 @@
  * @version            0.0.0
  * @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
+ * @link               http://www.ship-simu.org
  * 
  * 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
index c53f66a9e355ac30b339a2a3b3cf1cba6907bb3c..90d4ae086ef4d807cafbfc88194c50d7149349b0 100644 (file)
@@ -6,7 +6,7 @@
  * @version            0.0.0
  * @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
+ * @link               http://www.ship-simu.org
  *
  * 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
index fefef2d23d70967fc70a8f49ac360dd0c2585f7a..2dbe65cee5c96b5fbd779622697041a0bb4f2b1b 100644 (file)
@@ -6,7 +6,7 @@
  * @version            0.0.0
  * @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
+ * @link               http://www.ship-simu.org
  * 
  * 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
index 3a64350f7c7ce4a59218643fd0370e09025cc788..d15fbfec73535865e25a316e5001ef9229b77922 100644 (file)
@@ -6,7 +6,7 @@
  * @version            0.0.0
  * @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
+ * @link               http://www.ship-simu.org
  *
  * 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
index c43ab814b7286374d2a3e150b4da9eb29df8dbee..b8a286846f54a8e637cb26aa3681a6d8d3553322 100644 (file)
@@ -6,7 +6,7 @@
  * @version            0.0.0
  * @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
+ * @link               http://www.ship-simu.org
  * 
  * 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
index 11d94975a5375709d222caa949f52b016dab511b..2cedc57b14a60f38a8a4f6b46155838a05887288 100644 (file)
@@ -6,7 +6,7 @@
  * @version            0.0.0
  * @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
+ * @link               http://www.ship-simu.org
  * 
  * 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
index ce897d2fc68e75978a6f7eddd40c1fd7ca0901a2..102dae24afc088e39c2106dfdf5e07a7cdad358f 100644 (file)
@@ -6,7 +6,7 @@
  * @version            0.0.0
  * @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
+ * @link               http://www.ship-simu.org
  * 
  * 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
index ddb98356c1097e7376de9db2d14ea0c14c07b285..6e02cfe4941379e500a27d84d3fdce7e9004a732 100644 (file)
@@ -6,7 +6,7 @@
  * @version            0.0.0
  * @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
+ * @link               http://www.ship-simu.org
  * 
  * 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
index f87a412a5cf10d61995c0d68822c83ca1676bdad..cd38561c3ae1c6cf32928df254667476d4f64c90 100644 (file)
@@ -6,7 +6,7 @@
  * @version            0.0.0
  * @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
+ * @link               http://www.ship-simu.org
  * 
  * 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
index c82818f697cdce70760c42bad3636653f73284df..9b6b581de5026fe8f59229b85da095bd4978faef 100644 (file)
@@ -6,7 +6,7 @@
  * @version            0.0.0
  * @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
+ * @link               http://www.ship-simu.org
  * 
  * 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
index ba59b572a873f665667be67dda5c6c89392b0aa8..9df443e778eae076adb85ad2ed2b160a65a5468a 100644 (file)
@@ -6,7 +6,7 @@
  * @version            0.0.0
  * @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
+ * @link               http://www.ship-simu.org
  * 
  * 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
index 210b94c3369490db9629090ba7da2ffdf8fb402c..ea92f6de3b660e1d6551dfb0a7ee6789a5355ea0 100644 (file)
@@ -6,7 +6,7 @@
  * @version            0.0.0
  * @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
+ * @link               http://www.ship-simu.org
  *
  * 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
index a5c8946f9dcc6571a8d1878eed8ea56a79bd23ee..9511e21692306793db92e38105a7d7ea6eb0fca9 100644 (file)
@@ -6,7 +6,7 @@
  * @version            0.0.0
  * @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
+ * @link               http://www.ship-simu.org
  *
  * 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
index 9e218ad2ad31fb724b0b82fded91326140864bde..92364cd3b1d6007c43e6a072b6d46e522e9a8014 100644 (file)
@@ -6,7 +6,7 @@
  * @version            0.0.0
  * @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
+ * @link               http://www.ship-simu.org
  * 
  * 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
index 34f0ed3c36d3dea146563c2219552519d83564e8..5f037fe4353d93233b31b19afc441bf3f423510a 100644 (file)
@@ -6,7 +6,7 @@
  * @version            0.0.0
  * @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
+ * @link               http://www.ship-simu.org
  * 
  * 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
index 16abfebb35fffaee72930a71f44a0d863e318da5..29efd8f94820646252fce96535e815545304ba24 100644 (file)
@@ -6,7 +6,7 @@
  * @version            0.0.0
  * @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
+ * @link               http://www.ship-simu.org
  *
  * 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
index 823321802b6298028d6b7b9d0ec5acf7de3bf0b5..d4283319161413f915924056b0fc0952687da8bc 100644 (file)
@@ -6,7 +6,7 @@
  * @version            0.0.0
  * @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
+ * @link               http://www.ship-simu.org
  * 
  * 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
index 7f0ee053e5539c163fcd349907a500264617ed8f..25a694c37ed3c7c70545f02069b68ecdbc87894c 100644 (file)
@@ -6,7 +6,7 @@
  * @version            0.0.0
  * @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
+ * @link               http://www.ship-simu.org
  * 
  * 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
index 42a938ca05e81b613f4af52d94777c788b905a17..7fa7f48e3ac6af16cd98cbf329e578af8966c49f 100644 (file)
@@ -6,7 +6,7 @@
  * @version            0.0.0
  * @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
+ * @link               http://www.ship-simu.org
  *
  * 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
index 7468bd4ff58efeb24eba5c137600624fb099d41c..6fe94458367b610f7f8cd3c09dc186c4af18ded4 100644 (file)
@@ -6,7 +6,7 @@
  * @version            0.0.0
  * @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
+ * @link               http://www.ship-simu.org
  * @deprecated
  *
  * This program is free software: you can redistribute it and/or modify
index 95deb6175fab38daa683cd5e30be8b41793f9215..eed88505a3e491eeb764530a3ff493d1e134a1af 100644 (file)
@@ -6,7 +6,7 @@
  * @version            0.0.0
  * @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
+ * @link               http://www.ship-simu.org
  * 
  * 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
index fd6202265cf3b06dfb71033bb55dcc22d3ae91bc..bcc958f558d540ab2db8f2db546e1e4d5fa3f356 100644 (file)
@@ -6,7 +6,7 @@
  * @version            0.0.0
  * @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
+ * @link               http://www.ship-simu.org
  * 
  * 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
index f318d67857164072082689e88470974ea936cfac..0fc6f6685f9ca1d1a73727f8a4f0fc95a6a8c552 100644 (file)
@@ -6,7 +6,7 @@
  * @version            0.0.0
  * @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
+ * @link               http://www.ship-simu.org
  *
  * 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
index 27b676623c9903574db3ce3df78dc3015572ee06..add16453d11816c75a134ccac0521e8cfe423ba6 100644 (file)
@@ -6,7 +6,7 @@
  * @version            0.0.0
  * @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
+ * @link               http://www.ship-simu.org
  *
  * 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
index dc1039138962b17b01bd7539608decb27703aaee..77285264438eba5fcfeedeb980c99347f80e12b4 100644 (file)
@@ -6,7 +6,7 @@
  * @version            0.0.0
  * @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
+ * @link               http://www.ship-simu.org
  *
  * 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
index a2952b456a8f45fed02f221afd76e4021127f445..a3043d7eafecd1b35b72c49e3ccaa52a058c8f22 100644 (file)
@@ -6,7 +6,7 @@
  * @version            0.0.0
  * @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
+ * @link               http://www.ship-simu.org
  *
  * 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
index 39d67e733f750ff0d1b1cecb95f612ea7aafde2e..1b4438b0c901741d19d7c4a7e9ebcad3a62920b7 100644 (file)
@@ -6,7 +6,7 @@
  * @version            0.0.0
  * @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
+ * @link               http://www.ship-simu.org
  * 
  * 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
index 66c9a55c16cfae8c69e3343f71cf33fe40ea7b87..890aa2d2c6e7c5ae229dfca330fba2b85cb89e67 100644 (file)
@@ -6,7 +6,7 @@
  * @version            0.0.0
  * @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
+ * @link               http://www.ship-simu.org
  * 
  * 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
index 055ebe9ab7c593d505d30751a335b48724ae3c29..7c40bfb8c4ba5d0ad3af5be01d5b975711d28556 100644 (file)
@@ -6,7 +6,7 @@
  * @version            0.0.0
  * @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
+ * @link               http://www.ship-simu.org
  * 
  * 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
index 3e78c1a224b1237513c302f826d272348963e732..65eb60d07e9569e02af02a51350657a1a5475a22 100644 (file)
@@ -6,7 +6,7 @@
  * @version            0.0.0
  * @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
+ * @link               http://www.ship-simu.org
  * 
  * 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
index a4098a7dc02b1611a32086acd2b9a4241783534b..264d69d549b598343f9e5279c7ab71ee85a64226 100644 (file)
@@ -6,7 +6,7 @@
  * @version            0.0.0
  * @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
+ * @link               http://www.ship-simu.org
  *
  * 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
index 0f39cdc26957aa0caf8325ca79a6e85ed96c9997..00f240ea7ba15bc623f28907f4e34abd92aa956a 100644 (file)
@@ -4,7 +4,7 @@
  * @version            0.0.0
  * @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
+ * @link               http://www.ship-simu.org
  *
  * 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
index a2d6dcf98f8ab396cfbad09c47d7d1971218b15c..1812a16fb656f09fb8cf1d3463bc690c34da8f22 100644 (file)
@@ -6,7 +6,7 @@
  * @version            0.0.0
  * @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
+ * @link               http://www.ship-simu.org
  * @deprecated
  * @see                InvalidObjectException
  *
index eb91335bd4f9627abcb6652833db25cf44638d5a..42ed410f3ed0c33dd8146d4f5bf04967c6ff8974 100644 (file)
@@ -6,7 +6,7 @@
  * @version            0.0.0
  * @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
+ * @link               http://www.ship-simu.org
  * 
  * 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
index 1877e126a2b0d045c24eb99f36e81990299f6058..16e36e16574f6a4f2d1fb516b31271ae3324289c 100644 (file)
@@ -6,7 +6,7 @@
  * @version            0.0.0
  * @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
+ * @link               http://www.ship-simu.org
  * 
  * 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
index 2a36031d8ca0d88b448a8b4ef3ed377086b5d2df..36372e574c436af7031ee35ea6a8127debe65ea3 100644 (file)
@@ -6,7 +6,7 @@
  * @version            0.0.0
  * @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
+ * @link               http://www.ship-simu.org
  *
  * 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
index 29a84ae22010976353ca2e7b034ca3ba7e74d65e..78dd8571a51735521eb35fedb0305e9eb6f4ead1 100644 (file)
@@ -6,7 +6,7 @@
  * @version            0.0.0
  * @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
+ * @link               http://www.ship-simu.org
  * 
  * 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
index d798a692b762c069c2daa6793cb5f4fd22773667..ab6b7f058ff1785479c8c89dd247572f673a89c7 100644 (file)
@@ -6,7 +6,7 @@
  * @version            0.0.0
  * @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
+ * @link               http://www.ship-simu.org
  * 
  * 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
index 687f29590044c1bab3722e650ce8e5dcf5f82ab0..3d1507a3e234ef60a9aabd028a1df899cd517854 100644 (file)
@@ -6,7 +6,7 @@
  * @version            0.0.0
  * @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
+ * @link               http://www.ship-simu.org
  * 
  * 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
index 68241d3e8f6cfac8e506743cfc03f610dde7b569..9aa3ad4bba4c9b4daa11320c2d5cdaf22bb7b272 100644 (file)
@@ -6,7 +6,7 @@
  * @version            0.0.0
  * @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
+ * @link               http://www.ship-simu.org
  *
  * 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
index 7e7a21bec9bb81da5bbf77de5316a68e46d189fb..b309f7b2d8eb583a17a86cb36eae38328c809ee4 100644 (file)
@@ -6,7 +6,7 @@
  * @version            0.0.0
  * @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
+ * @link               http://www.ship-simu.org
  * @deprecated
  * 
  * This program is free software: you can redistribute it and/or modify
index 2d79973509180cf4e56e5eae3dd19496b73c6988..c761da6afbdb286c7648f503e6e05c31c7d4431a 100644 (file)
@@ -6,7 +6,7 @@
  * @version            0.0.0
  * @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
+ * @link               http://www.ship-simu.org
  * 
  * 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
index d5e1b214f5e86e190774cd9d003f88cb3c3c9439..46d15190a33cbe74b5e2491505e28cb1958218dc 100644 (file)
@@ -6,7 +6,7 @@
  * @version            0.0.0
  * @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
+ * @link               http://www.ship-simu.org
  *
  * 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
index b649aa1bb3b614ab0a9f124e1673a1bd9256864c..0fe1d02965602c1cf49c85f3560f6343b281eff1 100644 (file)
@@ -6,7 +6,7 @@
  * @version            0.0.0
  * @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
+ * @link               http://www.ship-simu.org
  *
  * 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
index 64aedd73cae24596739812f7283d9e5af7d89c88..3c816e96fe4fa9e5a6b4dd4526ec60b5ae7ea867 100644 (file)
@@ -6,7 +6,7 @@
  * @version            0.0.0
  * @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
+ * @link               http://www.ship-simu.org
  *
  * 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
diff --git a/inc/classes/exceptions/user/class_UserPasswordMismatchException.php b/inc/classes/exceptions/user/class_UserPasswordMismatchException.php
new file mode 100644 (file)
index 0000000..2ca954d
--- /dev/null
@@ -0,0 +1,46 @@
+<?php
+/**
+ * A class for mismatching passwords
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @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
+ *
+ * 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
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * 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 UserPasswordMismatchException extends FrameworkException {
+       /**
+        * The super constructor for all exceptions
+        *
+        * @param               $msgArray               The non-optional message for the exception
+        * @param               $code           An optional code for better debugging
+        * @return      void
+        */
+       public function __construct(array $msgArray, $code = 0) {
+               // Create the message
+               $message = sprintf("[%s:%d] Supplied password for user <u>%s</u> did not match with stored password.",
+                       $msgArray[0]->__toString(),
+                       $this->getLine(),
+                       $msgArray[1]->getUserName()
+               );
+
+               // Make sure everything is assigned properly
+               parent::__construct($message, $code);
+       }
+}
+
+// [EOF]
+?>
index ac261821ae3d60a5c57cb9ce097dc118f5661e0f..42160ede8200b25384131a7e772969319a79ffd9 100644 (file)
@@ -6,7 +6,7 @@
  * @version            0.0.0
  * @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
+ * @link               http://www.ship-simu.org
  *
  * 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
index e775a18ec9b48e8ce29602e749bf90b5cca998bf..cdf7afdc705b803b8657253885f41a8825b8b6db 100644 (file)
@@ -11,7 +11,7 @@
  * @version            0.0.0
  * @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
+ * @link               http://www.ship-simu.org
  *
  * 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
diff --git a/inc/classes/interfaces/auth/.htaccess b/inc/classes/interfaces/auth/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/inc/classes/interfaces/auth/class_Authorizeable.php b/inc/classes/interfaces/auth/class_Authorizeable.php
new file mode 100644 (file)
index 0000000..88e383f
--- /dev/null
@@ -0,0 +1,34 @@
+<?php
+/**
+ * An interface for authorization methods
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @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
+ *
+ * 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
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+interface Authorizeable extends FrameworkInterface {
+       /**
+        * Destroy the authorization data
+        *
+        * @return      void
+        */
+       function destroyAuthData();
+}
+
+//
+?>
index c6fa237371afa603691258bc89db61477f3d003b..b58c8badd324475c701dab5da7807e9597ee4089 100644 (file)
@@ -2,11 +2,11 @@
 /**
  * An interface for classes which are "able" to cache
  *
- * @author             Roland Haeder <webmaster@mxchange.org>
+ * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
  * @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
+ * @link               http://www.ship-simu.org
  *
  * 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
index 055ad90d6a932b175f3021455b1c663194036758..60a8e962c55d6e86564213e551b6afe0e6ae60bf 100644 (file)
@@ -2,11 +2,11 @@
 /**
  * 
  *
- * @author             Roland Haeder <webmaster@mxchange.org>
+ * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
  * @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
+ * @link               http://www.ship-simu.org
  *
  * 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
index 3acb33bb6851a1487e43b1f2596884f828cb94ac..212e03174b8a9a3d9b91ce08d6273af4a3a20920 100644 (file)
@@ -7,7 +7,7 @@
  * @version            0.0.0
  * @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
+ * @link               http://www.ship-simu.org
  *
  * 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
index 379204e341914f8680d2e82bd4edfdc1258f1892..76679cb547d61a7de8f75131243ec5cf7d0c450a 100644 (file)
@@ -6,7 +6,7 @@
  * @version            0.0.0
  * @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
+ * @link               http://www.ship-simu.org
  *
  * 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
index 799f90fe40c35205fb0bcdf86c83e97819e9024e..c7b725a24e7c9ec94584410677d005df7e8468da 100644 (file)
@@ -6,7 +6,7 @@
  * @version            0.0.0
  * @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
+ * @link               http://www.ship-simu.org
  *
  * 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
index ecba54f6a09fb7964f21a9230744b10fd067790c..7169d880ef9d27f7d83f4f5933c773b99387eb70 100644 (file)
@@ -6,7 +6,7 @@
  * @version            0.0.0
  * @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
+ * @link               http://www.ship-simu.org
  *
  * 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
index 35b51f35b5a74c775607be64e2c6066073ea69e5..f6cf6be6f153c78f0adac3fe5cd321cb7e42196d 100644 (file)
@@ -2,11 +2,11 @@
 /**
  * An interface for criterias
  *
- * @author             Roland Haeder <webmaster@mxchange.org>
+ * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
  * @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
+ * @link               http://www.ship-simu.org
  *
  * 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
index 79c3b4768b7537171233fd94077e56ccb28a706a..cfb84942ae970b8111cc711ddfe8a9f021214bcb 100644 (file)
@@ -2,11 +2,11 @@
 /**
  * An interface for local criterias
  *
- * @author             Roland Haeder <webmaster@mxchange.org>
+ * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
  * @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
+ * @link               http://www.ship-simu.org
  *
  * 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
index 8af7c67d7f03e21d09a1f7a48dd5e2c364cf2e43..42daaad8235fc3edb92ec8e94fedab327457509d 100644 (file)
@@ -6,7 +6,7 @@
  * @version            0.0.0
  * @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
+ * @link               http://www.ship-simu.org
  *
  * 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
index c5cf54e32f7f8b67e9fc44d7b52b5c0f9b4ce792..196616153b9fb0ceb1537b8b24896c8709fffe83 100644 (file)
@@ -6,7 +6,7 @@
  * @version            0.0.0
  * @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
+ * @link               http://www.ship-simu.org
  *
  * 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
index f61df0713e040f6e7026a6b2dd62cefc08d40181..7621713a4d2b85bdaed6731e81aaf73bc0912a3c 100644 (file)
@@ -10,7 +10,7 @@
  * @version            0.0.0
  * @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
+ * @link               http://www.ship-simu.org
  *
  * 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
@@ -56,7 +56,7 @@ interface DatabaseFrontendInterface extends FrameworkDatabaseInterface {
         * @throws      UnsupportedCriteriaException    If the criteria is unsupported
         * @throws      SqlException                                    If an SQL error occurs
         */
-       function querySelect ($resultType, $tableName, Criteria $criteriaInstance);
+       function querySelect ($resultType, $tableName, LocalSearchCriteria $criteriaInstance);
 
        /**
         * "Inserts" a data set instance into a local file database folder
@@ -65,7 +65,7 @@ interface DatabaseFrontendInterface extends FrameworkDatabaseInterface {
         * @return      void
         * @throws      SqlException    If an SQL error occurs
         */
-       function insertDataSet (StoreableCriteria $dataSetInstance);
+       function queryInsertDataSet (StoreableCriteria $dataSetInstance);
 }
 
 // [EOF]
index bf149a9d61164b95aed0be9955a7516c83cd216c..9a56aec30bf4c536413a580d3152fc98da5fa93b 100644 (file)
@@ -6,7 +6,7 @@
  * @version            0.0.0
  * @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
+ * @link               http://www.ship-simu.org
  *
  * 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
index 7dfc98e7aa938fd234fdd64c6f08e10616d5b996..cce33d045931e8faf30a2f4d1c0f0bb485c06561 100644 (file)
@@ -6,7 +6,7 @@
  * @version            0.0.0
  * @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
+ * @link               http://www.ship-simu.org
  *
  * 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
index b66038fa72116a7add22edf82877945714ba1f7d..d4eea0f4441ab9c6d5f6f5dc0fdcabb46d7686ad 100644 (file)
@@ -7,7 +7,7 @@
  * @version            0.0.0
  * @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
+ * @link               http://www.ship-simu.org
  *
  * 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
index 9b880758114dd5ec3828ed1116226ac91194afd0..657dc2aecf9b263e7d19f1c7724b8e2bd2e53081 100644 (file)
@@ -6,7 +6,7 @@
  * @version            0.0.0
  * @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
+ * @link               http://www.ship-simu.org
  *
  * 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
diff --git a/inc/classes/interfaces/helper/.htaccess b/inc/classes/interfaces/helper/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/inc/classes/interfaces/helper/class_HelpableLogin.php b/inc/classes/interfaces/helper/class_HelpableLogin.php
new file mode 100644 (file)
index 0000000..cf5f84f
--- /dev/null
@@ -0,0 +1,36 @@
+<?php
+/**
+ * A helper interface for logins
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @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
+ *
+ * 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
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+interface HelpableLogin extends FrameworkInterface {
+       /**
+        * Execute the login request by given response instance. This instance can
+        * be used for sending cookies or at least the session id out.
+        *
+        * @param       $responseInstance       An instance of a Responseable class
+        * @return      void
+        */
+       function executeLogin (Responseable $responseInstance);
+}
+
+//
+?>
index a5a09270278a1d4a2c996e514ad5039f1dc25587..2d839a64c55fa09e0e36b3dfbc1510ae2844695e 100644 (file)
@@ -6,7 +6,7 @@
  * @version            0.0.0
  * @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
+ * @link               http://www.ship-simu.org
  *
  * 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
index 294f697ccb3fc978938f75fe3e54e2ad0219a490..5dc756b6931ecfa02af6af57eefe1ab25f660bf4 100644 (file)
@@ -6,7 +6,7 @@
  * @version            0.0.0
  * @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
+ * @link               http://www.ship-simu.org
  *
  * 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
index 92231d803682c34de1caf62668fef6d4d5743116..2862c544f7887b74013a6d5b6e9125a36f657394 100644 (file)
@@ -6,7 +6,7 @@
  * @version            0.0.0
  * @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
+ * @link               http://www.ship-simu.org
  *
  * 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
index babc1289449cf4467368bc56aee1c40d41e2a098..8dff6817d7011fa9b8044f6d0296c40800bcf094 100644 (file)
@@ -6,7 +6,7 @@
  * @version            0.0.0
  * @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
+ * @link               http://www.ship-simu.org
  *
  * 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
index c1c64fcf25001fb75f0e86e0e8ea7d01f4527376..4d4dfac3e2f06b093607d515326b5e8dcbd4f07c 100644 (file)
@@ -6,7 +6,7 @@
  * @version            0.0.0
  * @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
+ * @link               http://www.ship-simu.org
  *
  * 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
index c7abf2d8d05004c86668f487103db3336b2daf7e..107b13387ce19f8f730b80f5a4fa7fa68575af63 100644 (file)
@@ -2,11 +2,11 @@
 /**
  * An interface for user login classes
  *
- * @author             Roland Haeder <webmaster@mxchange.org>
+ * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
  * @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
+ * @link               http://www.ship-simu.org
  *
  * 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
@@ -28,9 +28,10 @@ interface LoginableUser extends FrameworkInterface {
         * in a boolean attribute which is then readable by a matching getter.
         *
         * @param       $requestInstance        An instance of a Requestable class
+        * @param       $responseInstance       An instance of a Responseable class
         * @return      void
         */
-       function doLogin (Requestable $requestInstance);
+       function doLogin (Requestable $requestInstance, Responseable $responseInstance);
 }
 
 //
diff --git a/inc/classes/interfaces/reader/.htaccess b/inc/classes/interfaces/reader/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/inc/classes/interfaces/reader/class_ReadableNews.php b/inc/classes/interfaces/reader/class_ReadableNews.php
new file mode 100644 (file)
index 0000000..c38b702
--- /dev/null
@@ -0,0 +1,34 @@
+<?php
+/**
+ * An interface for news reader
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @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
+ *
+ * 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
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+interface ReadableNews extends FrameworkInterface {
+       /**
+        * Initializes the news reader class. This is very reader-dependent
+        *
+        * @return      void
+        */
+       function initializeReader();
+}
+
+//
+?>
index 9fbf2ff4f152857e2781680cd2f5bcbe188e4e2b..89a6fb22096ea59522f23cf2795f1863eabf6fb2 100644 (file)
@@ -2,11 +2,11 @@
 /**
  * A class for user registration
  *
- * @author             Roland Haeder <webmaster@mxchange.org>
+ * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
  * @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
+ * @link               http://www.ship-simu.org
  *
  * 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
index a750ac1b3740bb44e1772b92d0aae4bf800a8bdd..d25fbab5dc9daf386839c9c2a32571f20ce776f3 100644 (file)
@@ -2,11 +2,11 @@
 /**
  * An interface for registries
  *
- * @author             Roland Haeder <webmaster@mxchange.org>
+ * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
  * @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
+ * @link               http://www.ship-simu.org
  *
  * 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
index 0616d002adfa3bba9d058e5b0a6bec3401152607..7be47dbc4b6b3d913e1fbdcedee13b0874a4809b 100644 (file)
@@ -2,11 +2,11 @@
 /**
  * A class for registerable classes
  *
- * @author             Roland Haeder <webmaster@mxchange.org>
+ * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
  * @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
+ * @link               http://www.ship-simu.org
  *
  * 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
index 1c093b7c908711ddc29f188f9d868d75d27f6bc1..1c3d092507be464a067c9a19a0f7fc0886c4c7b0 100644 (file)
@@ -6,7 +6,7 @@
  * @version            0.0.0
  * @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
+ * @link               http://www.ship-simu.org
  *
  * 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
@@ -70,6 +70,14 @@ interface Requestable extends FrameworkInterface {
         * @return      void
         */
        function requestIsValid ($isValid = true);
+
+       /**
+        * Reads a cookie and returns it's value or null if not found
+        *
+        * @param       $cookieName             Name of cookie we shall read
+        * @return      $cookieValue    Value of cookie or null if not found
+        */
+       function readCookie ($cookieName);
 }
 
 //
index 5e01cd944e2837a43c7c23aefa8429abfaa59550..c60c187292c2901018e97439108865b02cce2bbf 100644 (file)
@@ -6,7 +6,7 @@
  * @version            0.0.0
  * @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
+ * @link               http://www.ship-simu.org
  *
  * 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
index 2f275147a3571bdb6f90680ab3eb6bcc93f1b6ee..1b3d5f00bd8b8c74d4a71860aec9d4672e25c9ba 100644 (file)
@@ -6,7 +6,7 @@
  * @version            0.0.0
  * @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
+ * @link               http://www.ship-simu.org
  *
  * 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
index 30bde5b388eebd806860b5874d9fef5fa5f76bfa..a1fabde81d9b02364c040ec7fdbf6f860b3d6a9b 100644 (file)
@@ -6,7 +6,7 @@
  * @version            0.0.0
  * @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
+ * @link               http://www.ship-simu.org
  *
  * 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
@@ -56,7 +56,7 @@ interface Responseable extends FrameworkInterface {
         * @throws      ResponseHeadersAlreadySentException             Thrown if headers are
         *                                                                                                      already sent
         */
-       function flushBuffer($force=false);
+       function flushBuffer ($force = false);
 
        /**
         * Adds a fatal message id to the response. The added messages can then be
@@ -66,6 +66,35 @@ interface Responseable extends FrameworkInterface {
         * @return      void
         */
        function addFatalMessage ($messageId);
+
+       /**
+        * Adds a cookie to the response
+        *
+        * @param       $cookieName             Cookie's name
+        * @param       $cookieValue    Value to store in the cookie
+        * @param       $encrypted              Do some extra encryption on the value
+        * @return      void
+        * @throws      ResponseHeadersAlreadySentException             If headers are already sent
+        */
+       function addCookie ($cookieName, $cookieValue, $encrypted = false);
+
+       /**
+        * Redirect to a configured URL. The URL can be absolute or relative. In
+        * case of relative URL it will be extended automatically.
+        *
+        * @param       $configEntry    The configuration entry which holds our URL
+        * @return      void
+        * @throws      ResponseHeadersAlreadySentException             If headers are already sent
+        */
+       function redirectToConfiguredUrl ($configEntry);
+
+       /**
+        * Expires the given cookie if it is set
+        *
+        * @param       $cookieName             Cookie to expire
+        * @return      void
+        */
+       function expireCookie ($cookieName);
 }
 
 //
diff --git a/inc/classes/interfaces/result/.htaccess b/inc/classes/interfaces/result/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/inc/classes/interfaces/result/class_SearchableResult.php b/inc/classes/interfaces/result/class_SearchableResult.php
new file mode 100644 (file)
index 0000000..595e5c4
--- /dev/null
@@ -0,0 +1,35 @@
+<?php
+/**
+ * An interface for searchable results
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @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
+ *
+ * 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
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+interface SearchableResult extends FrameworkInterface {
+       /**
+        * Searches for an entry in the data result and returns it
+        *
+        * @param       $criteriaInstance       The criteria to look inside the data set
+        * @return      $result                         Found result entry
+        */
+       function searchEntry (LocalSearchCriteria $criteriaInstance);
+}
+
+// [EOF]
+?>
index 16a500ed98dc2e37e7014bd5eaef56ca9aa1e7ed..c0ec28b7d369529c43e0bcda43b4ae78f350298e 100644 (file)
@@ -6,7 +6,7 @@
  * @version            0.0.0
  * @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
+ * @link               http://www.ship-simu.org
  *
  * 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
index b8617363bfe4c58094ab2dca4dc847dba3e86f49..230d04ebcce7d0b4bba53324623c59a36f899486 100644 (file)
@@ -6,7 +6,7 @@
  * @version            0.0.0
  * @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
+ * @link               http://www.ship-simu.org
  *
  * 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
index 768df477908345a52bb6a547137fe3bc8369e9b3..4dafed2894514b3194fc8db14698b47cebd383f6 100644 (file)
@@ -6,7 +6,7 @@
  * @version            0.0.0
  * @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
+ * @link               http://www.ship-simu.org
  *
  * 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
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
  */
 interface ManageableUser extends FrameworkInterface {
+       /**
+        * Determines wether the username exists or not
+        *
+        * @return      $exists         Wether the username exists
+        */
+       function ifUsernameExists ();
+
+       /**
+        * Determines wether the email exists or not
+        *
+        * @return      $exists         Wether the email exists
+        */
+       function ifEmailAddressExists ();
+
+       /**
+        * Checks if the 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
+        */
+       function ifPasswordHashMatches (Requestable $requestInstance);
+
+       /**
+        * Adds data for later complete update
+        *
+        * @param       $column         Column we want to update
+        * @param       $value          New value to store in database
+        * @return      void
+        */
+       function addUpdateData ($column, $value);
 }
 
 //
index 9b2df36d50d7fe562c80e54e3718a37908f2f786..15ba51ef0d5c8eca17639646801af360ef5d07a6 100644 (file)
@@ -3,10 +3,10 @@
  * A general action class
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
- * @version            0.3.0
+ * @version            0.0.0
  * @copyright  Copyright(c) 2007, 2008 Roland Haeder, this is free software
  * @license            GNU GPL 3.0 or any newer version
- * @link               http://www.mxchange.org
+ * @link               http://www.ship-simu.org
  *
  * 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
index aae33eb5c2c8f0d67d7c97ba8b20bfc0218aa754..c5f1e8a02ff4480fbece3a9479ef4f065d73acfa 100644 (file)
@@ -60,16 +60,16 @@ class LoginAfterRegistrationAction extends BaseAction implements Commandable {
         */
        public function execute (Requestable $requestInstance, Responseable $responseInstance) {
                // Get a login class from factory
-               $loginInstance = ObjectFactory::createObjectByConfiguredName('login_user');
+               $loginInstance = ObjectFactory::createObjectByConfiguredName('user_login_class');
 
                // Login the user by the request instance
-               $loginInstance->doLogin($requestInstance);
+               $loginInstance->doLogin($requestInstance, $responseInstance);
 
                // Was the login fine? Then redirect here
                if ($loginInstance->ifLoginWasSuccessfull()) {
                        // Try to redirect here
                        try {
-                               $responseInstance->redirectConfiguredUrl('app_login');
+                               $responseInstance->redirectToConfiguredUrl('app_login_url');
                        } catch (FrameworkException $e) {
                                // Something went wrong here!
                                $responseInstance->addFatalMessage($e->getMessage());
diff --git a/inc/classes/main/auth/.htaccess b/inc/classes/main/auth/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/inc/classes/main/auth/class_CookieAuth.php b/inc/classes/main/auth/class_CookieAuth.php
new file mode 100644 (file)
index 0000000..6b1bf3f
--- /dev/null
@@ -0,0 +1,121 @@
+<?php
+/**
+ * A cookie-bases authorization class
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @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
+ *
+ * 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
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * 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 CookieAuth extends BaseFrameworkSystem implements Authorizeable, Registerable {
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+
+               // Set part description
+               $this->setObjectDescription("Cookie-based login");
+
+               // Create unique ID number
+               $this->generateUniqueId();
+
+               // Clean up a little
+               $this->removeNumberFormaters();
+               $this->removeSystemArray();
+       }
+
+       /**
+        * Creates an instance of this class by the given response instance
+        *
+        * @param       $responseInstance       An instance of a Responseable class
+        * @return      $loginInstance          An instance of this login class
+        */
+       public final static function createCookieAuth (Responseable $responseInstance) {
+               // Get a new instance
+               $loginInstance = new CookieAuth();
+
+               // Set the response instance
+               $loginInstance->setResponseInstance($responseInstance);
+
+               // Return the prepared instance
+               return $loginInstance;
+       }
+
+       /**
+        * "Setter" for username auth data
+        *
+        * @param       $userName       The username from request we shall set
+        * @return      void
+        */
+       public function setUserAuth ($userName) {
+               $this->getResponseInstance()->addCookie('username', $userName);
+       }
+
+       /**
+        * "Setter" for password hash auth data
+        *
+        * @param       $passHash       The hashed password from request we shall set
+        * @return      void
+        */
+       public function setPasswordAuth ($passHash) {
+               $this->getResponseInstance()->addCookie('u_hash', $passHash, true);
+       }
+
+       /**
+        * Getter for user auth cookie
+        *
+        * @return      $userName       Username to get from cookie
+        */
+       public function getUserAuth () {
+               // Get the username from cookie
+               $userName = $this->getRequestInstance()->readCookie('username');
+
+               // Return the username
+               return $userName;
+       }
+
+       /**
+        * Getter for password hash auth cookie
+        *
+        * @return      $passHash       Password hash to get from cookie
+        */
+       public function getPasswordAuth () {
+               // Get the username from cookie
+               $passHash = $this->getRequestInstance()->readCookie('u_hash');
+
+               // Return the username
+               return $passHash;
+       }
+
+       /**
+        * Destroy the authorization data
+        *
+        * @return      void
+        */
+       public function destroyAuthData () {
+               // Expire both cookies
+               $this->getResponseInstance()->expireCookie('username');
+               $this->getResponseInstance()->expireCookie('u_hash');
+       }
+}
+
+// [EOF]
+?>
index 01d2a367819df645c6f0251e726154a6537546b4..4cb7459b6d72a47d19a4e5e00beb12455bc44fd7 100644 (file)
@@ -3,10 +3,10 @@
  * A simple memory cache (similar to a registry)
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
- * @version            0.3.0
+ * @version            0.0.0
  * @copyright  Copyright(c) 2007, 2008 Roland Haeder, this is free software
  * @license            GNU GPL 3.0 or any newer version
- * @link               http://www.mxchange.org
+ * @link               http://www.ship-simu.org
  *
  * 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
index 2a0c80768b2b2c7fd2928af4a88e30716f82d640..3484a4eb5a9dc5724e37525bfe81954e230114a0 100644 (file)
@@ -32,6 +32,15 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
         * The language instance for the template loader
         */
        private static $langInstance = null;
+       /**
+        * Instance of a request class
+        */
+       private $requestInstance = null;
+
+       /**
+        * Instance of a response class
+        */
+       private $responseInstance = null;
 
        /**
         * The real class name
@@ -61,7 +70,7 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
        /**
         * The file I/O instance for the template loader
         */
-       private $fileIOInstance = null;
+       private $fileIoInstance = null;
 
        /***********************
         * Exception codes.... *
@@ -267,7 +276,7 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
                        $this->systemclasses[] = $this->getConfigInstance()->readConfig('app_helper_class');
 
                        // Set debug instance
-                       $this->setDebugInstance(DebugMiddleware::createDebugMiddleware($this->getConfigInstance()->readConfig('debug_engine')));
+                       $this->setDebugInstance(DebugMiddleware::createDebugMiddleware($this->getConfigInstance()->readConfig('debug_class')));
 
                        // Get output instance and set it
                        $outputInstance = ObjectFactory::createObjectByConfiguredName('web_engine', array($this->getConfigInstance()->readConfig('web_content_type')));
@@ -407,6 +416,44 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
                self::$applicationInstance = $applicationInstance;
        }
 
+       /**
+        * Setter for request instance
+        *
+        * @param       $requestInstance        An instance of a Requestable class
+        * @return      void
+        */
+       public final function setRequestInstance (Requestable $requestInstance) {
+               $this->requestInstance = $requestInstance;
+       }
+
+       /**
+        * Getter for request instance
+        *
+        * @return      $requestInstance        An instance of a Requestable class
+        */
+       public final function getRequestInstance () {
+               return $this->requestInstance;
+       }
+
+       /**
+        * Setter for response instance
+        *
+        * @param       $responseInstance       An instance of a Responseable class
+        * @return      void
+        */
+       public final function setResponseInstance (Responseable $responseInstance) {
+               $this->responseInstance = $responseInstance;
+       }
+
+       /**
+        * Getter for response instance
+        *
+        * @return      $responseInstance       An instance of a Responseable class
+        */
+       public final function getResponseInstance () {
+               return $this->responseInstance;
+       }
+
        /**
         * Getter for $realClass
         *
@@ -758,20 +805,20 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
        /**
         * Private getter for file IO instance
         *
-        * @return      $fileIOInstance An instance to the file I/O sub-system
+        * @return      $fileIoInstance An instance to the file I/O sub-system
         */
        protected final function getFileIoInstance () {
-               return $this->fileIOInstance;
+               return $this->fileIoInstance;
        }
 
        /**
         * Setter for file I/O instance
         *
-        * @param       $fileIOInstance An instance to the file I/O sub-system
+        * @param       $fileIoInstance An instance to the file I/O sub-system
         * @return      void
         */
-       public final function setFileIoInstance (FileIoHandler $fileIOInstance) {
-               $this->fileIOInstance = $fileIOInstance;
+       public final function setFileIoInstance (FileIoHandler $fileIoInstance) {
+               $this->fileIoInstance = $fileIoInstance;
        }
 
        /**
@@ -821,7 +868,7 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
                }
 
                // Initialize the template engine
-               $tplEngine = ObjectFactory::createObjectByConfiguredName('tpl_engine', array($fqfn, $appInstance->getLanguageInstance(), $appInstance->getFileIoInstance()));
+               $tplEngine = ObjectFactory::createObjectByConfiguredName('template_class', array($fqfn, $appInstance->getLanguageInstance(), $appInstance->getFileIoInstance()));
 
                // Return the prepared instance
                return $tplEngine;
@@ -886,10 +933,19 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
         * @return      $className      Generated class name
         */
        public function convertToClassName ($str) {
+               // Init class name
                $className = "";
+
+               // Convert all dashes in underscores
+               $str = str_replace("-", "_", $str);
+
+               // Now use that underscores to get classname parts for hungarian style
                foreach (explode("_", $str) as $strPart) {
+                       // Make the class name part lower case and first upper case
                        $className .= ucfirst(strtolower($strPart));
-               }
+               } // END - foreach
+
+               // Return class name
                return $className;
        }
 
index 6543d45f09c36863f4adba1351c15b0f16a6f977..f1daed4b335acb8e71a19264bee2b9f47b4eaa37 100644 (file)
@@ -8,7 +8,7 @@
  * @version            0.0.0
  * @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
+ * @link               http://www.ship-simu.org
  *
  * 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
index 628cd0f8eb59cd66aa6b278a8393b48317675fcd..778e7d8bb0f2c62f07faa4c382eec916c1ec24e3 100644 (file)
@@ -2,11 +2,11 @@
 /**
  * 
  *
- * @author             Roland Haeder <webmaster@mxchange.org>
+ * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
  * @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
+ * @link               http://www.ship-simu.org
  *
  * 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
index e7f59adeee5049e89b676ce4ad40c69226210f43..cdfd7161ac0421c3fc84bd4a4a5be6593a712477 100644 (file)
@@ -6,7 +6,7 @@
  * @version            0.0.0
  * @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
+ * @link               http://www.ship-simu.org
  *
  * 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
index 8dcf3b1c451cc1a05fcfa0d8ca5644ad5be3f856..3cc3592cf40c022d46a85f709c1c0dbad2ef774a 100644 (file)
@@ -6,7 +6,7 @@
  * @version            0.0.0
  * @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
+ * @link               http://www.ship-simu.org
  *
  * 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
@@ -99,7 +99,7 @@ class WebHomeCommand extends BaseCommand implements Commandable {
                $templateInstance->loadCodeTemplate($masterTemplate);
 
                // Set title
-               $title = ucfirst($requestInstance->getRequestElement($this->getConfigInstance()->readConfig('command_parameter')));
+               $title = ucfirst($requestInstance->getRequestElement("page"));
                if (empty($title)) $title = "Home";
                $templateInstance->assignVariable('title', $title);
 
diff --git a/inc/classes/main/commands/web/class_WebLoginAreaCommand.php b/inc/classes/main/commands/web/class_WebLoginAreaCommand.php
new file mode 100644 (file)
index 0000000..d5f45ec
--- /dev/null
@@ -0,0 +1,129 @@
+<?php
+/**
+ * A command for the login area (member/gamer area)
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @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
+ *
+ * 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
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * 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 WebLoginAreaCommand extends BaseCommand implements Commandable {
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+
+               // Set special description
+               $this->setObjectDescription("Command for the &quot;home&quot; page");
+
+               // Create unique ID number
+               $this->generateUniqueId();
+
+               // Clean up a little
+               $this->removeSystemArray();
+       }
+
+       /**
+        * Creates an instance of this class
+        *
+        * @param       $resolverInstance               An instance of a command resolver class
+        * @return      $commandInstance                An instance a prepared command class
+        */
+       public final static function createWebLoginAreaCommand (CommandResolver $resolverInstance) {
+               // Get new instance
+               $commandInstance = new WebLoginAreaCommand();
+
+               // Set the application instance
+               $commandInstance->setResolverInstance($resolverInstance);
+
+               // Return the prepared instance
+               return $commandInstance;
+       }
+
+       /**
+        * Executes the given command with given request and response objects
+        *
+        * @param       $requestInstance                An instance of a class with an Requestable interface
+        * @param       $responseInstance               An instance of a class with an Responseable interface
+        * @return      void
+        */
+       public function execute (Requestable $requestInstance, Responseable $responseInstance) {
+               // Default action is the one from configuration
+               $action = sprintf("login_%s", $this->getConfigInstance()->readConfig('login_default_action'));
+
+               // Get the application instance
+               $appInstance = $this->getResolverInstance()->getApplicationInstance();
+
+               // Prepare a template instance
+               $templateInstance = $this->prepareTemplateEngine($appInstance);
+
+               // Load the master template
+               $masterTemplate = $appInstance->getMasterTemplate();
+
+               // Load header template
+               $templateInstance->loadCodeTemplate("header");
+
+               // Compile and assign it with a variable
+               $templateInstance->compileTemplate();
+               $templateInstance->assignTemplateWithVariable("header", "header");
+
+               // Load footer template
+               $templateInstance->loadCodeTemplate("footer");
+
+               // Compile and assign it with a variable
+               $templateInstance->compileTemplate();
+               $templateInstance->assignTemplateWithVariable("footer", "footer");
+
+               // Get "action" from request
+               $actReq = $requestInstance->getRequestElement("action");
+
+               // Do we have a "action" parameter set?
+               if (is_string($actReq)) {
+                       // Then use it with prefix
+                       $action = sprintf("login_%s", $actReq);
+               } // END - if
+
+               // TODO Do the action somewhere here
+
+               // Load the matching template
+               $templateInstance->loadCodeTemplate($action);
+
+               // Assign the template with the master template as a content ... ;)
+               $templateInstance->assignTemplateWithVariable($action, "content");
+
+               // Load the master template
+               $templateInstance->loadCodeTemplate($masterTemplate);
+
+               // Set title
+               $templateInstance->assignVariable('title', $this->getLanguageInstance()->getMessage('login_{$action}_title'));
+
+               // ... and all variables. This should be merged together in a pattern
+               // to make things easier. A cache mechanism should be added between
+               // these two calls to cache compiled templates.
+               $templateInstance->compileVariables();
+
+               // Get the content back from the template engine and put it in the response class
+               $templateInstance->transferToResponse($responseInstance);
+       }
+}
+
+// [EOF]
+?>
index 1f85254b819bc94d93f94a76c2b7402fba5bec83..df504999875b2368fce140f38b2f4c102f80e3e5 100644 (file)
@@ -6,7 +6,7 @@
  * @version            0.0.0
  * @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
+ * @link               http://www.ship-simu.org
  *
  * 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
@@ -103,7 +103,7 @@ class WebRegisterCommand extends BaseCommand implements Commandable {
                $templateInstance->loadCodeTemplate($masterTemplate);
 
                // Set title
-               $title = ucfirst($requestInstance->getRequestElement($this->getConfigInstance()->readConfig('command_parameter')));
+               $title = ucfirst($requestInstance->getRequestElement("page"));
                if (empty($title)) $title = "Register";
                $templateInstance->assignVariable('title', $title);
 
index ffdc18214ca599b3d3e97a2d7c5e68379e1a7947..ffd8b8e7504f40216fef2382262bcb1ce0a5b60a 100644 (file)
@@ -6,7 +6,7 @@
  * @version            0.0.0
  * @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
+ * @link               http://www.ship-simu.org
  *
  * 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
index 409ded2b9eba7a60ee8893b1818947fce167013b..4438cc216e60f0d61f44da6ed10b1928b31028c8 100644 (file)
@@ -53,8 +53,8 @@ class BaseController extends BaseFrameworkSystem {
                $this->removeSystemArray();
 
                // Initialize both filter chains
-               $this->preFilterChain  = ObjectFactory::createObjectByConfiguredName('filter_chain');
-               $this->postFilterChain = ObjectFactory::createObjectByConfiguredName('filter_chain');
+               $this->preFilterChain  = ObjectFactory::createObjectByConfiguredName('filter_chain_class');
+               $this->postFilterChain = ObjectFactory::createObjectByConfiguredName('filter_chain_class');
        }
 
        /**
index 326c0b00bce91ea26f80cb8574aa987aa3190cb5..fee2d39f00034c55f50e7b8828cfb8173245b919 100644 (file)
@@ -51,6 +51,10 @@ class WebDefaultNewsController extends BaseController implements Controller {
                // Set the command resolver
                $controllerInstance->setResolverInstance($resolverInstance);
 
+               // Add news filters to this controller
+               $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('news_download_class'));
+               $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('news_process_class'));
+
                // Return the prepared instance
                return $controllerInstance;
        }
@@ -63,32 +67,24 @@ class WebDefaultNewsController extends BaseController implements Controller {
         * @return      void
         */
        public function handleRequest (Requestable $requestInstance, Responseable $responseInstance) {
+               // Run the pre filters
+               $this->executePreFilters($requestInstance, $responseInstance);
+
                // Get the command instance from the resolver by sending a request instance to the resolver
                $commandInstance = $this->getResolverInstance()->resolvCommandByRequest($requestInstance);
 
-               // Load the news here
-               $this->loadNewsByRequest($requestInstance);
-
                // This request was valid! :-D
                $requestInstance->requestIsValid();
 
                // Execute the command
                $commandInstance->execute($requestInstance, $responseInstance);
 
+               // Run the pre filters
+               $this->executePostFilters($requestInstance, $responseInstance);
+
                // Flush the response out
                $responseInstance->flushBuffer();
        }
-
-       /**
-        * Loads news by a given request
-        *
-        * @param       $requestInstance        An instance of a request class
-        * @return      void
-        */
-       private function loadNewsByRequest (Requestable $requestInstance) {
-               // Generate a new news object but not carring about which concrete we have
-               $newsInstance = WebNewsFactory::createFactoryByRequest($requestInstance)->createNewsObject();
-       }
 }
 
 // [EOF]
diff --git a/inc/classes/main/controller/login/.htaccess b/inc/classes/main/controller/login/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/inc/classes/main/controller/login/class_WebLoginAreaController.php b/inc/classes/main/controller/login/class_WebLoginAreaController.php
new file mode 100644 (file)
index 0000000..34893a1
--- /dev/null
@@ -0,0 +1,92 @@
+<?php
+/**
+ * Controller for login area with news
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @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
+ *
+ * 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
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * 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 WebLoginAreaController extends BaseController implements Controller {
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+
+               // Set part description
+               $this->setObjectDescription("Default controller with news");
+
+               // Create unique ID number
+               $this->generateUniqueId();
+       }
+
+       /**
+        * Creates an instance of this class
+        *
+        * @param       $resolverInstance               An instance of a command resolver class
+        * @return      $controllerInstance             A prepared instance of this class
+        */
+       public final static function createWebLoginAreaController (CommandResolver $resolverInstance) {
+               // Create the instance
+               $controllerInstance = new WebLoginAreaController();
+
+               // Set the command resolver
+               $controllerInstance->setResolverInstance($resolverInstance);
+
+               // Add some filters to this controller
+               $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_auth_class'));
+               $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('news_download_class'));
+               $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('news_process_class'));
+
+               // Return the prepared instance
+               return $controllerInstance;
+       }
+
+       /**
+        * Handles the given request and response
+        *
+        * @param       $requestInstance        An instance of a request class
+        * @param       $responseInstance       An instance of a response class
+        * @return      void
+        */
+       public function handleRequest (Requestable $requestInstance, Responseable $responseInstance) {
+               // Run the pre filters
+               $this->executePreFilters($requestInstance, $responseInstance);
+
+               // Get the command instance from the resolver by sending a request instance to the resolver
+               $commandInstance = $this->getResolverInstance()->resolvCommandByRequest($requestInstance);
+
+               // This request was valid! :-D
+               $requestInstance->requestIsValid();
+
+               // Execute the command
+               $commandInstance->execute($requestInstance, $responseInstance);
+
+               // Run the pre filters
+               $this->executePostFilters($requestInstance, $responseInstance);
+
+               // Flush the response out
+               $responseInstance->flushBuffer();
+       }
+}
+
+// [EOF]
+?>
index feb6366fac03eb5fc0effabdec8b3d831d39621c..2e76c2f94d518ac66873823e0ac8ad525feda36c 100644 (file)
@@ -7,7 +7,7 @@
  * @version            0.0.0
  * @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
+ * @link               http://www.ship-simu.org
  *
  * 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
index f948909671be7412d9fa19ac8e744c3847167b3a..fc5b1addd3757b37530196a67e8393841b05a966 100644 (file)
@@ -5,10 +5,10 @@
  * for looking in storages like the database.
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
- * @version            0.3.0
+ * @version            0.0.0
  * @copyright  Copyright(c) 2007, 2008 Roland Haeder, this is free software
  * @license            GNU GPL 3.0 or any newer version
- * @link               http://www.mxchange.org
+ * @link               http://www.ship-simu.org
  *
  * 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
index cdde42113806c1e70aa1fbdda9f7a7c68bfbad16..4ec02ad9171256c275b26311527851df3b475cc7 100644 (file)
@@ -3,10 +3,10 @@
  * A helper class for cryptographical things like hashing passwords and so on
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
- * @version            0.3.0
+ * @version            0.0.0
  * @copyright  Copyright(c) 2007, 2008 Roland Haeder, this is free software
  * @license            GNU GPL 3.0 or any newer version
- * @link               http://www.mxchange.org
+ * @link               http://www.ship-simu.org
  *
  * 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
index 6c338fdd99968564dcc52ce231adfd780aaf37b1..504f4ab110bbb095b2ff5bbfbddbc3f1061e3d8e 100644 (file)
@@ -7,7 +7,7 @@
  * @version            0.0.0
  * @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
+ * @link               http://www.ship-simu.org
  *
  * 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
index cdf894fc04a0428758b2274ec8e3665e59d7372b..2d2e04bdcf87a4ab38c9844f3483f59304f1ce27 100644 (file)
@@ -7,7 +7,7 @@
  * @version            0.0.0
  * @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
+ * @link               http://www.ship-simu.org
  *
  * 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
@@ -24,7 +24,7 @@
  */
 abstract class BaseDatabaseFrontend extends BaseFrameworkSystem implements DatabaseFrontendInterface, LimitableObject {
        // Constants for exceptions
-       const EXCEPTION_SQL_QUERY = 0xc00;
+       const EXCEPTION_SQL_QUERY = 0x050;
 
        /**
         * The limiter instance
index 9c42999de5863e1a5484eee9dcf43a7df5f416df..52447117eb08edac4cf44933fd3b5e0932424fc9 100644 (file)
@@ -6,7 +6,7 @@
  * @version            0.0.0
  * @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
+ * @link               http://www.ship-simu.org
  *
  * 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
index 151698c7f28b9410837921a480688c516dc4cf62..220ad14d2888bdb84e28054e84aff41e455f5d04 100644 (file)
@@ -8,7 +8,7 @@
  * @version            0.0.0
  * @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
+ * @link               http://www.ship-simu.org
  *
  * 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
@@ -26,8 +26,8 @@
 class LocalFileDatabase extends BaseDatabaseFrontend implements DatabaseFrontendInterface {
 
        // Constants for MySQL backward-compatiblity (PLEASE FIX THEM!)
-       const DB_CODE_TABLE_MISSING     = 0x000;
-       const DB_CODE_TABLE_UNWRITEABLE = 0x001;
+       const DB_CODE_TABLE_MISSING     = 0x010;
+       const DB_CODE_TABLE_UNWRITEABLE = 0x011;
 
        /**
         * Save path for "file database"
@@ -535,16 +535,10 @@ class LocalFileDatabase extends BaseDatabaseFrontend implements DatabaseFrontend
         * @throws      UnsupportedCriteriaException    If the criteria is unsupported
         * @throws      SqlException                                    If an "SQL error" occurs
         */
-       public function querySelect ($resultType, $tableName, Criteria $criteriaInstance) {
+       public function querySelect ($resultType, $tableName, LocalSearchCriteria $criteriaInstance) {
                // The result is null by any errors
                $resultData = null;
 
-               // Is this criteria supported?
-               if (!$criteriaInstance instanceof LocalSearchCriteria) {
-                       // Not supported by this database layer
-                       throw new UnsupportedCriteriaException(array($this, $criteriaInstance), self::EXCEPTION_REQUIRED_INTERFACE_MISSING);
-               }
-
                // Create full path name
                $pathName = $this->getSavePath() . $tableName . '/';
 
@@ -640,7 +634,7 @@ class LocalFileDatabase extends BaseDatabaseFrontend implements DatabaseFrontend
         * @return      void
         * @throws      SqlException    If an SQL error occurs
         */
-       public function insertDataSet (StoreableCriteria $dataSetInstance) {
+       public function queryInsertDataSet (StoreableCriteria $dataSetInstance) {
                // Create full path name
                $fqfn = sprintf("%s%s/%s.%s",
                        $this->getSavePath(),
index 88bc13fbb24e1ee3b91782005888fb2431f26b4f..5fc62e2a836a0a2fd32fb9ea2d8bcf6d676d0711 100644 (file)
@@ -7,7 +7,7 @@
  * @version            0.0.0
  * @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
+ * @link               http://www.ship-simu.org
  *
  * 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
@@ -29,7 +29,7 @@ class UserDatabaseWrapper extends BaseDatabaseWrapper {
        private $cacheInstance = null;
 
        // Constants for exceptions
-       const EXCEPTION_CLIENT_USERNAME_NOT_FOUND = 0xe00;
+       const EXCEPTION_CLIENT_USERNAME_NOT_FOUND = 0x070;
 
        // Constants for database columns
        const DB_COLUMN_USERNAME = "username";
@@ -132,14 +132,14 @@ class UserDatabaseWrapper extends BaseDatabaseWrapper {
         */
        public function insertRegistrationObject (UserRegister $registrationInstance) {
                // Generate a data set for the request
-               $dataSetInstance = ObjectFactory::createObjectByConfiguredName('dataset_criteria');
+               $dataSetInstance = ObjectFactory::createObjectByConfiguredName('dataset_criteria_class');
                $dataSetInstance->setTableName(self::DB_TABLE_USER);
 
                // Add registration elements to the dataset
                $registrationInstance->addElementsToDataSet($dataSetInstance);
 
                // "Insert" this request instance completely into the database
-               $this->getDatabaseInstance()->insertDataSet($dataSetInstance);
+               $this->getDatabaseInstance()->queryInsertDataSet($dataSetInstance);
        }
 }
 
index 77b28b4bebf6a6982af80f8b6df183d065ffc462..be17ae39adbfde9ab0749a20a304cc16c9b2c9f6 100644 (file)
@@ -6,7 +6,7 @@
  * @version            0.0.0
  * @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
+ * @link               http://www.ship-simu.org
  *
  * 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
index af33e70080ede3d9924f959a682297f34afbe64b..34db47c5f7ad932d7727ea37f80754e7b60efbef 100644 (file)
@@ -6,7 +6,7 @@
  * @version            0.0.0
  * @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
+ * @link               http://www.ship-simu.org
  *
  * 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
index 3eb613382e9b7248d6b22454f0bfb3f7263620f3..81dd64dc9a21fec6ce1fe77282ac9bc7cc6e359d 100644 (file)
@@ -6,7 +6,7 @@
  * @version            0.0.0
  * @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
+ * @link               http://www.ship-simu.org
  *
  * 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
index 0f9ea835e08f41f6e8e1a81e47e910c9ac59d264..926e8fc6994e4915f479c82b7a22cb6e61c980e3 100644 (file)
@@ -7,7 +7,7 @@
  * @version            0.0.0
  * @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
+ * @link               http://www.ship-simu.org
  *
  * 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
index 6d5c15de54fd078d2bf1014929174a0fc5ae1a97..2f967e4b360d8d9c44d5712f3c0afb3b8ba51e14 100644 (file)
@@ -7,7 +7,7 @@
  * @version            0.0.0
  * @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
+ * @link               http://www.ship-simu.org
  *
  * 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
index 48f83383fe8b7e22213447c9b2cd645235b2fc47..e2cb7bce35571fc18604c469a8c6180758272f7a 100644 (file)
@@ -66,7 +66,7 @@ class CacheFactory extends BaseFactory {
         */
        public function createConfiguredCache () {
                // Read the config entry
-               $cacheType = $this->getConfigInstance()->readConfig("cache_type");
+               $cacheType = $this->getConfigInstance()->readConfig("cache_class");
 
                // And get a new instance
                $cacheInstance = ObjectFactory::createObjectByName($cacheType);
index 024020d6d4782d93e9063712e7715c34da869537..9a2ec9c2d2c9958191c6af7bf2a415dc0e39e255 100644 (file)
@@ -55,14 +55,17 @@ class ObjectFactory extends BaseFactory {
         * @throws      EmptyVariableException  If a variable is empty unexpectly
         */
        public final static function createObjectByName ($className, array $args=array()) {
-               // First get an instance of this factory
-               $factoryInstance = new ObjectFactory();
-
                // Is the class name valid and is the class there?
                if (empty($className)) {
+                       // First get an instance of this factory
+                       $factoryInstance = new ObjectFactory();
+
                        // Throw an exception here
                        throw new EmptyVariableException(array($factoryInstance, 'className'), self::EXCEPTION_UNEXPECTED_EMPTY_STRING);
                } elseif (!class_exists($className)) {
+                       // First get an instance of this factory
+                       $factoryInstance = new ObjectFactory();
+
                        // Then throw an exception
                        throw new ClassNotFoundException(array($factoryInstance, $className), self::EXCEPTION_CLASS_NOT_FOUND);
                }
index ecd1f286422f9f38294e25dbac5848da3f3d1a1b..dfbb6db85f26b04d14187a21182792a387c2f42d 100644 (file)
@@ -51,67 +51,16 @@ class WebNewsFactory extends BaseFactory {
         * @return      $factoryInstance        An instance of a WebNewsFactory class
         */
        public final static function createFactoryByRequest (Requestable $requestInstance) {
-               // Generate the new instance
-               $factoryInstance = new WebNewsFactory();
-
-               // Get the element name from configuration
-               $element = FrameworkConfiguration::getInstance()->readConfig('app_selector_get');
-
-               // Analyze the request, first get the Uni* application name (short one from URL)
-               $appName = $requestInstance->getRequestElement($element);
-
-               // Initialize some variables
-               $className = "";
-               $className2 = $appName;
-
-               // Then construct the class name
-               foreach (array("_", "-") as $exp) {
-                       $array = explode($exp, $className2);
-                       foreach ($array as $el) {
-                               $className .= ucfirst(strtolower($el));
-                       }
-
-                       // Copy it back and clear the class name
-                       $className2 = $className;
-                       $className = "";
-               }
-
-               // After all is done, copy it back and add this class' name
-               $className = $className2 . $factoryInstance->__toString();
+               // Get the news reader class name from config
+               $className = $requestInstance->getConfigInstance()->readConfig('news_reader_class');
 
                // Once we have that name, try to load initialize it
-               $realFactoryInstance = ObjectFactory::createObjectByName($className);
-
-               // And assign it with the factory
-               $factoryInstance->setRealFactoryInstance($realFactoryInstance);
+               $newsInstance = ObjectFactory::createObjectByName($className, array($requestInstance));
 
-               // Remember the request we have used for later usage
-               $factoryInstance->setRequestInstance($requestInstance);
+               // Initialize the reader
+               $newsInstance->initializeReader();
 
                // Return the prepared factory instance
-               return $factoryInstance;
-       }
-
-       /**
-        * Setter for the request instance
-        *
-        * @param       $requestInstance        An instance of a request object
-        * @return      void
-        */
-       public final function setRequestInstance (Requestable $requestInstance) {
-               $this->requestInstance = $requestInstance;
-       }
-
-       /**
-        * Creates a new object instance and returns it
-        *
-        * @return      $newsInstance   An instance of a news object
-        */
-       public function createNewsObject () {
-               // Ask the real factory class for doing this
-               $newsInstance = $this->getRealFactoryInstance()->createNewObject($this->requestInstance);
-
-               // And return it
                return $newsInstance;
        }
 }
diff --git a/inc/classes/main/filter/auth/.htaccess b/inc/classes/main/filter/auth/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/inc/classes/main/filter/auth/class_UserAuthFilter.php b/inc/classes/main/filter/auth/class_UserAuthFilter.php
new file mode 100644 (file)
index 0000000..5754bf1
--- /dev/null
@@ -0,0 +1,114 @@
+<?php
+/**
+ * A filter for checking user permissions
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @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
+ *
+ * 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
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * 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 UserAuthFilter extends BaseFilter implements Filterable {
+       // Exception constants
+       const EXCEPTION_AUTH_DATA_INVALID = 0x0a0;
+
+       /**
+        * The login method we shall choose
+        */
+       private $authMethod = "";
+
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+
+               // Set part description
+               $this->setObjectDescription("A user authorization filter");
+
+               // Create unique ID number
+               $this->generateUniqueId();
+       }
+
+       /**
+        * Creates an instance of this filter class
+        *
+        * @return      $filterInstance         An instance of this filter class
+        */
+       public final static function createUserAuthFilter () {
+               // Get a new instance
+               $filterInstance = new UserAuthFilter();
+
+               // Set default auth method
+               $filterInstance->setDefaultAuthMethod();
+
+               // Return the instance
+               return $filterInstance;
+       }
+
+       /**
+        * Setter for default login method from config
+        *
+        * @return      void
+        */
+       protected function setDefaultAuthMethod () {
+               $this->authMethod = $this->getConfigInstance()->readConfig('auth_method_class');
+       }
+
+       /**
+        * Executes the filter with given request and response objects
+        *
+        * @param       $requestInstance        An instance of a class with an Requestable interface
+        * @param       $responseInstance       An instance of a class with an Responseable interface
+        * @return      void
+        * @throws      UserAuthorizationException      If the auth login was not found or if it was invalid
+        */
+       public function execute (Requestable $requestInstance, Responseable $responseInstance) {
+               // Then get an auth instance for checking and updating the auth cookies
+               $authInstance = ObjectFactory::createObjectByName($this->authMethod, array($responseInstance));
+
+               // Set request instance
+               $authInstance->setRequestInstance($requestInstance);
+
+               // Now, get the auth data for comparison
+               $authLogin = $authInstance->getUserAuth();
+               $authHash  = $authInstance->getPasswordAuth();
+
+               // If one is empty stop here
+               if ((empty($authLogin)) || (empty($authHash))) {
+                       // Destroy the auth data
+                       $authInstance->destroyAuthData();
+
+                       // Mark the request as invalid
+                       $requestInstance->requestIsValid(false);
+
+                       // Add fatal message
+                       $responseInstance->addFatalMessage('auth_data_incomplete');
+
+                       // Stop here
+                       throw new UserAuthorizationException($this, self::EXCEPTION_AUTH_DATA_INVALID);
+               }
+
+               // Destroy safely the auth instance
+               unset($authInstance);
+       }
+}
+
+// [EOF]
+?>
index 3029dcee64c559460175239cd023ace84dd708a0..d52c6aa6ac639c9e1eedd85dd8817c22be3bf698 100644 (file)
@@ -23,7 +23,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 RulesAcceptedFilter extends BaseFrameworkSystem implements Filterable {
+class RulesAcceptedFilter extends BaseFilter implements Filterable {
        /**
         * Protected constructor
         *
@@ -38,10 +38,6 @@ class RulesAcceptedFilter extends BaseFrameworkSystem implements Filterable {
 
                // Create unique ID number
                $this->generateUniqueId();
-
-               // Clean up a little
-               $this->removeNumberFormaters();
-               $this->removeSystemArray();
        }
 
        /**
@@ -76,7 +72,7 @@ class RulesAcceptedFilter extends BaseFrameworkSystem implements Filterable {
                        // Add a message to the response
                        $responseInstance->addFatalMessage('rules_unchecked');
 
-                       // Abort here
+                       // Skip further processing
                        return false;
                }
        }
diff --git a/inc/classes/main/filter/class_BaseFilter.php b/inc/classes/main/filter/class_BaseFilter.php
new file mode 100644 (file)
index 0000000..3800c49
--- /dev/null
@@ -0,0 +1,45 @@
+<?php
+/**
+ * A general filter class
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @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
+ *
+ * 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
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * 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 BaseFilter extends BaseFrameworkSystem {
+       // Exception constants
+       const EXCEPTION_FILTER_CHAIN_ABORTED = 0x090;
+
+       /**
+        * Protected constructor
+        *
+        * @param       $className      Name of the filter class
+        * @return      void
+        */
+       protected function __construct ($className) {
+               // Call parent constructor
+               parent::__construct($className);
+
+               // Clean up a little
+               $this->removeNumberFormaters();
+               $this->removeSystemArray();
+       }
+}
+
+// [EOF]
+?>
index fa1f8f42112f095634f1e98c9e809012a3f5f467..7004eb50f4563d5e56639dcabdcfffcab7f20daf 100644 (file)
@@ -81,11 +81,16 @@ class FilterChain extends BaseFrameworkSystem {
                // Run all filters
                //* DEBUG */ echo "COUNT=".count($this->filters)."<br />\n";
                foreach ($this->filters as $filterInstance) {
-                       // Execute this filter
-                       //* DEBUG */ echo "FILTER: ".$filterInstance->__toString().": Processing started.<br />\n";
+                       // Try to execute this filter
+                       try {
+                               //* DEBUG */ echo "FILTER: ".$filterInstance->__toString().": Processing started.<br />\n";
                                $filterInstance->execute($requestInstance, $responseInstance);
-                       //* DEBUG */ echo "FILTER: ".$filterInstance->__toString().": Processing ended.<br />\n";
-               }
+                               //* DEBUG */ echo "FILTER: ".$filterInstance->__toString().": Processing ended.<br />\n";
+                       } catch (FilterChainException $e) {
+                               // This exception can be thrown to just skip any further processing
+                               break;
+                       }
+               } // END - foreach
        }
 }
 
diff --git a/inc/classes/main/filter/news/.htaccess b/inc/classes/main/filter/news/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/inc/classes/main/filter/news/class_NewsDownloadFilter.php b/inc/classes/main/filter/news/class_NewsDownloadFilter.php
new file mode 100644 (file)
index 0000000..e3a1881
--- /dev/null
@@ -0,0 +1,73 @@
+<?php
+/**
+ * A pre-filter for downloading news from a source. This can be a XML feed or
+ * the local database. You *can* register this filter as post filter but for
+ * output on web pages it makes no sense.
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @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
+ *
+ * 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
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * 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 NewsDownloadFilter extends BaseFilter implements Filterable {
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+
+               // Set part description
+               $this->setObjectDescription("A filter for downloading news");
+
+               // Create unique ID number
+               $this->generateUniqueId();
+       }
+
+       /**
+        * Creates an instance of this filter class
+        *
+        * @return      $filterInstance         An instance of this filter class
+        */
+       public final static function createNewsDownloadFilter () {
+               // Get a new instance
+               $filterInstance = new NewsDownloadFilter();
+
+               // Return the instance
+               return $filterInstance;
+       }
+
+       /**
+        * Executes the filter with given request and response objects
+        *
+        * @param       $requestInstance        An instance of a class with an Requestable interface
+        * @param       $responseInstance       An instance of a class with an Responseable interface
+        * @return      void
+        */
+       public function execute (Requestable $requestInstance, Responseable $responseInstance) {
+               // Get a news instance
+               $newsInstance = WebNewsFactory::createFactoryByRequest($requestInstance);
+
+               // TODO Need to extend/rewrite this
+               $this->partialStub("Unfinished work.");
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/main/filter/news/class_NewsProcessFilter.php b/inc/classes/main/filter/news/class_NewsProcessFilter.php
new file mode 100644 (file)
index 0000000..8df6a0f
--- /dev/null
@@ -0,0 +1,68 @@
+<?php
+/**
+ * A post-filter for processing downloaded news. This will prepare the news fir
+ * output to the template engine.
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @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
+ *
+ * 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
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * 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 NewsProcessFilter extends BaseFilter implements Filterable {
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+
+               // Set part description
+               $this->setObjectDescription("A filter for processing news");
+
+               // Create unique ID number
+               $this->generateUniqueId();
+       }
+
+       /**
+        * Creates an instance of this filter class
+        *
+        * @return      $filterInstance         An instance of this filter class
+        */
+       public final static function createNewsProcessFilter () {
+               // Get a new instance
+               $filterInstance = new NewsProcessFilter();
+
+               // Return the instance
+               return $filterInstance;
+       }
+
+       /**
+        * Executes the filter with given request and response objects
+        *
+        * @param       $requestInstance        An instance of a class with an Requestable interface
+        * @param       $responseInstance       An instance of a class with an Responseable interface
+        * @return      void
+        */
+       public function execute (Requestable $requestInstance, Responseable $responseInstance) {
+               $this->partialStub("Unfinished work.");
+       }
+}
+
+// [EOF]
+?>
index 3ac6d34ac97fd2f8fc2acecb7873d233469b03f5..ef9c70c3fd2ce8d7c527ed8d87e98e51a714091d 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 NullFilter extends BaseFrameworkSystem implements Filterable {
+class NullFilter extends BaseFilter implements Filterable {
        /**
         * Protected constructor
         *
@@ -37,10 +37,6 @@ class NullFilter extends BaseFrameworkSystem implements Filterable {
 
                // Create unique ID number
                $this->generateUniqueId();
-
-               // Clean up a little
-               $this->removeNumberFormaters();
-               $this->removeSystemArray();
        }
 
        /**
index a1276c88a3204b4c10c46f50a3095ad66ff5ef84..4785a9653cbff6eb5df1efa0653894729b01c467 100644 (file)
@@ -24,7 +24,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 EmailValidatorFilter extends BaseFrameworkSystem implements Filterable {
+class EmailValidatorFilter extends BaseFilter implements Filterable {
        /**
         * Protected constructor
         *
@@ -39,10 +39,6 @@ class EmailValidatorFilter extends BaseFrameworkSystem implements Filterable {
 
                // Create unique ID number
                $this->generateUniqueId();
-
-               // Clean up a little
-               $this->removeNumberFormaters();
-               $this->removeSystemArray();
        }
 
        /**
index a8369d819088c995cdd98bd99a60e91da7ec8b70..1d371b1e82d14e7e31485b09d54fa5ce04503f67 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 PasswordValidatorFilter extends BaseFrameworkSystem implements Filterable {
+class PasswordValidatorFilter extends BaseFilter implements Filterable {
        /**
         * Protected constructor
         *
@@ -37,10 +37,6 @@ class PasswordValidatorFilter extends BaseFrameworkSystem implements Filterable
 
                // Create unique ID number
                $this->generateUniqueId();
-
-               // Clean up a little
-               $this->removeNumberFormaters();
-               $this->removeSystemArray();
        }
 
        /**
index 068f807754892d010b16ac14b559d5b47ef792b4..456f16a40c0933e68c3f67b49914e6d5876d59e2 100644 (file)
@@ -24,7 +24,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 UserNameValidatorFilter extends BaseFrameworkSystem implements Filterable {
+class UserNameValidatorFilter extends BaseFilter implements Filterable {
        /**
         * Protected constructor
         *
@@ -39,10 +39,6 @@ class UserNameValidatorFilter extends BaseFrameworkSystem implements Filterable
 
                // Create unique ID number
                $this->generateUniqueId();
-
-               // Clean up a little
-               $this->removeNumberFormaters();
-               $this->removeSystemArray();
        }
 
        /**
diff --git a/inc/classes/main/helper/login/.htaccess b/inc/classes/main/helper/login/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/inc/classes/main/helper/login/class_BaseLoginHelper.php b/inc/classes/main/helper/login/class_BaseLoginHelper.php
new file mode 100644 (file)
index 0000000..25be6a9
--- /dev/null
@@ -0,0 +1,38 @@
+<?php
+/**
+ * A general login helper class
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @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
+ *
+ * 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
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * 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 BaseLoginHelper extends BaseHelper {
+       /**
+        * Protected constructor
+        *
+        * @param       $className      Real name of the class
+        * @return      void
+        */
+       protected function __construct ($className) {
+               // Call parent constructor
+               parent::__construct($className);
+       }
+}
+
+// [EOF]
+?>
index e71f15137d7a414d7a1ac1f28c38262585ca90d2..61a62434792800f2a23b179c96893868feacd3c9 100644 (file)
@@ -49,10 +49,10 @@ class WebFormHelper extends BaseHelper {
        private $subGroupName = "";
 
        // Class Constants
-       const EXCEPTION_FORM_NAME_INVALID       = 0xb00;
-       const EXCEPTION_CLOSED_FORM             = 0xb01;
-       const EXCEPTION_OPENED_FORM             = 0xb02;
-       const EXCEPTION_UNEXPECTED_CLOSED_GROUP = 0xb03;
+       const EXCEPTION_FORM_NAME_INVALID       = 0x030;
+       const EXCEPTION_CLOSED_FORM             = 0x031;
+       const EXCEPTION_OPENED_FORM             = 0x032;
+       const EXCEPTION_UNEXPECTED_CLOSED_GROUP = 0x033;
 
        /**
         * Protected constructor
@@ -119,8 +119,9 @@ class WebFormHelper extends BaseHelper {
                // Check wether we shall open or close the form
                if ($this->formOpened === false) {
                        // Add HTML code
-                       $formContent = sprintf("<form name=\"%s\" class=\"forms\" action=\"%s\" method=\"%s\" target=\"%s\"",
+                       $formContent = sprintf("<form name=\"%s\" class=\"forms\" action=\"%s/%s\" method=\"%s\" target=\"%s\"",
                                $formName,
+                               $this->getConfigInstance()->readConfig('base_url'),
                                $this->getConfigInstance()->readConfig('form_action'),
                                $this->getConfigInstance()->readConfig('form_method'),
                                $this->getConfigInstance()->readConfig('form_target')
index 1b57ee66195376c9a96ced813f5d12003c859fe2..f3cf60ef1ace67f2a87abc96fb1bcccff670ef94 100644 (file)
@@ -6,7 +6,7 @@
  * @version            0.0.0
  * @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
+ * @link               http://www.ship-simu.org
  *
  * 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
index 6206023750941ab67c58c16e633b0add0209ad8f..f9eacc71fbbe5d4d9df3ad44c5cde5b351b22578 100644 (file)
@@ -6,7 +6,7 @@
  * @version            0.0.0
  * @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
+ * @link               http://www.ship-simu.org
  *
  * 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
index c86de9a92793f4b73f0547ccf7241c34854cd51f..25c77cb838aeebef89e9b665c76b1472e62fbeb3 100644 (file)
@@ -6,7 +6,7 @@
  * @version            0.0.0
  * @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
+ * @link               http://www.ship-simu.org
  *
  * 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
index 73cf90804d48f25bc715d079cdce09a9b0e81fc5..5a7acddd62e01ad1f1670461fc8751d050230ac4 100644 (file)
@@ -6,7 +6,7 @@
  * @version            0.0.0
  * @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
+ * @link               http://www.ship-simu.org
  *
  * 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
index 19d05972ca3436b1dd60618450aa9abe7fa6a2ed..eb99cf1e8b1e8acc06332409caf81d0e62d6cacb 100644 (file)
@@ -7,7 +7,7 @@
  * @version            0.0.0
  * @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
+ * @link               http://www.ship-simu.org
  *
  * 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
index e75cf829d43646d23071cc711ea1b53606780040..dfba40dce91e02afa83942143d6426ebce45ea45 100644 (file)
@@ -7,7 +7,7 @@
  * @version            0.0.0
  * @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
+ * @link               http://www.ship-simu.org
  *
  * 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
index 6c86b6266a692ec069c6587eb2cdc8903a71f6d8..5b4f58838d6f9f1b842ee71e00e9fb59c8738341 100644 (file)
@@ -7,7 +7,7 @@
  * @version            0.0.0
  * @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
+ * @link               http://www.ship-simu.org
  *
  * 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
diff --git a/inc/classes/main/reader/.htaccess b/inc/classes/main/reader/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/inc/classes/main/reader/class_DefaultNewsReader.php b/inc/classes/main/reader/class_DefaultNewsReader.php
new file mode 100644 (file)
index 0000000..7fa8ff2
--- /dev/null
@@ -0,0 +1,74 @@
+<?php
+/**
+ * A default news reader class reads news from database layer
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @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
+ *
+ * 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
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * 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 DefaultNewsReader extends BaseFrameworkSystem implements ReadableNews {
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+
+               // Set part description
+               $this->setObjectDescription("Default news reader");
+
+               // Create unique ID number
+               $this->generateUniqueId();
+
+               // Clean up a little
+               $this->removeNumberFormaters();
+               $this->removeSystemArray();
+       }
+
+       /**
+        * Creates an instance of this reader by a provided request instance
+        *
+        * @param       $requestInstance        An instance of a Requestable class
+        * @return      $readerInstance         An instance of this reader class
+        */
+       public final static function createDefaultNewsReader (Requestable $requestInstance) {
+               // Get a new instance
+               $readerInstance = new DefaultNewsReader();
+
+               // Set request instance
+               $readerInstance->setRequestInstance($requestInstance);
+
+               // Return prepared instance
+               return $readerInstance;
+       }
+
+       /**
+        * Initializes this reader class by pre-fetching news depending on "page"
+        * (outside or login area), which amount of news and how much to skip
+        *
+        * @return      void
+        */
+       public function initializeReader () {
+               // TODO Need to implement this method
+       }
+}
+
+// [EOF]
+?>
index 3066d2989d8d369c6cd88fdccd73f54991a18d36..79225300e10d1f8eccfaf9d8b2e9529b0b5686d8 100644 (file)
@@ -3,10 +3,10 @@
  * A general registration class
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
- * @version            0.3.0
+ * @version            0.0.0
  * @copyright  Copyright(c) 2007, 2008 Roland Haeder, this is free software
  * @license            GNU GPL 3.0 or any newer version
- * @link               http://www.mxchange.org
+ * @link               http://www.ship-simu.org
  *
  * 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
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 abstract class BaseRegistration extends BaseFrameworkSystem implements UserRegister {
-       /**
-        * Instance of a request class
-        */
-       private $requestInstance = null;
-
-       /**
-        * Instance of a response class
-        */
-       private $responseInstance = null;
-
        /**
         * Pre-registration filter chain
         */
@@ -64,46 +54,8 @@ abstract class BaseRegistration extends BaseFrameworkSystem implements UserRegis
         */
        protected function initFilterChains () {
                // Pre/post-registration filters
-               $this->preRegistrationFilter = ObjectFactory::createObjectByConfiguredName('filter_chain');
-               $this->postRegistrationFilter = ObjectFactory::createObjectByConfiguredName('filter_chain');
-       }
-
-       /**
-        * Setter for request instance
-        *
-        * @param       $requestInstance        An instance of a Requestable class
-        * @return      void
-        */
-       public final function setRequestInstance (Requestable $requestInstance) {
-               $this->requestInstance = $requestInstance;
-       }
-
-       /**
-        * Getter for request instance
-        *
-        * @return      $requestInstance        An instance of a Requestable class
-        */
-       public final function getRequestInstance () {
-               return $this->requestInstance;
-       }
-
-       /**
-        * Setter for response instance
-        *
-        * @param       $responseInstance       An instance of a Responseable class
-        * @return      void
-        */
-       public final function setResponseInstance (Responseable $responseInstance) {
-               $this->responseInstance = $responseInstance;
-       }
-
-       /**
-        * Getter for response instance
-        *
-        * @return      $responseInstance       An instance of a Responseable class
-        */
-       public final function getResponseInstance () {
-               return $this->responseInstance;
+               $this->preRegistrationFilter = ObjectFactory::createObjectByConfiguredName('filter_chain_class');
+               $this->postRegistrationFilter = ObjectFactory::createObjectByConfiguredName('filter_chain_class');
        }
 
        /**
index a8abb509266f09293349f4562f675c380566f6d5..308e89c72ba8ca44ad33c7a4d4c5a41144eeaef5 100644 (file)
@@ -3,10 +3,10 @@
  * A registry for several data types
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
- * @version            0.3.0
+ * @version            0.0.0
  * @copyright  Copyright(c) 2007, 2008 Roland Haeder, this is free software
  * @license            GNU GPL 3.0 or any newer version
- * @link               http://www.mxchange.org
+ * @link               http://www.ship-simu.org
  *
  * 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
index e3bb312f9ea3757b0cb0d4dbd7b70a187a567c30..b6f9b95f46c6f2cd874228c1b2afde5532df8f1c 100644 (file)
@@ -93,7 +93,7 @@ class HttpRequest extends BaseFrameworkSystem implements Requestable {
                if (!isset($this->requestData[$element])) {
                        // Then throw an exception
                        throw new MissingArrayElementsException(array($this, 'requestData', $element), self::EXCEPTION_MISSING_ELEMENT);
-               }
+               } // END - if
 
                // All clear
                return true;
@@ -113,7 +113,7 @@ class HttpRequest extends BaseFrameworkSystem implements Requestable {
                try {
                        if ($this->isRequestElementSet($element)) {
                                $value = $this->requestData[$element];
-                       }
+                       } // END - if
                } catch (MissingArrayElementsException $e) {
                        // Do nothing here
                }
@@ -158,7 +158,7 @@ class HttpRequest extends BaseFrameworkSystem implements Requestable {
                // Does this header exist?
                if (isset($_SERVER[$name])) {
                        $headerValue = $_SERVER[$name];
-               }
+               } // END - if
 
                // Return the value
                return $headerValue;
@@ -176,7 +176,7 @@ class HttpRequest extends BaseFrameworkSystem implements Requestable {
        /**
         * Sets wether the request was valid (default: true)
         *
-        * @param       $isValid                Wether the request is valid
+        * @param       $isValid        Wether the request is valid
         * @return      void
         */
        public final function requestIsValid ($isValid = true) {
@@ -191,6 +191,26 @@ class HttpRequest extends BaseFrameworkSystem implements Requestable {
        public final function isRequestValid () {
                return $this->requestIsValid;
        }
+
+       /**
+        * Reads a cookie and returns it's value or null if not found
+        *
+        * @param       $cookieName             Name of cookie we shall read
+        * @return      $cookieValue    Value of cookie or null if not found
+        */
+       public final function readCookie ($cookieName) {
+               // Default is no cookie with that name found
+               $cookieValue = null;
+
+               // Is the cookie set?
+               if (isset($_COOKIE[$cookieName])) {
+                       // Then get it
+                       $cookieValue = $_COOKIE[$cookieName];
+               } // END - if
+
+               // Return the value
+               return $cookieValue;
+       }
 }
 
 // [EOF]
index fa52125d68a944b13b6a37e3fac32c6b9fabea51..f4b87a2b30c7967e36bc25d5fc7e15877e6834f9 100644 (file)
@@ -94,7 +94,7 @@ class WebCommandResolver extends BaseResolver implements CommandResolver {
                // Test if the required parameter is set
                try {
                        // This goes fine so let's resolv the command
-                       $commandName = $requestInstance->getRequestElement($this->getConfigInstance()->readConfig('command_parameter'));
+                       $commandName = $requestInstance->getRequestElement("page");
 
                        // Is the command empty? Then fall back to default command
                        if (empty($commandName)) $commandName = $this->getConfigInstance()->readConfig('default_command');
@@ -181,7 +181,7 @@ class WebCommandResolver extends BaseResolver implements CommandResolver {
                                // Still not found?
                                throw new InvalidCommandException(array($this, $defaultCommand), self::EXCEPTION_INVALID_COMMAND);
                        }
-               }
+               } // END - if
 
                // Initiate the command
                $commandInstance = ObjectFactory::createObjectByName($className, array($this));
index b5f66e85314c923e1e952b8b0bb76ea75b4f52b7..0585196bc06c999fcaa3fe3adb7afd2a2424763a 100644 (file)
@@ -126,7 +126,9 @@ class WebControllerResolver extends BaseResolver implements ControllerResolver {
        }
 
        /**
-        * "Loads" a given controller and instances it if not yet cached
+        * "Loads" a given controller and instances it if not yet cached. If the
+        * controller was not found one of the default controllers will be used
+        * depending on wether news shall be displayed.
         *
         * @param       $commandName                    A controller name we shall look for
         * @return      $controllerInstance             A loaded controller instance
@@ -150,6 +152,7 @@ class WebControllerResolver extends BaseResolver implements ControllerResolver {
                $class = "WebDefaultController";
 
                // Generate the class name
+               //* DEBUG: */ echo __METHOD__.": Command=".$commandName;
                if ($commandName != $defaultCommand) {
                        // Create controller class name
                        $class = sprintf("Web%sController",
@@ -162,6 +165,7 @@ class WebControllerResolver extends BaseResolver implements ControllerResolver {
                        // No nes at "home" page
                        $class = "WebDefaultController";
                }
+               //* DEBUG: */ echo ", controller=".$class."<br />\n";
 
                // Is this class loaded?
                if (!class_exists($class)) {
@@ -176,7 +180,7 @@ class WebControllerResolver extends BaseResolver implements ControllerResolver {
                } // END - if
 
                // Initiate the resolver and controller
-               $resolverInstance = ObjectFactory::createObjectByConfiguredName('web_cmd_resolver', array($commandName, $this->getApplicationInstance()));
+               $resolverInstance = ObjectFactory::createObjectByConfiguredName('web_cmd_resolver_class', array($commandName, $this->getApplicationInstance()));
                $controllerInstance = ObjectFactory::createObjectByName($class, array($resolverInstance));
 
                // Remove resolver
index 074373d1ea00655dec310069f75ebe6e9ef26463..3fc5d2db1943c62b56ad4a209604804ab03cefd5 100644 (file)
@@ -35,6 +35,11 @@ class HttpResponse extends BaseFrameworkSystem implements Responseable {
         */
        private $responseHeaders = array();
 
+       /**
+        * Cookies we shall sent out
+        */
+       private $cookies = array();
+
        /**
         * Body of the response
         */
@@ -136,7 +141,7 @@ class HttpResponse extends BaseFrameworkSystem implements Responseable {
         * @param       $output         Output we shall sent in the HTTP response
         * @return      void
         */
-       public function setReponseBody ($output) {
+       public function setResponseBody ($output) {
                $this->responseBody = $output;
        }
 
@@ -163,15 +168,25 @@ class HttpResponse extends BaseFrameworkSystem implements Responseable {
                        // General header for no caching
                        $this->addHeader('Expired', $now); // rfc2616 - Section 14.21
                        $this->addHeader('Last-Modified', $now);
-                       $this->addHeader('Cache-Control:', 'no-store, no-cache, must-revalidate, pre-check=0, post-check=0, max-age=0'); // HTTP/1.1
-                       $this->addHeader('Pragma:', 'no-cache'); // HTTP/1.0
+                       $this->addHeader('Cache-Control', 'no-store, no-cache, must-revalidate, pre-check=0, post-check=0, max-age=0'); // HTTP/1.1
+                       $this->addHeader('Pragma', 'no-cache'); // HTTP/1.0
 
                        // Define the charset to be used
                        //$this->addHeader('Content-Type:', sprintf("text/html; charset=%s", $this->getConfigInstance()->readConfig('header_charset')));
 
                        foreach ($this->responseHeaders as $name=>$value) {
                                header("{$name}: {$value}");
-                       }
+                       } // END - foreach
+
+                       // Send cookies out?
+                       if (count($this->cookies) > 0) {
+                               // Send all cookies
+                               $cookieString = implode(" ", $this->cookies);
+                               header("Set-Cookie: {$cookieString}");
+
+                               // Remove them all
+                               $this->cookies = array();
+                       } // END - if
                }
 
                // Are there some error messages?
@@ -187,7 +202,7 @@ class HttpResponse extends BaseFrameworkSystem implements Responseable {
                }
 
                // Clear response header and body
-               $this->setReponseBody("");
+               $this->setResponseBody("");
                $this->resetResponseHeaders();
        }
 
@@ -221,6 +236,115 @@ class HttpResponse extends BaseFrameworkSystem implements Responseable {
                // Adds the resolved message id to the fatal message list
                $this->fatalMessages[] = $this->getApplicationInstance()->getLanguageInstance()->getMessage($messageId);
        }
+
+       /**
+        * Adds a cookie to the response
+        *
+        * @param       $cookieName             Cookie's name
+        * @param       $cookieValue    Value to store in the cookie
+        * @param       $encrypted              Do some extra encryption on the value
+        * @param       $expires                Timestamp of expiration (default: configured)
+        * @return      void
+        * @throws      ResponseHeadersAlreadySentException             If headers are already sent
+        */
+       public function addCookie ($cookieName, $cookieValue, $encrypted = false, $expires = null) {
+               // Are headers already sent?
+               if (headers_sent()) {
+                       // Throw an exception here
+                       throw new ResponseHeadersAlreadySentException($this, self::EXCEPTION_HEADERS_ALREADY_SENT);
+               } // END - if
+
+               // Shall we encrypt the cookie?
+               if ($encrypted === true) {
+                       // @TODO Encryption of cookie data not yet supported
+               } // END - if
+
+               // For slow browsers set the cookie array element first
+               $_COOKIE[$cookieName] = $cookieValue;
+
+               // Get all config entries
+               if (is_null($expires)) {
+                       $expires = (time() + $this->getConfigInstance()->readConfig('cookie_expire'));
+               } // END - if
+
+               $path = $this->getConfigInstance()->readConfig('cookie_path');
+               $domain = $this->getConfigInstance()->readConfig('cookie_domain');
+
+               setcookie($cookieName, $cookieValue, $expires);
+               // TODO Why are these parameters conflicting?
+               //, $path, $domain, (isset($_SERVER['HTTPS']))
+               return;
+               // TODO This will send only one cookie out, the first one.
+
+               // Now construct the full header
+               $cookieString = $cookieName . "=" . $cookieValue . "; ";
+               $cookieString .= "expires=" . date("D, d-F-Y H:i:s", $expires) . " GMT";
+               // TODO Why are these parameters conflicting?
+               // $cookieString .= "; path=".$path."; domain=".$domain;
+
+               // Set the cookie as a header
+               $this->cookies[$cookieName] = $cookieString;
+       }
+
+       /**
+        * Redirect to a configured URL. The URL can be absolute or relative. In
+        * case of relative URL it will be extended automatically.
+        *
+        * @param       $configEntry    The configuration entry which holds our URL
+        * @return      void
+        * @throws      ResponseHeadersAlreadySentException             If headers are already sent
+        */
+       public function redirectToConfiguredUrl ($configEntry) {
+               // Is the header not yet sent?
+               if (headers_sent()) {
+                       // Throw an exception here
+                       throw new ResponseHeadersAlreadySentException($this, self::EXCEPTION_HEADERS_ALREADY_SENT);
+               } // END - if
+
+               // Get the url from config
+               $url = $this->getConfigInstance()->readConfig($configEntry);
+
+               // Do we have a "http" in front of the URL?
+               if (substr(strtolower($url), 0, 4) != "http") {
+                       // Is there a / in front of the relative URL?
+                       if (substr($url, 0, 1) == "/") $url = substr($url, 1);
+
+                       // No, then extend it with our base URL
+                       $url = $this->getConfigInstance()->readConfig('base_url') . "/" . $url;
+               } // END - if
+
+               // Add redirect header
+               $this->addHeader("Location", $url);
+
+               // Set correct response status
+               $this->setResponseStatus("301 Moved Permanently");
+
+               // Clear the body
+               $this->setResponseBody("");
+
+               // Flush the result
+               $this->flushBuffer();
+
+               // All done here...
+               exit();
+       }
+
+       /**
+        * Expires the given cookie if it is set
+        *
+        * @param       $cookieName             Cookie to expire
+        * @return      void
+        */
+       public function expireCookie ($cookieName) {
+               // Is the cookie there?
+               if (isset($_COOKIE[$cookieName])) {
+                       // Then expire it with 20 minutes past
+                       $this->addCookie($cookieName, "", false, (time() - 1200));
+
+                       // Remove it from array
+                       unset($_COOKIE[$cookieName]);
+               } // END - if
+       }
 }
 
 // [EOF]
index 3d48861ba6fd259debbccf177bef32f3a4441e03..c6a0b1149a9d3e1907e019f51711ab0c68e5c74e 100644 (file)
@@ -3,10 +3,10 @@
  * A database result class
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
- * @version            0.3.0
+ * @version            0.0.0
  * @copyright  Copyright(c) 2007, 2008 Roland Haeder, this is free software
  * @license            GNU GPL 3.0 or any newer version
- * @link               http://www.mxchange.org
+ * @link               http://www.ship-simu.org
  *
  * 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
@@ -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 DatabaseResult extends BaseFrameworkSystem {
+class DatabaseResult extends BaseFrameworkSystem implements SearchableResult, SeekableIterator {
        /**
         * Current position in array
         */
@@ -97,7 +97,7 @@ class DatabaseResult extends BaseFrameworkSystem {
                // Is the result valid?
                if ($this->resultArray['status'] === "ok") {
                        // The status is fine so let's have a look for the next entry
-                       if (isset($this->resultArray['rows'][($this->currentPos + 1)])) {
+                       if ($this->valid()) {
                                // Next entry found, so count one up and cache it
                                $this->currentPos++;
                                $this->currentRow = $this->resultArray['rows'][$this->currentPos];
@@ -108,6 +108,89 @@ class DatabaseResult extends BaseFrameworkSystem {
                // Return the result
                return $nextValid;
        }
+
+       /**
+        * Seeks for to a specified position
+        *
+        * @param       $index  Index to seek for
+        * @return      void
+        */
+       public function seek ($index) {
+               // Rewind to beginning
+               $this->rewind();
+
+               // Search for the entry
+               while ($this->currentPos < $index && ($this->valid())) {
+                       // Continue on
+                       $this->next();
+               } // END - while
+       }
+
+       /**
+        * Gives back the current position or null if not found
+        *
+        * @return      $current        Current element to give back
+        */
+       public function current () {
+               // Default is not found
+               $current = null;
+
+               // Does the current enty exist?
+               if (isset($this->resultArray['rows'][$this->currentPos])) {
+                       // Then get it
+                       $current = $this->resultArray['rows'][$this->currentPos];
+               } // END - if
+
+               // Return the result
+               return $current;
+       }
+
+       /**
+        * Checks if next() and rewind will give a valid result
+        *
+        * @return      $isValid Wether the next/rewind entry is valid
+        */
+       public function valid () {
+               // By default nothing is valid
+               $isValid = false;
+
+               // Check if 
+               if ((isset($this->resultArray['rows'][($this->currentPos + 1)])) && (isset($this->resultArray['rows'][0]))) {
+                       // All fine!
+                       $isValid = true;
+               } // END - if
+
+               // Return the result
+               return $isValid;
+       }
+
+       /**
+        * Gets the current key of iteration
+        *
+        * @return      $currentPos     Key from iterator
+        */
+       public function key () {
+               return $this->currentPos;
+       }
+
+       /**
+        * Rewind to the beginning
+        *
+        * @return      void
+        */
+       public function rewind () {
+               $this->currentPos = 0;
+       }
+
+       /**
+        * Searches for an entry in the data result and returns it
+        *
+        * @param       $criteriaInstance       The criteria to look inside the data set
+        * @return      $result                         Found result entry
+        */
+       public function searchEntry (LocalSearchCriteria $criteriaInstance) {
+               die("OK");
+       }
 }
 
 // [EOF]
index b50af11d865a3f3b051be397b5ff13b96d441ecd..8875a4ca06ba2b8d4076973cf39558c8351ff9ed 100644 (file)
@@ -3,10 +3,10 @@
  * A standard random number generator
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
- * @version            0.3.0
+ * @version            0.0.0
  * @copyright  Copyright(c) 2007, 2008 Roland Haeder, this is free software
  * @license            GNU GPL 3.0 or any newer version
- * @link               http://www.mxchange.org
+ * @link               http://www.ship-simu.org
  *
  * 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
index e1c3bcee1e5fdeb743f6738e685ca67fa246cd1d..fad4cf4a3f5a956a63092319b477076d58f0586b 100644 (file)
@@ -7,7 +7,7 @@
  * @version            0.0.0
  * @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
+ * @link               http://www.ship-simu.org
  *
  * 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
@@ -109,9 +109,9 @@ class TemplateEngine extends BaseFrameworkSystem implements CompileableTemplate
        private $helpers = array();
 
        // Exception codes for the template engine
-       const EXCEPTION_TEMPLATE_TYPE_IS_UNEXPECTED   = 0xa00;
-       const EXCEPTION_TEMPLATE_CONTAINS_INVALID_VAR = 0xa01;
-       const EXCEPTION_INVALID_VIEW_HELPER           = 0xa02;
+       const EXCEPTION_TEMPLATE_TYPE_IS_UNEXPECTED   = 0x020;
+       const EXCEPTION_TEMPLATE_CONTAINS_INVALID_VAR = 0x021;
+       const EXCEPTION_INVALID_VIEW_HELPER           = 0x022;
 
        /**
         * Protected constructor
index 25e2cc3ffd1e5cdd2745da5d444425878062355e..cc9c44348058bd2e9645030a5d2950a22554955e 100644 (file)
@@ -33,8 +33,9 @@ class User extends BaseFrameworkSystem implements ManageableUser, Registerable {
        private $email = "";
 
        // Exceptions
-       const EXCEPTION_USERNAME_NOT_FOUND   = 0xd00;
-       const EXCEPTION_USER_EMAIL_NOT_FOUND = 0xd01;
+       const EXCEPTION_USERNAME_NOT_FOUND   = 0x060;
+       const EXCEPTION_USER_EMAIL_NOT_FOUND = 0x061;
+       const EXCEPTION_USER_PASS_MISMATCH   = 0x062;
 
        /**
         * Protected constructor
@@ -147,14 +148,14 @@ class User extends BaseFrameworkSystem implements ManageableUser, Registerable {
         * @return      $exists         Wether the username exists
         */
        public function ifUsernameExists () {
-               // By default the username does exist
-               $exists = true;
+               // By default the username does not exist
+               $exists = false;
 
                // Get a UserDatabaseWrapper instance
-               $wrapperInstance = ObjectFactory::createObjectByConfiguredName('user_db_wrapper');
+               $wrapperInstance = ObjectFactory::createObjectByConfiguredName('user_db_wrapper_class');
 
                // Create a search criteria
-               $criteriaInstance = ObjectFactory::createObjectByConfiguredName('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());
@@ -164,9 +165,9 @@ class User extends BaseFrameworkSystem implements ManageableUser, Registerable {
                $result = $wrapperInstance->doSelectByCriteria($criteriaInstance);
 
                // Search for it
-               if (!$result->next()) {
-                       // Entry not found
-                       $exists = false;
+               if ($result->next()) {
+                       // Entry found
+                       $exists = true;
                } // END - if
 
                // Return the status
@@ -179,14 +180,14 @@ class User extends BaseFrameworkSystem implements ManageableUser, Registerable {
         * @return      $exists         Wether the email exists
         */
        public function ifEmailAddressExists () {
-               // By default the username does exist
-               $exists = true;
+               // By default the email does not exist
+               $exists = false;
 
                // Get a UserDatabaseWrapper instance
-               $wrapperInstance = ObjectFactory::createObjectByConfiguredName('user_db_wrapper');
+               $wrapperInstance = ObjectFactory::createObjectByConfiguredName('user_db_wrapper_class');
 
                // Create a search criteria
-               $criteriaInstance = ObjectFactory::createObjectByConfiguredName('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_EMAIL, $this->getEmail());
@@ -196,14 +197,62 @@ class User extends BaseFrameworkSystem implements ManageableUser, Registerable {
                $result = $wrapperInstance->doSelectByCriteria($criteriaInstance);
 
                // Search for it
-               if (!$result->next()) {
-                       // Entry not found
-                       $exists = false;
+               if ($result->next()) {
+                       // Entry found
+                       $exists = true;
                } // END - if
 
                // Return the status
                return $exists;
        }
+
+       /**
+        * Checks if the 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
+        */
+       public function ifPasswordHashMatches (Requestable $requestInstance) {
+               // By default nothing matches... ;)
+               $matches = false;
+
+               // 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
+               $result = $wrapperInstance->doSelectByCriteria($criteriaInstance);
+
+               // Search for it
+               if ($result->next()) {
+                       // Get the current entry (can only be one!)
+                       $entry = $result->current();
+
+                       // So does the hashes match?
+                       $matches = ($requestInstance->getRequestElement('pass_hash') === $entry['pass_hash']);
+               } // END - if
+
+               // Return the status
+               return $matches;
+       }
+
+       /**
+        * Adds data for later complete update
+        *
+        * @param       $column         Column we want to update
+        * @param       $value          New value to store in database
+        * @return      void
+        */
+       public function addUpdateData ($column, $value) {
+               $this->partialStub("Column={$column}, value={$value}");
+       }
 }
 
 // [EOF]
index 3b643540b54793c47c1d85ce4e86db91e7f43fe5..472aa8ba717bb14d1feeed04d43a9fee9ad483df 100644 (file)
@@ -6,7 +6,7 @@
  * @version            0.0.0
  * @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
+ * @link               http://www.ship-simu.org
  * 
  * 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
index b88142642733cebf86c392a538fdf3b1fe669b4c..346538024f1b8d6ac3f8ff8e6f615bba785bfe9a 100644 (file)
@@ -6,7 +6,7 @@
  * @version            0.0.0
  * @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
+ * @link               http://www.ship-simu.org
  *
  * 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
index 0c428075180f97e19c36f1dfa42e1cb5718ddac9..fc8ea9135f5db01086c03492435d0dba57f91574 100644 (file)
@@ -6,7 +6,7 @@
  * @version            0.0.0
  * @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
+ * @link               http://www.ship-simu.org
  *
  * 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
@@ -158,12 +158,12 @@ class DatabaseConnection extends BaseMiddleware implements DatabaseConnector, Re
         * @param       $dataSetInstance        A storeable data set
         * @return      void
         */
-       public function insertDataSet (StoreableCriteria $dataSetInstance) {
+       public function queryInsertDataSet (StoreableCriteria $dataSetInstance) {
                // Connect to the database
                $this->dbLayer->connectToDatabase();
 
                // Ask the database layer
-               $this->dbLayer->insertDataSet($dataSetInstance);
+               $this->dbLayer->queryInsertDataSet($dataSetInstance);
        }
 }
 
index 6a6bacff9cc24f0fa18f62ccc44c1a931bd92a4a..1f5e6e0e64ca44ab7e00a486b7820f136f88320e 100644 (file)
@@ -8,7 +8,7 @@
  * @version            0.0.0
  * @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
+ * @link               http://www.ship-simu.org
  *
  * 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
index 071e1d6ecbef9d823ce2fff46c9f71d660450428..99cb434e16a1379a2a2220834fbcf062f7bb8b56 100644 (file)
@@ -7,7 +7,7 @@
  * @version            0.0.0
  * @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
+ * @link               http://www.ship-simu.org
  *
  * 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
@@ -68,8 +68,8 @@ class FileIoHandler extends BaseMiddleware {
                $ioHandler = new FileIoHandler();
 
                // Set the *real* file IO instances (both the same)
-               $ioHandler->setInputStream(ObjectFactory::createObjectByConfiguredName('file_input_stream'));
-               $ioHandler->setOutputStream(ObjectFactory::createObjectByConfiguredName('file_output_stream'));
+               $ioHandler->setInputStream(ObjectFactory::createObjectByConfiguredName('file_input_class'));
+               $ioHandler->setOutputStream(ObjectFactory::createObjectByConfiguredName('file_output_class'));
 
                // Return instance
                return $ioHandler;
index ccc1a64e3dbc2f08dc55460d8602f332a637d600..50571624abfeeac3611f4ad9f0c39c3eaf7ae363 100644 (file)
@@ -8,7 +8,7 @@
  * @version            0.0.0
  * @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
+ * @link               http://www.ship-simu.org
  *
  * 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
@@ -25,9 +25,9 @@
  */
 
 // Load the class from inc/config direktory
-require_once(dirname(__FILE__) . '/classes/interfaces/class_FrameworkInterface.php');
-require_once(dirname(__FILE__) . '/classes/interfaces/registry/class_Registerable.php');
-require_once(dirname(__FILE__) . '/config/class_FrameworkConfiguration.php');
+@require_once(dirname(__FILE__) . '/classes/interfaces/class_FrameworkInterface.php');
+@require_once(dirname(__FILE__) . '/classes/interfaces/registry/class_Registerable.php');
+@require_once(dirname(__FILE__) . '/config/class_FrameworkConfiguration.php');
 
 // Get a new configuration instance
 $cfg = FrameworkConfiguration::createFrameworkConfiguration();
@@ -35,6 +35,9 @@ $cfg = FrameworkConfiguration::createFrameworkConfiguration();
 // CFG: SERVER-PATH
 $cfg->definePath(dirname(dirname(__FILE__)) . '/'); // DON'T MISS THE TRAILING SLASH!!!
 
+// CFG: BASE-URL
+$cfg->setConfigEntry('base_url', $cfg->detectBaseUrl());
+
 // CFG: DATABASE-TYPE
 $cfg->defineDatabaseType('local');
 
@@ -62,9 +65,6 @@ $cfg->setConfigEntry('raw_template_extension', ".tpl");
 // CFG: CODE-TEMPLATE-EXTENSION
 $cfg->setConfigEntry('code_template_extension', ".ctp");
 
-// CFG: SELECTOR-GET
-$cfg->setConfigEntry('app_selector_get', "app");
-
 // CFG: SELECTOR-PATH
 $cfg->setConfigEntry('selector_path', "selector");
 
@@ -90,10 +90,10 @@ $cfg->setConfigEntry('application_path', "application");
 $cfg->setConfigEntry('compile_output_path', "templates/_compiled/"); // DON'T MISS THE TRAILING SLASH!
 
 // CFG: TEMPLATE-ENGINE
-$cfg->setConfigEntry('tpl_engine', "TemplateEngine");
+$cfg->setConfigEntry('template_class', "TemplateEngine");
 
 // CFG: DEBUG-ENGINE
-$cfg->setConfigEntry('debug_engine', "DebugWebOutput");
+$cfg->setConfigEntry('debug_class', "DebugWebOutput");
 
 // CFG: DEFAULT-LANGUAGE
 $cfg->setConfigEntry('default_lang', "de"); // A two-char language string: de for german, en for english and so on
@@ -150,49 +150,49 @@ $cfg->setConfigEntry('default_application', "selector");
 $cfg->setConfigEntry('verbose_level', 0);
 
 // CFG: CACHE-TYPE
-$cfg->setConfigEntry('cache_type', "MemoryCache");
+$cfg->setConfigEntry('cache_class', "MemoryCache");
 
 // CFG: SEARCH-CRITERIA
-$cfg->setConfigEntry('search_criteria', "SearchCriteria");
+$cfg->setConfigEntry('search_criteria_class', "SearchCriteria");
 
 // CFG: DATASET-CRITERIA
-$cfg->setConfigEntry('dataset_criteria', "DataSetCriteria");
+$cfg->setConfigEntry('dataset_criteria_class', "DataSetCriteria");
 
 // CFG: FILE-IO-HANDLER
-$cfg->setConfigEntry('file_io_handler', "FileIoHandler");
+$cfg->setConfigEntry('file_io_class', "FileIoHandler");
 
 // CFG: FILTER-CHAIN
-$cfg->setConfigEntry('filter_chain', "FilterChain");
+$cfg->setConfigEntry('filter_chain_class', "FilterChain");
 
 // CFG: FILE-INPUT-STREAM
-$cfg->setConfigEntry('file_input_stream', "FileIoStream");
+$cfg->setConfigEntry('file_input_class', "FileIoStream");
 
 // CFG: FILE-OUTPUT-STREAM
-$cfg->setConfigEntry('file_output_stream', "FileIoStream");
+$cfg->setConfigEntry('file_output_class', "FileIoStream");
 
 // CFG: EMAIL-VALIDATOR
-$cfg->setConfigEntry('email_validator', "EmailValidatorFilter");
+$cfg->setConfigEntry('email_validator_class', "EmailValidatorFilter");
 
 // CFG: USERNAME-VALIDATOR
-$cfg->setConfigEntry('username_validator', "UserNameValidatorFilter");
+$cfg->setConfigEntry('username_validator_class', "UserNameValidatorFilter");
 
 // CFG: PASSWORD-VALIDATOR
-$cfg->setConfigEntry('password_validator', "PasswordValidatorFilter");
+$cfg->setConfigEntry('password_validator_class', "PasswordValidatorFilter");
 
 // CFG: RULES-ACCEPTED-FILTER
-$cfg->setConfigEntry('rules_accepted_filter', "RulesAcceptedFilter");
+$cfg->setConfigEntry('rules_accepted_class', "RulesAcceptedFilter");
 
 // CFG: CRYPTO-HELPER
-$cfg->setConfigEntry('crypto_heler', "CryptoHelper");
+$cfg->setConfigEntry('crypto_class', "CryptoHelper");
 
 // CFG: RNG-CLASS
 $cfg->setConfigEntry('rng_class', "RandomNumberGenerator");
 
 // CFG: USER-DB-WRAPPER
-$cfg->setConfigEntry('user_db_wrapper', "UserDatabaseWrapper");
+$cfg->setConfigEntry('user_db_wrapper_class', "UserDatabaseWrapper");
 
 // CFG: WEB-CMD-RESOLVER
-$cfg->setConfigEntry('web_cmd_resolver', "WebCommandResolver");
+$cfg->setConfigEntry('web_cmd_resolver_class', "WebCommandResolver");
 
 // CFG: MATH-PRIME
 $cfg->setConfigEntry('math_prime', 591623);
@@ -213,10 +213,22 @@ $cfg->setConfigEntry('hash_mask', "%1s:%2s:%3s"); // 1=salt, 2=extra salt, 3=pla
 $cfg->setConfigEntry('is_single_server', "Y");
 
 // CFG: POST-REGISTRATION-ACTION
-$cfg->setConfigEntry('post_registration_action', "LoginAfterRegistrationAction");
+$cfg->setConfigEntry('post_registration_class', "LoginAfterRegistrationAction");
 
 // CFG: USER-CLASS
 $cfg->setConfigEntry('user_class', "User");
 
+// CFG: COOKIE-EXPIRE
+$cfg->setConfigEntry('cookie_expire', (60*60*2)); // Two hours!
+
+// CFG: COOKIE-PATH
+$cfg->setConfigEntry('cookie_path', dirname($_SERVER['SCRIPT_NAME']) . "/");
+
+// CFG: COOKIE-DOMAIN
+$cfg->setConfigEntry('cookie_domain', $cfg->detectDomain()); // Is mostly the same...
+
+// CFG: COOKIE-SSL
+$cfg->setConfigEntry('cookie_ssl', (isset($_SERVER['HTTPS'])));
+
 // [EOF]
 ?>
index 6bfc3a26ce0fbfd1fbec6d0396a529c5b3da6bf2..50a4ac18a35d588fe162e4b75c0f17f140c1019e 100644 (file)
@@ -39,8 +39,8 @@ class FrameworkConfiguration implements Registerable {
        private static $cfgInstance = null;
 
        // Some constants for the configuration system
-       const EXCEPTION_CONFIG_ENTRY_IS_EMPTY      = 0xc00;
-       const EXCEPTION_CONFIG_ENTRY_WAS_NOT_FOUND = 0xc01;
+       const EXCEPTION_CONFIG_ENTRY_IS_EMPTY      = 0x040;
+       const EXCEPTION_CONFIG_ENTRY_WAS_NOT_FOUND = 0x041;
 
        /**
         * Protected constructor
@@ -169,7 +169,7 @@ class FrameworkConfiguration implements Registerable {
        /**
         * Define the local file path
         *
-        * @param               $path   The database type. See path inc/database/.
+        * @param               $path   Local file path for include files.
         * @return      void
         */
        public function definePath ($path) {
@@ -261,6 +261,41 @@ class FrameworkConfiguration implements Registerable {
        public function __toString () {
                return get_class($this);
        }
+
+       /**
+        * Dectect and return the base URL for all URLs and forms
+        *
+        * @return      $baseUrl        Detected base URL
+        */
+       public function detectBaseUrl() {
+               // Initialize the URL
+               $baseUrl = "http";
+
+               // Do we have HTTPS?
+               if (isset($_SERVER['HTTPS'])) {
+                       // Add the >s< for HTTPS
+                       $baseUrl .= "s";
+               } // END - if
+
+               // Construct the full URL now and secure it against CSRF attacks
+               $baseUrl = $baseUrl . "://" . $this->detectDomain() . dirname($_SERVER['SCRIPT_NAME']);
+
+               // Return the URL
+               return $baseUrl;
+       }
+
+       /**
+        * Detect safely and return the full domain where this script is installed
+        *
+        * @return      $fullDomain             The detected full domain
+        */
+       public function detectDomain () {
+               // Detect the full domain
+               $fullDomain = htmlentities(strip_tags($_SERVER['SERVER_NAME']), ENT_QUOTES);
+
+               // Return it
+               return $fullDomain;
+       }
 } // END - class
 
 // [EOF]
index 4947dd1f48e9b4a4b982aed68137e8b7010a2d7c..8dd90e46da5f2d9169f3d3280612742550664ff9 100644 (file)
@@ -6,7 +6,7 @@
  * @version            0.0.0
  * @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
+ * @link               http://www.ship-simu.org
  *
  * 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
index e4e36fbeeece4bbd196f5f56b52a4bb546cb9a92..613d6d2df80d560a4f18a4a11497ddadd74f4372 100644 (file)
@@ -6,7 +6,7 @@
  * @version            0.0.0
  * @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
+ * @link               http://www.ship-simu.org
  *
  * 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
index e9472bbb4573367e8f9bdaed7f3609df762e3ba9..afb41612bd913bc05e750be7d25a86d00becaebe 100644 (file)
@@ -8,7 +8,7 @@
  * @version            0.0.0
  * @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
+ * @link               http://www.ship-simu.org
  *
  * 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
@@ -25,7 +25,7 @@
  */
 
 // Get the instance
-$io = ObjectFactory::createObjectByConfiguredName('file_io_handler');
+$io = ObjectFactory::createObjectByConfiguredName('file_io_class');
 
 // [EOF]
 ?>
index dc603cad1b060c5f73cddbbb1e193e78edc407b5..a9af02b50245144ec9ed515900e5e26c51395b59 100644 (file)
@@ -6,7 +6,7 @@
  * @version            0.0.0
  * @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
+ * @link               http://www.ship-simu.org
  *
  * 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
@@ -29,14 +29,14 @@ $cfg = FrameworkConfiguration::getInstance();
 require(sprintf("%sinc/loader/class_ClassLoader%s", PATH, $cfg->readConfig('php_extension')));
 
 // Does the user has an application specified?
-if (!empty($_GET[$cfg->readConfig('app_selector_get')])) {
+if (!empty($_GET['app'])) {
        // Set the application from string
-       $application = (string) $_GET[$cfg->readConfig('app_selector_get')];
+       $application = (string) $_GET['app'];
 } elseif (!empty($_SERVER['argv'][1])) {
        // Set the application from string
        $application = (string) $_SERVER['argv'][1];
        $app = explode('=', trim($application));
-       if ($app[0] == $cfg->readConfig('app_selector_get')) {
+       if ($app[0] == 'app') {
                // Application is valid!
                $application = trim($app[1]);
        } else {
index 869f4c2b24944c1a9fb27da2ef718fb3a94f2f69..fa9c771d9f23912c58b003725cf68f51d0917c5a 100644 (file)
@@ -6,7 +6,7 @@
  * @version            0.0.0
  * @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
+ * @link               http://www.ship-simu.org
  *
  * 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
@@ -102,6 +102,11 @@ class ClassLoader {
         */
        private $classCacheFQFN = "";
 
+       /**
+        * Counter for loaded include files
+        */
+       private $total = 0;
+
        /**
         * The *public* constructor
         *
@@ -236,7 +241,6 @@ class ClassLoader {
                // If the basePath is false it is invalid
                if ($basePath2 === false) {
                        // TODO: Do not die here.
-                       debug_print_backtrace();
                        die("Cannot read {$basePath} !");
                } else {
                        // Set base path
@@ -307,6 +311,9 @@ class ClassLoader {
                        // File is found so load it only once
                        require($this->classes[$fileName]);
 
+                       // Count this include
+                       $this->total++;
+
                        // Developer mode excludes caching (better debugging)
                        if (!defined('DEVELOPER')) {
                                // Mark this class as loaded
@@ -336,6 +343,15 @@ class ClassLoader {
                        } // END - if
                } // END - foreach
        }
+
+       /**
+        * Getter for total include counter
+        *
+        * @return      $total  Total loaded include files
+        */
+       public final function getTotal () {
+               return $this->total;
+       }
 }
 
 // [EOF]
index 4f07c30c79062b5ab545924dcc11363bcb31b84e..35b9359f7dec4f39c3ab0cb25d4e14faaa400716 100644 (file)
@@ -6,7 +6,7 @@
  * @version            0.0.0
  * @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
+ * @link               http://www.ship-simu.org
  *
  * 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
@@ -23,7 +23,7 @@
  */
 
 // Get a debugger instance
-$debug = DebugMiddleware::createDebugMiddleware(FrameworkConfiguration::getInstance()->readConfig('debug_engine'));
+$debug = DebugMiddleware::createDebugMiddleware(FrameworkConfiguration::getInstance()->readConfig('debug_class'));
 
 // Empty string should be ignored and used for testing the middleware
 DebugMiddleware::getInstance()->output("");