From 660ab9f970714bd7c6aa5acd567f989e5ec616c6 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Sun, 15 Jun 2008 19:24:15 +0000 Subject: [PATCH] Code sync from ship-simu code (all class config entries must end with _class!) --- .gitattributes | 30 ++++ inc/classes/exceptions/auth/.htaccess | 1 + .../auth/class_UserAuthorizationException.php | 46 ++++++ inc/classes/exceptions/class_ | 39 +++++ .../exceptions/class_FrameworkException.php | 9 +- .../class_MismatchingCompressorsException.php | 2 +- .../class_ContainerItemIsNoArrayException.php | 2 +- .../class_ContainerItemIsNullException.php | 2 +- .../class_ContainerMaybeDamagedException.php | 2 +- .../class_DefaultControllerException.php | 2 +- .../database/class_DatabaseException.php | 2 +- .../database/general/class_SqlException.php | 2 +- .../class_SavePathIsEmptyException.php | 2 +- .../class_SavePathIsNoDirectoryException.php | 2 +- .../class_SavePathReadProtectedException.php | 2 +- .../class_SavePathWriteProtectedException.php | 2 +- ...class_WrapperUserNameNotFoundException.php | 2 +- inc/classes/exceptions/filter/.htaccess | 1 + .../filter/class_FilterChainException.php | 45 ++++++ .../helper/class_FormClosedException.php | 2 +- .../helper/class_FormGroupClosedException.php | 2 +- .../helper/class_FormOpenedException.php | 2 +- .../helper/class_InvalidFormNameException.php | 2 +- .../class_UserInstanceMissingException.php | 46 ++++++ .../io/class_DirPointerNotOpenedException.php | 2 +- .../class_FilePointerNotOpenedException.php | 2 +- .../io/class_InvalidDataLengthException.php | 2 +- ...lass_InvalidDirectoryResourceException.php | 2 +- .../io/class_InvalidMD5ChecksumException.php | 2 +- .../io/class_PathIsEmptyException.php | 2 +- .../io/class_PathIsNoDirectoryException.php | 2 +- .../io/class_PathReadProtectedException.php | 2 +- ...ass_InvalidLanguagePathStringException.php | 2 +- .../class_LanguagePathIsEmptyException.php | 2 +- ...ass_LanguagePathIsNoDirectoryException.php | 2 +- ...ass_LanguagePathReadProtectedException.php | 2 +- .../class_MissingFileIoHandlerException.php | 2 +- .../class_MissingLanguageHandlerException.php | 2 +- .../main/class_ClassMismatchException.php | 2 +- .../main/class_ClassNotFoundException.php | 2 +- .../class_ConfigEntryIsEmptyException.php | 2 +- .../class_ConfigEntryNotFoundException.php | 2 +- .../class_DimNotFoundInArrayException.php | 2 +- .../main/class_EmptyVariableException.php | 2 +- .../class_ExceptionNotChangedException.php | 2 +- .../main/class_ExceptionNotFoundException.php | 2 +- .../main/class_GetterNotFoundException.php | 2 +- .../main/class_InvalidArrayCountException.php | 2 +- .../main/class_InvalidCommandException.php | 2 +- .../class_InvalidCommandInstanceException.php | 2 +- .../main/class_InvalidControllerException.php | 2 +- .../main/class_InvalidObjectException.php | 2 +- .../class_MissingArrayElementsException.php | 2 +- ...ingDecimalsThousandsSeperatorException.php | 2 +- .../main/class_MissingMethodException.php | 2 +- .../main/class_NoArrayCreatedException.php | 2 +- .../main/class_NoArrayException.php | 2 +- .../main/class_NoObjectException.php | 2 +- .../main/class_NullPointerException.php | 2 +- ...ss_ResponseHeadersAlreadySentException.php | 2 +- .../main/class_VariableIsNotSetException.php | 2 +- .../class_BasePathIsEmptyException.php | 2 +- .../class_BasePathIsNoDirectoryException.php | 2 +- .../class_BasePathReadProtectedException.php | 2 +- .../class_InvalidBasePathStringException.php | 2 +- ...s_InvalidTemplateVariableNameException.php | 2 +- .../class_UnexpectedTemplateTypeException.php | 2 +- ...ass_UnsupportedTemplateEngineException.php | 2 +- .../class_ViewHelperNotFoundException.php | 2 +- .../user/class_UserEmailMissingException.php | 2 +- .../class_UserPasswordMismatchException.php | 46 ++++++ .../user/class_UsernameMissingException.php | 2 +- .../class_ManageableApplication.php | 2 +- inc/classes/interfaces/auth/.htaccess | 1 + .../interfaces/auth/class_Authorizeable.php | 34 +++++ .../interfaces/cache/class_Cacheable.php | 4 +- inc/classes/interfaces/class_ | 4 +- .../interfaces/class_FrameworkInterface.php | 2 +- .../interfaces/commands/class_Commandable.php | 2 +- .../compressor/class_Compressor.php | 2 +- .../controller/class_Controller.php | 2 +- .../interfaces/criteria/class_Criteria.php | 4 +- .../extended/class_LocalSearchCriteria.php | 4 +- .../extended/class_StoreableCriteria.php | 2 +- .../class_FrameworkDatabaseInterface.php | 2 +- .../class_DatabaseFrontendInterface.php | 6 +- .../middleware/class_DatabaseConnector.php | 2 +- .../interfaces/debug/class_Debugger.php | 2 +- .../extended/class_LimitableObject.php | 2 +- .../interfaces/filter/class_Filterable.php | 2 +- inc/classes/interfaces/helper/.htaccess | 1 + .../interfaces/helper/class_HelpableLogin.php | 36 +++++ .../interfaces/io/class_Streamable.php | 2 +- .../io/file/class_FileInputStreamer.php | 2 +- .../io/file/class_FileOutputStreamer.php | 2 +- .../io/output/class_OutputStreamer.php | 2 +- .../language/class_ManageableLanguage.php | 2 +- .../interfaces/login/class_LoginableUser.php | 7 +- inc/classes/interfaces/reader/.htaccess | 1 + .../interfaces/reader/class_ReadableNews.php | 34 +++++ .../registration/class_UserRegister.php | 4 +- .../interfaces/registry/class_Register.php | 4 +- .../registry/class_Registerable.php | 4 +- .../interfaces/request/class_Requestable.php | 10 +- .../resolver/class_CommandResolver.php | 2 +- .../resolver/class_ControllerResolver.php | 2 +- .../response/class_Responseable.php | 33 ++++- inc/classes/interfaces/result/.htaccess | 1 + .../result/class_SearchableResult.php | 35 +++++ .../template/class_CompileableTemplate.php | 2 +- .../template/view/class_ViewHelper.php | 2 +- .../interfaces/user/class_ManageableUser.php | 33 ++++- inc/classes/main/actions/class_BaseAction.php | 4 +- .../class_LoginAfterRegistrationAction.php | 6 +- inc/classes/main/auth/.htaccess | 1 + inc/classes/main/auth/class_CookieAuth.php | 121 ++++++++++++++++ inc/classes/main/cache/class_MemoryCache.php | 4 +- .../main/class_BaseFrameworkSystem.php | 74 ++++++++-- .../main/class_FrameworkArrayObject.php | 2 +- inc/classes/main/commands/class_ | 4 +- .../commands/web/class_WebDoFormCommand.php | 2 +- .../commands/web/class_WebHomeCommand.php | 4 +- .../web/class_WebLoginAreaCommand.php | 129 +++++++++++++++++ .../commands/web/class_WebRegisterCommand.php | 4 +- .../main/console/class_ConsoleTools.php | 2 +- .../main/controller/class_BaseController.php | 4 +- .../class_WebDefaultNewsController.php | 24 ++-- inc/classes/main/controller/login/.htaccess | 1 + .../login/class_WebLoginAreaController.php | 92 ++++++++++++ .../main/criteria/class_DataSetCriteria.php | 2 +- .../main/criteria/class_SearchCriteria.php | 4 +- .../main/crypto/class_CryptoHelper.php | 4 +- inc/classes/main/database/class_ | 2 +- .../database/class_BaseDatabaseFrontend.php | 4 +- .../database/class_BaseDatabaseWrapper.php | 2 +- .../databases/class_LocalFileDatabase.php | 16 +-- .../wrapper/class_UserDatabaseWrapper.php | 8 +- .../main/debug/class_DebugConsoleOutput.php | 2 +- .../main/debug/class_DebugErrorLogOutput.php | 2 +- .../main/debug/class_DebugWebOutput.php | 2 +- .../main/extended/class_ObjectLimits.php | 2 +- .../extended/class_SerializationContainer.php | 2 +- .../factories/cache/class_CacheFactory.php | 2 +- .../factories/objects/class_ObjectFactory.php | 9 +- .../factories/web/class_WebNewsFactory.php | 61 +------- inc/classes/main/filter/auth/.htaccess | 1 + .../main/filter/auth/class_UserAuthFilter.php | 114 +++++++++++++++ .../checkboxes/class_RulesAcceptedFilter.php | 8 +- inc/classes/main/filter/class_BaseFilter.php | 45 ++++++ inc/classes/main/filter/class_FilterChain.php | 13 +- inc/classes/main/filter/news/.htaccess | 1 + .../filter/news/class_NewsDownloadFilter.php | 73 ++++++++++ .../filter/news/class_NewsProcessFilter.php | 68 +++++++++ .../main/filter/null/class_NullFilter.php | 6 +- .../validator/class_EmailValidatorFilter.php | 6 +- .../class_PasswordValidatorFilter.php | 6 +- .../class_UserNameValidatorFilter.php | 6 +- inc/classes/main/helper/login/.htaccess | 1 + .../helper/login/class_BaseLoginHelper.php | 38 +++++ .../main/helper/web/class_WebFormHelper.php | 11 +- inc/classes/main/io/class_FileIoStream.php | 2 +- .../io/class_FrameworkDirectoryPointer.php | 2 +- .../io/class_FrameworkFileInputPointer.php | 2 +- .../io/class_FrameworkFileOutputPointer.php | 2 +- .../main/language/class_LanguageSystem.php | 2 +- .../main/output/class_ConsoleOutput.php | 2 +- inc/classes/main/output/class_WebOutput.php | 2 +- inc/classes/main/reader/.htaccess | 1 + .../main/reader/class_DefaultNewsReader.php | 74 ++++++++++ .../registration/class_BaseRegistration.php | 56 +------- inc/classes/main/registry/class_Registry.php | 4 +- .../main/request/class_HttpRequest.php | 28 +++- .../resolver/web/class_WebCommandResolver.php | 4 +- .../web/class_WebControllerResolver.php | 8 +- .../main/response/class_HttpResponse.php | 134 +++++++++++++++++- .../main/result/class_DatabaseResult.php | 91 +++++++++++- .../main/rng/class_RandomNumberGenerator.php | 4 +- .../main/template/class_TemplateEngine.php | 8 +- inc/classes/main/user/class_User.php | 81 ++++++++--- .../middleware/class_BaseMiddleware.php | 2 +- .../compressor/class_CompressorChannel.php | 2 +- .../database/class_DatabaseConnection.php | 6 +- .../debug/class_DebugMiddleware.php | 2 +- .../middleware/io/class_FileIoHandler.php | 6 +- inc/config.php | 60 ++++---- inc/config/class_FrameworkConfiguration.php | 41 +++++- inc/config/config-override.php | 4 +- inc/database.php | 2 +- inc/database/lib-local.php | 2 +- inc/file_io.php | 4 +- inc/includes.php | 8 +- inc/loader/class_ClassLoader.php | 20 ++- inc/output.php | 4 +- 193 files changed, 1932 insertions(+), 426 deletions(-) create mode 100644 inc/classes/exceptions/auth/.htaccess create mode 100644 inc/classes/exceptions/auth/class_UserAuthorizationException.php create mode 100644 inc/classes/exceptions/class_ create mode 100644 inc/classes/exceptions/filter/.htaccess create mode 100644 inc/classes/exceptions/filter/class_FilterChainException.php create mode 100644 inc/classes/exceptions/helper/class_UserInstanceMissingException.php create mode 100644 inc/classes/exceptions/user/class_UserPasswordMismatchException.php create mode 100644 inc/classes/interfaces/auth/.htaccess create mode 100644 inc/classes/interfaces/auth/class_Authorizeable.php create mode 100644 inc/classes/interfaces/helper/.htaccess create mode 100644 inc/classes/interfaces/helper/class_HelpableLogin.php create mode 100644 inc/classes/interfaces/reader/.htaccess create mode 100644 inc/classes/interfaces/reader/class_ReadableNews.php create mode 100644 inc/classes/interfaces/result/.htaccess create mode 100644 inc/classes/interfaces/result/class_SearchableResult.php create mode 100644 inc/classes/main/auth/.htaccess create mode 100644 inc/classes/main/auth/class_CookieAuth.php create mode 100644 inc/classes/main/commands/web/class_WebLoginAreaCommand.php create mode 100644 inc/classes/main/controller/login/.htaccess create mode 100644 inc/classes/main/controller/login/class_WebLoginAreaController.php create mode 100644 inc/classes/main/filter/auth/.htaccess create mode 100644 inc/classes/main/filter/auth/class_UserAuthFilter.php create mode 100644 inc/classes/main/filter/class_BaseFilter.php create mode 100644 inc/classes/main/filter/news/.htaccess create mode 100644 inc/classes/main/filter/news/class_NewsDownloadFilter.php create mode 100644 inc/classes/main/filter/news/class_NewsProcessFilter.php create mode 100644 inc/classes/main/helper/login/.htaccess create mode 100644 inc/classes/main/helper/login/class_BaseLoginHelper.php create mode 100644 inc/classes/main/reader/.htaccess create mode 100644 inc/classes/main/reader/class_DefaultNewsReader.php diff --git a/.gitattributes b/.gitattributes index 722aab641..ee41aeafb 100644 --- a/.gitattributes +++ b/.gitattributes @@ -55,6 +55,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 @@ -77,11 +80,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 @@ -133,10 +139,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 @@ -165,6 +174,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 @@ -176,6 +187,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 @@ -188,6 +201,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 @@ -199,6 +214,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 @@ -212,6 +229,7 @@ inc/classes/main/commands/local/class_LocalHomeCommand.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 @@ -227,6 +245,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 @@ -256,12 +276,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 @@ -271,6 +297,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 @@ -283,6 +311,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 index 000000000..3a4288278 --- /dev/null +++ b/inc/classes/exceptions/auth/.htaccess @@ -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 index 000000000..5fedd40f3 --- /dev/null +++ b/inc/classes/exceptions/auth/class_UserAuthorizationException.php @@ -0,0 +1,46 @@ + + * @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 . + */ +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 %s", + $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 index 000000000..3001d8420 --- /dev/null +++ b/inc/classes/exceptions/class_ @@ -0,0 +1,39 @@ + + * @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 . + */ +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] +?> diff --git a/inc/classes/exceptions/class_FrameworkException.php b/inc/classes/exceptions/class_FrameworkException.php index b7db9a34d..2c4039660 100644 --- a/inc/classes/exceptions/class_FrameworkException.php +++ b/inc/classes/exceptions/class_FrameworkException.php @@ -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)); diff --git a/inc/classes/exceptions/compressor/class_MismatchingCompressorsException.php b/inc/classes/exceptions/compressor/class_MismatchingCompressorsException.php index 8e8d7d985..97c95adc7 100644 --- a/inc/classes/exceptions/compressor/class_MismatchingCompressorsException.php +++ b/inc/classes/exceptions/compressor/class_MismatchingCompressorsException.php @@ -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/container/class_ContainerItemIsNoArrayException.php b/inc/classes/exceptions/container/class_ContainerItemIsNoArrayException.php index dca689ec8..062205298 100644 --- a/inc/classes/exceptions/container/class_ContainerItemIsNoArrayException.php +++ b/inc/classes/exceptions/container/class_ContainerItemIsNoArrayException.php @@ -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/container/class_ContainerItemIsNullException.php b/inc/classes/exceptions/container/class_ContainerItemIsNullException.php index 9effef81b..05334ed1d 100644 --- a/inc/classes/exceptions/container/class_ContainerItemIsNullException.php +++ b/inc/classes/exceptions/container/class_ContainerItemIsNullException.php @@ -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/container/class_ContainerMaybeDamagedException.php b/inc/classes/exceptions/container/class_ContainerMaybeDamagedException.php index 9217d80bb..33232c08a 100644 --- a/inc/classes/exceptions/container/class_ContainerMaybeDamagedException.php +++ b/inc/classes/exceptions/container/class_ContainerMaybeDamagedException.php @@ -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/controller/class_DefaultControllerException.php b/inc/classes/exceptions/controller/class_DefaultControllerException.php index 11189697f..5a93a29cf 100644 --- a/inc/classes/exceptions/controller/class_DefaultControllerException.php +++ b/inc/classes/exceptions/controller/class_DefaultControllerException.php @@ -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/database/class_DatabaseException.php b/inc/classes/exceptions/database/class_DatabaseException.php index 6b713d2e6..3ff2e019e 100644 --- a/inc/classes/exceptions/database/class_DatabaseException.php +++ b/inc/classes/exceptions/database/class_DatabaseException.php @@ -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/database/general/class_SqlException.php b/inc/classes/exceptions/database/general/class_SqlException.php index 542764aad..5cd4385c6 100644 --- a/inc/classes/exceptions/database/general/class_SqlException.php +++ b/inc/classes/exceptions/database/general/class_SqlException.php @@ -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/database/local_file/class_SavePathIsEmptyException.php b/inc/classes/exceptions/database/local_file/class_SavePathIsEmptyException.php index dc5ed66be..d9de2eef9 100644 --- a/inc/classes/exceptions/database/local_file/class_SavePathIsEmptyException.php +++ b/inc/classes/exceptions/database/local_file/class_SavePathIsEmptyException.php @@ -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/database/local_file/class_SavePathIsNoDirectoryException.php b/inc/classes/exceptions/database/local_file/class_SavePathIsNoDirectoryException.php index a8bcc6ed2..a3be62a18 100644 --- a/inc/classes/exceptions/database/local_file/class_SavePathIsNoDirectoryException.php +++ b/inc/classes/exceptions/database/local_file/class_SavePathIsNoDirectoryException.php @@ -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/database/local_file/class_SavePathReadProtectedException.php b/inc/classes/exceptions/database/local_file/class_SavePathReadProtectedException.php index ee1da7f48..06ef4b4cd 100644 --- a/inc/classes/exceptions/database/local_file/class_SavePathReadProtectedException.php +++ b/inc/classes/exceptions/database/local_file/class_SavePathReadProtectedException.php @@ -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/database/local_file/class_SavePathWriteProtectedException.php b/inc/classes/exceptions/database/local_file/class_SavePathWriteProtectedException.php index eb5417fe9..a5c57f482 100644 --- a/inc/classes/exceptions/database/local_file/class_SavePathWriteProtectedException.php +++ b/inc/classes/exceptions/database/local_file/class_SavePathWriteProtectedException.php @@ -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/database/wrapper/class_WrapperUserNameNotFoundException.php b/inc/classes/exceptions/database/wrapper/class_WrapperUserNameNotFoundException.php index 6b38482df..c6014b123 100644 --- a/inc/classes/exceptions/database/wrapper/class_WrapperUserNameNotFoundException.php +++ b/inc/classes/exceptions/database/wrapper/class_WrapperUserNameNotFoundException.php @@ -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 index 000000000..3a4288278 --- /dev/null +++ b/inc/classes/exceptions/filter/.htaccess @@ -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 index 000000000..e1bfe10db --- /dev/null +++ b/inc/classes/exceptions/filter/class_FilterChainException.php @@ -0,0 +1,45 @@ + + * @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 . + */ +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] +?> diff --git a/inc/classes/exceptions/helper/class_FormClosedException.php b/inc/classes/exceptions/helper/class_FormClosedException.php index b7acb6fcf..dd012eb04 100644 --- a/inc/classes/exceptions/helper/class_FormClosedException.php +++ b/inc/classes/exceptions/helper/class_FormClosedException.php @@ -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/exceptions/helper/class_FormGroupClosedException.php b/inc/classes/exceptions/helper/class_FormGroupClosedException.php index ff951fee6..8c56a5d2e 100644 --- a/inc/classes/exceptions/helper/class_FormGroupClosedException.php +++ b/inc/classes/exceptions/helper/class_FormGroupClosedException.php @@ -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_FormOpenedException.php b/inc/classes/exceptions/helper/class_FormOpenedException.php index 6a95cd991..c2aafbd20 100644 --- a/inc/classes/exceptions/helper/class_FormOpenedException.php +++ b/inc/classes/exceptions/helper/class_FormOpenedException.php @@ -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/exceptions/helper/class_InvalidFormNameException.php b/inc/classes/exceptions/helper/class_InvalidFormNameException.php index b45e7a1c9..00c36a25f 100644 --- a/inc/classes/exceptions/helper/class_InvalidFormNameException.php +++ b/inc/classes/exceptions/helper/class_InvalidFormNameException.php @@ -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 index 000000000..a10957209 --- /dev/null +++ b/inc/classes/exceptions/helper/class_UserInstanceMissingException.php @@ -0,0 +1,46 @@ + + * @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 . + */ +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 %s does not include a class with implemented interface ManageableUser.", + $classArray[0]->__toString(), + $this->getLine(), + $classArray[1] + ); + + // Call parent constructor + parent::__construct($message, $code); + } +} + +// [EOF] +?> diff --git a/inc/classes/exceptions/io/class_DirPointerNotOpenedException.php b/inc/classes/exceptions/io/class_DirPointerNotOpenedException.php index 9527dbc1a..12b4d2668 100644 --- a/inc/classes/exceptions/io/class_DirPointerNotOpenedException.php +++ b/inc/classes/exceptions/io/class_DirPointerNotOpenedException.php @@ -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/io/class_FilePointerNotOpenedException.php b/inc/classes/exceptions/io/class_FilePointerNotOpenedException.php index 8fb500192..760fca2f9 100644 --- a/inc/classes/exceptions/io/class_FilePointerNotOpenedException.php +++ b/inc/classes/exceptions/io/class_FilePointerNotOpenedException.php @@ -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/io/class_InvalidDataLengthException.php b/inc/classes/exceptions/io/class_InvalidDataLengthException.php index c53f66a9e..90d4ae086 100644 --- a/inc/classes/exceptions/io/class_InvalidDataLengthException.php +++ b/inc/classes/exceptions/io/class_InvalidDataLengthException.php @@ -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/io/class_InvalidDirectoryResourceException.php b/inc/classes/exceptions/io/class_InvalidDirectoryResourceException.php index fefef2d23..2dbe65cee 100644 --- a/inc/classes/exceptions/io/class_InvalidDirectoryResourceException.php +++ b/inc/classes/exceptions/io/class_InvalidDirectoryResourceException.php @@ -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/io/class_InvalidMD5ChecksumException.php b/inc/classes/exceptions/io/class_InvalidMD5ChecksumException.php index 3a64350f7..d15fbfec7 100644 --- a/inc/classes/exceptions/io/class_InvalidMD5ChecksumException.php +++ b/inc/classes/exceptions/io/class_InvalidMD5ChecksumException.php @@ -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/io/class_PathIsEmptyException.php b/inc/classes/exceptions/io/class_PathIsEmptyException.php index c43ab814b..b8a286846 100644 --- a/inc/classes/exceptions/io/class_PathIsEmptyException.php +++ b/inc/classes/exceptions/io/class_PathIsEmptyException.php @@ -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/io/class_PathIsNoDirectoryException.php b/inc/classes/exceptions/io/class_PathIsNoDirectoryException.php index 11d94975a..2cedc57b1 100644 --- a/inc/classes/exceptions/io/class_PathIsNoDirectoryException.php +++ b/inc/classes/exceptions/io/class_PathIsNoDirectoryException.php @@ -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/io/class_PathReadProtectedException.php b/inc/classes/exceptions/io/class_PathReadProtectedException.php index ce897d2fc..102dae24a 100644 --- a/inc/classes/exceptions/io/class_PathReadProtectedException.php +++ b/inc/classes/exceptions/io/class_PathReadProtectedException.php @@ -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/language/class_InvalidLanguagePathStringException.php b/inc/classes/exceptions/language/class_InvalidLanguagePathStringException.php index ddb98356c..6e02cfe49 100644 --- a/inc/classes/exceptions/language/class_InvalidLanguagePathStringException.php +++ b/inc/classes/exceptions/language/class_InvalidLanguagePathStringException.php @@ -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/language/class_LanguagePathIsEmptyException.php b/inc/classes/exceptions/language/class_LanguagePathIsEmptyException.php index f87a412a5..cd38561c3 100644 --- a/inc/classes/exceptions/language/class_LanguagePathIsEmptyException.php +++ b/inc/classes/exceptions/language/class_LanguagePathIsEmptyException.php @@ -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/language/class_LanguagePathIsNoDirectoryException.php b/inc/classes/exceptions/language/class_LanguagePathIsNoDirectoryException.php index c82818f69..9b6b581de 100644 --- a/inc/classes/exceptions/language/class_LanguagePathIsNoDirectoryException.php +++ b/inc/classes/exceptions/language/class_LanguagePathIsNoDirectoryException.php @@ -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/language/class_LanguagePathReadProtectedException.php b/inc/classes/exceptions/language/class_LanguagePathReadProtectedException.php index ba59b572a..9df443e77 100644 --- a/inc/classes/exceptions/language/class_LanguagePathReadProtectedException.php +++ b/inc/classes/exceptions/language/class_LanguagePathReadProtectedException.php @@ -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/language/class_MissingFileIoHandlerException.php b/inc/classes/exceptions/language/class_MissingFileIoHandlerException.php index 210b94c33..ea92f6de3 100644 --- a/inc/classes/exceptions/language/class_MissingFileIoHandlerException.php +++ b/inc/classes/exceptions/language/class_MissingFileIoHandlerException.php @@ -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/language/class_MissingLanguageHandlerException.php b/inc/classes/exceptions/language/class_MissingLanguageHandlerException.php index a5c8946f9..9511e2169 100644 --- a/inc/classes/exceptions/language/class_MissingLanguageHandlerException.php +++ b/inc/classes/exceptions/language/class_MissingLanguageHandlerException.php @@ -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/main/class_ClassMismatchException.php b/inc/classes/exceptions/main/class_ClassMismatchException.php index 9e218ad2a..92364cd3b 100644 --- a/inc/classes/exceptions/main/class_ClassMismatchException.php +++ b/inc/classes/exceptions/main/class_ClassMismatchException.php @@ -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/main/class_ClassNotFoundException.php b/inc/classes/exceptions/main/class_ClassNotFoundException.php index 34f0ed3c3..5f037fe43 100644 --- a/inc/classes/exceptions/main/class_ClassNotFoundException.php +++ b/inc/classes/exceptions/main/class_ClassNotFoundException.php @@ -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/main/class_ConfigEntryIsEmptyException.php b/inc/classes/exceptions/main/class_ConfigEntryIsEmptyException.php index 16abfebb3..29efd8f94 100644 --- a/inc/classes/exceptions/main/class_ConfigEntryIsEmptyException.php +++ b/inc/classes/exceptions/main/class_ConfigEntryIsEmptyException.php @@ -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/main/class_ConfigEntryNotFoundException.php b/inc/classes/exceptions/main/class_ConfigEntryNotFoundException.php index 823321802..d42833191 100644 --- a/inc/classes/exceptions/main/class_ConfigEntryNotFoundException.php +++ b/inc/classes/exceptions/main/class_ConfigEntryNotFoundException.php @@ -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/main/class_DimNotFoundInArrayException.php b/inc/classes/exceptions/main/class_DimNotFoundInArrayException.php index 7f0ee053e..25a694c37 100644 --- a/inc/classes/exceptions/main/class_DimNotFoundInArrayException.php +++ b/inc/classes/exceptions/main/class_DimNotFoundInArrayException.php @@ -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/main/class_EmptyVariableException.php b/inc/classes/exceptions/main/class_EmptyVariableException.php index 42a938ca0..7fa7f48e3 100644 --- a/inc/classes/exceptions/main/class_EmptyVariableException.php +++ b/inc/classes/exceptions/main/class_EmptyVariableException.php @@ -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/main/class_ExceptionNotChangedException.php b/inc/classes/exceptions/main/class_ExceptionNotChangedException.php index 7468bd4ff..6fe944583 100644 --- a/inc/classes/exceptions/main/class_ExceptionNotChangedException.php +++ b/inc/classes/exceptions/main/class_ExceptionNotChangedException.php @@ -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 diff --git a/inc/classes/exceptions/main/class_ExceptionNotFoundException.php b/inc/classes/exceptions/main/class_ExceptionNotFoundException.php index 95deb6175..eed88505a 100644 --- a/inc/classes/exceptions/main/class_ExceptionNotFoundException.php +++ b/inc/classes/exceptions/main/class_ExceptionNotFoundException.php @@ -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/main/class_GetterNotFoundException.php b/inc/classes/exceptions/main/class_GetterNotFoundException.php index fd6202265..bcc958f55 100644 --- a/inc/classes/exceptions/main/class_GetterNotFoundException.php +++ b/inc/classes/exceptions/main/class_GetterNotFoundException.php @@ -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/main/class_InvalidArrayCountException.php b/inc/classes/exceptions/main/class_InvalidArrayCountException.php index f318d6785..0fc6f6685 100644 --- a/inc/classes/exceptions/main/class_InvalidArrayCountException.php +++ b/inc/classes/exceptions/main/class_InvalidArrayCountException.php @@ -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/main/class_InvalidCommandException.php b/inc/classes/exceptions/main/class_InvalidCommandException.php index 27b676623..add16453d 100644 --- a/inc/classes/exceptions/main/class_InvalidCommandException.php +++ b/inc/classes/exceptions/main/class_InvalidCommandException.php @@ -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/main/class_InvalidCommandInstanceException.php b/inc/classes/exceptions/main/class_InvalidCommandInstanceException.php index dc1039138..772852644 100644 --- a/inc/classes/exceptions/main/class_InvalidCommandInstanceException.php +++ b/inc/classes/exceptions/main/class_InvalidCommandInstanceException.php @@ -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/main/class_InvalidControllerException.php b/inc/classes/exceptions/main/class_InvalidControllerException.php index a2952b456..a3043d7ea 100644 --- a/inc/classes/exceptions/main/class_InvalidControllerException.php +++ b/inc/classes/exceptions/main/class_InvalidControllerException.php @@ -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/main/class_InvalidObjectException.php b/inc/classes/exceptions/main/class_InvalidObjectException.php index 39d67e733..1b4438b0c 100644 --- a/inc/classes/exceptions/main/class_InvalidObjectException.php +++ b/inc/classes/exceptions/main/class_InvalidObjectException.php @@ -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/main/class_MissingArrayElementsException.php b/inc/classes/exceptions/main/class_MissingArrayElementsException.php index 66c9a55c1..890aa2d2c 100644 --- a/inc/classes/exceptions/main/class_MissingArrayElementsException.php +++ b/inc/classes/exceptions/main/class_MissingArrayElementsException.php @@ -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/main/class_MissingDecimalsThousandsSeperatorException.php b/inc/classes/exceptions/main/class_MissingDecimalsThousandsSeperatorException.php index 055ebe9ab..7c40bfb8c 100644 --- a/inc/classes/exceptions/main/class_MissingDecimalsThousandsSeperatorException.php +++ b/inc/classes/exceptions/main/class_MissingDecimalsThousandsSeperatorException.php @@ -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/main/class_MissingMethodException.php b/inc/classes/exceptions/main/class_MissingMethodException.php index 3e78c1a22..65eb60d07 100644 --- a/inc/classes/exceptions/main/class_MissingMethodException.php +++ b/inc/classes/exceptions/main/class_MissingMethodException.php @@ -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/main/class_NoArrayCreatedException.php b/inc/classes/exceptions/main/class_NoArrayCreatedException.php index a4098a7dc..264d69d54 100644 --- a/inc/classes/exceptions/main/class_NoArrayCreatedException.php +++ b/inc/classes/exceptions/main/class_NoArrayCreatedException.php @@ -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/main/class_NoArrayException.php b/inc/classes/exceptions/main/class_NoArrayException.php index 0f39cdc26..00f240ea7 100644 --- a/inc/classes/exceptions/main/class_NoArrayException.php +++ b/inc/classes/exceptions/main/class_NoArrayException.php @@ -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 diff --git a/inc/classes/exceptions/main/class_NoObjectException.php b/inc/classes/exceptions/main/class_NoObjectException.php index a2d6dcf98..1812a16fb 100644 --- a/inc/classes/exceptions/main/class_NoObjectException.php +++ b/inc/classes/exceptions/main/class_NoObjectException.php @@ -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 * diff --git a/inc/classes/exceptions/main/class_NullPointerException.php b/inc/classes/exceptions/main/class_NullPointerException.php index eb91335bd..42ed410f3 100644 --- a/inc/classes/exceptions/main/class_NullPointerException.php +++ b/inc/classes/exceptions/main/class_NullPointerException.php @@ -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/main/class_ResponseHeadersAlreadySentException.php b/inc/classes/exceptions/main/class_ResponseHeadersAlreadySentException.php index 1877e126a..16e36e165 100644 --- a/inc/classes/exceptions/main/class_ResponseHeadersAlreadySentException.php +++ b/inc/classes/exceptions/main/class_ResponseHeadersAlreadySentException.php @@ -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/main/class_VariableIsNotSetException.php b/inc/classes/exceptions/main/class_VariableIsNotSetException.php index 2a36031d8..36372e574 100644 --- a/inc/classes/exceptions/main/class_VariableIsNotSetException.php +++ b/inc/classes/exceptions/main/class_VariableIsNotSetException.php @@ -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/template/class_BasePathIsEmptyException.php b/inc/classes/exceptions/template/class_BasePathIsEmptyException.php index 29a84ae22..78dd8571a 100644 --- a/inc/classes/exceptions/template/class_BasePathIsEmptyException.php +++ b/inc/classes/exceptions/template/class_BasePathIsEmptyException.php @@ -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/template/class_BasePathIsNoDirectoryException.php b/inc/classes/exceptions/template/class_BasePathIsNoDirectoryException.php index d798a692b..ab6b7f058 100644 --- a/inc/classes/exceptions/template/class_BasePathIsNoDirectoryException.php +++ b/inc/classes/exceptions/template/class_BasePathIsNoDirectoryException.php @@ -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/template/class_BasePathReadProtectedException.php b/inc/classes/exceptions/template/class_BasePathReadProtectedException.php index 687f29590..3d1507a3e 100644 --- a/inc/classes/exceptions/template/class_BasePathReadProtectedException.php +++ b/inc/classes/exceptions/template/class_BasePathReadProtectedException.php @@ -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/template/class_InvalidBasePathStringException.php b/inc/classes/exceptions/template/class_InvalidBasePathStringException.php index 68241d3e8..9aa3ad4bb 100644 --- a/inc/classes/exceptions/template/class_InvalidBasePathStringException.php +++ b/inc/classes/exceptions/template/class_InvalidBasePathStringException.php @@ -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/template/class_InvalidTemplateVariableNameException.php b/inc/classes/exceptions/template/class_InvalidTemplateVariableNameException.php index 7e7a21bec..b309f7b2d 100644 --- a/inc/classes/exceptions/template/class_InvalidTemplateVariableNameException.php +++ b/inc/classes/exceptions/template/class_InvalidTemplateVariableNameException.php @@ -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 diff --git a/inc/classes/exceptions/template/class_UnexpectedTemplateTypeException.php b/inc/classes/exceptions/template/class_UnexpectedTemplateTypeException.php index 2d7997350..c761da6af 100644 --- a/inc/classes/exceptions/template/class_UnexpectedTemplateTypeException.php +++ b/inc/classes/exceptions/template/class_UnexpectedTemplateTypeException.php @@ -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/template/class_UnsupportedTemplateEngineException.php b/inc/classes/exceptions/template/class_UnsupportedTemplateEngineException.php index d5e1b214f..46d15190a 100644 --- a/inc/classes/exceptions/template/class_UnsupportedTemplateEngineException.php +++ b/inc/classes/exceptions/template/class_UnsupportedTemplateEngineException.php @@ -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/template/class_ViewHelperNotFoundException.php b/inc/classes/exceptions/template/class_ViewHelperNotFoundException.php index b649aa1bb..0fe1d0296 100644 --- a/inc/classes/exceptions/template/class_ViewHelperNotFoundException.php +++ b/inc/classes/exceptions/template/class_ViewHelperNotFoundException.php @@ -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_UserEmailMissingException.php b/inc/classes/exceptions/user/class_UserEmailMissingException.php index 64aedd73c..3c816e96f 100644 --- a/inc/classes/exceptions/user/class_UserEmailMissingException.php +++ b/inc/classes/exceptions/user/class_UserEmailMissingException.php @@ -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 index 000000000..2ca954d6f --- /dev/null +++ b/inc/classes/exceptions/user/class_UserPasswordMismatchException.php @@ -0,0 +1,46 @@ + + * @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 . + */ +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 %s 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] +?> diff --git a/inc/classes/exceptions/user/class_UsernameMissingException.php b/inc/classes/exceptions/user/class_UsernameMissingException.php index ac261821a..42160ede8 100644 --- a/inc/classes/exceptions/user/class_UsernameMissingException.php +++ b/inc/classes/exceptions/user/class_UsernameMissingException.php @@ -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/application/class_ManageableApplication.php b/inc/classes/interfaces/application/class_ManageableApplication.php index e775a18ec..cdf7afdc7 100644 --- a/inc/classes/interfaces/application/class_ManageableApplication.php +++ b/inc/classes/interfaces/application/class_ManageableApplication.php @@ -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 index 000000000..3a4288278 --- /dev/null +++ b/inc/classes/interfaces/auth/.htaccess @@ -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 index 000000000..88e383fe3 --- /dev/null +++ b/inc/classes/interfaces/auth/class_Authorizeable.php @@ -0,0 +1,34 @@ + + * @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 . + */ +interface Authorizeable extends FrameworkInterface { + /** + * Destroy the authorization data + * + * @return void + */ + function destroyAuthData(); +} + +// +?> diff --git a/inc/classes/interfaces/cache/class_Cacheable.php b/inc/classes/interfaces/cache/class_Cacheable.php index c6fa23737..b58c8badd 100644 --- a/inc/classes/interfaces/cache/class_Cacheable.php +++ b/inc/classes/interfaces/cache/class_Cacheable.php @@ -2,11 +2,11 @@ /** * An interface for classes which are "able" to cache * - * @author Roland Haeder + * @author Roland Haeder * @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/class_ b/inc/classes/interfaces/class_ index 055ad90d6..60a8e962c 100644 --- a/inc/classes/interfaces/class_ +++ b/inc/classes/interfaces/class_ @@ -2,11 +2,11 @@ /** * * - * @author Roland Haeder + * @author Roland Haeder * @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/class_FrameworkInterface.php b/inc/classes/interfaces/class_FrameworkInterface.php index 3acb33bb6..212e03174 100644 --- a/inc/classes/interfaces/class_FrameworkInterface.php +++ b/inc/classes/interfaces/class_FrameworkInterface.php @@ -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/interfaces/commands/class_Commandable.php b/inc/classes/interfaces/commands/class_Commandable.php index 379204e34..76679cb54 100644 --- a/inc/classes/interfaces/commands/class_Commandable.php +++ b/inc/classes/interfaces/commands/class_Commandable.php @@ -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/compressor/class_Compressor.php b/inc/classes/interfaces/compressor/class_Compressor.php index 799f90fe4..c7b725a24 100644 --- a/inc/classes/interfaces/compressor/class_Compressor.php +++ b/inc/classes/interfaces/compressor/class_Compressor.php @@ -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/controller/class_Controller.php b/inc/classes/interfaces/controller/class_Controller.php index ecba54f6a..7169d880e 100644 --- a/inc/classes/interfaces/controller/class_Controller.php +++ b/inc/classes/interfaces/controller/class_Controller.php @@ -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/criteria/class_Criteria.php b/inc/classes/interfaces/criteria/class_Criteria.php index 35b51f35b..f6cf6be6f 100644 --- a/inc/classes/interfaces/criteria/class_Criteria.php +++ b/inc/classes/interfaces/criteria/class_Criteria.php @@ -2,11 +2,11 @@ /** * An interface for criterias * - * @author Roland Haeder + * @author Roland Haeder * @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/criteria/extended/class_LocalSearchCriteria.php b/inc/classes/interfaces/criteria/extended/class_LocalSearchCriteria.php index 79c3b4768..cfb84942a 100644 --- a/inc/classes/interfaces/criteria/extended/class_LocalSearchCriteria.php +++ b/inc/classes/interfaces/criteria/extended/class_LocalSearchCriteria.php @@ -2,11 +2,11 @@ /** * An interface for local criterias * - * @author Roland Haeder + * @author Roland Haeder * @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/criteria/extended/class_StoreableCriteria.php b/inc/classes/interfaces/criteria/extended/class_StoreableCriteria.php index 8af7c67d7..42daaad82 100644 --- a/inc/classes/interfaces/criteria/extended/class_StoreableCriteria.php +++ b/inc/classes/interfaces/criteria/extended/class_StoreableCriteria.php @@ -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/database/class_FrameworkDatabaseInterface.php b/inc/classes/interfaces/database/class_FrameworkDatabaseInterface.php index c5cf54e32..196616153 100644 --- a/inc/classes/interfaces/database/class_FrameworkDatabaseInterface.php +++ b/inc/classes/interfaces/database/class_FrameworkDatabaseInterface.php @@ -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/database/frontend/class_DatabaseFrontendInterface.php b/inc/classes/interfaces/database/frontend/class_DatabaseFrontendInterface.php index f61df0713..7621713a4 100644 --- a/inc/classes/interfaces/database/frontend/class_DatabaseFrontendInterface.php +++ b/inc/classes/interfaces/database/frontend/class_DatabaseFrontendInterface.php @@ -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] diff --git a/inc/classes/interfaces/database/middleware/class_DatabaseConnector.php b/inc/classes/interfaces/database/middleware/class_DatabaseConnector.php index bf149a9d6..9a56aec30 100644 --- a/inc/classes/interfaces/database/middleware/class_DatabaseConnector.php +++ b/inc/classes/interfaces/database/middleware/class_DatabaseConnector.php @@ -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/debug/class_Debugger.php b/inc/classes/interfaces/debug/class_Debugger.php index 7dfc98e7a..cce33d045 100644 --- a/inc/classes/interfaces/debug/class_Debugger.php +++ b/inc/classes/interfaces/debug/class_Debugger.php @@ -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/extended/class_LimitableObject.php b/inc/classes/interfaces/extended/class_LimitableObject.php index b66038fa7..d4eea0f44 100644 --- a/inc/classes/interfaces/extended/class_LimitableObject.php +++ b/inc/classes/interfaces/extended/class_LimitableObject.php @@ -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/interfaces/filter/class_Filterable.php b/inc/classes/interfaces/filter/class_Filterable.php index 9b8807581..657dc2aec 100644 --- a/inc/classes/interfaces/filter/class_Filterable.php +++ b/inc/classes/interfaces/filter/class_Filterable.php @@ -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 index 000000000..3a4288278 --- /dev/null +++ b/inc/classes/interfaces/helper/.htaccess @@ -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 index 000000000..cf5f84f87 --- /dev/null +++ b/inc/classes/interfaces/helper/class_HelpableLogin.php @@ -0,0 +1,36 @@ + + * @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 . + */ +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); +} + +// +?> diff --git a/inc/classes/interfaces/io/class_Streamable.php b/inc/classes/interfaces/io/class_Streamable.php index a5a092702..2d839a64c 100644 --- a/inc/classes/interfaces/io/class_Streamable.php +++ b/inc/classes/interfaces/io/class_Streamable.php @@ -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/io/file/class_FileInputStreamer.php b/inc/classes/interfaces/io/file/class_FileInputStreamer.php index 294f697cc..5dc756b69 100644 --- a/inc/classes/interfaces/io/file/class_FileInputStreamer.php +++ b/inc/classes/interfaces/io/file/class_FileInputStreamer.php @@ -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/io/file/class_FileOutputStreamer.php b/inc/classes/interfaces/io/file/class_FileOutputStreamer.php index 92231d803..2862c544f 100644 --- a/inc/classes/interfaces/io/file/class_FileOutputStreamer.php +++ b/inc/classes/interfaces/io/file/class_FileOutputStreamer.php @@ -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/io/output/class_OutputStreamer.php b/inc/classes/interfaces/io/output/class_OutputStreamer.php index babc12894..8dff6817d 100644 --- a/inc/classes/interfaces/io/output/class_OutputStreamer.php +++ b/inc/classes/interfaces/io/output/class_OutputStreamer.php @@ -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/language/class_ManageableLanguage.php b/inc/classes/interfaces/language/class_ManageableLanguage.php index c1c64fcf2..4d4dfac3e 100644 --- a/inc/classes/interfaces/language/class_ManageableLanguage.php +++ b/inc/classes/interfaces/language/class_ManageableLanguage.php @@ -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/login/class_LoginableUser.php b/inc/classes/interfaces/login/class_LoginableUser.php index c7abf2d8d..107b13387 100644 --- a/inc/classes/interfaces/login/class_LoginableUser.php +++ b/inc/classes/interfaces/login/class_LoginableUser.php @@ -2,11 +2,11 @@ /** * An interface for user login classes * - * @author Roland Haeder + * @author Roland Haeder * @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 index 000000000..3a4288278 --- /dev/null +++ b/inc/classes/interfaces/reader/.htaccess @@ -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 index 000000000..c38b70200 --- /dev/null +++ b/inc/classes/interfaces/reader/class_ReadableNews.php @@ -0,0 +1,34 @@ + + * @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 . + */ +interface ReadableNews extends FrameworkInterface { + /** + * Initializes the news reader class. This is very reader-dependent + * + * @return void + */ + function initializeReader(); +} + +// +?> diff --git a/inc/classes/interfaces/registration/class_UserRegister.php b/inc/classes/interfaces/registration/class_UserRegister.php index 9fbf2ff4f..89a6fb220 100644 --- a/inc/classes/interfaces/registration/class_UserRegister.php +++ b/inc/classes/interfaces/registration/class_UserRegister.php @@ -2,11 +2,11 @@ /** * A class for user registration * - * @author Roland Haeder + * @author Roland Haeder * @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/registry/class_Register.php b/inc/classes/interfaces/registry/class_Register.php index a750ac1b3..d25fbab5d 100644 --- a/inc/classes/interfaces/registry/class_Register.php +++ b/inc/classes/interfaces/registry/class_Register.php @@ -2,11 +2,11 @@ /** * An interface for registries * - * @author Roland Haeder + * @author Roland Haeder * @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/registry/class_Registerable.php b/inc/classes/interfaces/registry/class_Registerable.php index 0616d002a..7be47dbc4 100644 --- a/inc/classes/interfaces/registry/class_Registerable.php +++ b/inc/classes/interfaces/registry/class_Registerable.php @@ -2,11 +2,11 @@ /** * A class for registerable classes * - * @author Roland Haeder + * @author Roland Haeder * @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/request/class_Requestable.php b/inc/classes/interfaces/request/class_Requestable.php index 1c093b7c9..1c3d09250 100644 --- a/inc/classes/interfaces/request/class_Requestable.php +++ b/inc/classes/interfaces/request/class_Requestable.php @@ -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); } // diff --git a/inc/classes/interfaces/resolver/class_CommandResolver.php b/inc/classes/interfaces/resolver/class_CommandResolver.php index 5e01cd944..c60c18729 100644 --- a/inc/classes/interfaces/resolver/class_CommandResolver.php +++ b/inc/classes/interfaces/resolver/class_CommandResolver.php @@ -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/resolver/class_ControllerResolver.php b/inc/classes/interfaces/resolver/class_ControllerResolver.php index 2f275147a..1b3d5f00b 100644 --- a/inc/classes/interfaces/resolver/class_ControllerResolver.php +++ b/inc/classes/interfaces/resolver/class_ControllerResolver.php @@ -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/response/class_Responseable.php b/inc/classes/interfaces/response/class_Responseable.php index 30bde5b38..a1fabde81 100644 --- a/inc/classes/interfaces/response/class_Responseable.php +++ b/inc/classes/interfaces/response/class_Responseable.php @@ -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 index 000000000..3a4288278 --- /dev/null +++ b/inc/classes/interfaces/result/.htaccess @@ -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 index 000000000..595e5c426 --- /dev/null +++ b/inc/classes/interfaces/result/class_SearchableResult.php @@ -0,0 +1,35 @@ + + * @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 . + */ +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] +?> diff --git a/inc/classes/interfaces/template/class_CompileableTemplate.php b/inc/classes/interfaces/template/class_CompileableTemplate.php index 16a500ed9..c0ec28b7d 100644 --- a/inc/classes/interfaces/template/class_CompileableTemplate.php +++ b/inc/classes/interfaces/template/class_CompileableTemplate.php @@ -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/template/view/class_ViewHelper.php b/inc/classes/interfaces/template/view/class_ViewHelper.php index b8617363b..230d04ebc 100644 --- a/inc/classes/interfaces/template/view/class_ViewHelper.php +++ b/inc/classes/interfaces/template/view/class_ViewHelper.php @@ -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/user/class_ManageableUser.php b/inc/classes/interfaces/user/class_ManageableUser.php index 768df4779..4dafed289 100644 --- a/inc/classes/interfaces/user/class_ManageableUser.php +++ b/inc/classes/interfaces/user/class_ManageableUser.php @@ -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 @@ -22,6 +22,37 @@ * along with this program. If not, see . */ 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); } // diff --git a/inc/classes/main/actions/class_BaseAction.php b/inc/classes/main/actions/class_BaseAction.php index 9b2df36d5..15ba51ef0 100644 --- a/inc/classes/main/actions/class_BaseAction.php +++ b/inc/classes/main/actions/class_BaseAction.php @@ -3,10 +3,10 @@ * A general action class * * @author Roland Haeder - * @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 diff --git a/inc/classes/main/actions/post_registration/class_LoginAfterRegistrationAction.php b/inc/classes/main/actions/post_registration/class_LoginAfterRegistrationAction.php index aae33eb5c..c5f1e8a02 100644 --- a/inc/classes/main/actions/post_registration/class_LoginAfterRegistrationAction.php +++ b/inc/classes/main/actions/post_registration/class_LoginAfterRegistrationAction.php @@ -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 index 000000000..3a4288278 --- /dev/null +++ b/inc/classes/main/auth/.htaccess @@ -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 index 000000000..6b1bf3f06 --- /dev/null +++ b/inc/classes/main/auth/class_CookieAuth.php @@ -0,0 +1,121 @@ + + * @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 . + */ +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] +?> diff --git a/inc/classes/main/cache/class_MemoryCache.php b/inc/classes/main/cache/class_MemoryCache.php index 01d2a3678..4cb7459b6 100644 --- a/inc/classes/main/cache/class_MemoryCache.php +++ b/inc/classes/main/cache/class_MemoryCache.php @@ -3,10 +3,10 @@ * A simple memory cache (similar to a registry) * * @author Roland Haeder - * @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 diff --git a/inc/classes/main/class_BaseFrameworkSystem.php b/inc/classes/main/class_BaseFrameworkSystem.php index 2a0c80768..3484a4eb5 100644 --- a/inc/classes/main/class_BaseFrameworkSystem.php +++ b/inc/classes/main/class_BaseFrameworkSystem.php @@ -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; } diff --git a/inc/classes/main/class_FrameworkArrayObject.php b/inc/classes/main/class_FrameworkArrayObject.php index 6543d45f0..f1daed4b3 100644 --- a/inc/classes/main/class_FrameworkArrayObject.php +++ b/inc/classes/main/class_FrameworkArrayObject.php @@ -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 diff --git a/inc/classes/main/commands/class_ b/inc/classes/main/commands/class_ index 628cd0f8e..778e7d8bb 100644 --- a/inc/classes/main/commands/class_ +++ b/inc/classes/main/commands/class_ @@ -2,11 +2,11 @@ /** * * - * @author Roland Haeder + * @author Roland Haeder * @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/commands/web/class_WebDoFormCommand.php b/inc/classes/main/commands/web/class_WebDoFormCommand.php index e7f59adee..cdfd7161a 100644 --- a/inc/classes/main/commands/web/class_WebDoFormCommand.php +++ b/inc/classes/main/commands/web/class_WebDoFormCommand.php @@ -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/main/commands/web/class_WebHomeCommand.php b/inc/classes/main/commands/web/class_WebHomeCommand.php index 8dcf3b1c4..3cc3592cf 100644 --- a/inc/classes/main/commands/web/class_WebHomeCommand.php +++ b/inc/classes/main/commands/web/class_WebHomeCommand.php @@ -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 index 000000000..d5f45ec59 --- /dev/null +++ b/inc/classes/main/commands/web/class_WebLoginAreaCommand.php @@ -0,0 +1,129 @@ + + * @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 . + */ +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 "home" 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] +?> diff --git a/inc/classes/main/commands/web/class_WebRegisterCommand.php b/inc/classes/main/commands/web/class_WebRegisterCommand.php index 1f85254b8..df5049998 100644 --- a/inc/classes/main/commands/web/class_WebRegisterCommand.php +++ b/inc/classes/main/commands/web/class_WebRegisterCommand.php @@ -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); diff --git a/inc/classes/main/console/class_ConsoleTools.php b/inc/classes/main/console/class_ConsoleTools.php index ffdc18214..ffd8b8e75 100644 --- a/inc/classes/main/console/class_ConsoleTools.php +++ b/inc/classes/main/console/class_ConsoleTools.php @@ -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/main/controller/class_BaseController.php b/inc/classes/main/controller/class_BaseController.php index 409ded2b9..4438cc216 100644 --- a/inc/classes/main/controller/class_BaseController.php +++ b/inc/classes/main/controller/class_BaseController.php @@ -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'); } /** diff --git a/inc/classes/main/controller/default/class_WebDefaultNewsController.php b/inc/classes/main/controller/default/class_WebDefaultNewsController.php index 326c0b00b..fee2d39f0 100644 --- a/inc/classes/main/controller/default/class_WebDefaultNewsController.php +++ b/inc/classes/main/controller/default/class_WebDefaultNewsController.php @@ -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 index 000000000..3a4288278 --- /dev/null +++ b/inc/classes/main/controller/login/.htaccess @@ -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 index 000000000..34893a10f --- /dev/null +++ b/inc/classes/main/controller/login/class_WebLoginAreaController.php @@ -0,0 +1,92 @@ + + * @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 . + */ +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] +?> diff --git a/inc/classes/main/criteria/class_DataSetCriteria.php b/inc/classes/main/criteria/class_DataSetCriteria.php index feb6366fa..2e76c2f94 100644 --- a/inc/classes/main/criteria/class_DataSetCriteria.php +++ b/inc/classes/main/criteria/class_DataSetCriteria.php @@ -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/criteria/class_SearchCriteria.php b/inc/classes/main/criteria/class_SearchCriteria.php index f94890967..fc5b1addd 100644 --- a/inc/classes/main/criteria/class_SearchCriteria.php +++ b/inc/classes/main/criteria/class_SearchCriteria.php @@ -5,10 +5,10 @@ * for looking in storages like the database. * * @author Roland Haeder - * @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 diff --git a/inc/classes/main/crypto/class_CryptoHelper.php b/inc/classes/main/crypto/class_CryptoHelper.php index cdde42113..4ec02ad91 100644 --- a/inc/classes/main/crypto/class_CryptoHelper.php +++ b/inc/classes/main/crypto/class_CryptoHelper.php @@ -3,10 +3,10 @@ * A helper class for cryptographical things like hashing passwords and so on * * @author Roland Haeder - * @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 diff --git a/inc/classes/main/database/class_ b/inc/classes/main/database/class_ index 6c338fdd9..504f4ab11 100644 --- a/inc/classes/main/database/class_ +++ b/inc/classes/main/database/class_ @@ -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/database/class_BaseDatabaseFrontend.php b/inc/classes/main/database/class_BaseDatabaseFrontend.php index cdf894fc0..2d2e04bdc 100644 --- a/inc/classes/main/database/class_BaseDatabaseFrontend.php +++ b/inc/classes/main/database/class_BaseDatabaseFrontend.php @@ -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 diff --git a/inc/classes/main/database/class_BaseDatabaseWrapper.php b/inc/classes/main/database/class_BaseDatabaseWrapper.php index 9c42999de..52447117e 100644 --- a/inc/classes/main/database/class_BaseDatabaseWrapper.php +++ b/inc/classes/main/database/class_BaseDatabaseWrapper.php @@ -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/main/database/databases/class_LocalFileDatabase.php b/inc/classes/main/database/databases/class_LocalFileDatabase.php index 151698c7f..220ad14d2 100644 --- a/inc/classes/main/database/databases/class_LocalFileDatabase.php +++ b/inc/classes/main/database/databases/class_LocalFileDatabase.php @@ -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(), diff --git a/inc/classes/main/database/wrapper/class_UserDatabaseWrapper.php b/inc/classes/main/database/wrapper/class_UserDatabaseWrapper.php index 88bc13fbb..5fc62e2a8 100644 --- a/inc/classes/main/database/wrapper/class_UserDatabaseWrapper.php +++ b/inc/classes/main/database/wrapper/class_UserDatabaseWrapper.php @@ -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); } } diff --git a/inc/classes/main/debug/class_DebugConsoleOutput.php b/inc/classes/main/debug/class_DebugConsoleOutput.php index 77b28b4be..be17ae39a 100644 --- a/inc/classes/main/debug/class_DebugConsoleOutput.php +++ b/inc/classes/main/debug/class_DebugConsoleOutput.php @@ -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/main/debug/class_DebugErrorLogOutput.php b/inc/classes/main/debug/class_DebugErrorLogOutput.php index af33e7008..34db47c5f 100644 --- a/inc/classes/main/debug/class_DebugErrorLogOutput.php +++ b/inc/classes/main/debug/class_DebugErrorLogOutput.php @@ -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/main/debug/class_DebugWebOutput.php b/inc/classes/main/debug/class_DebugWebOutput.php index 3eb613382..81dd64dc9 100644 --- a/inc/classes/main/debug/class_DebugWebOutput.php +++ b/inc/classes/main/debug/class_DebugWebOutput.php @@ -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/main/extended/class_ObjectLimits.php b/inc/classes/main/extended/class_ObjectLimits.php index 0f9ea835e..926e8fc69 100644 --- a/inc/classes/main/extended/class_ObjectLimits.php +++ b/inc/classes/main/extended/class_ObjectLimits.php @@ -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/extended/class_SerializationContainer.php b/inc/classes/main/extended/class_SerializationContainer.php index 6d5c15de5..2f967e4b3 100644 --- a/inc/classes/main/extended/class_SerializationContainer.php +++ b/inc/classes/main/extended/class_SerializationContainer.php @@ -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/factories/cache/class_CacheFactory.php b/inc/classes/main/factories/cache/class_CacheFactory.php index 48f83383f..e2cb7bce3 100644 --- a/inc/classes/main/factories/cache/class_CacheFactory.php +++ b/inc/classes/main/factories/cache/class_CacheFactory.php @@ -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); diff --git a/inc/classes/main/factories/objects/class_ObjectFactory.php b/inc/classes/main/factories/objects/class_ObjectFactory.php index 024020d6d..9a2ec9c2d 100644 --- a/inc/classes/main/factories/objects/class_ObjectFactory.php +++ b/inc/classes/main/factories/objects/class_ObjectFactory.php @@ -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); } diff --git a/inc/classes/main/factories/web/class_WebNewsFactory.php b/inc/classes/main/factories/web/class_WebNewsFactory.php index ecd1f2864..dfbb6db85 100644 --- a/inc/classes/main/factories/web/class_WebNewsFactory.php +++ b/inc/classes/main/factories/web/class_WebNewsFactory.php @@ -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 index 000000000..3a4288278 --- /dev/null +++ b/inc/classes/main/filter/auth/.htaccess @@ -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 index 000000000..5754bf1d6 --- /dev/null +++ b/inc/classes/main/filter/auth/class_UserAuthFilter.php @@ -0,0 +1,114 @@ + + * @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 . + */ +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] +?> diff --git a/inc/classes/main/filter/checkboxes/class_RulesAcceptedFilter.php b/inc/classes/main/filter/checkboxes/class_RulesAcceptedFilter.php index 3029dcee6..d52c6aa6a 100644 --- a/inc/classes/main/filter/checkboxes/class_RulesAcceptedFilter.php +++ b/inc/classes/main/filter/checkboxes/class_RulesAcceptedFilter.php @@ -23,7 +23,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -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 index 000000000..3800c4925 --- /dev/null +++ b/inc/classes/main/filter/class_BaseFilter.php @@ -0,0 +1,45 @@ + + * @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 . + */ +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] +?> diff --git a/inc/classes/main/filter/class_FilterChain.php b/inc/classes/main/filter/class_FilterChain.php index fa1f8f421..7004eb50f 100644 --- a/inc/classes/main/filter/class_FilterChain.php +++ b/inc/classes/main/filter/class_FilterChain.php @@ -81,11 +81,16 @@ class FilterChain extends BaseFrameworkSystem { // Run all filters //* DEBUG */ echo "COUNT=".count($this->filters)."
\n"; foreach ($this->filters as $filterInstance) { - // Execute this filter - //* DEBUG */ echo "FILTER: ".$filterInstance->__toString().": Processing started.
\n"; + // Try to execute this filter + try { + //* DEBUG */ echo "FILTER: ".$filterInstance->__toString().": Processing started.
\n"; $filterInstance->execute($requestInstance, $responseInstance); - //* DEBUG */ echo "FILTER: ".$filterInstance->__toString().": Processing ended.
\n"; - } + //* DEBUG */ echo "FILTER: ".$filterInstance->__toString().": Processing ended.
\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 index 000000000..3a4288278 --- /dev/null +++ b/inc/classes/main/filter/news/.htaccess @@ -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 index 000000000..e3a1881c2 --- /dev/null +++ b/inc/classes/main/filter/news/class_NewsDownloadFilter.php @@ -0,0 +1,73 @@ + + * @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 . + */ +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 index 000000000..8df6a0f01 --- /dev/null +++ b/inc/classes/main/filter/news/class_NewsProcessFilter.php @@ -0,0 +1,68 @@ + + * @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 . + */ +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] +?> diff --git a/inc/classes/main/filter/null/class_NullFilter.php b/inc/classes/main/filter/null/class_NullFilter.php index 3ac6d34ac..ef9c70c3f 100644 --- a/inc/classes/main/filter/null/class_NullFilter.php +++ b/inc/classes/main/filter/null/class_NullFilter.php @@ -22,7 +22,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -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(); } /** diff --git a/inc/classes/main/filter/validator/class_EmailValidatorFilter.php b/inc/classes/main/filter/validator/class_EmailValidatorFilter.php index a1276c88a..4785a9653 100644 --- a/inc/classes/main/filter/validator/class_EmailValidatorFilter.php +++ b/inc/classes/main/filter/validator/class_EmailValidatorFilter.php @@ -24,7 +24,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -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(); } /** diff --git a/inc/classes/main/filter/validator/class_PasswordValidatorFilter.php b/inc/classes/main/filter/validator/class_PasswordValidatorFilter.php index a8369d819..1d371b1e8 100644 --- a/inc/classes/main/filter/validator/class_PasswordValidatorFilter.php +++ b/inc/classes/main/filter/validator/class_PasswordValidatorFilter.php @@ -22,7 +22,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -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(); } /** diff --git a/inc/classes/main/filter/validator/class_UserNameValidatorFilter.php b/inc/classes/main/filter/validator/class_UserNameValidatorFilter.php index 068f80775..456f16a40 100644 --- a/inc/classes/main/filter/validator/class_UserNameValidatorFilter.php +++ b/inc/classes/main/filter/validator/class_UserNameValidatorFilter.php @@ -24,7 +24,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -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 index 000000000..3a4288278 --- /dev/null +++ b/inc/classes/main/helper/login/.htaccess @@ -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 index 000000000..25be6a929 --- /dev/null +++ b/inc/classes/main/helper/login/class_BaseLoginHelper.php @@ -0,0 +1,38 @@ + + * @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 . + */ +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] +?> diff --git a/inc/classes/main/helper/web/class_WebFormHelper.php b/inc/classes/main/helper/web/class_WebFormHelper.php index e71f15137..61a624347 100644 --- a/inc/classes/main/helper/web/class_WebFormHelper.php +++ b/inc/classes/main/helper/web/class_WebFormHelper.php @@ -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("
getConfigInstance()->readConfig('base_url'), $this->getConfigInstance()->readConfig('form_action'), $this->getConfigInstance()->readConfig('form_method'), $this->getConfigInstance()->readConfig('form_target') diff --git a/inc/classes/main/io/class_FileIoStream.php b/inc/classes/main/io/class_FileIoStream.php index 1b57ee661..f3cf60ef1 100644 --- a/inc/classes/main/io/class_FileIoStream.php +++ b/inc/classes/main/io/class_FileIoStream.php @@ -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/main/io/class_FrameworkDirectoryPointer.php b/inc/classes/main/io/class_FrameworkDirectoryPointer.php index 620602375..f9eacc71f 100644 --- a/inc/classes/main/io/class_FrameworkDirectoryPointer.php +++ b/inc/classes/main/io/class_FrameworkDirectoryPointer.php @@ -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/main/io/class_FrameworkFileInputPointer.php b/inc/classes/main/io/class_FrameworkFileInputPointer.php index c86de9a92..25c77cb83 100644 --- a/inc/classes/main/io/class_FrameworkFileInputPointer.php +++ b/inc/classes/main/io/class_FrameworkFileInputPointer.php @@ -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/main/io/class_FrameworkFileOutputPointer.php b/inc/classes/main/io/class_FrameworkFileOutputPointer.php index 73cf90804..5a7acddd6 100644 --- a/inc/classes/main/io/class_FrameworkFileOutputPointer.php +++ b/inc/classes/main/io/class_FrameworkFileOutputPointer.php @@ -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/main/language/class_LanguageSystem.php b/inc/classes/main/language/class_LanguageSystem.php index 19d05972c..eb99cf1e8 100644 --- a/inc/classes/main/language/class_LanguageSystem.php +++ b/inc/classes/main/language/class_LanguageSystem.php @@ -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/output/class_ConsoleOutput.php b/inc/classes/main/output/class_ConsoleOutput.php index e75cf829d..dfba40dce 100644 --- a/inc/classes/main/output/class_ConsoleOutput.php +++ b/inc/classes/main/output/class_ConsoleOutput.php @@ -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/output/class_WebOutput.php b/inc/classes/main/output/class_WebOutput.php index 6c86b6266..5b4f58838 100644 --- a/inc/classes/main/output/class_WebOutput.php +++ b/inc/classes/main/output/class_WebOutput.php @@ -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 index 000000000..3a4288278 --- /dev/null +++ b/inc/classes/main/reader/.htaccess @@ -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 index 000000000..7fa8ff2e6 --- /dev/null +++ b/inc/classes/main/reader/class_DefaultNewsReader.php @@ -0,0 +1,74 @@ + + * @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 . + */ +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] +?> diff --git a/inc/classes/main/registration/class_BaseRegistration.php b/inc/classes/main/registration/class_BaseRegistration.php index 3066d2989..79225300e 100644 --- a/inc/classes/main/registration/class_BaseRegistration.php +++ b/inc/classes/main/registration/class_BaseRegistration.php @@ -3,10 +3,10 @@ * A general registration class * * @author Roland Haeder - * @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 @@ -22,16 +22,6 @@ * along with this program. If not, see . */ 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'); } /** diff --git a/inc/classes/main/registry/class_Registry.php b/inc/classes/main/registry/class_Registry.php index a8abb5092..308e89c72 100644 --- a/inc/classes/main/registry/class_Registry.php +++ b/inc/classes/main/registry/class_Registry.php @@ -3,10 +3,10 @@ * A registry for several data types * * @author Roland Haeder - * @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 diff --git a/inc/classes/main/request/class_HttpRequest.php b/inc/classes/main/request/class_HttpRequest.php index e3bb312f9..b6f9b95f4 100644 --- a/inc/classes/main/request/class_HttpRequest.php +++ b/inc/classes/main/request/class_HttpRequest.php @@ -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] diff --git a/inc/classes/main/resolver/web/class_WebCommandResolver.php b/inc/classes/main/resolver/web/class_WebCommandResolver.php index fa52125d6..f4b87a2b3 100644 --- a/inc/classes/main/resolver/web/class_WebCommandResolver.php +++ b/inc/classes/main/resolver/web/class_WebCommandResolver.php @@ -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)); diff --git a/inc/classes/main/resolver/web/class_WebControllerResolver.php b/inc/classes/main/resolver/web/class_WebControllerResolver.php index b5f66e853..0585196bc 100644 --- a/inc/classes/main/resolver/web/class_WebControllerResolver.php +++ b/inc/classes/main/resolver/web/class_WebControllerResolver.php @@ -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."
\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 diff --git a/inc/classes/main/response/class_HttpResponse.php b/inc/classes/main/response/class_HttpResponse.php index 074373d1e..3fc5d2db1 100644 --- a/inc/classes/main/response/class_HttpResponse.php +++ b/inc/classes/main/response/class_HttpResponse.php @@ -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] diff --git a/inc/classes/main/result/class_DatabaseResult.php b/inc/classes/main/result/class_DatabaseResult.php index 3d48861ba..c6a0b1149 100644 --- a/inc/classes/main/result/class_DatabaseResult.php +++ b/inc/classes/main/result/class_DatabaseResult.php @@ -3,10 +3,10 @@ * A database result class * * @author Roland Haeder - * @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 . */ -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] diff --git a/inc/classes/main/rng/class_RandomNumberGenerator.php b/inc/classes/main/rng/class_RandomNumberGenerator.php index b50af11d8..8875a4ca0 100644 --- a/inc/classes/main/rng/class_RandomNumberGenerator.php +++ b/inc/classes/main/rng/class_RandomNumberGenerator.php @@ -3,10 +3,10 @@ * A standard random number generator * * @author Roland Haeder - * @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 diff --git a/inc/classes/main/template/class_TemplateEngine.php b/inc/classes/main/template/class_TemplateEngine.php index e1c3bcee1..fad4cf4a3 100644 --- a/inc/classes/main/template/class_TemplateEngine.php +++ b/inc/classes/main/template/class_TemplateEngine.php @@ -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 diff --git a/inc/classes/main/user/class_User.php b/inc/classes/main/user/class_User.php index 25e2cc3ff..cc9c44348 100644 --- a/inc/classes/main/user/class_User.php +++ b/inc/classes/main/user/class_User.php @@ -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] diff --git a/inc/classes/middleware/class_BaseMiddleware.php b/inc/classes/middleware/class_BaseMiddleware.php index 3b643540b..472aa8ba7 100644 --- a/inc/classes/middleware/class_BaseMiddleware.php +++ b/inc/classes/middleware/class_BaseMiddleware.php @@ -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/middleware/compressor/class_CompressorChannel.php b/inc/classes/middleware/compressor/class_CompressorChannel.php index b88142642..346538024 100644 --- a/inc/classes/middleware/compressor/class_CompressorChannel.php +++ b/inc/classes/middleware/compressor/class_CompressorChannel.php @@ -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/middleware/database/class_DatabaseConnection.php b/inc/classes/middleware/database/class_DatabaseConnection.php index 0c4280751..fc8ea9135 100644 --- a/inc/classes/middleware/database/class_DatabaseConnection.php +++ b/inc/classes/middleware/database/class_DatabaseConnection.php @@ -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); } } diff --git a/inc/classes/middleware/debug/class_DebugMiddleware.php b/inc/classes/middleware/debug/class_DebugMiddleware.php index 6a6bacff9..1f5e6e0e6 100644 --- a/inc/classes/middleware/debug/class_DebugMiddleware.php +++ b/inc/classes/middleware/debug/class_DebugMiddleware.php @@ -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 diff --git a/inc/classes/middleware/io/class_FileIoHandler.php b/inc/classes/middleware/io/class_FileIoHandler.php index 071e1d6ec..99cb434e1 100644 --- a/inc/classes/middleware/io/class_FileIoHandler.php +++ b/inc/classes/middleware/io/class_FileIoHandler.php @@ -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; diff --git a/inc/config.php b/inc/config.php index ccc1a64e3..50571624a 100644 --- a/inc/config.php +++ b/inc/config.php @@ -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] ?> diff --git a/inc/config/class_FrameworkConfiguration.php b/inc/config/class_FrameworkConfiguration.php index 6bfc3a26c..50a4ac18a 100644 --- a/inc/config/class_FrameworkConfiguration.php +++ b/inc/config/class_FrameworkConfiguration.php @@ -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] diff --git a/inc/config/config-override.php b/inc/config/config-override.php index bdc7d9bd0..b177c57e7 100644 --- a/inc/config/config-override.php +++ b/inc/config/config-override.php @@ -23,8 +23,8 @@ */ // CFG: DEFAULT-APPLICATION -FrameworkConfiguration::getInstance()->setConfigEntry("default_application", "hub"); -FrameworkConfiguration::getInstance()->setConfigEntry("app_name", "hub"); +FrameworkConfiguration::getInstance()->setConfigEntry("default_application", "mxchange"); +FrameworkConfiguration::getInstance()->setConfigEntry("app_name", "mxchange"); // [EOF] ?> diff --git a/inc/database.php b/inc/database.php index 4947dd1f4..8dd90e46d 100644 --- a/inc/database.php +++ b/inc/database.php @@ -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/database/lib-local.php b/inc/database/lib-local.php index e4e36fbee..613d6d2df 100644 --- a/inc/database/lib-local.php +++ b/inc/database/lib-local.php @@ -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/file_io.php b/inc/file_io.php index e9472bbb4..afb41612b 100644 --- a/inc/file_io.php +++ b/inc/file_io.php @@ -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] ?> diff --git a/inc/includes.php b/inc/includes.php index dc603cad1..a9af02b50 100644 --- a/inc/includes.php +++ b/inc/includes.php @@ -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 { diff --git a/inc/loader/class_ClassLoader.php b/inc/loader/class_ClassLoader.php index 869f4c2b2..fa9c771d9 100644 --- a/inc/loader/class_ClassLoader.php +++ b/inc/loader/class_ClassLoader.php @@ -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] diff --git a/inc/output.php b/inc/output.php index 4f07c30c7..35b9359f7 100644 --- a/inc/output.php +++ b/inc/output.php @@ -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(""); -- 2.39.5