]> git.mxchange.org Git - core.git/commitdiff
Now in own repository for remote checkouts
authorRoland Häder <roland@mxchange.org>
Wed, 19 Nov 2008 23:44:34 +0000 (23:44 +0000)
committerRoland Häder <roland@mxchange.org>
Wed, 19 Nov 2008 23:44:34 +0000 (23:44 +0000)
549 files changed:
.gitattributes [new file with mode: 0644]
devel/.htaccess [new file with mode: 0644]
devel/class_Debug.php [new file with mode: 0644]
inc/.htaccess [new file with mode: 0644]
inc/classes.php [new file with mode: 0644]
inc/classes/.htaccess [new file with mode: 0644]
inc/classes/exceptions/.htaccess [new file with mode: 0644]
inc/classes/exceptions/actions/.htaccess [new file with mode: 0644]
inc/classes/exceptions/actions/class_InvalidActionException.php [new file with mode: 0644]
inc/classes/exceptions/auth/.htaccess [new file with mode: 0644]
inc/classes/exceptions/auth/class_UserAuthorizationException.php [new file with mode: 0644]
inc/classes/exceptions/class_ [new file with mode: 0644]
inc/classes/exceptions/class_FrameworkException.php [new file with mode: 0644]
inc/classes/exceptions/compressor/.htaccess [new file with mode: 0644]
inc/classes/exceptions/compressor/class_MismatchingCompressorsException.php [new file with mode: 0644]
inc/classes/exceptions/container/.htaccess [new file with mode: 0644]
inc/classes/exceptions/container/class_ContainerItemIsNoArrayException.php [new file with mode: 0644]
inc/classes/exceptions/container/class_ContainerItemIsNullException.php [new file with mode: 0644]
inc/classes/exceptions/container/class_ContainerMaybeDamagedException.php [new file with mode: 0644]
inc/classes/exceptions/controller/.htaccess [new file with mode: 0644]
inc/classes/exceptions/controller/class_DefaultControllerException.php [new file with mode: 0644]
inc/classes/exceptions/controller/class_InvalidControllerException.php [new file with mode: 0644]
inc/classes/exceptions/criteria/.htaccess [new file with mode: 0644]
inc/classes/exceptions/crypto/.htaccess [new file with mode: 0644]
inc/classes/exceptions/crypto/class_EncryptInvalidLengthException.php [new file with mode: 0644]
inc/classes/exceptions/crypto/class_EncryptMissingException.php [new file with mode: 0644]
inc/classes/exceptions/database/.htaccess [new file with mode: 0644]
inc/classes/exceptions/database/class_ [new file with mode: 0644]
inc/classes/exceptions/database/class_DatabaseException.php [new file with mode: 0644]
inc/classes/exceptions/database/general/.htaccess [new file with mode: 0644]
inc/classes/exceptions/database/general/class_DatabaseUpdateSupportException.php [new file with mode: 0644]
inc/classes/exceptions/database/general/class_SqlException.php [new file with mode: 0644]
inc/classes/exceptions/database/local_file/.htaccess [new file with mode: 0644]
inc/classes/exceptions/database/local_file/class_SavePathIsEmptyException.php [new file with mode: 0644]
inc/classes/exceptions/database/local_file/class_SavePathIsNoDirectoryException.php [new file with mode: 0644]
inc/classes/exceptions/database/local_file/class_SavePathReadProtectedException.php [new file with mode: 0644]
inc/classes/exceptions/database/local_file/class_SavePathWriteProtectedException.php [new file with mode: 0644]
inc/classes/exceptions/database/wrapper/.htaccess [new file with mode: 0644]
inc/classes/exceptions/database/wrapper/class_WrapperUserNameNotFoundException.php [new file with mode: 0644]
inc/classes/exceptions/filter/.htaccess [new file with mode: 0644]
inc/classes/exceptions/filter/class_FilterChainException.php [new file with mode: 0644]
inc/classes/exceptions/helper/.htaccess [new file with mode: 0644]
inc/classes/exceptions/helper/class_FormClosedException.php [new file with mode: 0644]
inc/classes/exceptions/helper/class_FormGroupClosedException.php [new file with mode: 0644]
inc/classes/exceptions/helper/class_FormOpenedException.php [new file with mode: 0644]
inc/classes/exceptions/helper/class_HelperGroupAlreadyCreatedException.php [new file with mode: 0644]
inc/classes/exceptions/helper/class_HelperNoPreviousOpenedSubGroupException.php [new file with mode: 0644]
inc/classes/exceptions/helper/class_HelperSubGroupAlreadyCreatedException.php [new file with mode: 0644]
inc/classes/exceptions/helper/class_InvalidFormNameException.php [new file with mode: 0644]
inc/classes/exceptions/helper/class_NoGroupOpenedException.php [new file with mode: 0644]
inc/classes/exceptions/helper/class_UserInstanceMissingException.php [new file with mode: 0644]
inc/classes/exceptions/io/.htaccess [new file with mode: 0644]
inc/classes/exceptions/io/class_DirPointerNotOpenedException.php [new file with mode: 0644]
inc/classes/exceptions/io/class_FileNotFoundException.php [new file with mode: 0644]
inc/classes/exceptions/io/class_FilePointerNotOpenedException.php [new file with mode: 0644]
inc/classes/exceptions/io/class_FileReadProtectedException.php [new file with mode: 0644]
inc/classes/exceptions/io/class_InvalidDataLengthException.php [new file with mode: 0644]
inc/classes/exceptions/io/class_InvalidDirectoryResourceException.php [new file with mode: 0644]
inc/classes/exceptions/io/class_InvalidMD5ChecksumException.php [new file with mode: 0644]
inc/classes/exceptions/io/class_PathIsEmptyException.php [new file with mode: 0644]
inc/classes/exceptions/io/class_PathIsNoDirectoryException.php [new file with mode: 0644]
inc/classes/exceptions/io/class_PathReadProtectedException.php [new file with mode: 0644]
inc/classes/exceptions/language/.htaccess [new file with mode: 0644]
inc/classes/exceptions/language/class_InvalidLanguagePathStringException.php [new file with mode: 0644]
inc/classes/exceptions/language/class_LanguagePathIsEmptyException.php [new file with mode: 0644]
inc/classes/exceptions/language/class_LanguagePathIsNoDirectoryException.php [new file with mode: 0644]
inc/classes/exceptions/language/class_LanguagePathReadProtectedException.php [new file with mode: 0644]
inc/classes/exceptions/language/class_MissingFileIoHandlerException.php [new file with mode: 0644]
inc/classes/exceptions/language/class_MissingLanguageHandlerException.php [new file with mode: 0644]
inc/classes/exceptions/main/.htaccess [new file with mode: 0644]
inc/classes/exceptions/main/class_AssertionException.php [new file with mode: 0644]
inc/classes/exceptions/main/class_ClassMismatchException.php [new file with mode: 0644]
inc/classes/exceptions/main/class_ClassNotFoundException.php [new file with mode: 0644]
inc/classes/exceptions/main/class_ConfigEntryIsEmptyException.php [new file with mode: 0644]
inc/classes/exceptions/main/class_ConfigEntryNotFoundException.php [new file with mode: 0644]
inc/classes/exceptions/main/class_DimNotFoundInArrayException.php [new file with mode: 0644]
inc/classes/exceptions/main/class_EmptyVariableException.php [new file with mode: 0644]
inc/classes/exceptions/main/class_ExceptionNotFoundException.php [new file with mode: 0644]
inc/classes/exceptions/main/class_FatalErrorException.php [new file with mode: 0644]
inc/classes/exceptions/main/class_GetterNotFoundException.php [new file with mode: 0644]
inc/classes/exceptions/main/class_InvalidArrayCountException.php [new file with mode: 0644]
inc/classes/exceptions/main/class_InvalidCommandException.php [new file with mode: 0644]
inc/classes/exceptions/main/class_InvalidCommandInstanceException.php [new file with mode: 0644]
inc/classes/exceptions/main/class_InvalidInterfaceException.php [new file with mode: 0644]
inc/classes/exceptions/main/class_InvalidObjectException.php [new file with mode: 0644]
inc/classes/exceptions/main/class_MissingArrayElementsException.php [new file with mode: 0644]
inc/classes/exceptions/main/class_MissingDecimalsThousandsSeperatorException.php [new file with mode: 0644]
inc/classes/exceptions/main/class_MissingMethodException.php [new file with mode: 0644]
inc/classes/exceptions/main/class_NoArrayCreatedException.php [new file with mode: 0644]
inc/classes/exceptions/main/class_NoArrayException.php [new file with mode: 0644]
inc/classes/exceptions/main/class_NoObjectException.php [new file with mode: 0644]
inc/classes/exceptions/main/class_NullPointerException.php [new file with mode: 0644]
inc/classes/exceptions/main/class_ResponseHeadersAlreadySentException.php [new file with mode: 0644]
inc/classes/exceptions/main/class_VariableIsNotSetException.php [new file with mode: 0644]
inc/classes/exceptions/result/.htaccess [new file with mode: 0644]
inc/classes/exceptions/result/class_InvalidDatabaseResultException.php [new file with mode: 0644]
inc/classes/exceptions/result/class_ResultUpdateException.php [new file with mode: 0644]
inc/classes/exceptions/template/.htaccess [new file with mode: 0644]
inc/classes/exceptions/template/class_BasePathIsEmptyException.php [new file with mode: 0644]
inc/classes/exceptions/template/class_BasePathIsNoDirectoryException.php [new file with mode: 0644]
inc/classes/exceptions/template/class_BasePathReadProtectedException.php [new file with mode: 0644]
inc/classes/exceptions/template/class_InvalidBasePathStringException.php [new file with mode: 0644]
inc/classes/exceptions/template/class_UnexpectedTemplateTypeException.php [new file with mode: 0644]
inc/classes/exceptions/template/class_UnsupportedTemplateEngineException.php [new file with mode: 0644]
inc/classes/exceptions/template/class_ViewHelperNotFoundException.php [new file with mode: 0644]
inc/classes/exceptions/user/.htaccess [new file with mode: 0644]
inc/classes/exceptions/user/class_AccountPasswordMismatchException.php [new file with mode: 0644]
inc/classes/exceptions/user/class_UserEmailMissingException.php [new file with mode: 0644]
inc/classes/exceptions/user/class_UserPasswordMismatchException.php [new file with mode: 0644]
inc/classes/exceptions/user/class_UsernameMissingException.php [new file with mode: 0644]
inc/classes/exceptions/xml/.htaccess [new file with mode: 0644]
inc/classes/exceptions/xml/class_InvalidXmlNodeException.php [new file with mode: 0644]
inc/classes/exceptions/xml/class_XmlNodeMismatchException.php [new file with mode: 0644]
inc/classes/exceptions/xml/class_XmlParserException.php [new file with mode: 0644]
inc/classes/interfaces/.htaccess [new file with mode: 0644]
inc/classes/interfaces/actions/.htaccess [new file with mode: 0644]
inc/classes/interfaces/actions/class_PerformableAction.php [new file with mode: 0644]
inc/classes/interfaces/actions/commands/.htaccess [new file with mode: 0644]
inc/classes/interfaces/actions/commands/class_Commandable.php [new file with mode: 0644]
inc/classes/interfaces/application/.htaccess [new file with mode: 0644]
inc/classes/interfaces/application/class_ManageableApplication.php [new file with mode: 0644]
inc/classes/interfaces/auth/.htaccess [new file with mode: 0644]
inc/classes/interfaces/auth/class_Authorizeable.php [new file with mode: 0644]
inc/classes/interfaces/cache/.htaccess [new file with mode: 0644]
inc/classes/interfaces/cache/class_Cacheable.php [new file with mode: 0644]
inc/classes/interfaces/captcha/.htaccess [new file with mode: 0644]
inc/classes/interfaces/captcha/class_SolveableCaptcha.php [new file with mode: 0644]
inc/classes/interfaces/class_ [new file with mode: 0644]
inc/classes/interfaces/class_FrameworkInterface.php [new file with mode: 0644]
inc/classes/interfaces/compressor/.htaccess [new file with mode: 0644]
inc/classes/interfaces/compressor/class_Compressor.php [new file with mode: 0644]
inc/classes/interfaces/controller/.htaccess [new file with mode: 0644]
inc/classes/interfaces/controller/class_Controller.php [new file with mode: 0644]
inc/classes/interfaces/criteria/.htaccess [new file with mode: 0644]
inc/classes/interfaces/criteria/class_Criteria.php [new file with mode: 0644]
inc/classes/interfaces/criteria/extended/.htaccess [new file with mode: 0644]
inc/classes/interfaces/criteria/extended/class_LocalSearchCriteria.php [new file with mode: 0644]
inc/classes/interfaces/criteria/extended/class_LocalUpdateCriteria.php [new file with mode: 0644]
inc/classes/interfaces/criteria/extended/class_StoreableCriteria.php [new file with mode: 0644]
inc/classes/interfaces/crypto/.htaccess [new file with mode: 0644]
inc/classes/interfaces/crypto/class_Cryptable.php [new file with mode: 0644]
inc/classes/interfaces/database/.htaccess [new file with mode: 0644]
inc/classes/interfaces/database/class_FrameworkDatabaseInterface.php [new file with mode: 0644]
inc/classes/interfaces/database/class_Updateable.php [new file with mode: 0644]
inc/classes/interfaces/database/frontend/.htaccess [new file with mode: 0644]
inc/classes/interfaces/database/frontend/class_DatabaseFrontendInterface.php [new file with mode: 0644]
inc/classes/interfaces/database/middleware/.htaccess [new file with mode: 0644]
inc/classes/interfaces/database/middleware/class_DatabaseConnector.php [new file with mode: 0644]
inc/classes/interfaces/debug/.htaccess [new file with mode: 0644]
inc/classes/interfaces/debug/class_Debugger.php [new file with mode: 0644]
inc/classes/interfaces/discovery/.htaccess [new file with mode: 0644]
inc/classes/interfaces/discovery/class_Discoverable.php [new file with mode: 0644]
inc/classes/interfaces/filter/.htaccess [new file with mode: 0644]
inc/classes/interfaces/filter/class_Filterable.php [new file with mode: 0644]
inc/classes/interfaces/helper/.htaccess [new file with mode: 0644]
inc/classes/interfaces/helper/class_HelpableLogin.php [new file with mode: 0644]
inc/classes/interfaces/helper/class_HelpableTemplate.php [new file with mode: 0644]
inc/classes/interfaces/io/.htaccess [new file with mode: 0644]
inc/classes/interfaces/io/class_Streamable.php [new file with mode: 0644]
inc/classes/interfaces/io/file/.htaccess [new file with mode: 0644]
inc/classes/interfaces/io/file/class_FileInputStreamer.php [new file with mode: 0644]
inc/classes/interfaces/io/file/class_FileOutputStreamer.php [new file with mode: 0644]
inc/classes/interfaces/io/output/.htaccess [new file with mode: 0644]
inc/classes/interfaces/io/output/class_OutputStreamer.php [new file with mode: 0644]
inc/classes/interfaces/language/.htaccess [new file with mode: 0644]
inc/classes/interfaces/language/class_ManageableLanguage.php [new file with mode: 0644]
inc/classes/interfaces/login/.htaccess [new file with mode: 0644]
inc/classes/interfaces/login/class_LoginableUser.php [new file with mode: 0644]
inc/classes/interfaces/mailer/.htaccess [new file with mode: 0644]
inc/classes/interfaces/mailer/class_DeliverableMail.php [new file with mode: 0644]
inc/classes/interfaces/reader/.htaccess [new file with mode: 0644]
inc/classes/interfaces/reader/class_ReadableNews.php [new file with mode: 0644]
inc/classes/interfaces/registration/.htaccess [new file with mode: 0644]
inc/classes/interfaces/registration/class_UserRegister.php [new file with mode: 0644]
inc/classes/interfaces/registry/.htaccess [new file with mode: 0644]
inc/classes/interfaces/registry/class_Register.php [new file with mode: 0644]
inc/classes/interfaces/registry/class_Registerable.php [new file with mode: 0644]
inc/classes/interfaces/request/.htaccess [new file with mode: 0644]
inc/classes/interfaces/request/class_Requestable.php [new file with mode: 0644]
inc/classes/interfaces/resolver/.htaccess [new file with mode: 0644]
inc/classes/interfaces/resolver/actions/.htaccess [new file with mode: 0644]
inc/classes/interfaces/resolver/actions/class_ActionResolver.php [new file with mode: 0644]
inc/classes/interfaces/resolver/class_Resolver.php [new file with mode: 0644]
inc/classes/interfaces/resolver/commands/.htaccess [new file with mode: 0644]
inc/classes/interfaces/resolver/commands/class_CommandResolver.php [new file with mode: 0644]
inc/classes/interfaces/resolver/controller/.htaccess [new file with mode: 0644]
inc/classes/interfaces/resolver/controller/class_ControllerResolver.php [new file with mode: 0644]
inc/classes/interfaces/response/.htaccess [new file with mode: 0644]
inc/classes/interfaces/response/class_Responseable.php [new file with mode: 0644]
inc/classes/interfaces/result/.htaccess [new file with mode: 0644]
inc/classes/interfaces/result/class_SearchableResult.php [new file with mode: 0644]
inc/classes/interfaces/result/class_UpdateableResult.php [new file with mode: 0644]
inc/classes/interfaces/template/.htaccess [new file with mode: 0644]
inc/classes/interfaces/template/class_CompileableTemplate.php [new file with mode: 0644]
inc/classes/interfaces/template/view/class_ViewHelper.php [new file with mode: 0644]
inc/classes/interfaces/user/.htaccess [new file with mode: 0644]
inc/classes/interfaces/user/class_ManageableAccount.php [new file with mode: 0644]
inc/classes/interfaces/user/extended/.htaccess [new file with mode: 0644]
inc/classes/interfaces/user/extended/class_ManageableGuest.php [new file with mode: 0644]
inc/classes/interfaces/user/extended/class_ManageableMember.php [new file with mode: 0644]
inc/classes/main/.htaccess [new file with mode: 0644]
inc/classes/main/actions/.htaccess [new file with mode: 0644]
inc/classes/main/actions/class_ [new file with mode: 0644]
inc/classes/main/actions/class_BaseAction.php [new file with mode: 0644]
inc/classes/main/actions/post_registration/.htaccess [new file with mode: 0644]
inc/classes/main/actions/post_registration/class_LoginAfterRegistrationAction.php [new file with mode: 0644]
inc/classes/main/actions/web/.htaccess [new file with mode: 0644]
inc/classes/main/actions/web/class_WebLoginProfileAction.php [new file with mode: 0644]
inc/classes/main/application/.htaccess [new file with mode: 0644]
inc/classes/main/application/class_BaseApplication.php [new file with mode: 0644]
inc/classes/main/auth/.htaccess [new file with mode: 0644]
inc/classes/main/auth/class_CookieAuth.php [new file with mode: 0644]
inc/classes/main/cache/.htaccess [new file with mode: 0644]
inc/classes/main/cache/class_MemoryCache.php [new file with mode: 0644]
inc/classes/main/class_ [new file with mode: 0644]
inc/classes/main/class_Base [new file with mode: 0644]
inc/classes/main/class_BaseFrameworkSystem.php [new file with mode: 0644]
inc/classes/main/class_FrameworkArrayObject.php [new file with mode: 0644]
inc/classes/main/commands/.htaccess [new file with mode: 0644]
inc/classes/main/commands/class_ [new file with mode: 0644]
inc/classes/main/commands/class_BaseCommand.php [new file with mode: 0644]
inc/classes/main/commands/image/.htaccess [new file with mode: 0644]
inc/classes/main/commands/image/class_ImageCodeCaptchaCommand.php [new file with mode: 0644]
inc/classes/main/commands/web/.htaccess [new file with mode: 0644]
inc/classes/main/commands/web/class_ [new file with mode: 0644]
inc/classes/main/commands/web/class_WebConfirmCommand.php [new file with mode: 0644]
inc/classes/main/commands/web/class_WebDoFormCommand.php [new file with mode: 0644]
inc/classes/main/commands/web/class_WebHomeCommand.php [new file with mode: 0644]
inc/classes/main/commands/web/class_WebLoginAreaCommand.php [new file with mode: 0644]
inc/classes/main/commands/web/class_WebLoginCommand.php [new file with mode: 0644]
inc/classes/main/commands/web/class_WebLoginFailedCommand.php [new file with mode: 0644]
inc/classes/main/commands/web/class_WebLogoutCommand.php [new file with mode: 0644]
inc/classes/main/commands/web/class_WebLogoutDoneCommand.php [new file with mode: 0644]
inc/classes/main/commands/web/class_WebRegisterCommand.php [new file with mode: 0644]
inc/classes/main/commands/web/class_WebResendLinkCommand.php [new file with mode: 0644]
inc/classes/main/compressor/.htaccess [new file with mode: 0644]
inc/classes/main/compressor/class_Bzip2Compressor.php [new file with mode: 0644]
inc/classes/main/compressor/class_GzipCompressor.php [new file with mode: 0644]
inc/classes/main/compressor/class_NullCompressor.php [new file with mode: 0644]
inc/classes/main/console/.htaccess [new file with mode: 0644]
inc/classes/main/console/class_ConsoleTools.php [new file with mode: 0644]
inc/classes/main/controller/.htaccess [new file with mode: 0644]
inc/classes/main/controller/captcha/.htaccess [new file with mode: 0644]
inc/classes/main/controller/captcha/class_ImageCodeCaptchaController.php [new file with mode: 0644]
inc/classes/main/controller/class_ [new file with mode: 0644]
inc/classes/main/controller/class_BaseController.php [new file with mode: 0644]
inc/classes/main/controller/form/.htaccess [new file with mode: 0644]
inc/classes/main/controller/form/class_WebDoFormController.php [new file with mode: 0644]
inc/classes/main/controller/image/.htaccess [new file with mode: 0644]
inc/classes/main/controller/image/class_ImageDefaultController.php [new file with mode: 0644]
inc/classes/main/controller/login/.htaccess [new file with mode: 0644]
inc/classes/main/controller/login/class_WebLoginAreaController.php [new file with mode: 0644]
inc/classes/main/controller/web/.htaccess [new file with mode: 0644]
inc/classes/main/controller/web/class_ [new file with mode: 0644]
inc/classes/main/controller/web/class_WebConfirmController.php [new file with mode: 0644]
inc/classes/main/controller/web/class_WebDefaultController.php [new file with mode: 0644]
inc/classes/main/controller/web/class_WebDefaultNewsController.php [new file with mode: 0644]
inc/classes/main/controller/web/class_WebLoginController.php [new file with mode: 0644]
inc/classes/main/controller/web/class_WebLoginFailedController.php [new file with mode: 0644]
inc/classes/main/controller/web/class_WebLogoutController.php [new file with mode: 0644]
inc/classes/main/controller/web/class_WebLogoutDoneController.php [new file with mode: 0644]
inc/classes/main/controller/web/class_WebRegisterController.php [new file with mode: 0644]
inc/classes/main/controller/web/class_WebStatusController.php [new file with mode: 0644]
inc/classes/main/criteria/.htaccess [new file with mode: 0644]
inc/classes/main/criteria/class_DataSetCriteria.php [new file with mode: 0644]
inc/classes/main/criteria/class_SearchCriteria.php [new file with mode: 0644]
inc/classes/main/criteria/class_UpdateCriteria.php [new file with mode: 0644]
inc/classes/main/crypto/.htaccess [new file with mode: 0644]
inc/classes/main/crypto/class_CryptoHelper.php [new file with mode: 0644]
inc/classes/main/database/.htaccess [new file with mode: 0644]
inc/classes/main/database/class_ [new file with mode: 0644]
inc/classes/main/database/class_BaseDatabaseFrontend.php [new file with mode: 0644]
inc/classes/main/database/class_BaseDatabaseWrapper.php [new file with mode: 0644]
inc/classes/main/database/databases/.htaccess [new file with mode: 0644]
inc/classes/main/database/databases/class_LocalFileDatabase.php [new file with mode: 0644]
inc/classes/main/database/wrapper/.htaccess [new file with mode: 0644]
inc/classes/main/database/wrapper/class_NewsDatabaseWrapper.php [new file with mode: 0644]
inc/classes/main/database/wrapper/class_PaymentsDatabaseWrapper.php [new file with mode: 0644]
inc/classes/main/database/wrapper/class_UserDatabaseWrapper.php [new file with mode: 0644]
inc/classes/main/database/wrapper/class_UserPointsDatabaseWrapper.php [new file with mode: 0644]
inc/classes/main/debug/.htaccess [new file with mode: 0644]
inc/classes/main/debug/class_DebugConsoleOutput.php [new file with mode: 0644]
inc/classes/main/debug/class_DebugErrorLogOutput.php [new file with mode: 0644]
inc/classes/main/debug/class_DebugWebOutput.php [new file with mode: 0644]
inc/classes/main/discovery/.htaccess [new file with mode: 0644]
inc/classes/main/discovery/class_ [new file with mode: 0644]
inc/classes/main/discovery/class_BaseDiscovery.php [new file with mode: 0644]
inc/classes/main/discovery/payment/.htaccess [new file with mode: 0644]
inc/classes/main/discovery/payment/class_LocalPaymentDiscovery.php [new file with mode: 0644]
inc/classes/main/factories/.htaccess [new file with mode: 0644]
inc/classes/main/factories/cache/.htaccess [new file with mode: 0644]
inc/classes/main/factories/cache/class_CacheFactory.php [new file with mode: 0644]
inc/classes/main/factories/class_BaseFactory.php [new file with mode: 0644]
inc/classes/main/factories/objects/.htaccess [new file with mode: 0644]
inc/classes/main/factories/objects/class_ObjectFactory.php [new file with mode: 0644]
inc/classes/main/factories/web/.htaccess [new file with mode: 0644]
inc/classes/main/factories/web/class_WebNewsFactory.php [new file with mode: 0644]
inc/classes/main/filter/.htaccess [new file with mode: 0644]
inc/classes/main/filter/auth/.htaccess [new file with mode: 0644]
inc/classes/main/filter/auth/class_UserAuthFilter.php [new file with mode: 0644]
inc/classes/main/filter/change/.htaccess [new file with mode: 0644]
inc/classes/main/filter/change/class_EmailChangeFilter.php [new file with mode: 0644]
inc/classes/main/filter/change/class_PasswordChangeFilter.php [new file with mode: 0644]
inc/classes/main/filter/checkboxes/.htaccess [new file with mode: 0644]
inc/classes/main/filter/checkboxes/class_RulesAcceptedFilter.php [new file with mode: 0644]
inc/classes/main/filter/class_ [new file with mode: 0644]
inc/classes/main/filter/class_AbstractFilterDecorator.php [new file with mode: 0644]
inc/classes/main/filter/class_BaseFilter.php [new file with mode: 0644]
inc/classes/main/filter/class_FilterChain.php [new file with mode: 0644]
inc/classes/main/filter/crypto/.htaccess [new file with mode: 0644]
inc/classes/main/filter/crypto/class_CaptchaEncryptFilter.php [new file with mode: 0644]
inc/classes/main/filter/decorator/.htaccess [new file with mode: 0644]
inc/classes/main/filter/guest/.htaccess [new file with mode: 0644]
inc/classes/main/filter/guest/class_UserNameIsGuestFilter.php [new file with mode: 0644]
inc/classes/main/filter/news/.htaccess [new file with mode: 0644]
inc/classes/main/filter/news/class_NewsDownloadFilter.php [new file with mode: 0644]
inc/classes/main/filter/news/class_NewsProcessFilter.php [new file with mode: 0644]
inc/classes/main/filter/null/.htaccess [new file with mode: 0644]
inc/classes/main/filter/null/class_NullFilter.php [new file with mode: 0644]
inc/classes/main/filter/payment/.htaccess [new file with mode: 0644]
inc/classes/main/filter/payment/class_PaymentDiscoveryFilter.php [new file with mode: 0644]
inc/classes/main/filter/update/.htaccess [new file with mode: 0644]
inc/classes/main/filter/update/class_UserStatusConfimedUpdateFilter.php [new file with mode: 0644]
inc/classes/main/filter/update/class_UserUpdateFilter.php [new file with mode: 0644]
inc/classes/main/filter/validator/.htaccess [new file with mode: 0644]
inc/classes/main/filter/validator/class_EmailValidatorFilter.php [new file with mode: 0644]
inc/classes/main/filter/validator/class_PasswordValidatorFilter.php [new file with mode: 0644]
inc/classes/main/filter/validator/class_UserNameValidatorFilter.php [new file with mode: 0644]
inc/classes/main/filter/verifier/.htaccess [new file with mode: 0644]
inc/classes/main/filter/verifier/class_AccountPasswordVerifierFilter.php [new file with mode: 0644]
inc/classes/main/filter/verifier/class_ConfirmCodeVerifierFilter.php [new file with mode: 0644]
inc/classes/main/filter/verifier/class_GraphicalCodeCaptchaVerifierFilter.php [new file with mode: 0644]
inc/classes/main/filter/verifier/class_PasswordGuestVerifierFilter.php [new file with mode: 0644]
inc/classes/main/filter/verifier/class_PasswordVerifierFilter.php [new file with mode: 0644]
inc/classes/main/filter/verifier/class_UserGuestVerifierFilter.php [new file with mode: 0644]
inc/classes/main/filter/verifier/class_UserNameVerifierFilter.php [new file with mode: 0644]
inc/classes/main/filter/verifier/class_UserStatusVerifierFilter.php [new file with mode: 0644]
inc/classes/main/filter/verifier/class_UserUnconfirmedVerifierFilter.php [new file with mode: 0644]
inc/classes/main/helper/.htaccess [new file with mode: 0644]
inc/classes/main/helper/captcha/.htaccess [new file with mode: 0644]
inc/classes/main/helper/captcha/class_ [new file with mode: 0644]
inc/classes/main/helper/captcha/class_BaseCaptcha.php [new file with mode: 0644]
inc/classes/main/helper/captcha/images/.htaccess [new file with mode: 0644]
inc/classes/main/helper/captcha/images/class_ImageHelper.php [new file with mode: 0644]
inc/classes/main/helper/captcha/web/.htaccess [new file with mode: 0644]
inc/classes/main/helper/captcha/web/class_GraphicalCodeCaptcha.php [new file with mode: 0644]
inc/classes/main/helper/class_ [new file with mode: 0644]
inc/classes/main/helper/class_BaseHelper.php [new file with mode: 0644]
inc/classes/main/helper/login/.htaccess [new file with mode: 0644]
inc/classes/main/helper/login/class_BaseLoginHelper.php [new file with mode: 0644]
inc/classes/main/helper/web/.htaccess [new file with mode: 0644]
inc/classes/main/helper/web/blocks/.htaccess [new file with mode: 0644]
inc/classes/main/helper/web/blocks/class_WebBlockHelper.php [new file with mode: 0644]
inc/classes/main/helper/web/class_ [new file with mode: 0644]
inc/classes/main/helper/web/class_BaseWebHelper.php [new file with mode: 0644]
inc/classes/main/helper/web/forms/.htaccess [new file with mode: 0644]
inc/classes/main/helper/web/forms/class_WebFormHelper.php [new file with mode: 0644]
inc/classes/main/helper/web/links/.htaccess [new file with mode: 0644]
inc/classes/main/helper/web/links/class_WebLinkHelper.php [new file with mode: 0644]
inc/classes/main/images/.htaccess [new file with mode: 0644]
inc/classes/main/images/class_ [new file with mode: 0644]
inc/classes/main/images/class_BaseImage.php [new file with mode: 0644]
inc/classes/main/images/extended/.htaccess [new file with mode: 0644]
inc/classes/main/images/extended/class_PngImage.php [new file with mode: 0644]
inc/classes/main/io/.htaccess [new file with mode: 0644]
inc/classes/main/io/class_FileIoStream.php [new file with mode: 0644]
inc/classes/main/io/class_FrameworkDirectoryPointer.php [new file with mode: 0644]
inc/classes/main/io/class_FrameworkFileInputPointer.php [new file with mode: 0644]
inc/classes/main/io/class_FrameworkFileOutputPointer.php [new file with mode: 0644]
inc/classes/main/language/.htaccess [new file with mode: 0644]
inc/classes/main/language/class_LanguageSystem.php [new file with mode: 0644]
inc/classes/main/mailer/.htaccess [new file with mode: 0644]
inc/classes/main/mailer/class_ [new file with mode: 0644]
inc/classes/main/mailer/class_BaseMailer.php [new file with mode: 0644]
inc/classes/main/mailer/debug/.htaccess [new file with mode: 0644]
inc/classes/main/mailer/debug/class_DebugMailer.php [new file with mode: 0644]
inc/classes/main/output/.htaccess [new file with mode: 0644]
inc/classes/main/output/class_ConsoleOutput.php [new file with mode: 0644]
inc/classes/main/output/class_WebOutput.php [new file with mode: 0644]
inc/classes/main/points/.htaccess [new file with mode: 0644]
inc/classes/main/points/class_UserPoints.php [new file with mode: 0644]
inc/classes/main/reader/.htaccess [new file with mode: 0644]
inc/classes/main/reader/class_DefaultNewsReader.php [new file with mode: 0644]
inc/classes/main/registration/.htaccess [new file with mode: 0644]
inc/classes/main/registration/class_BaseRegistration.php [new file with mode: 0644]
inc/classes/main/registry/.htaccess [new file with mode: 0644]
inc/classes/main/registry/class_Registry.php [new file with mode: 0644]
inc/classes/main/request/.htaccess [new file with mode: 0644]
inc/classes/main/request/class_HttpRequest.php [new file with mode: 0644]
inc/classes/main/resolver/.htaccess [new file with mode: 0644]
inc/classes/main/resolver/action/.htaccess [new file with mode: 0644]
inc/classes/main/resolver/action/class_BaseActionResolver.php [new file with mode: 0644]
inc/classes/main/resolver/action/web/.htaccess [new file with mode: 0644]
inc/classes/main/resolver/action/web/class_WebActionResolver.php [new file with mode: 0644]
inc/classes/main/resolver/class_BaseResolver.php [new file with mode: 0644]
inc/classes/main/resolver/command/.htaccess [new file with mode: 0644]
inc/classes/main/resolver/command/class_BaseCommandResolver.php [new file with mode: 0644]
inc/classes/main/resolver/command/image/.htaccess [new file with mode: 0644]
inc/classes/main/resolver/command/image/class_ImageCommandResolver.php [new file with mode: 0644]
inc/classes/main/resolver/command/web/.htaccess [new file with mode: 0644]
inc/classes/main/resolver/command/web/class_ [new file with mode: 0644]
inc/classes/main/resolver/command/web/class_WebCommandResolver.php [new file with mode: 0644]
inc/classes/main/resolver/controller/.htaccess [new file with mode: 0644]
inc/classes/main/resolver/controller/class_BaseControllerResolver.php [new file with mode: 0644]
inc/classes/main/resolver/controller/image/.htaccess [new file with mode: 0644]
inc/classes/main/resolver/controller/image/class_ImageControllerResolver.php [new file with mode: 0644]
inc/classes/main/resolver/controller/web/.htaccess [new file with mode: 0644]
inc/classes/main/resolver/controller/web/class_WebControllerResolver.php [new file with mode: 0644]
inc/classes/main/response/.htaccess [new file with mode: 0644]
inc/classes/main/response/class_BaseResponse.php [new file with mode: 0644]
inc/classes/main/response/http/.htaccess [new file with mode: 0644]
inc/classes/main/response/http/class_HttpResponse.php [new file with mode: 0644]
inc/classes/main/response/image/.htaccess [new file with mode: 0644]
inc/classes/main/response/image/class_ImageResponse.php [new file with mode: 0644]
inc/classes/main/result/.htaccess [new file with mode: 0644]
inc/classes/main/result/class_DatabaseResult.php [new file with mode: 0644]
inc/classes/main/rng/.htaccess [new file with mode: 0644]
inc/classes/main/rng/class_RandomNumberGenerator.php [new file with mode: 0644]
inc/classes/main/template/.htaccess [new file with mode: 0644]
inc/classes/main/template/class_BaseTemplateEngine.php [new file with mode: 0644]
inc/classes/main/template/image/.htaccess [new file with mode: 0644]
inc/classes/main/template/image/class_ImageTemplateEngine.php [new file with mode: 0644]
inc/classes/main/template/mail/.htaccess [new file with mode: 0644]
inc/classes/main/template/mail/class_MailTemplateEngine.php [new file with mode: 0644]
inc/classes/main/template/web/.htaccess [new file with mode: 0644]
inc/classes/main/template/web/class_WebTemplateEngine.php [new file with mode: 0644]
inc/classes/main/user/.htaccess [new file with mode: 0644]
inc/classes/main/user/class_BaseUser.php [new file with mode: 0644]
inc/classes/main/user/guest/.htaccess [new file with mode: 0644]
inc/classes/main/user/guest/class_Guest.php [new file with mode: 0644]
inc/classes/main/user/member/.htaccess [new file with mode: 0644]
inc/classes/main/user/member/class_Member.php [new file with mode: 0644]
inc/classes/middleware/.htaccess [new file with mode: 0644]
inc/classes/middleware/class_BaseMiddleware.php [new file with mode: 0644]
inc/classes/middleware/compressor/.htaccess [new file with mode: 0644]
inc/classes/middleware/compressor/class_CompressorChannel.php [new file with mode: 0644]
inc/classes/middleware/database/.htaccess [new file with mode: 0644]
inc/classes/middleware/database/class_DatabaseConnection.php [new file with mode: 0644]
inc/classes/middleware/debug/.htaccess [new file with mode: 0644]
inc/classes/middleware/debug/class_DebugMiddleware.php [new file with mode: 0644]
inc/classes/middleware/io/.htaccess [new file with mode: 0644]
inc/classes/middleware/io/class_FileIoHandler.php [new file with mode: 0644]
inc/classes/third_party/.htaccess [new file with mode: 0644]
inc/classes/third_party/akismet/.htaccess [new file with mode: 0644]
inc/classes/third_party/akismet/akismet.class.php [new file with mode: 0644]
inc/classes/third_party/api/.htaccess [new file with mode: 0644]
inc/classes/third_party/api/primusportal/.htaccess [new file with mode: 0644]
inc/classes/third_party/api/primusportal/class_PrimeraApi.php [new file with mode: 0644]
inc/classes/third_party/api/wernisportal/.htaccess [new file with mode: 0644]
inc/classes/third_party/api/wernisportal/class_WernisApi.php [new file with mode: 0644]
inc/classes/third_party/php_mailer/.htaccess [new file with mode: 0644]
inc/classes/third_party/php_mailer/ChangeLog.txt [new file with mode: 0644]
inc/classes/third_party/php_mailer/LICENSE [new file with mode: 0644]
inc/classes/third_party/php_mailer/README [new file with mode: 0644]
inc/classes/third_party/php_mailer/class.phpmailer.php [new file with mode: 0644]
inc/classes/third_party/php_mailer/class.pop3.php [new file with mode: 0644]
inc/classes/third_party/php_mailer/class.smtp.php [new file with mode: 0644]
inc/classes/third_party/php_mailer/docs/extending.html [new file with mode: 0644]
inc/classes/third_party/php_mailer/docs/faq.html [new file with mode: 0644]
inc/classes/third_party/php_mailer/docs/pop3_article.txt [new file with mode: 0644]
inc/classes/third_party/php_mailer/docs/use_gmail.txt [new file with mode: 0644]
inc/classes/third_party/php_mailer/examples/contents.html [new file with mode: 0644]
inc/classes/third_party/php_mailer/examples/images/bkgrnd.gif [new file with mode: 0644]
inc/classes/third_party/php_mailer/examples/images/phpmailer.gif [new file with mode: 0644]
inc/classes/third_party/php_mailer/examples/images/phpmailer.png [new file with mode: 0644]
inc/classes/third_party/php_mailer/examples/images/phpmailer_mini.gif [new file with mode: 0644]
inc/classes/third_party/php_mailer/examples/index.html [new file with mode: 0644]
inc/classes/third_party/php_mailer/examples/pop3_before_smtp_test.php [new file with mode: 0644]
inc/classes/third_party/php_mailer/examples/test_gmail.php [new file with mode: 0644]
inc/classes/third_party/php_mailer/examples/test_mail.php [new file with mode: 0644]
inc/classes/third_party/php_mailer/examples/test_sendmail.php [new file with mode: 0644]
inc/classes/third_party/php_mailer/examples/test_smtp.php [new file with mode: 0644]
inc/classes/third_party/php_mailer/language/.htaccess [new file with mode: 0644]
inc/classes/third_party/php_mailer/language/phpmailer.lang-br.php [new file with mode: 0644]
inc/classes/third_party/php_mailer/language/phpmailer.lang-ca.php [new file with mode: 0644]
inc/classes/third_party/php_mailer/language/phpmailer.lang-cz.php [new file with mode: 0644]
inc/classes/third_party/php_mailer/language/phpmailer.lang-de.php [new file with mode: 0644]
inc/classes/third_party/php_mailer/language/phpmailer.lang-dk.php [new file with mode: 0644]
inc/classes/third_party/php_mailer/language/phpmailer.lang-en.php [new file with mode: 0644]
inc/classes/third_party/php_mailer/language/phpmailer.lang-es.php [new file with mode: 0644]
inc/classes/third_party/php_mailer/language/phpmailer.lang-et.php [new file with mode: 0644]
inc/classes/third_party/php_mailer/language/phpmailer.lang-fi.php [new file with mode: 0644]
inc/classes/third_party/php_mailer/language/phpmailer.lang-fo.php [new file with mode: 0644]
inc/classes/third_party/php_mailer/language/phpmailer.lang-fr.php [new file with mode: 0644]
inc/classes/third_party/php_mailer/language/phpmailer.lang-hu.php [new file with mode: 0644]
inc/classes/third_party/php_mailer/language/phpmailer.lang-it.php [new file with mode: 0644]
inc/classes/third_party/php_mailer/language/phpmailer.lang-ja.php [new file with mode: 0644]
inc/classes/third_party/php_mailer/language/phpmailer.lang-nl.php [new file with mode: 0644]
inc/classes/third_party/php_mailer/language/phpmailer.lang-no.php [new file with mode: 0644]
inc/classes/third_party/php_mailer/language/phpmailer.lang-pl.php [new file with mode: 0644]
inc/classes/third_party/php_mailer/language/phpmailer.lang-ro.php [new file with mode: 0644]
inc/classes/third_party/php_mailer/language/phpmailer.lang-ru.php [new file with mode: 0644]
inc/classes/third_party/php_mailer/language/phpmailer.lang-se.php [new file with mode: 0644]
inc/classes/third_party/php_mailer/language/phpmailer.lang-tr.php [new file with mode: 0644]
inc/classes/third_party/php_mailer/phpdoc/PHPMailer/PHPMailer.html [new file with mode: 0644]
inc/classes/third_party/php_mailer/phpdoc/PHPMailer/SMTP.html [new file with mode: 0644]
inc/classes/third_party/php_mailer/phpdoc/PHPMailer/_class_phpmailer_php.html [new file with mode: 0644]
inc/classes/third_party/php_mailer/phpdoc/PHPMailer/_class_smtp_php.html [new file with mode: 0644]
inc/classes/third_party/php_mailer/phpdoc/blank.html [new file with mode: 0644]
inc/classes/third_party/php_mailer/phpdoc/classtrees_PHPMailer.html [new file with mode: 0644]
inc/classes/third_party/php_mailer/phpdoc/elementindex.html [new file with mode: 0644]
inc/classes/third_party/php_mailer/phpdoc/elementindex_PHPMailer.html [new file with mode: 0644]
inc/classes/third_party/php_mailer/phpdoc/errors.html [new file with mode: 0644]
inc/classes/third_party/php_mailer/phpdoc/index.html [new file with mode: 0644]
inc/classes/third_party/php_mailer/phpdoc/li_PHPMailer.html [new file with mode: 0644]
inc/classes/third_party/php_mailer/phpdoc/media/banner.css [new file with mode: 0644]
inc/classes/third_party/php_mailer/phpdoc/media/stylesheet.css [new file with mode: 0644]
inc/classes/third_party/php_mailer/phpdoc/packages.html [new file with mode: 0644]
inc/classes/third_party/php_mailer/test/phpmailer_test.php [new file with mode: 0644]
inc/classes/third_party/php_mailer/test/phpunit.php [new file with mode: 0644]
inc/classes/third_party/php_mailer/test/test.png [new file with mode: 0644]
inc/config.php [new file with mode: 0644]
inc/config/.htaccess [new file with mode: 0644]
inc/config/class_FrameworkConfiguration.php [new file with mode: 0644]
inc/config/config-hubmaster.php [new file with mode: 0644]
inc/database.php [new file with mode: 0644]
inc/database/.htaccess [new file with mode: 0644]
inc/database/lib-local.php [new file with mode: 0644]
inc/file_io.php [new file with mode: 0644]
inc/includes.php [new file with mode: 0644]
inc/language.php [new file with mode: 0644]
inc/language/.htaccess [new file with mode: 0644]
inc/loader/.htaccess [new file with mode: 0644]
inc/loader/class_ClassLoader.php [new file with mode: 0644]
inc/output.php [new file with mode: 0644]
inc/selector.php [new file with mode: 0644]
templates/.htaccess [new file with mode: 0644]
templates/_compiled/.htaccess [new file with mode: 0644]
templates/de/.htaccess [new file with mode: 0644]
templates/de/code/.htaccess [new file with mode: 0644]
templates/de/code/emergency_exit.ctp [new file with mode: 0644]
templates/de/code/footer_msg.ctp [new file with mode: 0644]
templates/de/code/header.ctp [new file with mode: 0644]
templates/de/html/.htaccess [new file with mode: 0644]
templates/images/.htaccess [new file with mode: 0644]
templates/images/_cache/.htaccess [new file with mode: 0644]
templates/images/de/.htaccess [new file with mode: 0644]
templates/images/de/image/.htaccess [new file with mode: 0644]
templates/images/de/image/base_image.itp [new file with mode: 0644]
templates/images/de/image/emergency_exit.itp [new file with mode: 0644]
tests/ConfigTest.php [new file with mode: 0644]
tests/RegistryTest.php [new file with mode: 0644]
tests/RequestTest.php [new file with mode: 0644]
tests/Test.php [new file with mode: 0644]
tests/all-tests.sh [new file with mode: 0644]
tests/old/contract-test.php [new file with mode: 0644]
tests/old/loader-test.php [new file with mode: 0644]
tests/old/personell-test.php [new file with mode: 0644]
tests/unittest.sh [new file with mode: 0644]

diff --git a/.gitattributes b/.gitattributes
new file mode 100644 (file)
index 0000000..0f127fc
--- /dev/null
@@ -0,0 +1,549 @@
+* text=auto !eol
+devel/.htaccess -text
+devel/class_Debug.php -text
+inc/.htaccess -text
+inc/classes.php -text
+inc/classes/.htaccess -text
+inc/classes/exceptions/.htaccess -text
+inc/classes/exceptions/actions/.htaccess -text
+inc/classes/exceptions/actions/class_InvalidActionException.php -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
+inc/classes/exceptions/container/.htaccess -text
+inc/classes/exceptions/container/class_ContainerItemIsNoArrayException.php -text
+inc/classes/exceptions/container/class_ContainerItemIsNullException.php -text
+inc/classes/exceptions/container/class_ContainerMaybeDamagedException.php -text
+inc/classes/exceptions/controller/.htaccess -text
+inc/classes/exceptions/controller/class_DefaultControllerException.php -text
+inc/classes/exceptions/controller/class_InvalidControllerException.php -text
+inc/classes/exceptions/criteria/.htaccess -text
+inc/classes/exceptions/crypto/.htaccess -text
+inc/classes/exceptions/crypto/class_EncryptInvalidLengthException.php -text
+inc/classes/exceptions/crypto/class_EncryptMissingException.php -text
+inc/classes/exceptions/database/.htaccess -text
+inc/classes/exceptions/database/class_ -text
+inc/classes/exceptions/database/class_DatabaseException.php -text
+inc/classes/exceptions/database/general/.htaccess -text
+inc/classes/exceptions/database/general/class_DatabaseUpdateSupportException.php -text
+inc/classes/exceptions/database/general/class_SqlException.php -text
+inc/classes/exceptions/database/local_file/.htaccess -text
+inc/classes/exceptions/database/local_file/class_SavePathIsEmptyException.php -text
+inc/classes/exceptions/database/local_file/class_SavePathIsNoDirectoryException.php -text
+inc/classes/exceptions/database/local_file/class_SavePathReadProtectedException.php -text
+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_HelperGroupAlreadyCreatedException.php -text
+inc/classes/exceptions/helper/class_HelperNoPreviousOpenedSubGroupException.php -text
+inc/classes/exceptions/helper/class_HelperSubGroupAlreadyCreatedException.php -text
+inc/classes/exceptions/helper/class_InvalidFormNameException.php -text
+inc/classes/exceptions/helper/class_NoGroupOpenedException.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_FileNotFoundException.php -text
+inc/classes/exceptions/io/class_FilePointerNotOpenedException.php -text
+inc/classes/exceptions/io/class_FileReadProtectedException.php -text
+inc/classes/exceptions/io/class_InvalidDataLengthException.php -text
+inc/classes/exceptions/io/class_InvalidDirectoryResourceException.php -text
+inc/classes/exceptions/io/class_InvalidMD5ChecksumException.php -text
+inc/classes/exceptions/io/class_PathIsEmptyException.php -text
+inc/classes/exceptions/io/class_PathIsNoDirectoryException.php -text
+inc/classes/exceptions/io/class_PathReadProtectedException.php -text
+inc/classes/exceptions/language/.htaccess -text
+inc/classes/exceptions/language/class_InvalidLanguagePathStringException.php -text
+inc/classes/exceptions/language/class_LanguagePathIsEmptyException.php -text
+inc/classes/exceptions/language/class_LanguagePathIsNoDirectoryException.php -text
+inc/classes/exceptions/language/class_LanguagePathReadProtectedException.php -text
+inc/classes/exceptions/language/class_MissingFileIoHandlerException.php -text
+inc/classes/exceptions/language/class_MissingLanguageHandlerException.php -text
+inc/classes/exceptions/main/.htaccess -text
+inc/classes/exceptions/main/class_AssertionException.php -text
+inc/classes/exceptions/main/class_ClassMismatchException.php -text
+inc/classes/exceptions/main/class_ClassNotFoundException.php -text
+inc/classes/exceptions/main/class_ConfigEntryIsEmptyException.php -text
+inc/classes/exceptions/main/class_ConfigEntryNotFoundException.php -text
+inc/classes/exceptions/main/class_DimNotFoundInArrayException.php -text
+inc/classes/exceptions/main/class_EmptyVariableException.php -text
+inc/classes/exceptions/main/class_ExceptionNotFoundException.php -text
+inc/classes/exceptions/main/class_FatalErrorException.php -text
+inc/classes/exceptions/main/class_GetterNotFoundException.php -text
+inc/classes/exceptions/main/class_InvalidArrayCountException.php -text
+inc/classes/exceptions/main/class_InvalidCommandException.php -text
+inc/classes/exceptions/main/class_InvalidCommandInstanceException.php -text
+inc/classes/exceptions/main/class_InvalidInterfaceException.php -text
+inc/classes/exceptions/main/class_InvalidObjectException.php -text
+inc/classes/exceptions/main/class_MissingArrayElementsException.php -text
+inc/classes/exceptions/main/class_MissingDecimalsThousandsSeperatorException.php -text
+inc/classes/exceptions/main/class_MissingMethodException.php -text
+inc/classes/exceptions/main/class_NoArrayCreatedException.php -text
+inc/classes/exceptions/main/class_NoArrayException.php -text
+inc/classes/exceptions/main/class_NoObjectException.php -text
+inc/classes/exceptions/main/class_NullPointerException.php -text
+inc/classes/exceptions/main/class_ResponseHeadersAlreadySentException.php -text
+inc/classes/exceptions/main/class_VariableIsNotSetException.php -text
+inc/classes/exceptions/result/.htaccess -text
+inc/classes/exceptions/result/class_InvalidDatabaseResultException.php -text
+inc/classes/exceptions/result/class_ResultUpdateException.php -text
+inc/classes/exceptions/template/.htaccess -text
+inc/classes/exceptions/template/class_BasePathIsEmptyException.php -text
+inc/classes/exceptions/template/class_BasePathIsNoDirectoryException.php -text
+inc/classes/exceptions/template/class_BasePathReadProtectedException.php -text
+inc/classes/exceptions/template/class_InvalidBasePathStringException.php -text
+inc/classes/exceptions/template/class_UnexpectedTemplateTypeException.php -text
+inc/classes/exceptions/template/class_UnsupportedTemplateEngineException.php -text
+inc/classes/exceptions/template/class_ViewHelperNotFoundException.php -text
+inc/classes/exceptions/user/.htaccess -text
+inc/classes/exceptions/user/class_AccountPasswordMismatchException.php -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/exceptions/xml/.htaccess -text
+inc/classes/exceptions/xml/class_InvalidXmlNodeException.php -text
+inc/classes/exceptions/xml/class_XmlNodeMismatchException.php -text
+inc/classes/exceptions/xml/class_XmlParserException.php -text
+inc/classes/interfaces/.htaccess -text
+inc/classes/interfaces/actions/.htaccess -text
+inc/classes/interfaces/actions/class_PerformableAction.php -text
+inc/classes/interfaces/actions/commands/.htaccess -text
+inc/classes/interfaces/actions/commands/class_Commandable.php -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/captcha/.htaccess -text
+inc/classes/interfaces/captcha/class_SolveableCaptcha.php -text
+inc/classes/interfaces/class_ -text
+inc/classes/interfaces/class_FrameworkInterface.php -text
+inc/classes/interfaces/compressor/.htaccess -text
+inc/classes/interfaces/compressor/class_Compressor.php -text
+inc/classes/interfaces/controller/.htaccess -text
+inc/classes/interfaces/controller/class_Controller.php -text
+inc/classes/interfaces/criteria/.htaccess -text
+inc/classes/interfaces/criteria/class_Criteria.php -text
+inc/classes/interfaces/criteria/extended/.htaccess -text
+inc/classes/interfaces/criteria/extended/class_LocalSearchCriteria.php -text
+inc/classes/interfaces/criteria/extended/class_LocalUpdateCriteria.php -text
+inc/classes/interfaces/criteria/extended/class_StoreableCriteria.php -text
+inc/classes/interfaces/crypto/.htaccess -text
+inc/classes/interfaces/crypto/class_Cryptable.php -text
+inc/classes/interfaces/database/.htaccess -text
+inc/classes/interfaces/database/class_FrameworkDatabaseInterface.php -text
+inc/classes/interfaces/database/class_Updateable.php -text
+inc/classes/interfaces/database/frontend/.htaccess -text
+inc/classes/interfaces/database/frontend/class_DatabaseFrontendInterface.php -text
+inc/classes/interfaces/database/middleware/.htaccess -text
+inc/classes/interfaces/database/middleware/class_DatabaseConnector.php -text
+inc/classes/interfaces/debug/.htaccess -text
+inc/classes/interfaces/debug/class_Debugger.php -text
+inc/classes/interfaces/discovery/.htaccess -text
+inc/classes/interfaces/discovery/class_Discoverable.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/helper/class_HelpableTemplate.php -text
+inc/classes/interfaces/io/.htaccess -text
+inc/classes/interfaces/io/class_Streamable.php -text
+inc/classes/interfaces/io/file/.htaccess -text
+inc/classes/interfaces/io/file/class_FileInputStreamer.php -text
+inc/classes/interfaces/io/file/class_FileOutputStreamer.php -text
+inc/classes/interfaces/io/output/.htaccess -text
+inc/classes/interfaces/io/output/class_OutputStreamer.php -text
+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/mailer/.htaccess -text
+inc/classes/interfaces/mailer/class_DeliverableMail.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
+inc/classes/interfaces/registry/class_Register.php -text
+inc/classes/interfaces/registry/class_Registerable.php -text
+inc/classes/interfaces/request/.htaccess -text
+inc/classes/interfaces/request/class_Requestable.php -text
+inc/classes/interfaces/resolver/.htaccess -text
+inc/classes/interfaces/resolver/actions/.htaccess -text
+inc/classes/interfaces/resolver/actions/class_ActionResolver.php -text
+inc/classes/interfaces/resolver/class_Resolver.php -text
+inc/classes/interfaces/resolver/commands/.htaccess -text
+inc/classes/interfaces/resolver/commands/class_CommandResolver.php -text
+inc/classes/interfaces/resolver/controller/.htaccess -text
+inc/classes/interfaces/resolver/controller/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/result/class_UpdateableResult.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
+inc/classes/interfaces/user/.htaccess -text
+inc/classes/interfaces/user/class_ManageableAccount.php -text
+inc/classes/interfaces/user/extended/.htaccess -text
+inc/classes/interfaces/user/extended/class_ManageableGuest.php -text
+inc/classes/interfaces/user/extended/class_ManageableMember.php -text
+inc/classes/main/.htaccess -text
+inc/classes/main/actions/.htaccess -text
+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/actions/web/.htaccess -text
+inc/classes/main/actions/web/class_WebLoginProfileAction.php -text
+inc/classes/main/application/.htaccess -text
+inc/classes/main/application/class_BaseApplication.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
+inc/classes/main/class_Base -text
+inc/classes/main/class_BaseFrameworkSystem.php -text
+inc/classes/main/class_FrameworkArrayObject.php -text
+inc/classes/main/commands/.htaccess -text
+inc/classes/main/commands/class_ -text
+inc/classes/main/commands/class_BaseCommand.php -text
+inc/classes/main/commands/image/.htaccess -text
+inc/classes/main/commands/image/class_ImageCodeCaptchaCommand.php -text
+inc/classes/main/commands/web/.htaccess -text
+inc/classes/main/commands/web/class_ -text
+inc/classes/main/commands/web/class_WebConfirmCommand.php -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_WebLoginCommand.php -text
+inc/classes/main/commands/web/class_WebLoginFailedCommand.php -text
+inc/classes/main/commands/web/class_WebLogoutCommand.php -text
+inc/classes/main/commands/web/class_WebLogoutDoneCommand.php -text
+inc/classes/main/commands/web/class_WebRegisterCommand.php -text
+inc/classes/main/commands/web/class_WebResendLinkCommand.php -text
+inc/classes/main/compressor/.htaccess -text
+inc/classes/main/compressor/class_Bzip2Compressor.php -text
+inc/classes/main/compressor/class_GzipCompressor.php -text
+inc/classes/main/compressor/class_NullCompressor.php -text
+inc/classes/main/console/.htaccess -text
+inc/classes/main/console/class_ConsoleTools.php -text
+inc/classes/main/controller/.htaccess -text
+inc/classes/main/controller/captcha/.htaccess -text
+inc/classes/main/controller/captcha/class_ImageCodeCaptchaController.php -text
+inc/classes/main/controller/class_ -text
+inc/classes/main/controller/class_BaseController.php -text
+inc/classes/main/controller/form/.htaccess -text
+inc/classes/main/controller/form/class_WebDoFormController.php -text
+inc/classes/main/controller/image/.htaccess -text
+inc/classes/main/controller/image/class_ImageDefaultController.php -text
+inc/classes/main/controller/login/.htaccess -text
+inc/classes/main/controller/login/class_WebLoginAreaController.php -text
+inc/classes/main/controller/web/.htaccess -text
+inc/classes/main/controller/web/class_ -text
+inc/classes/main/controller/web/class_WebConfirmController.php -text
+inc/classes/main/controller/web/class_WebDefaultController.php -text
+inc/classes/main/controller/web/class_WebDefaultNewsController.php -text
+inc/classes/main/controller/web/class_WebLoginController.php -text
+inc/classes/main/controller/web/class_WebLoginFailedController.php -text
+inc/classes/main/controller/web/class_WebLogoutController.php -text
+inc/classes/main/controller/web/class_WebLogoutDoneController.php -text
+inc/classes/main/controller/web/class_WebRegisterController.php -text
+inc/classes/main/controller/web/class_WebStatusController.php -text
+inc/classes/main/criteria/.htaccess -text
+inc/classes/main/criteria/class_DataSetCriteria.php -text
+inc/classes/main/criteria/class_SearchCriteria.php -text
+inc/classes/main/criteria/class_UpdateCriteria.php -text
+inc/classes/main/crypto/.htaccess -text
+inc/classes/main/crypto/class_CryptoHelper.php -text
+inc/classes/main/database/.htaccess -text
+inc/classes/main/database/class_ -text
+inc/classes/main/database/class_BaseDatabaseFrontend.php -text
+inc/classes/main/database/class_BaseDatabaseWrapper.php -text
+inc/classes/main/database/databases/.htaccess -text
+inc/classes/main/database/databases/class_LocalFileDatabase.php -text
+inc/classes/main/database/wrapper/.htaccess -text
+inc/classes/main/database/wrapper/class_NewsDatabaseWrapper.php -text
+inc/classes/main/database/wrapper/class_PaymentsDatabaseWrapper.php -text
+inc/classes/main/database/wrapper/class_UserDatabaseWrapper.php -text
+inc/classes/main/database/wrapper/class_UserPointsDatabaseWrapper.php -text
+inc/classes/main/debug/.htaccess -text
+inc/classes/main/debug/class_DebugConsoleOutput.php -text
+inc/classes/main/debug/class_DebugErrorLogOutput.php -text
+inc/classes/main/debug/class_DebugWebOutput.php -text
+inc/classes/main/discovery/.htaccess -text
+inc/classes/main/discovery/class_ -text
+inc/classes/main/discovery/class_BaseDiscovery.php -text
+inc/classes/main/discovery/payment/.htaccess -text
+inc/classes/main/discovery/payment/class_LocalPaymentDiscovery.php -text
+inc/classes/main/factories/.htaccess -text
+inc/classes/main/factories/cache/.htaccess -text
+inc/classes/main/factories/cache/class_CacheFactory.php -text
+inc/classes/main/factories/class_BaseFactory.php -text
+inc/classes/main/factories/objects/.htaccess -text
+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/change/.htaccess -text
+inc/classes/main/filter/change/class_EmailChangeFilter.php -text
+inc/classes/main/filter/change/class_PasswordChangeFilter.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/crypto/.htaccess -text
+inc/classes/main/filter/crypto/class_CaptchaEncryptFilter.php -text
+inc/classes/main/filter/decorator/.htaccess -text
+inc/classes/main/filter/guest/.htaccess -text
+inc/classes/main/filter/guest/class_UserNameIsGuestFilter.php -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/payment/.htaccess -text
+inc/classes/main/filter/payment/class_PaymentDiscoveryFilter.php -text
+inc/classes/main/filter/update/.htaccess -text
+inc/classes/main/filter/update/class_UserStatusConfimedUpdateFilter.php -text
+inc/classes/main/filter/update/class_UserUpdateFilter.php -text
+inc/classes/main/filter/validator/.htaccess -text
+inc/classes/main/filter/validator/class_EmailValidatorFilter.php -text
+inc/classes/main/filter/validator/class_PasswordValidatorFilter.php -text
+inc/classes/main/filter/validator/class_UserNameValidatorFilter.php -text
+inc/classes/main/filter/verifier/.htaccess -text
+inc/classes/main/filter/verifier/class_AccountPasswordVerifierFilter.php -text
+inc/classes/main/filter/verifier/class_ConfirmCodeVerifierFilter.php -text
+inc/classes/main/filter/verifier/class_GraphicalCodeCaptchaVerifierFilter.php -text
+inc/classes/main/filter/verifier/class_PasswordGuestVerifierFilter.php -text
+inc/classes/main/filter/verifier/class_PasswordVerifierFilter.php -text
+inc/classes/main/filter/verifier/class_UserGuestVerifierFilter.php -text
+inc/classes/main/filter/verifier/class_UserNameVerifierFilter.php -text
+inc/classes/main/filter/verifier/class_UserStatusVerifierFilter.php -text
+inc/classes/main/filter/verifier/class_UserUnconfirmedVerifierFilter.php -text
+inc/classes/main/helper/.htaccess -text
+inc/classes/main/helper/captcha/.htaccess -text
+inc/classes/main/helper/captcha/class_ -text
+inc/classes/main/helper/captcha/class_BaseCaptcha.php -text
+inc/classes/main/helper/captcha/images/.htaccess -text
+inc/classes/main/helper/captcha/images/class_ImageHelper.php -text
+inc/classes/main/helper/captcha/web/.htaccess -text
+inc/classes/main/helper/captcha/web/class_GraphicalCodeCaptcha.php -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/blocks/.htaccess -text
+inc/classes/main/helper/web/blocks/class_WebBlockHelper.php -text
+inc/classes/main/helper/web/class_ -text
+inc/classes/main/helper/web/class_BaseWebHelper.php -text
+inc/classes/main/helper/web/forms/.htaccess -text
+inc/classes/main/helper/web/forms/class_WebFormHelper.php -text
+inc/classes/main/helper/web/links/.htaccess -text
+inc/classes/main/helper/web/links/class_WebLinkHelper.php -text
+inc/classes/main/images/.htaccess -text
+inc/classes/main/images/class_ -text
+inc/classes/main/images/class_BaseImage.php -text
+inc/classes/main/images/extended/.htaccess -text
+inc/classes/main/images/extended/class_PngImage.php -text
+inc/classes/main/io/.htaccess -text
+inc/classes/main/io/class_FileIoStream.php -text
+inc/classes/main/io/class_FrameworkDirectoryPointer.php -text
+inc/classes/main/io/class_FrameworkFileInputPointer.php -text
+inc/classes/main/io/class_FrameworkFileOutputPointer.php -text
+inc/classes/main/language/.htaccess -text
+inc/classes/main/language/class_LanguageSystem.php -text
+inc/classes/main/mailer/.htaccess -text
+inc/classes/main/mailer/class_ -text
+inc/classes/main/mailer/class_BaseMailer.php -text
+inc/classes/main/mailer/debug/.htaccess -text
+inc/classes/main/mailer/debug/class_DebugMailer.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/points/.htaccess -text
+inc/classes/main/points/class_UserPoints.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
+inc/classes/main/registry/class_Registry.php -text
+inc/classes/main/request/.htaccess -text
+inc/classes/main/request/class_HttpRequest.php -text
+inc/classes/main/resolver/.htaccess -text
+inc/classes/main/resolver/action/.htaccess -text
+inc/classes/main/resolver/action/class_BaseActionResolver.php -text
+inc/classes/main/resolver/action/web/.htaccess -text
+inc/classes/main/resolver/action/web/class_WebActionResolver.php -text
+inc/classes/main/resolver/class_BaseResolver.php -text
+inc/classes/main/resolver/command/.htaccess -text
+inc/classes/main/resolver/command/class_BaseCommandResolver.php -text
+inc/classes/main/resolver/command/image/.htaccess -text
+inc/classes/main/resolver/command/image/class_ImageCommandResolver.php -text
+inc/classes/main/resolver/command/web/.htaccess -text
+inc/classes/main/resolver/command/web/class_ -text
+inc/classes/main/resolver/command/web/class_WebCommandResolver.php -text
+inc/classes/main/resolver/controller/.htaccess -text
+inc/classes/main/resolver/controller/class_BaseControllerResolver.php -text
+inc/classes/main/resolver/controller/image/.htaccess -text
+inc/classes/main/resolver/controller/image/class_ImageControllerResolver.php -text
+inc/classes/main/resolver/controller/web/.htaccess -text
+inc/classes/main/resolver/controller/web/class_WebControllerResolver.php -text
+inc/classes/main/response/.htaccess -text
+inc/classes/main/response/class_BaseResponse.php -text
+inc/classes/main/response/http/.htaccess -text
+inc/classes/main/response/http/class_HttpResponse.php -text
+inc/classes/main/response/image/.htaccess -text
+inc/classes/main/response/image/class_ImageResponse.php -text
+inc/classes/main/result/.htaccess -text
+inc/classes/main/result/class_DatabaseResult.php -text
+inc/classes/main/rng/.htaccess -text
+inc/classes/main/rng/class_RandomNumberGenerator.php -text
+inc/classes/main/template/.htaccess -text
+inc/classes/main/template/class_BaseTemplateEngine.php -text
+inc/classes/main/template/image/.htaccess -text
+inc/classes/main/template/image/class_ImageTemplateEngine.php -text
+inc/classes/main/template/mail/.htaccess -text
+inc/classes/main/template/mail/class_MailTemplateEngine.php -text
+inc/classes/main/template/web/.htaccess -text
+inc/classes/main/template/web/class_WebTemplateEngine.php -text
+inc/classes/main/user/.htaccess -text
+inc/classes/main/user/class_BaseUser.php -text
+inc/classes/main/user/guest/.htaccess -text
+inc/classes/main/user/guest/class_Guest.php -text
+inc/classes/main/user/member/.htaccess -text
+inc/classes/main/user/member/class_Member.php -text
+inc/classes/middleware/.htaccess -text
+inc/classes/middleware/class_BaseMiddleware.php -text
+inc/classes/middleware/compressor/.htaccess -text
+inc/classes/middleware/compressor/class_CompressorChannel.php -text
+inc/classes/middleware/database/.htaccess -text
+inc/classes/middleware/database/class_DatabaseConnection.php -text
+inc/classes/middleware/debug/.htaccess -text
+inc/classes/middleware/debug/class_DebugMiddleware.php -text
+inc/classes/middleware/io/.htaccess -text
+inc/classes/middleware/io/class_FileIoHandler.php -text
+inc/classes/third_party/.htaccess -text
+inc/classes/third_party/akismet/.htaccess -text
+inc/classes/third_party/akismet/akismet.class.php -text
+inc/classes/third_party/api/.htaccess -text
+inc/classes/third_party/api/primusportal/.htaccess -text
+inc/classes/third_party/api/primusportal/class_PrimeraApi.php -text
+inc/classes/third_party/api/wernisportal/.htaccess -text
+inc/classes/third_party/api/wernisportal/class_WernisApi.php -text
+inc/classes/third_party/php_mailer/.htaccess -text
+inc/classes/third_party/php_mailer/ChangeLog.txt -text
+inc/classes/third_party/php_mailer/LICENSE -text
+inc/classes/third_party/php_mailer/README -text
+inc/classes/third_party/php_mailer/class.phpmailer.php -text
+inc/classes/third_party/php_mailer/class.pop3.php -text
+inc/classes/third_party/php_mailer/class.smtp.php -text
+inc/classes/third_party/php_mailer/docs/extending.html -text
+inc/classes/third_party/php_mailer/docs/faq.html -text
+inc/classes/third_party/php_mailer/docs/pop3_article.txt -text
+inc/classes/third_party/php_mailer/docs/use_gmail.txt -text
+inc/classes/third_party/php_mailer/examples/contents.html -text
+inc/classes/third_party/php_mailer/examples/images/bkgrnd.gif -text
+inc/classes/third_party/php_mailer/examples/images/phpmailer.gif -text
+inc/classes/third_party/php_mailer/examples/images/phpmailer.png -text
+inc/classes/third_party/php_mailer/examples/images/phpmailer_mini.gif -text
+inc/classes/third_party/php_mailer/examples/index.html -text
+inc/classes/third_party/php_mailer/examples/pop3_before_smtp_test.php -text
+inc/classes/third_party/php_mailer/examples/test_gmail.php -text
+inc/classes/third_party/php_mailer/examples/test_mail.php -text
+inc/classes/third_party/php_mailer/examples/test_sendmail.php -text
+inc/classes/third_party/php_mailer/examples/test_smtp.php -text
+inc/classes/third_party/php_mailer/language/.htaccess -text
+inc/classes/third_party/php_mailer/language/phpmailer.lang-br.php -text
+inc/classes/third_party/php_mailer/language/phpmailer.lang-ca.php -text
+inc/classes/third_party/php_mailer/language/phpmailer.lang-cz.php -text
+inc/classes/third_party/php_mailer/language/phpmailer.lang-de.php -text
+inc/classes/third_party/php_mailer/language/phpmailer.lang-dk.php -text
+inc/classes/third_party/php_mailer/language/phpmailer.lang-en.php -text
+inc/classes/third_party/php_mailer/language/phpmailer.lang-es.php -text
+inc/classes/third_party/php_mailer/language/phpmailer.lang-et.php -text
+inc/classes/third_party/php_mailer/language/phpmailer.lang-fi.php -text
+inc/classes/third_party/php_mailer/language/phpmailer.lang-fo.php -text
+inc/classes/third_party/php_mailer/language/phpmailer.lang-fr.php -text
+inc/classes/third_party/php_mailer/language/phpmailer.lang-hu.php -text
+inc/classes/third_party/php_mailer/language/phpmailer.lang-it.php -text
+inc/classes/third_party/php_mailer/language/phpmailer.lang-ja.php -text
+inc/classes/third_party/php_mailer/language/phpmailer.lang-nl.php -text
+inc/classes/third_party/php_mailer/language/phpmailer.lang-no.php -text
+inc/classes/third_party/php_mailer/language/phpmailer.lang-pl.php -text
+inc/classes/third_party/php_mailer/language/phpmailer.lang-ro.php -text
+inc/classes/third_party/php_mailer/language/phpmailer.lang-ru.php -text
+inc/classes/third_party/php_mailer/language/phpmailer.lang-se.php -text
+inc/classes/third_party/php_mailer/language/phpmailer.lang-tr.php -text
+inc/classes/third_party/php_mailer/phpdoc/PHPMailer/PHPMailer.html -text
+inc/classes/third_party/php_mailer/phpdoc/PHPMailer/SMTP.html -text
+inc/classes/third_party/php_mailer/phpdoc/PHPMailer/_class_phpmailer_php.html -text
+inc/classes/third_party/php_mailer/phpdoc/PHPMailer/_class_smtp_php.html -text
+inc/classes/third_party/php_mailer/phpdoc/blank.html -text
+inc/classes/third_party/php_mailer/phpdoc/classtrees_PHPMailer.html -text
+inc/classes/third_party/php_mailer/phpdoc/elementindex.html -text
+inc/classes/third_party/php_mailer/phpdoc/elementindex_PHPMailer.html -text
+inc/classes/third_party/php_mailer/phpdoc/errors.html -text
+inc/classes/third_party/php_mailer/phpdoc/index.html -text
+inc/classes/third_party/php_mailer/phpdoc/li_PHPMailer.html -text
+inc/classes/third_party/php_mailer/phpdoc/media/banner.css -text
+inc/classes/third_party/php_mailer/phpdoc/media/stylesheet.css -text
+inc/classes/third_party/php_mailer/phpdoc/packages.html -text
+inc/classes/third_party/php_mailer/test/phpmailer_test.php -text
+inc/classes/third_party/php_mailer/test/phpunit.php -text
+inc/classes/third_party/php_mailer/test/test.png -text
+inc/config.php -text
+inc/config/.htaccess -text
+inc/config/class_FrameworkConfiguration.php -text
+inc/config/config-hubmaster.php -text
+inc/database.php -text
+inc/database/.htaccess -text
+inc/database/lib-local.php -text
+inc/file_io.php -text
+inc/includes.php -text
+inc/language.php -text
+inc/language/.htaccess -text
+inc/loader/.htaccess -text
+inc/loader/class_ClassLoader.php -text
+inc/output.php -text
+inc/selector.php -text
+templates/.htaccess -text
+templates/_compiled/.htaccess -text
+templates/de/.htaccess -text
+templates/de/code/.htaccess -text
+templates/de/code/emergency_exit.ctp -text
+templates/de/code/footer_msg.ctp -text
+templates/de/code/header.ctp -text
+templates/de/html/.htaccess -text
+templates/images/.htaccess -text
+templates/images/_cache/.htaccess -text
+templates/images/de/.htaccess -text
+templates/images/de/image/.htaccess -text
+templates/images/de/image/base_image.itp -text
+templates/images/de/image/emergency_exit.itp -text
+tests/ConfigTest.php -text
+tests/RegistryTest.php -text
+tests/RequestTest.php -text
+tests/Test.php -text
+tests/all-tests.sh -text
+tests/old/contract-test.php -text
+tests/old/loader-test.php -text
+tests/old/personell-test.php -text
+tests/unittest.sh -text
diff --git a/devel/.htaccess b/devel/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/devel/class_Debug.php b/devel/class_Debug.php
new file mode 100644 (file)
index 0000000..a732cb8
--- /dev/null
@@ -0,0 +1,53 @@
+<?php
+/**
+ * A dummy class for debugging
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class Debug {
+       // Constructor
+       public function __construct () {
+               // eval()-Befehle debuggen
+               //define('DEBUG_EVAL', true);
+               // SimulatorBase debuggen (VORSICHT! SEHR VIELE DEBUG-MELDUNGEN!!!)
+               //define('DEBUG_CORE', true);
+               //////// Objekte debuggen (ausgeben) ////////
+               // Datenbank-Objekt debuggen
+               //define('DEBUG_DATABASE_OBJ', true);
+               //////// Alles unteren debuggen ////////
+               //define('DEBUG_ALL', true);
+               // Kompressor debuggen
+               //define('DEBUG_COMPRESSOR', true);
+               // Datenbankschichten debuggen
+               //define('DEBUG_DATABASE', true);
+               // Template-System debuggen
+               //define('DEBUG_TEMPLATE', true);
+               // Konfiguration debuggen
+               //define('DEBUG_CONFIG', true);
+       }
+}
+
+/**
+ * Initialize the dummy debug class
+ */
+$dummy = new Debug();
+unset($dummy);
+
+//
+?>
diff --git a/inc/.htaccess b/inc/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/inc/classes.php b/inc/classes.php
new file mode 100644 (file)
index 0000000..78bafeb
--- /dev/null
@@ -0,0 +1,63 @@
+<?php
+/**
+ * Load required framework classes first
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+// Lower framework classes
+$lowerClasses = array(
+       0 => "exceptions", // Exceptions
+       1 => "interfaces", // Interfaces
+       2 => "main",       // General main classes
+       3 => "middleware"  // The middleware
+);
+
+// Load all classes
+foreach ($lowerClasses as $className) {
+       // Try to load the framework classes
+       try {
+               ClassLoader::getInstance()->loadClasses(sprintf("inc/classes/%s/", $className));
+       } catch (PathIsNoDirectoryException $e) {
+               ApplicationEntryPoint::app_die(sprintf("[Main:] Could not load framework classes from path <span class=\"exception_data\">%s</span> for the follwing reason: <span class=\"exception_reason\">%s</span>",
+                       $className
+               ));
+       } catch (PathIsEmptyException $e) {
+               ApplicationEntryPoint::app_die(sprintf("[Main:] Could not load framework classes from path <span class=\"exception_data\">%s</span> for the follwing reason: <span class=\"exception_reason\">%s</span>",
+                       $className
+               ));
+       } catch (PathReadProtectedException $e) {
+               ApplicationEntryPoint::app_die(sprintf("[Main:] Could not load framework classes from path <span class=\"exception_data\">%s</span> for the follwing reason: <span class=\"exception_reason\">%s</span>",
+                       $className
+               ));
+       } catch (DirPointerNotOpenedException $e) {
+               ApplicationEntryPoint::app_die(sprintf("[Main:] Could not load framework classes from path <span class=\"exception_data\">%s</span> for the follwing reason: <span class=\"exception_reason\">%s</span>",
+                       $className
+               ));
+       }
+}
+
+// Clean up the global namespace
+unset($lowerClasses[3]); // Applications shall not have any middleware
+unset($className);
+
+////// Until here the framework classes are loaded //////
+
+// [EOF]
+?>
diff --git a/inc/classes/.htaccess b/inc/classes/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/inc/classes/exceptions/.htaccess b/inc/classes/exceptions/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/inc/classes/exceptions/actions/.htaccess b/inc/classes/exceptions/actions/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/inc/classes/exceptions/actions/class_InvalidActionException.php b/inc/classes/exceptions/actions/class_InvalidActionException.php
new file mode 100644 (file)
index 0000000..96c1b73
--- /dev/null
@@ -0,0 +1,47 @@
+<?php
+/**
+ * This exception is thrown when a requested action is invalid
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class InvalidActionException extends FrameworkException {
+       /**
+        * The super constructor for all exceptions
+        *
+        * @param       $msgArray       An array with message parts
+        * @param       $code           An optional code for better debugging
+        * @return      void
+        */
+       public function __construct(array $msgArray, $code) {
+               // Prepare the message
+               $message = sprintf("[%s:%d] Cannot resolve action <span class=\"exception_reason\">%s (%s)</span>.",
+                       $msgArray[0]->__toString(),
+                       $this->getLine(),
+                       $msgArray[1],
+                       $msgArray[0]->getClassName()
+               );
+
+               // Call parent contructor with message
+               parent::__construct($message, $code);
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/exceptions/auth/.htaccess b/inc/classes/exceptions/auth/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/inc/classes/exceptions/auth/class_UserAuthorizationException.php b/inc/classes/exceptions/auth/class_UserAuthorizationException.php
new file mode 100644 (file)
index 0000000..a07bf45
--- /dev/null
@@ -0,0 +1,46 @@
+<?php
+/**
+ * An exception thrown when authorization of the user has failed
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class UserAuthorizationException extends FrameworkException {
+       /**
+        * The super constructor for all exceptions
+        *
+        * @param       $filterInstance         An instance of the filter throwing this exception
+        * @param       $code                           Error code
+        * @return      void
+        */
+       public function __construct(Filterable $filterInstance, $code) {
+               // Construct the message
+               $message = sprintf("[%s:%d] Authorization has failed. Error code <span class=\"exception_reason\">%s</span>",
+                       $filterInstance->__toString(),
+                       $this->getLine(),
+                       $this->getHexCode($code)
+               );
+
+               // Call parent exception constructor
+               parent::__construct($message, $code);
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/exceptions/class_ b/inc/classes/exceptions/class_
new file mode 100644 (file)
index 0000000..afe1a08
--- /dev/null
@@ -0,0 +1,39 @@
+<?php
+/**
+ * 
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class ???Exception extends FrameworkException {
+       /**
+        * The super constructor for all exceptions
+        *
+        * @param               $message        Error message
+        * @param               $code           Error code
+        * @return      void
+        */
+       public function __construct($message, $code) {
+               // Call parent exception constructor
+               parent::__construct($message, $code);
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/exceptions/class_FrameworkException.php b/inc/classes/exceptions/class_FrameworkException.php
new file mode 100644 (file)
index 0000000..c3a2c1a
--- /dev/null
@@ -0,0 +1,202 @@
+<?php
+/**
+ * A general abstract exception. You should not throw this even when you
+ * remove the "abstract" key-word. Better you make your own exception and
+ * attach a dedicated message to it.
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+abstract class FrameworkException extends ReflectionException {
+       /**
+        * Array for the backtrace
+        */
+       private $backTrace = array();
+
+       /**
+        * Extra data
+        */
+       private $extraData = "";
+
+       /**
+        * The super constructor for all exceptions
+        *
+        * @param       $message        The non-optional message for the exception
+        * @param       $code           An optional code for better debugging
+        * @return      void
+        */
+       public function __construct($message, $code = 0) {
+               // Extract backtrace
+               $this->saveBackTrace();
+
+               // Cast all data
+               $message = (string) $message;
+               $code    = (int)    $code;
+
+               // In emergency exit?
+               if (defined('EMERGENCY_EXIT_CALLED')) {
+                       // Output message
+                       printf("[%s:] Message: %s, Backtrace: <pre>%s</pre>",
+                               $this->__toString(),
+                               $message,
+                               $this->getPrintableBackTrace()
+                       );
+
+                       // End here
+                       exit();
+               } // END - if
+               // Make sure everything is assigned properly
+               parent::__construct($message, $code);
+
+               // Log it away if DEBUG_ALL is set
+               if (defined('DEBUG_ALL')) {
+                       // Log the error
+                       error_log(sprintf("[%s:] %s (%s)",
+                               $this->__toString(),
+                               $message,
+                               $this->getHexCode()
+                       ));
+               } // END - if
+       }
+
+       /**
+        * Save the current backtrace
+        *
+        * @return      void
+        */
+       private final function saveBackTrace () {
+               // Get full backtrace
+               $this->backTrace = debug_backtrace();
+
+               // Remove this call
+               $dummy = array_shift($this->backTrace);
+
+               // resort the array
+               ksort($this->backTrace);
+       }
+
+       /**
+        * Get saved backtrace
+        *
+        * @return      $backTrace      The full backtrace in an array
+        */
+       public final function getBackTrace () {
+               return $this->backTrace;
+       }
+
+       /**
+        * Getter for printable backtrace
+        *
+        * @return      $backTrace      Backtrace for web pages
+        */
+       public final function getPrintableBackTrace () {
+               // Get the backtrace
+               $dbgTrace = $this->getBackTrace();
+
+               // Taken from de.php.net user comments
+               $dbgMsg = "<br />\nDebug backtrace begin:<br />\n";
+               foreach ($dbgTrace as $dbgIndex => $dbgInfo) {
+                       // No info by default
+                       $info = "NULL";
+
+                       // Are there arguments?
+                       if ((isset($dbgInfo['args'])) && (is_array($dbgInfo['args'])) && (isset($dbgInfo['args'][0]))) {
+                               //* DEBUG: */ echo $dbgIndex.": <pre>".htmlentities(print_r($dbgInfo['args'], true))."</pre>";
+                               $info = "";
+                               foreach ($dbgInfo['args'] as $debug) {
+                                       // Add only non-array elements
+                                       if (!is_array($debug)) {
+                                               $info .= $debug.", ";
+                                       } // END - if
+                               } // END - if
+
+                               $info = substr($info, 0, -2);
+                       } // END - if
+
+                       // Prepare argument infos
+                       $info = "<em id=\"debug_args_".$dbgIndex."\">{$info}</em>";
+
+                       // File detection
+                       $file = "Unknown file";
+                       if (isset($dbgInfo['file'])) {
+                               $file = basename($dbgInfo['file']);
+                       } // END - if
+
+                       // Line detection
+                       $line = "Unknown line";
+                       if (isset($dbgInfo['line'])) {
+                               $line = "line {$dbgInfo['line']}";
+                       } // END - if
+
+                       // The message
+                       $dbgMsg .= "\t at <em id=\"debug_id_".$dbgIndex."\">".$dbgIndex."</em> <em id=\"debug_file_".$dbgIndex."\">".$file."</em> (<em id=\"debug_line_".$dbgIndex."\">".$line."</em>) -&gt; ".$dbgInfo['function']."(".$info.")<br />\n";
+               } // END - if
+               $dbgMsg .= "Debug backtrace end<br />\n";
+
+               return $dbgMsg;
+       }
+
+       /**
+        * Returns the name of the thrown exception
+        *
+        * @return      $toString               The name of the thrown exception
+        */
+       public function __toString() {
+               return get_class($this);
+       }
+
+       /**
+        * 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 ($code = null) {
+               // Get the decimal code
+               if (is_null($code)) $code = $this->getCode();
+
+               // Format it to hex-decimal, 0x as prefix and 3 chars
+               $hexCode = sprintf("0x%03s", dechex($code));
+
+               // Return it
+               return $hexCode;
+       }
+
+       /**
+        * Setter for extra data
+        *
+        * @param       $extraData      Extra data to store
+        * @return      void
+        */
+       protected final function setExtraData ($extraData) {
+               $this->extraData = $extraData;
+       }
+
+       /**
+        * Getter for extra data
+        *
+        * @return      $extraData      Extra data to store
+        */
+       public final function getExtraData () {
+               return $this->extraData;
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/exceptions/compressor/.htaccess b/inc/classes/exceptions/compressor/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/inc/classes/exceptions/compressor/class_MismatchingCompressorsException.php b/inc/classes/exceptions/compressor/class_MismatchingCompressorsException.php
new file mode 100644 (file)
index 0000000..dfba485
--- /dev/null
@@ -0,0 +1,51 @@
+<?php
+/**
+ * An exception thrown when compressors are mismatching
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class MismatchingCompressorsException extends FrameworkException {
+       /**
+        * The constructor
+        *
+        * @param       $array  Message from the exception
+        * @param       $code   Code number for the exception
+        * @return      void
+        */
+       public function __construct (array $array, $code) {
+               // Add a message around the missing class
+               $message = sprintf("[%s:%d] Der Kompressor <span class=\"exception_reason\">%s</span> zu den geladenen Daten aus <span class=\"exception_reason\">%s</span> und der aktuell verwendete Kompressor <span class=\"exception_reason\">%s</span> stimmen nicht &uuml;berein!",
+                       $array[0]->__toString(),
+                       $this->getLine(),
+                       strtoupper($array[1]),
+                       sprintf("%s:%s",
+                               basename(dirname($array[2])),
+                               basename($array[2])
+                       ),
+                       strtoupper($array[3])
+               );
+
+               // Call parent constructor
+               parent::__construct($message, $code);
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/exceptions/container/.htaccess b/inc/classes/exceptions/container/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/inc/classes/exceptions/container/class_ContainerItemIsNoArrayException.php b/inc/classes/exceptions/container/class_ContainerItemIsNoArrayException.php
new file mode 100644 (file)
index 0000000..fe6914e
--- /dev/null
@@ -0,0 +1,46 @@
+<?php
+/**
+ * An exception thrown when a container item is not an array
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ * @deprecated
+ * 
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class ContainerItemIsNoArrayException extends FrameworkException {
+       /**
+        * The constructor
+        *
+        * @param       $class  Class throwing this exception
+        * @param       $code   Code number for the exception
+        * @return      void
+        */
+       public function __construct (FrameworkInterface $class, $code) {
+               // Add a message around the missing class
+               $message = sprintf("[%s:%d] A container item is not an array.",
+                       $class->__toString(),
+                       $this->getLine()
+               );
+
+               // Call parent constructor
+               parent::__construct($message, $code);
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/exceptions/container/class_ContainerItemIsNullException.php b/inc/classes/exceptions/container/class_ContainerItemIsNullException.php
new file mode 100644 (file)
index 0000000..9d0b40b
--- /dev/null
@@ -0,0 +1,46 @@
+<?php
+/**
+ * An exception thrown when a container item is null
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ * @deprecated
+ * 
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class ContainerItemIsNullException extends FrameworkException {
+       /**
+        * The constructor
+        *
+        * @param       $class  Class throwing this exception
+        * @param       $code   Code number for the exception
+        * @return      void
+        */
+       public function __construct (FrameworkInterface $class, $code) {
+               // Add a message around the missing class
+               $message = sprintf("[%s:%d] A container item is <em>null</em>.",
+                       $class->__toString(),
+                       $this->getLine()
+               );
+
+               // Call parent constructor
+               parent::__construct($message, $code);
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/exceptions/container/class_ContainerMaybeDamagedException.php b/inc/classes/exceptions/container/class_ContainerMaybeDamagedException.php
new file mode 100644 (file)
index 0000000..f8307b2
--- /dev/null
@@ -0,0 +1,46 @@
+<?php
+/**
+ * An exception thrown when the container is possibly damaged
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ * @deprecated
+ * 
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class ContainerMaybeDamagedException extends FrameworkException {
+       /**
+        * The constructor
+        *
+        * @param       $class  Class throwing this exception
+        * @param       $code   Code number for the exception
+        * @return      void
+        */
+       public function __construct (FrameworkInterface $class, $code) {
+               // Add a message around the missing class
+               $message = sprintf("[%s:%d] A container is possibly damaged.",
+                       $class->__toString(),
+                       $this->getLine()
+               );
+
+               // Call parent constructor
+               parent::__construct($message, $code);
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/exceptions/controller/.htaccess b/inc/classes/exceptions/controller/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/inc/classes/exceptions/controller/class_DefaultControllerException.php b/inc/classes/exceptions/controller/class_DefaultControllerException.php
new file mode 100644 (file)
index 0000000..e0c891c
--- /dev/null
@@ -0,0 +1,48 @@
+<?php
+/**
+ * This exception is thrown when the default controller is missing
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class DefaultControllerException extends FrameworkException {
+       /**
+        * The super constructor for all exceptions
+        *
+        * @param       $resolverInstance       An instance of a resolver class
+        * @param       $code                           An optional code for better debugging
+        * @return      void
+        */
+       public function __construct(ControllerResolver $resolverInstance, $code) {
+               // Prepare the message
+               $message = sprintf("[%s:%d] Cannot resolv default controller. Maybe missing?",
+                       $resolverInstance->__toString(),
+                       $this->getLine()
+               );
+
+               // Set extra data
+               $this->setExtraData($resolverInstance->getClassName().":".$this->getLine());
+
+               // Call parent contructor with message
+               parent::__construct($message, $code);
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/exceptions/controller/class_InvalidControllerException.php b/inc/classes/exceptions/controller/class_InvalidControllerException.php
new file mode 100644 (file)
index 0000000..7fec632
--- /dev/null
@@ -0,0 +1,50 @@
+<?php
+/**
+ * This exception is thrown when the default controller is missing
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class InvalidControllerException extends FrameworkException {
+       /**
+        * The super constructor for all exceptions
+        *
+        * @param       $msgArray       An array with message parts
+        * @param       $code           An optional code for better debugging
+        * @return      void
+        */
+       public function __construct(array $msgArray, $code) {
+               // Prepare the message
+               $message = sprintf("[%s:%d] Cannot resolve controller <span class=\"exception_reason\">%s (class name: %s)</span>.",
+                       $msgArray[0]->__toString(),
+                       $this->getLine(),
+                       $msgArray[1],
+                       $msgArray[0]->getClassName()
+               );
+
+               // Set extra data
+               $this->setExtraData($msgArray[0]->getClassName().":".$this->getLine());
+
+               // Call parent contructor with message
+               parent::__construct($message, $code);
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/exceptions/criteria/.htaccess b/inc/classes/exceptions/criteria/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/inc/classes/exceptions/crypto/.htaccess b/inc/classes/exceptions/crypto/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/inc/classes/exceptions/crypto/class_EncryptInvalidLengthException.php b/inc/classes/exceptions/crypto/class_EncryptInvalidLengthException.php
new file mode 100644 (file)
index 0000000..4b6314d
--- /dev/null
@@ -0,0 +1,52 @@
+<?php
+/**
+ * An exception thrown when the decrypted "encrypt" string has an invalid length
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class EncryptInvalidLengthException extends FrameworkException {
+       /**
+        * The super constructor for all exceptions
+        *
+        * @param       $message        Error message
+        * @param       $code           Error code
+        * @return      void
+        */
+       public function __construct(Filterable $filterInstance, $code) {
+               // Get length
+               $length = $filterInstance->getConfigInstance()->readConfig('captcha_string_length');
+
+               // Construct message
+               $message = sprintf("[%s:%d] Encrypt string has an invalid length. Valid: %d",
+                       $filterInstance->__toString(),
+                       $this->getLine(),
+                       $length
+               );
+
+               // Set extra data
+               $this->setExtraData($filterInstance->__toString().":".$length);
+
+               // Call parent exception constructor
+               parent::__construct($message, $code);
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/exceptions/crypto/class_EncryptMissingException.php b/inc/classes/exceptions/crypto/class_EncryptMissingException.php
new file mode 100644 (file)
index 0000000..78583c0
--- /dev/null
@@ -0,0 +1,48 @@
+<?php
+/**
+ * An exception thrown when the "encrypt" string is missing
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class EncryptMissingException extends FrameworkException {
+       /**
+        * The super constructor for all exceptions
+        *
+        * @param       $message        Error message
+        * @param       $code           Error code
+        * @return      void
+        */
+       public function __construct(Filterable $filterInstance, $code) {
+               // Construct message
+               $message = sprintf("[%s:%d] Encrypt string is missing.",
+                       $filterInstance->__toString(),
+                       $this->getLine()
+               );
+
+               // Set extra data
+               $this->setExtraData($filterInstance->__toString());
+
+               // Call parent exception constructor
+               parent::__construct($message, $code);
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/exceptions/database/.htaccess b/inc/classes/exceptions/database/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/inc/classes/exceptions/database/class_ b/inc/classes/exceptions/database/class_
new file mode 100644 (file)
index 0000000..1124b16
--- /dev/null
@@ -0,0 +1,39 @@
+<?php
+/**
+ * 
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ * 
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class ???Exception extends DatabaseException {
+       /**
+        * The constructor
+        *
+        * @param       $message        Message from the exception
+        * @param       $code           Code number for the exception
+        * @return      void
+        */
+       public function __construct ($message, $code) {
+               // Just call the parent constructor
+               parent::__construct($message, $code);
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/exceptions/database/class_DatabaseException.php b/inc/classes/exceptions/database/class_DatabaseException.php
new file mode 100644 (file)
index 0000000..ab2eabb
--- /dev/null
@@ -0,0 +1,39 @@
+<?php
+/**
+ * A general database exception
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ * 
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class DatabaseException extends FrameworkException {
+       /**
+        * The constructor
+        *
+        * @param       $message        Message from the exception
+        * @param       $code           Code number for the exception
+        * @return      void
+        */
+       public function __construct ($message, $code) {
+               // Just call the parent constructor
+               parent::__construct($message, $code);
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/exceptions/database/general/.htaccess b/inc/classes/exceptions/database/general/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/inc/classes/exceptions/database/general/class_DatabaseUpdateSupportException.php b/inc/classes/exceptions/database/general/class_DatabaseUpdateSupportException.php
new file mode 100644 (file)
index 0000000..637b962
--- /dev/null
@@ -0,0 +1,45 @@
+<?php
+/**
+ * An exception thrown when a class tries an unallowed database update
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ * 
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class DatabaseUpdateSupportException extends DatabaseException {
+       /**
+        * The constructor
+        *
+        * @param       $class  Class trying the invalid database update
+        * @param       $code   Code number for the exception
+        * @return      void
+        */
+       public function __construct (FrameworkInterface $class, $code) {
+               // Generate message
+               $message = sprintf("[%s:%d] Database updated not allowed for this class.",
+                       $class->__toString(),
+                       $this->getLine()
+               );
+
+               // Just call the parent constructor
+               parent::__construct($message, $code);
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/exceptions/database/general/class_SqlException.php b/inc/classes/exceptions/database/general/class_SqlException.php
new file mode 100644 (file)
index 0000000..0634928
--- /dev/null
@@ -0,0 +1,47 @@
+<?php
+/**
+ * A SQL exception thrown when an SQL error was detected.
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ * 
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class SqlException extends DatabaseException {
+       /**
+        * The constructor
+        *
+        * @param       $msgArray       Message array
+        * @param       $code           Code number for the exception
+        * @return      void
+        */
+       public function __construct (array $msgArray, $code) {
+               // Construct the message
+               $message = sprintf("[%s:%d] SQL error detected. Message from database: <span class=\"exception_reason\">%s</span>, code: <span class=\"exception_reason\">%s</span>.",
+                       $msgArray[0]->__toString(),
+                       $this->getLine(),
+                       $msgArray[1],
+                       $this->getHexCode($msgArray[2])
+               );
+
+               // Call parent constructor
+               parent::__construct($message, $code);
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/exceptions/database/local_file/.htaccess b/inc/classes/exceptions/database/local_file/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/inc/classes/exceptions/database/local_file/class_SavePathIsEmptyException.php b/inc/classes/exceptions/database/local_file/class_SavePathIsEmptyException.php
new file mode 100644 (file)
index 0000000..06f14ca
--- /dev/null
@@ -0,0 +1,45 @@
+<?php
+/**
+ * An exception thrown when the save path string is empty
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ * 
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class SavePathIsEmptyException extends DatabaseException {
+       /**
+        * The constructor
+        *
+        * @param       $class  Class throwing this exception
+        * @param       $code   Code number for the exception
+        * @return      void
+        */
+       public function __construct (FrameworkInterface $class, $code) {
+               // Add a message around the missing class
+               $message = sprintf("[%s:%d] Save path is empty.",
+                       $class->__toString(),
+                       $this->getLine()
+               );
+
+               // Call parent constructor
+               parent::__construct($message, $code);
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/exceptions/database/local_file/class_SavePathIsNoDirectoryException.php b/inc/classes/exceptions/database/local_file/class_SavePathIsNoDirectoryException.php
new file mode 100644 (file)
index 0000000..b14fa97
--- /dev/null
@@ -0,0 +1,42 @@
+<?php
+/**
+ * An exception thrown when the save path is no directory
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ * 
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class SavePathIsNoDirectoryException extends DatabaseException {
+       /**
+        * The constructor
+        *
+        * @param       $message        Message from the exception
+        * @param       $code           Code number for the exception
+        * @return      void
+        */
+       public function __construct ($path, $code) {
+               // Add a message around the missing class
+               $message = sprintf("Der angegebene Speicherpfad <span class=\"exception_reason\">%s</span> ist ung&uuml;tig (kein Pfad).", $path);
+
+               // Call parent constructor
+               parent::__construct($message, $code);
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/exceptions/database/local_file/class_SavePathReadProtectedException.php b/inc/classes/exceptions/database/local_file/class_SavePathReadProtectedException.php
new file mode 100644 (file)
index 0000000..ce0ffa6
--- /dev/null
@@ -0,0 +1,42 @@
+<?php
+/**
+ * An exception thrown when the save path is read-protected
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ * 
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class SavePathReadProtectedException extends DatabaseException {
+       /**
+        * The constructor
+        *
+        * @param       $message        Message from the exception
+        * @param       $code           Code number for the exception
+        * @return      void
+        */
+       public function __construct ($path, $code) {
+               // Add a message around the missing class
+               $message = sprintf("Der Pfad <span class=\"exception_reason\">%s</span> ist lese-gesch&uuml;tzt. Bitte Zugriffsrechte (CHMOD) zum Lesen setzen.", $path);
+
+               // Call parent constructor
+               parent::__construct($message, $code);
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/exceptions/database/local_file/class_SavePathWriteProtectedException.php b/inc/classes/exceptions/database/local_file/class_SavePathWriteProtectedException.php
new file mode 100644 (file)
index 0000000..81a1067
--- /dev/null
@@ -0,0 +1,42 @@
+<?php
+/**
+ * An exception thrown when the save path is write-protected
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ * 
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class SavePathWriteProtectedException extends DatabaseException {
+       /**
+        * The constructor
+        *
+        * @param       $message        Message from the exception
+        * @param       $code           Code number for the exception
+        * @return      void
+        */
+       public function __construct ($path, $code) {
+               // Add a message around the missing class
+               $message = sprintf("Der angegebene Speicherpfad <span class=\"exception_reason\">%s</span> ist schreibgesch&uuml;tzt. Bitte Zugriffsrechte (CHMOD) entsprechend setzen.", $path);
+
+               // Call parent constructor
+               parent::__construct($message, $code);
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/exceptions/database/wrapper/.htaccess b/inc/classes/exceptions/database/wrapper/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/inc/classes/exceptions/database/wrapper/class_WrapperUserNameNotFoundException.php b/inc/classes/exceptions/database/wrapper/class_WrapperUserNameNotFoundException.php
new file mode 100644 (file)
index 0000000..819b388
--- /dev/null
@@ -0,0 +1,49 @@
+<?php
+/**
+ * An exception thrown when the database wrapper has not found the username
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ * @todo               This class is no longer used
+ * @deprecated
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class WrapperUserNameNotFoundException extends DatabaseException {
+       /**
+        * The constructor
+        *
+        * @param       $msgArray       Message from the exception
+        * @param       $code           Code number for the exception
+        * @return      void
+        */
+       public function __construct (array $msgArray, $code) {
+               // Add a message around the missing class
+               $message = sprintf("[%s:%d] Username <span class=\"exception_reason\">%s</span> was not found. Requesting class: <span class=\"exception_reason\">%s</span>",
+                       $msgArray[0]->__toString(),
+                       $this->getLine(),
+                       $msgArray[1]->getUserName(),
+                       $msgArray[1]->__toString()
+               );
+
+               // Call parent constructor
+               parent::__construct($message, $code);
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/exceptions/filter/.htaccess b/inc/classes/exceptions/filter/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/inc/classes/exceptions/filter/class_FilterChainException.php b/inc/classes/exceptions/filter/class_FilterChainException.php
new file mode 100644 (file)
index 0000000..b2cbb10
--- /dev/null
@@ -0,0 +1,45 @@
+<?php
+/**
+ * An exception thrown in a filter chain to stop processing further filters
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class FilterChainException extends FrameworkException {
+       /**
+        * The super constructor for all exceptions
+        *
+        * @param       $filterInstance         Instance of a filter class
+        * @param       $code                           Exception code for better debugging
+        * @return      void
+        */
+       public function __construct(Filterable $filterInstance, $code) {
+               // Construct the message
+               $message = sprintf("[%s:%d] Filter chain interruppted by fatal error in filter.",
+                       $filterInstance->__toString(),
+                       $this->getLine()
+               );
+
+               // Call the parent exception
+               parent::__construct($message, $code);
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/exceptions/helper/.htaccess b/inc/classes/exceptions/helper/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/inc/classes/exceptions/helper/class_FormClosedException.php b/inc/classes/exceptions/helper/class_FormClosedException.php
new file mode 100644 (file)
index 0000000..9978e5e
--- /dev/null
@@ -0,0 +1,47 @@
+<?php
+/**
+ * An exception thrown when the form is still closed but input field shall be
+ * added to it. This should normally not happen, but well, who knows?
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class FormClosedException extends FrameworkException {
+       /**
+        * The constructor
+        *
+        * @param       $classArray             Class throwing the exception
+        * @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] Could not add form element <span class=\"exception_reason\">%s</span> because form is closed.",
+                       $classArray[0]->__toString(),
+                       $this->getLine(),
+                       $classArray[1]
+               );
+
+               // Call parent constructor
+               parent::__construct($message, $code);
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/exceptions/helper/class_FormGroupClosedException.php b/inc/classes/exceptions/helper/class_FormGroupClosedException.php
new file mode 100644 (file)
index 0000000..92a6e43
--- /dev/null
@@ -0,0 +1,46 @@
+<?php
+/**
+ * An exception thrown when a form group is still closed.
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class FormGroupClosedException extends FrameworkException {
+       /**
+        * The constructor
+        *
+        * @param       $classArray             Class throwing the exception
+        * @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] Could not add sub group <span class=\"exception_reason\">%s</span> because no form group has been opened before.",
+                       $classArray[0]->__toString(),
+                       $this->getLine(),
+                       $classArray[1]
+               );
+
+               // Call parent constructor
+               parent::__construct($message, $code);
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/exceptions/helper/class_FormOpenedException.php b/inc/classes/exceptions/helper/class_FormOpenedException.php
new file mode 100644 (file)
index 0000000..aab6078
--- /dev/null
@@ -0,0 +1,47 @@
+<?php
+/**
+ * An exception thrown when the form is still opened but we e.g. shall flush
+ * the content.
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class FormOpenedException extends FrameworkException {
+       /**
+        * The constructor
+        *
+        * @param       $helperInstance         Class throwing the exception
+        * @param       $code                           Code number for the exception
+        * @return      void
+        */
+       public function __construct (BaseHelper $helperInstance, $code) {
+               // Add a message around the missing class
+               $message = sprintf("[%s:%d] Form is not yet closed. Close it with method <u>%s::addFormTag()</u> and add no parameters.",
+                       $helperInstance->__toString(),
+                       $this->getLine(),
+                       $helperInstance->__toString()
+               );
+
+               // Call parent constructor
+               parent::__construct($message, $code);
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/exceptions/helper/class_HelperGroupAlreadyCreatedException.php b/inc/classes/exceptions/helper/class_HelperGroupAlreadyCreatedException.php
new file mode 100644 (file)
index 0000000..0f14f17
--- /dev/null
@@ -0,0 +1,46 @@
+<?php
+/**
+ * An exception thrown when a group was added twice
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class HelperGroupAlreadyCreatedException extends FrameworkException {
+       /**
+        * The constructor
+        *
+        * @param       $msgArray       Array containing exception data
+        * @param       $code           Code number for the exception
+        * @return      void
+        */
+       public function __construct (array $msgArray, $code) {
+               // Add a message around the missing class
+               $message = sprintf("[%s:%d] Group %s already opened before.",
+                       $msgArray[0]->__toString(),
+                       $this->getLine(),
+                       $msgArray[1]
+               );
+
+               // Call parent constructor
+               parent::__construct($message, $code);
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/exceptions/helper/class_HelperNoPreviousOpenedSubGroupException.php b/inc/classes/exceptions/helper/class_HelperNoPreviousOpenedSubGroupException.php
new file mode 100644 (file)
index 0000000..b6b78f6
--- /dev/null
@@ -0,0 +1,46 @@
+<?php
+/**
+ * An exception thrown when no sub group was opened previously
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class HelperNoPreviousOpenedSubGroupException extends FrameworkException {
+       /**
+        * The constructor
+        *
+        * @param       $msgArray       Array containing exception data
+        * @param       $code           Code number for the exception
+        * @return      void
+        */
+       public function __construct (array $msgArray, $code) {
+               // Add a message around the missing class
+               $message = sprintf("[%s:%d] Sub group not opened before. Raw text follows: <span class=\"exception_reason\">%s</span>",
+                       $msgArray[0]->__toString(),
+                       $this->getLine(),
+                       $msgArray[1]
+               );
+
+               // Call parent constructor
+               parent::__construct($message, $code);
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/exceptions/helper/class_HelperSubGroupAlreadyCreatedException.php b/inc/classes/exceptions/helper/class_HelperSubGroupAlreadyCreatedException.php
new file mode 100644 (file)
index 0000000..efdfff9
--- /dev/null
@@ -0,0 +1,46 @@
+<?php
+/**
+ * An exception thrown when a sub group was added twice
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class HelperSubGroupAlreadyCreatedException extends FrameworkException {
+       /**
+        * The constructor
+        *
+        * @param       $msgArray       Array containing exception data
+        * @param       $code           Code number for the exception
+        * @return      void
+        */
+       public function __construct (array $msgArray, $code) {
+               // Add a message around the missing class
+               $message = sprintf("[%s:%d] Sub group %s already opened before.",
+                       $msgArray[0]->__toString(),
+                       $this->getLine(),
+                       $msgArray[1]
+               );
+
+               // Call parent constructor
+               parent::__construct($message, $code);
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/exceptions/helper/class_InvalidFormNameException.php b/inc/classes/exceptions/helper/class_InvalidFormNameException.php
new file mode 100644 (file)
index 0000000..70e1c3d
--- /dev/null
@@ -0,0 +1,45 @@
+<?php
+/**
+ * An exception thrown when the form name is invalid (set to false)
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class InvalidFormNameException extends FrameworkException {
+       /**
+        * The constructor
+        *
+        * @param       $helperInstance         Class throwing the exception
+        * @param       $code                           Code number for the exception
+        * @return      void
+        */
+       public function __construct (BaseHelper $helperInstance, $code) {
+               // Add a message around the missing class
+               $message = sprintf("[%s:%d] Form name not set.",
+                       $helperInstance->__toString(),
+                       $this->getLine()
+               );
+
+               // Call parent constructor
+               parent::__construct($message, $code);
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/exceptions/helper/class_NoGroupOpenedException.php b/inc/classes/exceptions/helper/class_NoGroupOpenedException.php
new file mode 100644 (file)
index 0000000..2946a8b
--- /dev/null
@@ -0,0 +1,46 @@
+<?php
+/**
+ * An exception thrown when a group was not opened before
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class NoGroupOpenedException extends FrameworkException {
+       /**
+        * The constructor
+        *
+        * @param       $msgArray       Array containing exception data
+        * @param       $code           Code number for the exception
+        * @return      void
+        */
+       public function __construct (array $msgArray, $code) {
+               // Add a message around the missing class
+               $message = sprintf("[%s:%d] Group not opened before. Raw text follows: <span class=\"exception_reason\">%s</span>",
+                       $msgArray[0]->__toString(),
+                       $this->getLine(),
+                       $msgArray[1]
+               );
+
+               // Call parent constructor
+               parent::__construct($message, $code);
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/exceptions/helper/class_UserInstanceMissingException.php b/inc/classes/exceptions/helper/class_UserInstanceMissingException.php
new file mode 100644 (file)
index 0000000..218968b
--- /dev/null
@@ -0,0 +1,46 @@
+<?php
+/**
+ * An exception thrown when a user instance is invalid
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class UserInstanceMissingException extends FrameworkException {
+       /**
+        * The constructor
+        *
+        * @param       $classArray             Array with class instance and registry key
+        * @param       $code                   Code number for the exception
+        * @return      void
+        */
+       public function __construct (array $classArray, $code) {
+               // Add a message around the missing class
+               $message = sprintf("[%s:%d] Registry key <span class=\"exception_reason\">%s</span> does not include a class with implemented interface <u>Manageable(User|Guest)</u>.",
+                       $classArray[0]->__toString(),
+                       $this->getLine(),
+                       $classArray[1]
+               );
+
+               // Call parent constructor
+               parent::__construct($message, $code);
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/exceptions/io/.htaccess b/inc/classes/exceptions/io/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/inc/classes/exceptions/io/class_DirPointerNotOpenedException.php b/inc/classes/exceptions/io/class_DirPointerNotOpenedException.php
new file mode 100644 (file)
index 0000000..5b0293e
--- /dev/null
@@ -0,0 +1,42 @@
+<?php
+/**
+ * An exception thrown when a directory pointer is not opended
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ * 
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class DirPointerNotOpenedException extends FrameworkException {
+       /**
+        * The constructor
+        *
+        * @param       $path   Message from the exception
+        * @param       $code   Code number for the exception
+        * @return      void
+        */
+       public function __construct ($path, $code) {
+               // Add a message around the missing class
+               $message = sprintf("F&uuml;r den Pfad <span class=\"exception_reason\">%s</span> konnte kein Pointer initialisiert werden.", $path);
+
+               // Call parent constructor
+               parent::__construct($message, $code);
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/exceptions/io/class_FileNotFoundException.php b/inc/classes/exceptions/io/class_FileNotFoundException.php
new file mode 100644 (file)
index 0000000..ea31a49
--- /dev/null
@@ -0,0 +1,49 @@
+<?php
+/**
+ * An exception thrown when a file was not found
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ * @todo               Rename this class to FileIoException
+ * @deprecated
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class FileNotFoundException extends FrameworkException {
+       /**
+        * The constructor
+        *
+        * @param       $fqfn   Full-qualified file name of (maybe) missing file
+        * @param       $code   Code number for the exception
+        * @return      void
+        */
+       public function __construct ($fqfn, $code) {
+               // Add a message around the missing class
+               $message = sprintf("The requested file <span class=\"exception_reason\">%s</span> was not found.",
+                       $fqfn
+               );
+
+               // Set extra data
+               $this->setExtraData(basename($fqfn));
+
+               // Call parent constructor
+               parent::__construct($message, $code);
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/exceptions/io/class_FilePointerNotOpenedException.php b/inc/classes/exceptions/io/class_FilePointerNotOpenedException.php
new file mode 100644 (file)
index 0000000..37300a5
--- /dev/null
@@ -0,0 +1,42 @@
+<?php
+/**
+ * An exception thrown when a file pointer is not opened
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ * 
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class FilePointerNotOpenedException extends FrameworkException {
+       /**
+        * The constructor
+        *
+        * @param       $fqfn   Full-qualified file name of (maybe) missing file
+        * @param       $code   Code number for the exception
+        * @return      void
+        */
+       public function __construct ($fqfn, $code) {
+               // Add a message around the missing class
+               $message = sprintf("Not able to initialize a pointer for the file <span class=\"exception_reason\">%s</span>. Maybe the file is missing.", $fqfn);
+
+               // Call parent constructor
+               parent::__construct($message, $code);
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/exceptions/io/class_FileReadProtectedException.php b/inc/classes/exceptions/io/class_FileReadProtectedException.php
new file mode 100644 (file)
index 0000000..4e8a0e6
--- /dev/null
@@ -0,0 +1,42 @@
+<?php
+/**
+ * An exception thrown when a file is read-protected
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ * 
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class FileReadProtectedException extends FrameworkException {
+       /**
+        * The constructor
+        *
+        * @param       $fileName       File which cannot be read from
+        * @param       $code           Code number for the exception
+        * @return      void
+        */
+       public function __construct ($fileName, $code) {
+               // Add a message around the missing class
+               $message = sprintf("File <span class=\"exception_reason\">%s</span> is read-protected. Please set read access rights (CHMOD).", $fileName);
+
+               // Call parent constructor
+               parent::__construct($message, $code);
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/exceptions/io/class_InvalidDataLengthException.php b/inc/classes/exceptions/io/class_InvalidDataLengthException.php
new file mode 100644 (file)
index 0000000..a1ef85a
--- /dev/null
@@ -0,0 +1,47 @@
+<?php
+/**
+ * An exception thrown when the length of the data mismatch
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class InvalidDataLengthException extends FrameworkException {
+       /**
+        * The constructor
+        *
+        * @param       $msgArray       Message from the exception
+        * @param       $code           Code number for the exception
+        * @return      void
+        */
+       public function __construct (array $msgArray, $code) {
+               // Add a message around the missing class
+               $message = sprintf("[%s:%d] Eine unerwartete Datenl&auml;nge von <span class=\"exception_reason\">%s</span> Byte ist aufgetreten. <span class=\"exception_reason\">%s</span> wurden erwartet!",
+                       $msgArray[0]->__toString(),
+                       $this->getLine(),
+                       $msgArray[1],
+                       $msgArray[2]
+               );
+
+               // Call parent constructor
+               parent::__construct($message, $code);
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/exceptions/io/class_InvalidDirectoryResourceException.php b/inc/classes/exceptions/io/class_InvalidDirectoryResourceException.php
new file mode 100644 (file)
index 0000000..71a7f9c
--- /dev/null
@@ -0,0 +1,45 @@
+<?php
+/**
+ * An exception thrown when the returned directory resource is invalid
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ * 
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class InvalidDirectoryResourceException extends FrameworkException {
+       /**
+        * The constructor
+        *
+        * @param       $class  Class throwing this exception
+        * @param       $code   Code number for the exception
+        * @return      void
+        */
+       public function __construct (FrameworkInterface $class, $code) {
+               // Add a message around the missing class
+               $message = sprintf("[%s:%d] Has an invalid directory resource.",
+                       $class->__toString(),
+                       $this->getLine()
+               );
+
+               // Call parent constructor
+               parent::__construct($message, $code);
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/exceptions/io/class_InvalidMD5ChecksumException.php b/inc/classes/exceptions/io/class_InvalidMD5ChecksumException.php
new file mode 100644 (file)
index 0000000..2e5104a
--- /dev/null
@@ -0,0 +1,47 @@
+<?php
+/**
+ * An exception thrown when a MD5 checksum does not exception
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class InvalidMD5ChecksumException extends FrameworkException {
+       /**
+        * The constructor
+        *
+        * @param       $msgArray       Message from the exception
+        * @param       $code           Code number for the exception
+        * @return      void
+        */
+       public function __construct (array $msgArray, $code) {
+               // Add a message around the missing class
+               $message = sprintf("[%s:%d] Die MD5-Pr&uuml;fsummen <span class=\"exception_reason\">%s</span> und <span class=\"exception_reason\">%s</span> stimmen nicht &uuml;berein!",
+                       $msgArray[0]->__toString(),
+                       $this->getLine(),
+                       $msgArray[1],
+                       $msgArray[2]
+               );
+
+               // Call parent constructor
+               parent::__construct($message, $code);
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/exceptions/io/class_PathIsEmptyException.php b/inc/classes/exceptions/io/class_PathIsEmptyException.php
new file mode 100644 (file)
index 0000000..6747f78
--- /dev/null
@@ -0,0 +1,45 @@
+<?php
+/**
+ * An exception thrown when the path string is empty
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ * 
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class PathIsEmptyException extends FrameworkException {
+       /**
+        * The constructor
+        *
+        * @param       $class  Class throwing this exception
+        * @param       $code   Code number for the exception
+        * @return      void
+        */
+       public function __construct (FrameworkInterface $class, $code) {
+               // Add a message around the missing class
+               $message = sprintf("[%s:%d] Directory path is empty.",
+                       $class->__toString(),
+                       $this->getLine()
+               );
+
+               // Call parent constructor
+               parent::__construct($message, $code);
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/exceptions/io/class_PathIsNoDirectoryException.php b/inc/classes/exceptions/io/class_PathIsNoDirectoryException.php
new file mode 100644 (file)
index 0000000..7f908b1
--- /dev/null
@@ -0,0 +1,42 @@
+<?php
+/**
+ * An exception thrown when a given path is not a directory
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ * 
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class PathIsNoDirectoryException extends FrameworkException {
+       /**
+        * The constructor
+        *
+        * @param       $message        Message from the exception
+        * @param       $code           Code number for the exception
+        * @return      void
+        */
+       public function __construct ($path, $code) {
+               // Add a message around the missing class
+               $message = sprintf("Der angegebene Pfad <span class=\"exception_reason\">%s</span> ist ung&uuml;tig (kein Pfad).", $path);
+
+               // Call parent constructor
+               parent::__construct($message, $code);
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/exceptions/io/class_PathReadProtectedException.php b/inc/classes/exceptions/io/class_PathReadProtectedException.php
new file mode 100644 (file)
index 0000000..b5dd935
--- /dev/null
@@ -0,0 +1,42 @@
+<?php
+/**
+ * An exception thrown when a path is read-protected
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ * 
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class PathReadProtectedException extends FrameworkException {
+       /**
+        * The constructor
+        *
+        * @param       $message        Message from the exception
+        * @param       $code           Code number for the exception
+        * @return      void
+        */
+       public function __construct ($path, $code) {
+               // Add a message around the missing class
+               $message = sprintf("Der Pfad <span class=\"exception_reason\">%s</span> ist lese-gesch&uuml;tzt. Bitte Zugriffsrechte (CHMOD) zum Lesen setzen.", $path);
+
+               // Call parent constructor
+               parent::__construct($message, $code);
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/exceptions/language/.htaccess b/inc/classes/exceptions/language/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/inc/classes/exceptions/language/class_InvalidLanguagePathStringException.php b/inc/classes/exceptions/language/class_InvalidLanguagePathStringException.php
new file mode 100644 (file)
index 0000000..19be0cd
--- /dev/null
@@ -0,0 +1,46 @@
+<?php
+/**
+ * An exception thrown when the language path string is invalid
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ * 
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class InvalidLanguagePathStringException extends FrameworkException {
+       /**
+        * The constructor
+        *
+        * @param       $classArray             Array holding exception data
+        * @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] <span class=\"exception_reason\">%s</span> is not a string with path!",
+                       $classArray[0]->__toString(),
+                       $this->getLine(),
+                       $classArray[1]
+               );
+
+               // Call parent constructor
+               parent::__construct($message, $code);
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/exceptions/language/class_LanguagePathIsEmptyException.php b/inc/classes/exceptions/language/class_LanguagePathIsEmptyException.php
new file mode 100644 (file)
index 0000000..557d32d
--- /dev/null
@@ -0,0 +1,45 @@
+<?php
+/**
+ * An exception thrown when the language path string is empty
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ * 
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class LanguagePathIsEmptyException extends FrameworkException {
+       /**
+        * The constructor
+        *
+        * @param       $class  Class throwing this exception
+        * @param       $code   Code number for the exception
+        * @return      void
+        */
+       public function __construct (FrameworkInterface $class, $code) {
+               // Add a message around the missing class
+               $message = sprintf("[%s:%d] Language base path is empty.",
+                       $class->__toString(),
+                       $this->getLine()
+               );
+
+               // Call parent constructor
+               parent::__construct($message, $code);
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/exceptions/language/class_LanguagePathIsNoDirectoryException.php b/inc/classes/exceptions/language/class_LanguagePathIsNoDirectoryException.php
new file mode 100644 (file)
index 0000000..b17823d
--- /dev/null
@@ -0,0 +1,46 @@
+<?php
+/**
+ * An exception thrown when the language path is no directory
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ * 
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class LanguagePathIsNoDirectoryException extends FrameworkException {
+       /**
+        * The constructor
+        *
+        * @param       $classArray             Array holding exception data
+        * @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] Der Sprach-Basispfad <span class=\"exception_reason\">%s</span> existiert nicht oder ist eine Datei!",
+                       $classArray[0]->__toString(),
+                       $this->getLine(),
+                       $classArray[1]
+               );
+
+               // Call parent constructor
+               parent::__construct($message, $code);
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/exceptions/language/class_LanguagePathReadProtectedException.php b/inc/classes/exceptions/language/class_LanguagePathReadProtectedException.php
new file mode 100644 (file)
index 0000000..0938f77
--- /dev/null
@@ -0,0 +1,46 @@
+<?php
+/**
+ * An exception thrown when the language path is read-protected
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ * 
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class LanguagePathReadProtectedException extends FrameworkException {
+       /**
+        * The constructor
+        *
+        * @param       $class  Array holding exception data
+        * @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] Base language path <span class=\"exception_reason\">%s</span> is read-protected. Please change access rights (CHMOD).",
+                       $classArray[0]->__toString(),
+                       $this->getLine(),
+                       $classArray[1]
+               );
+
+               // Call parent constructor
+               parent::__construct($message, $code);
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/exceptions/language/class_MissingFileIoHandlerException.php b/inc/classes/exceptions/language/class_MissingFileIoHandlerException.php
new file mode 100644 (file)
index 0000000..6a844db
--- /dev/null
@@ -0,0 +1,45 @@
+<?php
+/**
+ * An exception thrown when the language handler is missing
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class MissingFileIoHandlerException extends FrameworkException {
+       /**
+        * The constructor
+        *
+        * @param       $class  Class throwing this exception
+        * @param       $code   Code number for the exception
+        * @return      void
+        */
+       public function __construct (FrameworkInterface $class, $code) {
+               // Add a message around the missing class
+               $message = sprintf("[%s:%d] File i/o sub-system not initialized!",
+                       $class->__toString(),
+                       $this->getLine()
+               );
+
+               // Call parent constructor
+               parent::__construct($message, $code);
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/exceptions/language/class_MissingLanguageHandlerException.php b/inc/classes/exceptions/language/class_MissingLanguageHandlerException.php
new file mode 100644 (file)
index 0000000..a4a4131
--- /dev/null
@@ -0,0 +1,45 @@
+<?php
+/**
+ * An exception thrown when the language handler is missing
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class MissingLanguageHandlerException extends FrameworkException {
+       /**
+        * The constructor
+        *
+        * @param       $class  Class throwing this exception
+        * @param       $code   Code number for the exception
+        * @return      void
+        */
+       public function __construct (FrameworkInterface $class, $code) {
+               // Add a message around the missing class
+               $message = sprintf("[%s:%d] Language sub-system not initialized!",
+                       $class->__toString(),
+                       $this->getLine()
+               );
+
+               // Call parent constructor
+               parent::__construct($message, $code);
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/exceptions/main/.htaccess b/inc/classes/exceptions/main/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/inc/classes/exceptions/main/class_AssertionException.php b/inc/classes/exceptions/main/class_AssertionException.php
new file mode 100644 (file)
index 0000000..270eb8f
--- /dev/null
@@ -0,0 +1,39 @@
+<?php
+/**
+ * An exception thrown when a assertion fails
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class AssertionException extends FrameworkException {
+       /**
+        * The constructor
+        *
+        * @param       $message        Message from the exception
+        * @param       $code           Code number for the exception
+        * @return      void
+        */
+       public function __construct ($message, $code) {
+               // Call parent constructor
+               parent::__construct($message, $code);
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/exceptions/main/class_ClassMismatchException.php b/inc/classes/exceptions/main/class_ClassMismatchException.php
new file mode 100644 (file)
index 0000000..51497b4
--- /dev/null
@@ -0,0 +1,45 @@
+<?php
+/**
+ * An exception thrown when two classes are not matching
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ * 
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class ClassMismatchException extends FrameworkException {
+       /**
+        * The constructor
+        *
+        * @param       $classArray             Array holding the exception informations
+        * @param       $code                   Code number for the exception
+        * @return      void
+        */
+       public function __construct (array $classArray, $code) {
+               // Add a message around the missing class
+               $message = sprintf("The class <span class=\"exception_reason\">%s</span> does not match class <span class=\"exception_reason\">%s</span>.",
+                       $classArray[0],
+                       $classArray[1]
+               );
+
+               // Call parent constructor
+               parent::__construct($message, $code);
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/exceptions/main/class_ClassNotFoundException.php b/inc/classes/exceptions/main/class_ClassNotFoundException.php
new file mode 100644 (file)
index 0000000..3a7b995
--- /dev/null
@@ -0,0 +1,51 @@
+<?php
+/**
+ * An exception thrown when a class was not found
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ * @todo               Rename this class to NoClassException
+ * @deprecated
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class ClassNotFoundException extends FrameworkException {
+       /**
+        * The constructor
+        *
+        * @param       $msgArray       Message from the exception
+        * @param       $code           Code number for the exception
+        * @return      void
+        */
+       public function __construct (array $msgArray, $code) {
+               // Add a message around the missing class
+               $message = sprintf("[%s:%d] Internal class <span class=\"exception_reason\">%s</span> not found.",
+                       $msgArray[0]->__toString(),
+                       $this->getLine(),
+                       $msgArray[1]
+               );
+
+               // Set extra data
+               $this->setExtraData($msgArray[1]);
+
+               // Call parent constructor
+               parent::__construct($message, $code);
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/exceptions/main/class_ConfigEntryIsEmptyException.php b/inc/classes/exceptions/main/class_ConfigEntryIsEmptyException.php
new file mode 100644 (file)
index 0000000..c0d60e2
--- /dev/null
@@ -0,0 +1,45 @@
+<?php
+/**
+ * An exception thrown when a configuration entry is empty
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class ConfigEntryIsEmptyException extends FrameworkException {
+       /**
+        * The constructor
+        *
+        * @param       $class  Class throwing this exception
+        * @param       $code   Code number for the exception
+        * @return      void
+        */
+       public function __construct (FrameworkConfiguration $class, $code) {
+               // Add a message around the missing class
+               $message = sprintf("[%s:%d] Empty configuration entry provided!",
+                       $class->__toString(),
+                       $this->getLine()
+               );
+
+               // Call parent constructor
+               parent::__construct($message, $code);
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/exceptions/main/class_ConfigEntryNotFoundException.php b/inc/classes/exceptions/main/class_ConfigEntryNotFoundException.php
new file mode 100644 (file)
index 0000000..76be0f1
--- /dev/null
@@ -0,0 +1,51 @@
+<?php
+/**
+ * An exception thrown when a configuration entry is not found
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ * @todo               Rename this class to NoFoundEntryException
+ * @deprecated
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class ConfigEntryNotFoundException extends FrameworkException {
+       /**
+        * The constructor
+        *
+        * @param       $classArray             Array with exception data
+        * @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] Configuration entry <span class=\"exception_reason\">%s</span> not found.",
+                       $classArray[0],
+                       $this->getLine(),
+                       $classArray[1]
+               );
+
+               // Set extra data
+               $this->setExtraData($classArray[1].":".$this->getLine());
+
+               // Call parent constructor
+               parent::__construct($message, $code);
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/exceptions/main/class_DimNotFoundInArrayException.php b/inc/classes/exceptions/main/class_DimNotFoundInArrayException.php
new file mode 100644 (file)
index 0000000..1e11cce
--- /dev/null
@@ -0,0 +1,50 @@
+<?php
+/**
+ * An exception thron when dimension entries are not found in an array
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ * 
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class DimNotFoundInArrayException extends FrameworkException {
+       /**
+        * The constructor
+        *
+        * @param       $class  Class throwing the exception
+        * @param       $code   Code number for the exception
+        * @return      void
+        */
+       public function __construct (FrameworkInterface $class, $code) {
+               if (is_object($class)) {
+                       // Add a message around the missing class
+                       $message = sprintf("[%s:%d] Dimensions not found in array, array is invalid!",
+                               $class->__toString(),
+                               $this->getLine()
+                       );
+               } else {
+                       // No class given
+                       $message = sprintf("Please provide a class for <span class=\"exception_reason\">%s</span>", __CLASS__);
+               }
+
+               // Call parent constructor
+               parent::__construct($message, $code);
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/exceptions/main/class_EmptyVariableException.php b/inc/classes/exceptions/main/class_EmptyVariableException.php
new file mode 100644 (file)
index 0000000..188969c
--- /dev/null
@@ -0,0 +1,46 @@
+<?php
+/**
+ * This exception is thrown when a variable is unexpected empty
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class EmptyVariableException extends FrameworkException {
+       /**
+        * The constructor
+        *
+        * @param       $msgArray       Message array holding all needed data
+        * @param       $code           Code number for the exception
+        * @return      void
+        */
+       public function __construct (array $msgArray, $code) {
+               // Add a message around the missing class
+               $message = sprintf("[%s:%d] Variable <span class=\"exception_reason\">%s</span> is not set.",
+                       $msgArray[0]->__toString(),
+                       $this->getLine(),
+                       $msgArray[1]
+               );
+
+               // Call parent constructor
+               parent::__construct($message, $code);
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/exceptions/main/class_ExceptionNotFoundException.php b/inc/classes/exceptions/main/class_ExceptionNotFoundException.php
new file mode 100644 (file)
index 0000000..42dc611
--- /dev/null
@@ -0,0 +1,48 @@
+<?php
+/**
+ * An exception thrown when an other exception was not found
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ * @todo               Is this exception still needed???
+ * @deprecated
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class ExceptionNotFoundException extends FrameworkException {
+       /**
+        * The constructor
+        *
+        * @param       $classArray             Array with exception data
+        * @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] Exception <span class=\"exception_reason\">%s</span> not found.",
+                       $classArray[0],
+                       $this->getLine(),
+                       $classArray[1]
+               );
+
+               // Call parent constructor
+               parent::__construct($message, $code);
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/exceptions/main/class_FatalErrorException.php b/inc/classes/exceptions/main/class_FatalErrorException.php
new file mode 100644 (file)
index 0000000..2c4b880
--- /dev/null
@@ -0,0 +1,40 @@
+<?php
+/**
+ * An exception thrown when a "fatal" error has been captured by an error handler
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class FatalErrorException extends FrameworkException {
+       /**
+        * The constructor
+        *
+        * @param       $message        Message from the exception
+        * @param       $code           Code number for the exception
+        * @return      void
+        */
+       public function __construct ($message, $code) {
+               die($message);
+               // Call parent constructor
+               parent::__construct($message, $code);
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/exceptions/main/class_GetterNotFoundException.php b/inc/classes/exceptions/main/class_GetterNotFoundException.php
new file mode 100644 (file)
index 0000000..9a918c3
--- /dev/null
@@ -0,0 +1,48 @@
+<?php
+/**
+ * An exception thrown when a getter for an attribute was not found
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ * @todo               This class is no longer needed!
+ * @deprecated
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class GetterNotFoundException extends FrameworkException {
+       /**
+        * The constructor
+        *
+        * @param       $message        Message from the exception
+        * @param       $code           Code number for the exception
+        * @return      void
+        */
+       public function __construct (array $dataArray, $code) {
+               // Add a message around the missing class
+               $message = sprintf("[%s:%d] Getter-Methode f&uuml;r Attribut <span class=\"exception_reason\">%s</span> nicht gefunden.",
+                       $dataArray[0]->__toString(),
+                       $this->getLine(),
+                       $dataArray[1]
+               );
+
+               // Call parent constructor
+               parent::__construct($message, $code);
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/exceptions/main/class_InvalidArrayCountException.php b/inc/classes/exceptions/main/class_InvalidArrayCountException.php
new file mode 100644 (file)
index 0000000..3703f1a
--- /dev/null
@@ -0,0 +1,48 @@
+<?php
+/**
+ * An exception thrown when the number of array elements mismatch
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class InvalidArrayCountException extends FrameworkException {
+       /**
+        * The constructor
+        *
+        * @param       $array  Message from the exception
+        * @param       $code   Code number for the exception
+        * @return      void
+        */
+       public function __construct (array $array, $code) {
+               // Add a message around the missing class
+               $message = sprintf("[%s:%d] <span class=\"exception_reason\">%s</span> hat <u>%d</u> Elemente, soll aber <u>%d</u> enthalten!",
+                       $array[0]->__toString(),
+                       $this->getLine(),
+                       $array[1],
+                       $array[2],
+                       $array[3]
+               );
+
+               // Call parent constructor
+               parent::__construct($message, $code);
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/exceptions/main/class_InvalidCommandException.php b/inc/classes/exceptions/main/class_InvalidCommandException.php
new file mode 100644 (file)
index 0000000..d55a167
--- /dev/null
@@ -0,0 +1,50 @@
+<?php
+/**
+ * This exception is thrown when a command is invalid
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class InvalidCommandException extends FrameworkException {
+       /**
+        * The constructor
+        *
+        * @param       $message        Message from the exception
+        * @param       $code           Code number for the exception
+        * @return      void
+        */
+       public function __construct (array $msgArray, $code) {
+               // Add a message around the missing class
+               $message = sprintf("[%s:%d] Invalid command <span class=\"exception_reason\">%s (class %s)</span> detected.",
+                       $msgArray[0]->__toString(),
+                       $this->getLine(),
+                       $msgArray[1],
+                       $msgArray[0]->getClassName()
+               );
+
+               // Set extra data
+               $this->setExtraData($msgArray[0]->getClassName().":".$this->getLine());
+
+               // Call parent constructor
+               parent::__construct($message, $code);
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/exceptions/main/class_InvalidCommandInstanceException.php b/inc/classes/exceptions/main/class_InvalidCommandInstanceException.php
new file mode 100644 (file)
index 0000000..34a4d24
--- /dev/null
@@ -0,0 +1,46 @@
+<?php
+/**
+ * This exception is thrown when a command instance is invalid
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class InvalidCommandInstanceException extends FrameworkException {
+       /**
+        * The constructor
+        *
+        * @param       $message        Message from the exception
+        * @param       $code           Code number for the exception
+        * @return      void
+        */
+       public function __construct (array $msgArray, $code) {
+               // Add a message around the missing class
+               $message = sprintf("[%s:%d] Invalid command <span class=\"exception_reason\">%s</span> detected.",
+                       $msgArray[0]->__toString(),
+                       $this->getLine(),
+                       $msgArray[1]
+               );
+
+               // Call parent constructor
+               parent::__construct($message, $code);
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/exceptions/main/class_InvalidInterfaceException.php b/inc/classes/exceptions/main/class_InvalidInterfaceException.php
new file mode 100644 (file)
index 0000000..93958ed
--- /dev/null
@@ -0,0 +1,46 @@
+<?php
+/**
+ * An exception thrown when an class instance does not implement a given interface
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ * 
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class InvalidInterfaceException extends FrameworkException {
+       /**
+        * The constructor
+        *
+        * @param       $classArray             Array with exception data
+        * @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] Object does not implement expected interface <span class=\"exception_reason\">%s</span>.",
+                       $classArray[0]->__toString(),
+                       $this->getLine(),
+                       $classArray[1]
+               );
+
+               // Call parent constructor
+               parent::__construct($message, $code);
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/exceptions/main/class_InvalidObjectException.php b/inc/classes/exceptions/main/class_InvalidObjectException.php
new file mode 100644 (file)
index 0000000..7a002d4
--- /dev/null
@@ -0,0 +1,45 @@
+<?php
+/**
+ * An exception thrown when an instance variable instances a non-object 
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ * 
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class InvalidObjectException extends FrameworkException {
+       /**
+        * The constructor
+        *
+        * @param       $class  Class throwing the exception
+        * @param       $code   Code number for the exception
+        * @return      void
+        */
+       public function __construct (FrameworkInterface $class, $code) {
+               // Add a message around the missing class
+               $message = sprintf("[%s:%d] Object is not allowed here.",
+                       $class->__toString(),
+                       $this->getLine()
+               );
+
+               // Call parent constructor
+               parent::__construct($message, $code);
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/exceptions/main/class_MissingArrayElementsException.php b/inc/classes/exceptions/main/class_MissingArrayElementsException.php
new file mode 100644 (file)
index 0000000..5c3547b
--- /dev/null
@@ -0,0 +1,57 @@
+<?php
+/**
+ * An exception thrown when required array elements are missing
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ * 
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class MissingArrayElementsException extends FrameworkException {
+       /**
+        * The constructor
+        *
+        * @param       $classArray             Array with exception data
+        * @param       $code                   Code number for the exception
+        * @return      void
+        */
+       public function __construct (array $classArray, $code) {
+               // Extract all elements
+               $elements = "";
+               if ((isset($classArray[2])) && (is_array($classArray[2]))) {
+                       // Convert into strings
+                       $elements = implode("</u>, <u>", $classArray[2]);
+               } else {
+                       // Invalid data
+                       $elements = "invalid_data";
+               }
+
+               // Add a message around the missing class
+               $message = sprintf("[%s:%d] Array <u>%s()</u> Does not have these elements: <span class=\"exception_reason\">%s</span>",
+                       $classArray[0]->__toString(),
+                       $this->getLine(),
+                       $classArray[1],
+                       $elements
+               );
+
+               // Call parent constructor
+               parent::__construct($message, $code);
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/exceptions/main/class_MissingDecimalsThousandsSeperatorException.php b/inc/classes/exceptions/main/class_MissingDecimalsThousandsSeperatorException.php
new file mode 100644 (file)
index 0000000..397e0e8
--- /dev/null
@@ -0,0 +1,45 @@
+<?php
+/**
+ * An exception thrown when the decimal and thousands seperators are missing
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ * 
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class MissingDecimalsThousandsSeperatorException extends FrameworkException {
+       /**
+        * The constructor
+        *
+        * @param       $message        Message from the exception
+        * @param       $code           Code number for the exception
+        * @return      void
+        */
+       public function __construct ($instance, $code) {
+               // Add a message around the missing class
+               $message = sprintf("[%s:%d] Die Dezimal- und Tausendertrenner fehlen!",
+                       $instance->__toString(),
+                       $this->getLine()
+               );
+
+               // Call parent constructor
+               parent::__construct($message, $code);
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/exceptions/main/class_MissingMethodException.php b/inc/classes/exceptions/main/class_MissingMethodException.php
new file mode 100644 (file)
index 0000000..3ef08ac
--- /dev/null
@@ -0,0 +1,47 @@
+<?php
+/**
+ * An exception thrown when a method is missing
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ * @deprecated
+ * 
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class MissingMethodException extends FrameworkException {
+       /**
+        * The constructor
+        *
+        * @param       $classArray             Array holding the exception data
+        * @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] This class has no method <u>%s()</u>!",
+                       $classArray[0]->__toString(),
+                       $this->getLine(),
+                       $classArray[1]
+               );
+
+               // Call parent constructor
+               parent::__construct($message, $code);
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/exceptions/main/class_NoArrayCreatedException.php b/inc/classes/exceptions/main/class_NoArrayCreatedException.php
new file mode 100644 (file)
index 0000000..77072fa
--- /dev/null
@@ -0,0 +1,48 @@
+<?php
+/**
+ * An exception thrown then no array was created in a dynamic environment
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ * @todo               This class is no longer needed
+ * @deprecated
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class NoArrayCreatedException extends FrameworkException {
+       /**
+        * The constructor
+        *
+        * @param       $array  Message from the exception
+        * @param       $code   Code number for the exception
+        * @return      void
+        */
+       public function __construct (array $array, $code) {
+               // Add a message around the missing class
+               $message = sprintf("[%s:%d] <span class=\"exception_reason\">%s</span> ist kein erstelltes Objekt.",
+                       $array[0]->__toString(),
+                       $this->getLine(),
+                       $array[1]
+               );
+
+               // Call parent constructor
+               parent::__construct($message, $code);
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/exceptions/main/class_NoArrayException.php b/inc/classes/exceptions/main/class_NoArrayException.php
new file mode 100644 (file)
index 0000000..30d312f
--- /dev/null
@@ -0,0 +1,42 @@
+<?php
+/**
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class NoArrayException extends FrameworkException {
+       /**
+        * The constructor
+        *
+        * @param       $message        Message from the exception
+        * @param       $code           Code number for the exception
+        * @return      void
+        */
+       public function __construct ($string, $code) {
+               // Add a message around the missing class
+               $message = sprintf("<span class=\"exception_reason\">%s</span> ist kein Array!",
+                       $string
+               );
+
+               // Call parent constructor
+               parent::__construct($message, $code);
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/exceptions/main/class_NoObjectException.php b/inc/classes/exceptions/main/class_NoObjectException.php
new file mode 100644 (file)
index 0000000..541b849
--- /dev/null
@@ -0,0 +1,46 @@
+<?php
+/**
+ * A deprecated exception which should be replaced with InvalidObjectException
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ * @deprecated
+ * @see                InvalidObjectException
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class NoObjectException extends FrameworkException {
+       /**
+        * The constructor
+        *
+        * @param       $string         Name of variable
+        * @param       $code           Code number for the exception
+        * @return      void
+        */
+       public function __construct ($string, $code) {
+               // Add a message around the missing class
+               $message = sprintf("<span class=\"exception_reason\">%s</span> ist kein Objekt!",
+                       $string
+               );
+
+               // Call parent constructor
+               parent::__construct($message, $code);
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/exceptions/main/class_NullPointerException.php b/inc/classes/exceptions/main/class_NullPointerException.php
new file mode 100644 (file)
index 0000000..551daa0
--- /dev/null
@@ -0,0 +1,45 @@
+<?php
+/**
+ * An exception thrown when an object instance is null
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ * 
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class NullPointerException extends FrameworkException {
+       /**
+        * The constructor
+        *
+        * @param       $class  Class throwing this exception
+        * @param       $code   Code number for the exception
+        * @return      void
+        */
+       public function __construct (FrameworkInterface $class, $code) {
+               // Add a message around the missing class
+               $message = sprintf("[%s:%d] An object instance is set to <em>null</em>.",
+                       $class->__toString(),
+                       $this->getLine()
+               );
+
+               // Call parent constructor
+               parent::__construct($message, $code);
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/exceptions/main/class_ResponseHeadersAlreadySentException.php b/inc/classes/exceptions/main/class_ResponseHeadersAlreadySentException.php
new file mode 100644 (file)
index 0000000..f08d662
--- /dev/null
@@ -0,0 +1,45 @@
+<?php
+/**
+ * An exception thrown when an object instance is null
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ * 
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class ResponseHeadersAlreadySentException extends FrameworkException {
+       /**
+        * The constructor
+        *
+        * @param       $class  Class throwing this exception
+        * @param       $code   Code number for the exception
+        * @return      void
+        */
+       public function __construct (FrameworkInterface $class, $code) {
+               // Add a message around the missing class
+               $message = sprintf("[%s:%d] Headers are already sent!",
+                       $class->__toString(),
+                       $this->getLine()
+               );
+
+               // Call parent constructor
+               parent::__construct($message, $code);
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/exceptions/main/class_VariableIsNotSetException.php b/inc/classes/exceptions/main/class_VariableIsNotSetException.php
new file mode 100644 (file)
index 0000000..ddcad58
--- /dev/null
@@ -0,0 +1,47 @@
+<?php
+/**
+ * An exception thrown when a variable is not set
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class VariableIsNotSetException extends FrameworkException {
+       /**
+        * The constructor
+        *
+        * @param       $array  Message from the exception
+        * @param       $code   Code number for the exception
+        * @return      void
+        */
+       public function __construct (array $array, $code) {
+               // Add a message around the missing class
+               $message = sprintf("[%s:%d] Bei der Initialisierung der Applikation <span class=\"exception_reason\">%s</span> wurde keine Variable <span class=\"exception_reason\">%s</span> erzeugt.",
+                       $array[0]->__toString(),
+                       $this->getLine(),
+                       $array[1],
+                       $array[2]
+               );
+
+               // Call parent constructor
+               parent::__construct($message, $code);
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/exceptions/result/.htaccess b/inc/classes/exceptions/result/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/inc/classes/exceptions/result/class_InvalidDatabaseResultException.php b/inc/classes/exceptions/result/class_InvalidDatabaseResultException.php
new file mode 100644 (file)
index 0000000..762eb82
--- /dev/null
@@ -0,0 +1,46 @@
+<?php
+/**
+ * An exception thrown if a database result does not contain expected entries
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class InvalidDatabaseResultException extends FrameworkException {
+       /**
+        * The super constructor for all exceptions
+        *
+        * @param       $msgArray       Error message array
+        * @param       $code           Error code
+        * @return      void
+        */
+       public function __construct(array $msgArray, $code) {
+               // Construct the message
+               $message = sprintf("[%s:%d] Database instance <span class=\"exception_reason\">%s</span> contains invalid entries.",
+                       $msgArray[0]->__toString(),
+                       $this->getLine(),
+                       $msgArray[1]->__toString()
+               );
+
+               // Call parent exception constructor
+               parent::__construct($message, $code);
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/exceptions/result/class_ResultUpdateException.php b/inc/classes/exceptions/result/class_ResultUpdateException.php
new file mode 100644 (file)
index 0000000..e58ab04
--- /dev/null
@@ -0,0 +1,45 @@
+<?php
+/**
+ * An exception thrown if result was not updated.
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class ResultUpdateException extends FrameworkException {
+       /**
+        * The super constructor for all exceptions
+        *
+        * @param       $resultInstance         Instance of the failed result update
+        * @param       $code                           Error code
+        * @return      void
+        */
+       public function __construct(UpdateableResult $resultInstance, $code) {
+               // Construct the message
+               $message = sprintf("[%s:%d] Update of result instance has nothing changed.",
+                       $resultInstance->__toString(),
+                       $this->getLine()
+               );
+
+               // Call parent exception constructor
+               parent::__construct($message, $code);
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/exceptions/template/.htaccess b/inc/classes/exceptions/template/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/inc/classes/exceptions/template/class_BasePathIsEmptyException.php b/inc/classes/exceptions/template/class_BasePathIsEmptyException.php
new file mode 100644 (file)
index 0000000..e4d4e4e
--- /dev/null
@@ -0,0 +1,45 @@
+<?php
+/**
+ * An exception thrown when the base path is empty
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ * 
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class BasePathIsEmptyException extends FrameworkException {
+       /**
+        * The constructor
+        *
+        * @param       $class  Class throwing this exception
+        * @param       $code   Code number for the exception
+        * @return      void
+        */
+       public function __construct (FrameworkInterface $class, $code) {
+               // Add a message around the missing class
+               $message = sprintf("[%s:%d] Template path is empty.",
+                       $class->__toString(),
+                       $this->getLine()
+               );
+
+               // Call parent constructor
+               parent::__construct($message, $code);
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/exceptions/template/class_BasePathIsNoDirectoryException.php b/inc/classes/exceptions/template/class_BasePathIsNoDirectoryException.php
new file mode 100644 (file)
index 0000000..04d510a
--- /dev/null
@@ -0,0 +1,46 @@
+<?php
+/**
+ * An exception thrown when the base path is no directory
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ * 
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class BasePathIsNoDirectoryException extends FrameworkException {
+       /**
+        * The constructor
+        *
+        * @param       $classArray             An array holding our informations
+        * @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] Der Template-Basispfad <span class=\"exception_reason\">%s</span> existiert nicht oder ist eine Datei!",
+                       $classArray[0]->__toString(),
+                       $this->getLine(),
+                       $classArray[1]
+               );
+
+               // Call parent constructor
+               parent::__construct($message, $code);
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/exceptions/template/class_BasePathReadProtectedException.php b/inc/classes/exceptions/template/class_BasePathReadProtectedException.php
new file mode 100644 (file)
index 0000000..6a4d956
--- /dev/null
@@ -0,0 +1,46 @@
+<?php
+/**
+ * An exception thrown when the base path is read-protected
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ * 
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class BasePathReadProtectedException extends FrameworkException {
+       /**
+        * The constructor
+        *
+        * @param       $classArray             An array holding our informations
+        * @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] Der Template-Basispfad <span class=\"exception_reason\">%s</span> ist lesegesch&uuml;tzt! Bitte Zugriffsrechte (CHMOD) &auml;ndern.",
+                       $classArray[0]->__toString(),
+                       $this->getLine(),
+                       $classArray[1]
+               );
+
+               // Call parent constructor
+               parent::__construct($message, $code);
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/exceptions/template/class_InvalidBasePathStringException.php b/inc/classes/exceptions/template/class_InvalidBasePathStringException.php
new file mode 100644 (file)
index 0000000..93f875e
--- /dev/null
@@ -0,0 +1,46 @@
+<?php
+/**
+ * An exception thrown hen the base path string is invalid
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class InvalidBasePathStringException extends FrameworkException {
+       /**
+        * The constructor
+        *
+        * @param       $classArray             Array holding exception data
+        * @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] <span class=\"exception_reason\">%s</span> is not a string with a base path!",
+                       $classArray[0]->__toString(),
+                       $this->getLine(),
+                       $classArray[1]
+               );
+
+               // Call parent constructor
+               parent::__construct($message, $code);
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/exceptions/template/class_UnexpectedTemplateTypeException.php b/inc/classes/exceptions/template/class_UnexpectedTemplateTypeException.php
new file mode 100644 (file)
index 0000000..9394348
--- /dev/null
@@ -0,0 +1,47 @@
+<?php
+/**
+ * An exception thrown when the template type is not supported
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ * 
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class UnexpectedTemplateTypeException extends FrameworkException {
+       /**
+        * The constructor
+        *
+        * @param       $msgArray       An array holding our informations
+        * @param       $code           Code number for the exception
+        * @return      void
+        */
+       public function __construct (array $msgArray, $code) {
+               // Add a message around the missing class
+               $message = sprintf("[%s:%d] Der Template-Typ <span class=\"exception_reason\">%s</span> entspricht nicht dem erwartetem Template-Typ <span class=\"exception_reason\">%s</span>.",
+                       $msgArray[0]->__toString(),
+                       $this->getLine(),
+                       $msgArray[1],
+                       $msgArray[2]
+               );
+
+               // Call parent constructor
+               parent::__construct($message, $code);
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/exceptions/template/class_UnsupportedTemplateEngineException.php b/inc/classes/exceptions/template/class_UnsupportedTemplateEngineException.php
new file mode 100644 (file)
index 0000000..75c81a4
--- /dev/null
@@ -0,0 +1,44 @@
+<?php
+/**
+ * An exception thrown when the template engine instance is not supported
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class UnsupportedTemplateEngineException extends FrameworkException {
+       /**
+        * The constructor
+        *
+        * @param       $class  Class throwing this class
+        * @param       $code   Code number for the exception
+        * @return      void
+        */
+       public function __construct (FrameworkInterface $class, $code) {
+               // Add a message around the missing class
+               $message = sprintf("Template-Engine %s not (yet) supported.",
+                       $class->__toString()
+               );
+
+               // Call parent constructor
+               parent::__construct($message, $code);
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/exceptions/template/class_ViewHelperNotFoundException.php b/inc/classes/exceptions/template/class_ViewHelperNotFoundException.php
new file mode 100644 (file)
index 0000000..37b3342
--- /dev/null
@@ -0,0 +1,47 @@
+<?php
+/**
+ * An exception thrown when a given view helper was not found
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ * @todo               Rename this class to NoViewHelperException
+ * @deprecated
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class ViewHelperNotFoundException extends FrameworkException {
+       /**
+        * The constructor
+        *
+        * @param       $msgArray       An array holding our informations
+        * @param       $code           Code number for the exception
+        * @return      void
+        */
+       public function __construct (array $msgArray, $code) {
+               // Add a message around the missing class
+               $message = sprintf("[%s:] View-Helper <span class=\"exception_reason\">%s</span> ist ung&uuml;ltig.",
+                       $msgArray[0]->__toString(),
+                       $msgArray[1]
+               );
+
+               // Call parent constructor
+               parent::__construct($message, $code);
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/exceptions/user/.htaccess b/inc/classes/exceptions/user/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/inc/classes/exceptions/user/class_AccountPasswordMismatchException.php b/inc/classes/exceptions/user/class_AccountPasswordMismatchException.php
new file mode 100644 (file)
index 0000000..603f132
--- /dev/null
@@ -0,0 +1,45 @@
+<?php
+/**
+ * A class for mismatching passwords
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class AccountPasswordMismatchException extends FrameworkException {
+       /**
+        * The super constructor for all exceptions
+        *
+        * @param       $filterInstance         A filterable class instance
+        * @param       $code                           An optional code for better debugging
+        * @return      void
+        */
+       public function __construct(Filterable $filterInstance, $code) {
+               // Create the message
+               $message = sprintf("[%s:%d] Supplied account password did not match with stored.",
+                       $filterInstance->__toString(),
+                       $this->getLine()
+               );
+
+               // Make sure everything is assigned properly
+               parent::__construct($message, $code);
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/exceptions/user/class_UserEmailMissingException.php b/inc/classes/exceptions/user/class_UserEmailMissingException.php
new file mode 100644 (file)
index 0000000..dcef370
--- /dev/null
@@ -0,0 +1,46 @@
+<?php
+/**
+ * A class for non-existing user emails
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class UserEmailMissingException 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] User email <span class=\"exception_reason\">%s</span> was not found.",
+                       $msgArray[0]->__toString(),
+                       $this->getLine(),
+                       $msgArray[1]
+               );
+
+               // Make sure everything is assigned properly
+               parent::__construct($message, $code);
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/exceptions/user/class_UserPasswordMismatchException.php b/inc/classes/exceptions/user/class_UserPasswordMismatchException.php
new file mode 100644 (file)
index 0000000..0457930
--- /dev/null
@@ -0,0 +1,46 @@
+<?php
+/**
+ * A class for mismatching passwords
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class UserPasswordMismatchException extends FrameworkException {
+       /**
+        * The super constructor for all exceptions
+        *
+        * @param       $msgArray       The non-optional message for the exception
+        * @param       $code           An optional code for better debugging
+        * @return      void
+        */
+       public function __construct(array $msgArray, $code = 0) {
+               // Create the message
+               $message = sprintf("[%s:%d] Supplied password for user <span class=\"exception_reason\">%s</span> 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
new file mode 100644 (file)
index 0000000..9f5e52d
--- /dev/null
@@ -0,0 +1,46 @@
+<?php
+/**
+ * A class for non-existing usernames
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class UsernameMissingException 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] Username <span class=\"exception_reason\">%s</span> was not found.",
+                       $msgArray[0]->__toString(),
+                       $this->getLine(),
+                       $msgArray[1]
+               );
+
+               // Make sure everything is assigned properly
+               parent::__construct($message, $code);
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/exceptions/xml/.htaccess b/inc/classes/exceptions/xml/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/inc/classes/exceptions/xml/class_InvalidXmlNodeException.php b/inc/classes/exceptions/xml/class_InvalidXmlNodeException.php
new file mode 100644 (file)
index 0000000..d503ae6
--- /dev/null
@@ -0,0 +1,53 @@
+<?php
+/**
+ * An exception thrown when an XML parser error was detected
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class InvalidXmlNodeException extends FrameworkException {
+       /**
+        * The super constructor for all exceptions
+        *
+        * @param       $classArray             Array holding the exception data
+        * @param       $code                   Error code
+        * @return      void
+        */
+       public function __construct (array $classArray, $code) {
+               // Extract attributes
+               $attributes = "<em>None</em>";
+               if ((is_array($classArray[2])) && (count($classArray[2]) > 0)) {
+                       $attributes = implode(", ", $classArray[2]);
+               } // END - if
+
+               // Construct our message
+               $message = sprintf("[%s:%d] Invalid XML node found: %s, attributes: %s.",
+                       $classArray[0]->__toString(),
+                       $this->getLine(),
+                       $classArray[1],
+                       $attributes
+               );
+
+               // Call parent exception constructor
+               parent::__construct($message, $code);
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/exceptions/xml/class_XmlNodeMismatchException.php b/inc/classes/exceptions/xml/class_XmlNodeMismatchException.php
new file mode 100644 (file)
index 0000000..848d542
--- /dev/null
@@ -0,0 +1,47 @@
+<?php
+/**
+ * An exception thrown when an XML node does not match the excepted
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class XmlNodeMismatchException extends FrameworkException {
+       /**
+        * The super constructor for all exceptions
+        *
+        * @param       $classArray             Array holding the exception data
+        * @param       $code                   Error code
+        * @return      void
+        */
+       public function __construct (array $classArray, $code) {
+               // Construct our message
+               $message = sprintf("[%s:%d] XML nodes mismatch. Given: %s, Expected: %s",
+                       $classArray[0]->__toString(),
+                       $this->getLine(),
+                       $classArray[1],
+                       $classArray[2]
+               );
+
+               // Call parent exception constructor
+               parent::__construct($message, $code);
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/exceptions/xml/class_XmlParserException.php b/inc/classes/exceptions/xml/class_XmlParserException.php
new file mode 100644 (file)
index 0000000..91d12e5
--- /dev/null
@@ -0,0 +1,47 @@
+<?php
+/**
+ * An exception thrown when an XML parser error was detected
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class XmlParserException extends FrameworkException {
+       /**
+        * The super constructor for all exceptions
+        *
+        * @param       $classArray             Array holding the exception data
+        * @param       $code                   Error code
+        * @return      void
+        */
+       public function __construct (array $classArray, $code) {
+               // Construct our message
+               $message = sprintf("[%s:%d] XML Error: %s at line %d.",
+                       $classArray[0]->__toString(),
+                       $this->getLine(),
+                       xml_error_string(xml_get_error_code($classArray[1])),
+                       xml_get_current_line_number($classArray[1])
+               );
+
+               // Call parent exception constructor
+               parent::__construct($message, $code);
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/interfaces/.htaccess b/inc/classes/interfaces/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/inc/classes/interfaces/actions/.htaccess b/inc/classes/interfaces/actions/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/inc/classes/interfaces/actions/class_PerformableAction.php b/inc/classes/interfaces/actions/class_PerformableAction.php
new file mode 100644 (file)
index 0000000..ad06b8c
--- /dev/null
@@ -0,0 +1,36 @@
+<?php
+/**
+ * An interface for performable actions
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+interface PerformableAction extends FrameworkInterface {
+       /**
+        * Executes the 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
+        */
+       function execute (Requestable $requestInstance, Responseable $responseInstance);
+}
+
+//
+?>
diff --git a/inc/classes/interfaces/actions/commands/.htaccess b/inc/classes/interfaces/actions/commands/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/inc/classes/interfaces/actions/commands/class_Commandable.php b/inc/classes/interfaces/actions/commands/class_Commandable.php
new file mode 100644 (file)
index 0000000..2bd63f0
--- /dev/null
@@ -0,0 +1,36 @@
+<?php
+/**
+ * An interface for commands for the front controller
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+interface Commandable extends PerformableAction {
+       /**
+        * Adds extra filters to the given controller instance
+        *
+        * @param       $controllerInstance             A controller instance
+        * @param       $requestInstance                An instance of a class with an Requestable interface
+        * @return      void
+        */
+       function addExtraFilters (Controller $controllerInstance, Requestable $requestInstance);
+}
+
+//
+?>
diff --git a/inc/classes/interfaces/application/.htaccess b/inc/classes/interfaces/application/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/inc/classes/interfaces/application/class_ManageableApplication.php b/inc/classes/interfaces/application/class_ManageableApplication.php
new file mode 100644 (file)
index 0000000..ec0e2b6
--- /dev/null
@@ -0,0 +1,99 @@
+<?php
+/**
+ * An interface for managing applications. This can be a lot. E.g.:
+ *
+ * - Un-/locking applications
+ * - Creating selectors for the selector-mode
+ * - Usage statistics
+ * - And many more...
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+interface ManageableApplication extends FrameworkInterface {
+       /**
+        * Getter for application's version number
+        *
+        * @return      $appVersion     The application's version number
+        */
+       function getAppVersion ();
+       /**
+        * Setter for application's version number
+        *
+        * @param               $appVersion     The application's version number
+        * @return      void
+        */
+       function setAppVersion ($appVersion);
+
+       /**
+        * Getter for application's human-readable name
+        *
+        * @return      $appName        The application's name readable for humans
+        */
+       function getAppName ();
+
+       /**
+        * Setter for application's human-readable name
+        *
+        * @param               $appName        The application's name readable for humans
+        * @return      void
+        */
+       function setAppName ($appName);
+
+       /**
+        * Getter for application's short uni*-like name
+        *
+        * @return      $shortName      The application's name readable for humans
+        */
+       function getAppShortName ();
+
+       /**
+        * Setter for application's short uni*-like name
+        *
+        * @param               $shortName      The application's name readable for humans
+        * @return      void
+        */
+       function setAppShortName ($shortName);
+
+       /**
+        * Getter for master template name
+        *
+        * @return      $masterTemplate         Name of the master template
+        */
+       function getMasterTemplate ();
+
+       /**
+        * Launches the application
+        *
+        * @return      void
+        */
+       function entryPoint ();
+
+       /**
+        * Handle the indexed array of fatal messages and puts them out in an
+        * acceptable fasion
+        *
+        * @param       $messageList    An array of fatal messages
+        * @return      void
+        */
+       function handleFatalMessages (array $messageList);
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/interfaces/auth/.htaccess b/inc/classes/interfaces/auth/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/inc/classes/interfaces/auth/class_Authorizeable.php b/inc/classes/interfaces/auth/class_Authorizeable.php
new file mode 100644 (file)
index 0000000..1ddfad6
--- /dev/null
@@ -0,0 +1,41 @@
+<?php
+/**
+ * An interface for authorization methods
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+interface Authorizeable extends FrameworkInterface {
+       /**
+        * Destroy the authorization data
+        *
+        * @return      void
+        */
+       function destroyAuthData();
+
+       /**
+        * Updates the authorization data and/or sets additional tracking data
+        *
+        * @return      void
+        */
+       function updateAuthData ();
+}
+
+//
+?>
diff --git a/inc/classes/interfaces/cache/.htaccess b/inc/classes/interfaces/cache/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/inc/classes/interfaces/cache/class_Cacheable.php b/inc/classes/interfaces/cache/class_Cacheable.php
new file mode 100644 (file)
index 0000000..39cb18c
--- /dev/null
@@ -0,0 +1,35 @@
+<?php
+/**
+ * An interface for classes which are "able" to cache
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+interface Cacheable extends FrameworkInterface {
+       /**
+        * Does the specified offset exist in cache?
+        *
+        * @param       $offset         The offsrt we are looking for
+        * @return      $exists         Wether the offset exists
+        */
+       function offsetExists ($offset);
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/interfaces/captcha/.htaccess b/inc/classes/interfaces/captcha/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/inc/classes/interfaces/captcha/class_SolveableCaptcha.php b/inc/classes/interfaces/captcha/class_SolveableCaptcha.php
new file mode 100644 (file)
index 0000000..e21ce4a
--- /dev/null
@@ -0,0 +1,41 @@
+<?php
+/**
+ * An interface for solveable CAPTCHAs
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+interface SolveableCaptcha extends FrameworkInterface {
+       /**
+        * Initiates the CAPTCHA
+        *
+        * @return      void
+        */
+       function initiateCaptcha ();
+
+       /**
+        * Render the CAPTCHA code
+        *
+        * @return      void
+        */
+       function renderCode ();
+}
+
+//
+?>
diff --git a/inc/classes/interfaces/class_ b/inc/classes/interfaces/class_
new file mode 100644 (file)
index 0000000..b750dd9
--- /dev/null
@@ -0,0 +1,28 @@
+<?php
+/**
+ * 
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+interface  extends FrameworkInterface {
+}
+
+//
+?>
diff --git a/inc/classes/interfaces/class_FrameworkInterface.php b/inc/classes/interfaces/class_FrameworkInterface.php
new file mode 100644 (file)
index 0000000..bffb874
--- /dev/null
@@ -0,0 +1,37 @@
+<?php
+/**
+ * This is the top-level interface for all other interfaces and should contain
+ * method stubs which is being used in every class
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+interface FrameworkInterface {
+       /**
+        * Getter for field name
+        *
+        * @param       $fieldName              Field name which we shall get
+        * @return      $fieldValue             Field value from the user
+        * @throws      NullPointerException    If the result instance is null
+        */
+       function getField ($fieldName);
+}
+
+//
+?>
diff --git a/inc/classes/interfaces/compressor/.htaccess b/inc/classes/interfaces/compressor/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/inc/classes/interfaces/compressor/class_Compressor.php b/inc/classes/interfaces/compressor/class_Compressor.php
new file mode 100644 (file)
index 0000000..0e8dfcb
--- /dev/null
@@ -0,0 +1,52 @@
+<?php
+/**
+ * An interface for compression classes
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+interface Compressor extends FrameworkInterface {
+       /**
+        * A compression stream
+        *
+        * @param               $streamData                     Mixed non-object stream data
+        * @return      $streamData                     The compressed stream data
+        * @throws      InvalidObjectException  If the stream is an object
+        */
+       function compressStream ($streamData);
+
+       /**
+        * A decompression stream
+        *
+        * @param               $streamData                     Mixed non-object stream data
+        * @return      $streamData                     The decompressed stream data
+        * @throws      InvalidObjectException  If the stream is an object
+        */
+       function decompressStream ($streamData);
+
+       /**
+        * Getter for the file extension of this compressor
+        *
+        * @return      $string The compressor's file extension
+        */
+       function getCompressorExtension ();
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/interfaces/controller/.htaccess b/inc/classes/interfaces/controller/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/inc/classes/interfaces/controller/class_Controller.php b/inc/classes/interfaces/controller/class_Controller.php
new file mode 100644 (file)
index 0000000..bf8ae97
--- /dev/null
@@ -0,0 +1,36 @@
+<?php
+/**
+ * An interface for controller
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+interface Controller extends FrameworkInterface {
+       /**
+        * Handles the given request and response
+        *
+        * @param       $requestInstance        An instance of a request class
+        * @param       $responseInstance       An instance of a response class
+        * @return      void
+        */
+       function handleRequest (Requestable $requestInstance, Responseable $responseInstance);
+}
+
+//
+?>
diff --git a/inc/classes/interfaces/criteria/.htaccess b/inc/classes/interfaces/criteria/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/inc/classes/interfaces/criteria/class_Criteria.php b/inc/classes/interfaces/criteria/class_Criteria.php
new file mode 100644 (file)
index 0000000..64ec5ad
--- /dev/null
@@ -0,0 +1,45 @@
+<?php
+/**
+ * An interface for criterias
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+interface Criteria extends FrameworkInterface {
+       /**
+        * Add criteria
+        *
+        * @param       $criteriaKey    Criteria key
+        * @param       $criteriaValue  Criteria value
+        * @return      void
+        */
+       function addCriteria ($criteriaKey, $criteriaValue);
+
+       /**
+        * Add configured criteria
+        *
+        * @param       $criteriaKey    Criteria key
+        * @param       $configEntry    Configuration entry
+        * @return      void
+        */
+       function addConfiguredCriteria ($criteriaKey, $configEntry);
+}
+
+//
+?>
diff --git a/inc/classes/interfaces/criteria/extended/.htaccess b/inc/classes/interfaces/criteria/extended/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/inc/classes/interfaces/criteria/extended/class_LocalSearchCriteria.php b/inc/classes/interfaces/criteria/extended/class_LocalSearchCriteria.php
new file mode 100644 (file)
index 0000000..dd09ad5
--- /dev/null
@@ -0,0 +1,28 @@
+<?php
+/**
+ * An interface for local criterias
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+interface LocalSearchCriteria extends Criteria {
+}
+
+//
+?>
diff --git a/inc/classes/interfaces/criteria/extended/class_LocalUpdateCriteria.php b/inc/classes/interfaces/criteria/extended/class_LocalUpdateCriteria.php
new file mode 100644 (file)
index 0000000..c88e0b0
--- /dev/null
@@ -0,0 +1,28 @@
+<?php
+/**
+ * An interface for local criterias
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+interface LocalUpdateCriteria extends Criteria {
+}
+
+//
+?>
diff --git a/inc/classes/interfaces/criteria/extended/class_StoreableCriteria.php b/inc/classes/interfaces/criteria/extended/class_StoreableCriteria.php
new file mode 100644 (file)
index 0000000..6abde1a
--- /dev/null
@@ -0,0 +1,28 @@
+<?php
+/**
+ * An interface for storeable data sets
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+interface StoreableCriteria extends Criteria {
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/interfaces/crypto/.htaccess b/inc/classes/interfaces/crypto/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/inc/classes/interfaces/crypto/class_Cryptable.php b/inc/classes/interfaces/crypto/class_Cryptable.php
new file mode 100644 (file)
index 0000000..9bb6075
--- /dev/null
@@ -0,0 +1,55 @@
+<?php
+/**
+ * A helper class for cryptographical things like hashing passwords and so on
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+interface Cryptable extends FrameworkInterface {
+       /**
+        * Hashes a string with salt and returns the hash. If an old previous hash
+        * is supplied the method will use the first X chars of that hash for hashing
+        * the password. This is useful if you want to check if password is identical
+        * for authorization purposes.
+        *
+        * @param       $str            Unhashed string
+        * @param       $oldHash        A hash from previous hashed string
+        * @return      $hashed         The hashed and salted string
+        */
+       function hashString ($str, $oldHash = "");
+
+       /**
+        * Encrypt the string with fixed salt
+        *
+        * @param       $str            The unencrypted string
+        * @return      $encrypted      Encrypted string
+        */
+       function encryptString ($str);
+
+       /**
+        * Decrypt the string with fixed salt
+        *
+        * @param       $encrypted      Encrypted string
+        * @return      $str            The unencrypted string
+        */
+       function decryptString ($encrypted);
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/interfaces/database/.htaccess b/inc/classes/interfaces/database/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/inc/classes/interfaces/database/class_FrameworkDatabaseInterface.php b/inc/classes/interfaces/database/class_FrameworkDatabaseInterface.php
new file mode 100644 (file)
index 0000000..6e3f3d6
--- /dev/null
@@ -0,0 +1,28 @@
+<?php
+/**
+ * The general interface for all other database interfaces
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+interface FrameworkDatabaseInterface extends FrameworkInterface {
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/interfaces/database/class_Updateable.php b/inc/classes/interfaces/database/class_Updateable.php
new file mode 100644 (file)
index 0000000..ba8de80
--- /dev/null
@@ -0,0 +1,37 @@
+<?php
+/**
+ * An interface for classes which are allowed to update database records
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+interface Updateable extends FrameworkInterface {
+       /**
+        * Updates a given field with new value
+        *
+        * @param       $fieldName              Field to update
+        * @param       $fieldValue             New value to store
+        * @return      void
+        * @throws      DatabaseUpdateSupportException  If this class does not support database updates
+        */
+       function updateDatabaseField ($fieldName, $fieldValue);
+}
+
+//
+?>
diff --git a/inc/classes/interfaces/database/frontend/.htaccess b/inc/classes/interfaces/database/frontend/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/inc/classes/interfaces/database/frontend/class_DatabaseFrontendInterface.php b/inc/classes/interfaces/database/frontend/class_DatabaseFrontendInterface.php
new file mode 100644 (file)
index 0000000..1d3ebe5
--- /dev/null
@@ -0,0 +1,69 @@
+<?php
+/**
+ * An interface for front-end database classes. The classes should prepare the
+ * objects for saving in the database. So for server-bases database classes SQL
+ * queries shall be generated and send to the backend classes. In case of local
+ * file databases the object shall be serialized and (maybe) transparently
+ * compressed before they got saved to a local file.
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+interface DatabaseFrontendInterface extends FrameworkDatabaseInterface {
+       /**
+        * Makes sure that the database connection is up and alive
+        *
+        * @return      void
+        */
+       function connectToDatabase ();
+
+       /**
+        * Starts a SELECT query on the database by given return type, table name
+        * and search criteria
+        *
+        * @param       $resultType             Result type ("array", "object" and "indexed" are valid)
+        * @param       $tableName              Name of the database table
+        * @param       $criteria               Search criteria class
+        * @return      $resultData             Result data of the query
+        * @throws      UnsupportedCriteriaException    If the criteria is unsupported
+        * @throws      SqlException                                    If an SQL error occurs
+        */
+       function querySelect ($resultType, $tableName, LocalSearchCriteria $criteriaInstance);
+
+       /**
+        * "Inserts" a data set instance into a local file database folder
+        *
+        * @param       $dataSetInstance        A storeable data set
+        * @return      void
+        * @throws      SqlException    If an SQL error occurs
+        */
+       function queryInsertDataSet (StoreableCriteria $dataSetInstance);
+
+       /**
+        * "Updates" a data set instance with a database layer
+        *
+        * @param       $dataSetInstance        A storeable data set
+        * @return      void
+        * @throws      SqlException    If an SQL error occurs
+        */
+       function queryUpdateDataSet (StoreableCriteria $dataSetInstance);
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/interfaces/database/middleware/.htaccess b/inc/classes/interfaces/database/middleware/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/inc/classes/interfaces/database/middleware/class_DatabaseConnector.php b/inc/classes/interfaces/database/middleware/class_DatabaseConnector.php
new file mode 100644 (file)
index 0000000..995f43a
--- /dev/null
@@ -0,0 +1,28 @@
+<?php
+/**
+ * An interface for middleware database classes
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+interface DatabaseConnector extends FrameworkDatabaseInterface {
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/interfaces/debug/.htaccess b/inc/classes/interfaces/debug/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/inc/classes/interfaces/debug/class_Debugger.php b/inc/classes/interfaces/debug/class_Debugger.php
new file mode 100644 (file)
index 0000000..8700229
--- /dev/null
@@ -0,0 +1,35 @@
+<?php
+/**
+ * An interface for debugger classes
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+interface Debugger extends FrameworkInterface {
+       /**
+        * Outputs the given data
+        *
+        * @param               $output Debug text for output
+        * @return      void
+        */
+       function outputStream ($output);
+}
+
+//
+?>
diff --git a/inc/classes/interfaces/discovery/.htaccess b/inc/classes/interfaces/discovery/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/inc/classes/interfaces/discovery/class_Discoverable.php b/inc/classes/interfaces/discovery/class_Discoverable.php
new file mode 100644 (file)
index 0000000..4aa69e8
--- /dev/null
@@ -0,0 +1,43 @@
+<?php
+/**
+ * An interface for discovery
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+interface Discoverable extends FrameworkInterface {
+       /**
+        * Discovers the request
+        *
+        * @param       $requestInstance        An instance of a Requestable class
+        * @return      void
+        */
+       function discover (Requestable $requestInstance);
+
+       /**
+        * Adds the database result in a human-readable format to the helper class
+        *
+        * @param       $helperInstance         An instance of a helper class
+        * @return      void
+        */
+       function addResultsToHelper (HelpableTemplate $helperInstance);
+}
+
+//
+?>
diff --git a/inc/classes/interfaces/filter/.htaccess b/inc/classes/interfaces/filter/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/inc/classes/interfaces/filter/class_Filterable.php b/inc/classes/interfaces/filter/class_Filterable.php
new file mode 100644 (file)
index 0000000..ad2c568
--- /dev/null
@@ -0,0 +1,36 @@
+<?php
+/**
+ * A class for pre and post filters
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+interface Filterable extends FrameworkInterface {
+       /**
+        * 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
+        */
+       function execute (Requestable $requestInstance, Responseable $responseInstance);
+}
+
+//
+?>
diff --git a/inc/classes/interfaces/helper/.htaccess b/inc/classes/interfaces/helper/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/inc/classes/interfaces/helper/class_HelpableLogin.php b/inc/classes/interfaces/helper/class_HelpableLogin.php
new file mode 100644 (file)
index 0000000..c1919d2
--- /dev/null
@@ -0,0 +1,36 @@
+<?php
+/**
+ * A helper interface for logins
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+interface HelpableLogin extends FrameworkInterface {
+       /**
+        * Execute the login request by given response instance. This instance can
+        * be used for sending cookies or at least the session id out.
+        *
+        * @param       $responseInstance       An instance of a Responseable class
+        * @return      void
+        */
+       function executeLogin (Responseable $responseInstance);
+}
+
+//
+?>
diff --git a/inc/classes/interfaces/helper/class_HelpableTemplate.php b/inc/classes/interfaces/helper/class_HelpableTemplate.php
new file mode 100644 (file)
index 0000000..d0a10f5
--- /dev/null
@@ -0,0 +1,34 @@
+<?php
+/**
+ * A helper interface for template helper ;)
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+interface HelpableTemplate extends FrameworkInterface {
+       /**
+        * Flush the content out,e g. to a template variable
+        *
+        * @return      void
+        */
+       function flushContent ();
+}
+
+//
+?>
diff --git a/inc/classes/interfaces/io/.htaccess b/inc/classes/interfaces/io/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/inc/classes/interfaces/io/class_Streamable.php b/inc/classes/interfaces/io/class_Streamable.php
new file mode 100644 (file)
index 0000000..975fbb3
--- /dev/null
@@ -0,0 +1,28 @@
+<?php
+/**
+ * An interface for streams
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+interface Streamable extends FrameworkInterface {
+}
+
+//
+?>
diff --git a/inc/classes/interfaces/io/file/.htaccess b/inc/classes/interfaces/io/file/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/inc/classes/interfaces/io/file/class_FileInputStreamer.php b/inc/classes/interfaces/io/file/class_FileInputStreamer.php
new file mode 100644 (file)
index 0000000..ddd4416
--- /dev/null
@@ -0,0 +1,38 @@
+<?php
+/**
+ * An interface for file input operations.
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+interface FileInputStreamer extends Streamable {
+       /**
+        * Reads from a local or remote file
+        *
+        * @param       $fqfn   The file's FQFN we shall load
+        * @return      $array  An array containing all read lines
+        * @throws      InvalidArrayCountException      If an array has not the
+        *                                                                      expected size
+        * @throws      InvalidMD5ChecksumException     If two MD5 hashes did not match
+        */
+       function loadFileContents ($fqfn);
+}
+
+//
+?>
diff --git a/inc/classes/interfaces/io/file/class_FileOutputStreamer.php b/inc/classes/interfaces/io/file/class_FileOutputStreamer.php
new file mode 100644 (file)
index 0000000..20fa404
--- /dev/null
@@ -0,0 +1,38 @@
+<?php
+/**
+ * An interface for file output operations.
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+interface FileOutputStreamer extends Streamable {
+       /**
+        * Saves streamed (that are mostly serialized objects) data to files or
+        * external servers.
+        *
+        * @param       $fileName       The local file's name including full path
+        * @param       $dataArray      Array containing the compressor's extension
+        *                                              and streamed data
+        * @return      void
+        */
+       function saveFile ($fileName, $dataArray);
+}
+
+//
+?>
diff --git a/inc/classes/interfaces/io/output/.htaccess b/inc/classes/interfaces/io/output/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/inc/classes/interfaces/io/output/class_OutputStreamer.php b/inc/classes/interfaces/io/output/class_OutputStreamer.php
new file mode 100644 (file)
index 0000000..4d8221f
--- /dev/null
@@ -0,0 +1,43 @@
+<?php
+/**
+ * An interface for output streams
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+interface OutputStreamer extends Streamable {
+       /**
+        * Assigns a variable for output
+        *
+        * @param               $var            The variable we shall assign
+        * @param               $value  The value to store in the variable
+        * @return      void
+        */
+       function assignVariable ($var, $value);
+
+       /**
+        * Output the code
+        *
+        * @return      void
+        */
+       function output ($outStream=false);
+}
+
+//
+?>
diff --git a/inc/classes/interfaces/language/.htaccess b/inc/classes/interfaces/language/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/inc/classes/interfaces/language/class_ManageableLanguage.php b/inc/classes/interfaces/language/class_ManageableLanguage.php
new file mode 100644 (file)
index 0000000..7bae590
--- /dev/null
@@ -0,0 +1,34 @@
+<?php
+/**
+ * An interface for language systems
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+interface ManageableLanguage extends FrameworkInterface {
+       /**
+        * Initialize the array-object for all later language strings
+        *
+        * @return      void
+        */
+       function initLanguageStrings();
+} // END - class
+
+// [EOF]
+?>
diff --git a/inc/classes/interfaces/login/.htaccess b/inc/classes/interfaces/login/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/inc/classes/interfaces/login/class_LoginableUser.php b/inc/classes/interfaces/login/class_LoginableUser.php
new file mode 100644 (file)
index 0000000..9bb89ca
--- /dev/null
@@ -0,0 +1,38 @@
+<?php
+/**
+ * An interface for user login classes
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+interface LoginableUser extends FrameworkInterface {
+       /**
+        * Logins the user with the given request containing the credential. The
+        * result of the login can be thrown by exception or, if prefered stored
+        * 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, Responseable $responseInstance);
+}
+
+//
+?>
diff --git a/inc/classes/interfaces/mailer/.htaccess b/inc/classes/interfaces/mailer/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/inc/classes/interfaces/mailer/class_DeliverableMail.php b/inc/classes/interfaces/mailer/class_DeliverableMail.php
new file mode 100644 (file)
index 0000000..7e04204
--- /dev/null
@@ -0,0 +1,56 @@
+<?php
+/**
+ * An interface for deliverable mail aka. mailer classes
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+interface DeliverableMail extends FrameworkInterface {
+       /**
+        * Adds a user class to the recipient list for current template
+        *
+        * @param       $userInstance   An instance of a user class
+        * @return      void
+        */
+       function addRecipientByUserInstance (ManageableMember $userInstance);
+
+       /**
+        * Use subject line provided by the (XML) template otherwise a subject line must be set
+        *
+        * @return      void
+        */
+       function useSubjectFromTemplate ();
+
+       /**
+        * Deliver email to the recipient(s)
+        *
+        * @return      void
+        */
+       function deliverEmail ();
+
+       /**
+        * Send notification to the admin
+        *
+        * @return      void
+        */
+       function sendAdminNotification ();
+}
+
+//
+?>
diff --git a/inc/classes/interfaces/reader/.htaccess b/inc/classes/interfaces/reader/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/inc/classes/interfaces/reader/class_ReadableNews.php b/inc/classes/interfaces/reader/class_ReadableNews.php
new file mode 100644 (file)
index 0000000..3c54d42
--- /dev/null
@@ -0,0 +1,34 @@
+<?php
+/**
+ * An interface for news reader
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+interface ReadableNews extends FrameworkInterface {
+       /**
+        * Initializes the news reader class. This is very reader-dependent
+        *
+        * @return      void
+        */
+       function initializeReader();
+}
+
+//
+?>
diff --git a/inc/classes/interfaces/registration/.htaccess b/inc/classes/interfaces/registration/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/inc/classes/interfaces/registration/class_UserRegister.php b/inc/classes/interfaces/registration/class_UserRegister.php
new file mode 100644 (file)
index 0000000..cc15f8e
--- /dev/null
@@ -0,0 +1,76 @@
+<?php
+/**
+ * A class for user registration
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+interface UserRegister extends FrameworkInterface {
+       /**
+        * Encrypt given request key or throws an exception if key was not found in
+        * request.
+        *
+        * @param       $requestKey             Key in request class
+        * @return      void
+        */
+       function encryptPassword ($requestKey);
+
+       /**
+        * Perform things like informing assigned affilates about new registration
+        * before registration
+        *
+        * @return      void
+        */
+       function doPreRegistration ();
+
+       /**
+        * Registers the new user account by insterting the request data into the
+        * database and paying some start credits or throw exceptions if this fails
+        *
+        * @return      void
+        */
+       function registerNewUser ();
+
+       /**
+        * Perform things like notifying partner websites after registration is done
+        *
+        * @return      void
+        */
+       function doPostRegistration ();
+
+       /**
+        * Do the action which is required after all registration steps are done.
+        * This can be a simple redirect to another webpage or displaying a message
+        * to the user. Or this can be a login step into the newly created account.
+        *
+        * @return      void
+        */
+       function doPostAction ();
+
+       /**
+        * Adds registration elements to a given dataset instance
+        *
+        * @param       $criteriaInstance       An instance of a storeable criteria
+        * @return      void
+        */
+       function addElementsToDataSet (StoreableCriteria $criteriaInstance);
+}
+
+//
+?>
diff --git a/inc/classes/interfaces/registry/.htaccess b/inc/classes/interfaces/registry/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/inc/classes/interfaces/registry/class_Register.php b/inc/classes/interfaces/registry/class_Register.php
new file mode 100644 (file)
index 0000000..d59051f
--- /dev/null
@@ -0,0 +1,52 @@
+<?php
+/**
+ * An interface for registries
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+interface Register extends FrameworkInterface {
+       /**
+        * Checks wether an instance key was found
+        *
+        * @param       $instanceKey    The key holding an instance in registry
+        * @return      $exists                 Wether the key exists in registry
+        */
+       function instanceExists ($instanceKey);
+
+       /**
+        * Adds/overwrites a new instance to the registry at the given key
+        *
+        * @param       $instanceKey            The key to identify the instance
+        * @param       $objectInstance         An instance we shall store
+        * @return      void
+        */
+       function addInstance ($instanceKey, Registerable $objectInstance);
+
+       /**
+        * Gets a registered instance or null if not found
+        *
+        * @param       $instanceKey            The key to identify the instance
+        * @return      $objectInstance         An instance we shall store
+        */
+       function getInstance ($instanceKey);
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/interfaces/registry/class_Registerable.php b/inc/classes/interfaces/registry/class_Registerable.php
new file mode 100644 (file)
index 0000000..16ed10e
--- /dev/null
@@ -0,0 +1,28 @@
+<?php
+/**
+ * A class for registerable classes
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+interface Registerable extends FrameworkInterface {
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/interfaces/request/.htaccess b/inc/classes/interfaces/request/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/inc/classes/interfaces/request/class_Requestable.php b/inc/classes/interfaces/request/class_Requestable.php
new file mode 100644 (file)
index 0000000..e5f9fa6
--- /dev/null
@@ -0,0 +1,84 @@
+<?php
+/**
+ * An interface for requests
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+interface Requestable extends FrameworkInterface {
+       /**
+        * Prepares the HTTP request data for usage by currently copying
+        * $_REQUEST into a private attribute. Later on we can add more
+        * things for initialization here.
+        *
+        * @return      void
+        */
+       function prepareRequestData ();
+
+       /**
+        * Checks wether a request element is set
+        * @param       $element        Name of the request element we want to check
+        * @return      $isSet          Wether the request element is set
+        * @throws      MissingArrayElementsException   Thrown if a request element is not set
+        */
+       function isRequestElementSet ($element);
+
+       /**
+        * Getter for request element or 'null' if element was not found
+        *
+        * @param       $element        Name of the request element we want to check
+        * @return      $value          Value of the found request element or 'null' if the
+        *                                              element was not found
+        */
+       function getRequestElement ($element);
+
+       /**
+        * Wrapper method for array_key() function for the request data array
+        *
+        * @return      $array  An array containing all array keys to return
+        */
+       function getParameterNames ();
+
+       /**
+        * Getter for a header element or 'null' if header was not found
+        *
+        * @param       $headerName             Name of the header
+        * @return      $headerValue    Value of the header or 'null' if not found
+        */
+       function getHeader ($headerName);
+
+       /**
+        * Sets wether the request was valid (default: true)
+        *
+        * @param       $isValid                Wether the request is valid
+        * @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/.htaccess b/inc/classes/interfaces/resolver/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/inc/classes/interfaces/resolver/actions/.htaccess b/inc/classes/interfaces/resolver/actions/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/inc/classes/interfaces/resolver/actions/class_ActionResolver.php b/inc/classes/interfaces/resolver/actions/class_ActionResolver.php
new file mode 100644 (file)
index 0000000..7a12f3d
--- /dev/null
@@ -0,0 +1,51 @@
+<?php
+/**
+ * An instance for action resolver classes
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+interface ActionResolver extends Resolver {
+       /**
+        * Returns an action instance for the current action
+        *
+        * @return      $actionInstance         An instance of the resolved action
+        */
+       function resolveAction ();
+
+       /**
+        * Returns an action instance for a given request class
+        *
+        * @param       $requestInstance        An instance of a request class
+        * @return      $actionInstance         An instance of the resolved action
+        */
+       function resolveActionByRequest (Requestable $requestInstance);
+
+       /**
+        * Checks wether the given action is valid
+        *
+        * @param       $actionName             The default action we shall execute
+        * @return      $isValid                Wether the given action is valid
+        * @throws      EmptyVariableException  Thrown if given action is not set
+        */
+       function isActionValid ($actionName);
+}
+
+//
+?>
diff --git a/inc/classes/interfaces/resolver/class_Resolver.php b/inc/classes/interfaces/resolver/class_Resolver.php
new file mode 100644 (file)
index 0000000..376d862
--- /dev/null
@@ -0,0 +1,28 @@
+<?php
+/**
+ * An interface for all resolvers
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+interface Resolver extends FrameworkInterface {
+}
+
+//
+?>
diff --git a/inc/classes/interfaces/resolver/commands/.htaccess b/inc/classes/interfaces/resolver/commands/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/inc/classes/interfaces/resolver/commands/class_CommandResolver.php b/inc/classes/interfaces/resolver/commands/class_CommandResolver.php
new file mode 100644 (file)
index 0000000..d7f3976
--- /dev/null
@@ -0,0 +1,44 @@
+<?php
+/**
+ * An instance for command resolver classes
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+interface CommandResolver extends Resolver {
+       /**
+        * Returns an command instance for a given request class
+        *
+        * @param       $requestInstance        An instance of a request class
+        * @return      $commandInstance        An instance of the resolved command
+        */
+       function resolveCommandByRequest (Requestable $requestInstance);
+
+       /**
+        * Checks wether the given command is valid
+        *
+        * @param       $commandName    The default command we shall execute
+        * @return      $isValid                Wether the given command is valid
+        * @throws      EmptyVariableException  Thrown if given command is not set
+        */
+       function isCommandValid ($commandName);
+}
+
+//
+?>
diff --git a/inc/classes/interfaces/resolver/controller/.htaccess b/inc/classes/interfaces/resolver/controller/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/inc/classes/interfaces/resolver/controller/class_ControllerResolver.php b/inc/classes/interfaces/resolver/controller/class_ControllerResolver.php
new file mode 100644 (file)
index 0000000..5d2786b
--- /dev/null
@@ -0,0 +1,34 @@
+<?php
+/**
+ * An instance for controller resolver classes
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+interface ControllerResolver extends Resolver {
+       /**
+        * Resolves the default controller of the given command
+        *
+        * @return      $controllerInstance             A controller instance for the default command
+        */
+        function resolveController ();
+}
+
+//
+?>
diff --git a/inc/classes/interfaces/response/.htaccess b/inc/classes/interfaces/response/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/inc/classes/interfaces/response/class_Responseable.php b/inc/classes/interfaces/response/class_Responseable.php
new file mode 100644 (file)
index 0000000..bb798fe
--- /dev/null
@@ -0,0 +1,109 @@
+<?php
+/**
+ * An interface for responses
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+interface Responseable extends FrameworkInterface {
+       /**
+        * Setter for status
+        *
+        * @param       $status         New response status
+        * @return      void
+        */
+       function setResponseStatus ($status);
+
+       /**
+        * Add header element
+        *
+        * @param       $name   Name of header element
+        * @param       $value  Value of header element
+        * @return      void
+        */
+       function addHeader ($name, $value);
+
+       /**
+        * "Writes" data to the response body
+        *
+        * @param       $output         Output we shall sent in the HTTP response
+        * @return      void
+        */
+       function writeToBody ($output);
+
+       /**
+        * Flushs the cached HTTP response to the outer world
+        *
+        * @param       $force  Wether we shall force the output or abort if headers are
+        *                                      already sent with an exception
+        * @return      void
+        * @throws      ResponseHeadersAlreadySentException             Thrown if headers are
+        *                                                                                                      already sent
+        */
+       function flushBuffer ($force = false);
+
+       /**
+        * Adds a fatal message id to the response. The added messages can then be
+        * processed and outputed to the world
+        *
+        * @param       $messageId      The message id we shall add
+        * @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);
+
+       /**
+        * Refreshs a given cookie. This will make the cookie live longer
+        *
+        * @param       $cookieName             Cookie to refresh
+        * @return      void
+        */
+       function refreshCookie ($cookieName);
+}
+
+//
+?>
diff --git a/inc/classes/interfaces/result/.htaccess b/inc/classes/interfaces/result/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/inc/classes/interfaces/result/class_SearchableResult.php b/inc/classes/interfaces/result/class_SearchableResult.php
new file mode 100644 (file)
index 0000000..c3bf26b
--- /dev/null
@@ -0,0 +1,44 @@
+<?php
+/**
+ * An interface for searchable results
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+interface SearchableResult extends FrameworkInterface {
+       /**
+        * Searches for an entry in the data result and returns it
+        *
+        * @param       $criteriaInstance       The criteria to look inside the data set
+        * @return      $result                         Found result entry
+        */
+       function searchEntry (LocalSearchCriteria $criteriaInstance);
+
+       /**
+        * Solver for result index value with call-back method
+        *
+        * @param       $databaseColumn         Database column where the index might be found
+        * @para        $callBack                       Call-back object for setting the index
+        * @return      void
+        */
+       function solveResultIndex ($databaseColumn, BaseDatabaseWrapper $wrapperInstance, array $callBack);
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/interfaces/result/class_UpdateableResult.php b/inc/classes/interfaces/result/class_UpdateableResult.php
new file mode 100644 (file)
index 0000000..42542ed
--- /dev/null
@@ -0,0 +1,45 @@
+<?php
+/**
+ * An interface for searchable results
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+interface UpdateableResult extends FrameworkInterface {
+       /**
+        * Adds an update request to the database result for writing it to the
+        * database layer
+        *
+        * @param       $criteriaInstance       An instance of a updateable criteria
+        * @return      void
+        * @throws      ResultUpdateException   If no result was updated
+        */
+       function add2UpdateQueue (LocalUpdateCriteria $criteriaInstance);
+
+       /**
+        * Adds registration elements to a given dataset instance
+        *
+        * @param       $criteriaInstance       An instance of a storeable criteria
+        * @return      void
+        */
+       function addElementsToDataSet (StoreableCriteria $criteriaInstance);
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/interfaces/template/.htaccess b/inc/classes/interfaces/template/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/inc/classes/interfaces/template/class_CompileableTemplate.php b/inc/classes/interfaces/template/class_CompileableTemplate.php
new file mode 100644 (file)
index 0000000..46ffe77
--- /dev/null
@@ -0,0 +1,89 @@
+<?php
+/**
+ * An interface for template engines
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+interface CompileableTemplate extends FrameworkInterface {
+       /**
+        * Assign variables for templates
+        *
+        * @param       $var    The "variable" we want to assign
+        * @param       $value  The value we want to store in the variable
+        * @return      void
+        */
+       function assignVariable ($var, $value);
+
+       /**
+        * Load a specified web template into the engine
+        *
+        * @param       $template       The web template we shall load which is located in
+        *                                              "html" by default
+        * @return      void
+        */
+       function loadWebTemplate ($template);
+
+       /**
+        * Load a specified code template into the engine for later compilation
+        * with other code/web/email templates.
+        *
+        * @param       $template       The code template we shall load which is
+        *                                              located in "html" by default
+        * @return      void
+        */
+       function loadCodeTemplate ($template);
+
+       /**
+        * Load a specified email template into the engine
+        *
+        * @param       $template       The email template we shall load which is
+        *                                              located in "emails" by default
+        * @return      void
+        */
+       function loadEmailTemplate ($template);
+
+       /**
+        * Compile all variables by inserting their respective values
+        *
+        * @return      void
+        */
+       function compileVariables ();
+
+
+       /**
+        * Compile all required code/web/email-templates into the current one
+        *
+        * @return      void
+        */
+       function compileTemplate ();
+
+       /**
+        * Output the compiled template to the outside world. In case of web
+        * templates this would be vaild (X)HTML code. And in case of email
+        * templates this would store a prepared email body inside the template
+        * engine.
+        *
+        * @return      void
+        */
+       function output ();
+} // END - class
+
+// [EOF]
+?>
diff --git a/inc/classes/interfaces/template/view/class_ViewHelper.php b/inc/classes/interfaces/template/view/class_ViewHelper.php
new file mode 100644 (file)
index 0000000..78e0cf8
--- /dev/null
@@ -0,0 +1,35 @@
+<?php
+/**
+ * An interface for view helpers
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+interface ViewHelper extends FrameworkInterface {
+       /**
+        * The execute method for executing the view helper
+        *
+        * @param       $args   Arguments to send to the view helper
+        * @return      mixed   Unknown return arguments, or void
+        */
+       function execute (array $args = null);
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/interfaces/user/.htaccess b/inc/classes/interfaces/user/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/inc/classes/interfaces/user/class_ManageableAccount.php b/inc/classes/interfaces/user/class_ManageableAccount.php
new file mode 100644 (file)
index 0000000..2dd0706
--- /dev/null
@@ -0,0 +1,50 @@
+<?php
+/**
+ * An interface for manageable accounts (logged-in users and guests likewise)
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+interface ManageableAccount 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 supplied password hash in request matches with stored in
+        * database.
+        *
+        * @param       $requestInstance        A requestable class instance
+        * @return      $matches                        Wether the supplied password hash matches
+        */
+       function ifPasswordHashMatches (Requestable $requestInstance);
+}
+
+//
+?>
diff --git a/inc/classes/interfaces/user/extended/.htaccess b/inc/classes/interfaces/user/extended/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/inc/classes/interfaces/user/extended/class_ManageableGuest.php b/inc/classes/interfaces/user/extended/class_ManageableGuest.php
new file mode 100644 (file)
index 0000000..be90712
--- /dev/null
@@ -0,0 +1,28 @@
+<?php
+/**
+ * An interface for manageable guests
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+interface ManageableGuest extends ManageableAccount {
+}
+
+//
+?>
diff --git a/inc/classes/interfaces/user/extended/class_ManageableMember.php b/inc/classes/interfaces/user/extended/class_ManageableMember.php
new file mode 100644 (file)
index 0000000..db33c63
--- /dev/null
@@ -0,0 +1,28 @@
+<?php
+/**
+ * An interface for manageable users
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+interface ManageableMember extends ManageableAccount {
+}
+
+//
+?>
diff --git a/inc/classes/main/.htaccess b/inc/classes/main/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/inc/classes/main/actions/.htaccess b/inc/classes/main/actions/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/inc/classes/main/actions/class_ b/inc/classes/main/actions/class_
new file mode 100644 (file)
index 0000000..90ff323
--- /dev/null
@@ -0,0 +1,62 @@
+<?php
+/**
+ * 
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class ???Action extends BaseAction implements Commandable {
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+       }
+
+       /**
+        * Creates an instance of this action
+        *
+        * @return      $actionInstance         An instance of this action class
+        */
+       public final static function create???Action () {
+               // Get a new instance
+               $actionInstance = new ???Action();
+
+               // Return the instance
+               return $actionInstance;
+       }
+
+       /**
+        * Executes the 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
+        * @todo        0% done
+        */
+       public function execute (Requestable $requestInstance, Responseable $responseInstance) {
+               $this->partialStub("You have to implement me.");
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/main/actions/class_BaseAction.php b/inc/classes/main/actions/class_BaseAction.php
new file mode 100644 (file)
index 0000000..a2b1665
--- /dev/null
@@ -0,0 +1,44 @@
+<?php
+/**
+ * A general action class. You shall extend this class if you are going to write
+ * your own action classes even when this class has no real content in it. We
+ * just handle the removal of some attributed here which you really don't need.
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class BaseAction extends BaseFrameworkSystem {
+       /**
+        * Protected constructor
+        *
+        * @param       $className      Name of the 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/actions/post_registration/.htaccess b/inc/classes/main/actions/post_registration/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/inc/classes/main/actions/post_registration/class_LoginAfterRegistrationAction.php b/inc/classes/main/actions/post_registration/class_LoginAfterRegistrationAction.php
new file mode 100644 (file)
index 0000000..15fd499
--- /dev/null
@@ -0,0 +1,83 @@
+<?php
+/**
+ * A post registration action to login after the registration is done
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class LoginAfterRegistrationAction extends BaseAction implements PerformableAction {
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+       }
+
+       /**
+        * Creates an instance of this action
+        *
+        * @return      $actionInstance         An instance of this action class
+        */
+       public final static function createLoginAfterRegistrationAction () {
+               // Get a new instance
+               $actionInstance = new LoginAfterRegistrationAction();
+
+               // Return the instance
+               return $actionInstance;
+       }
+
+       /**
+        * Executes the 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) {
+               // Get a login class from factory
+               $loginInstance = ObjectFactory::createObjectByConfiguredName('user_login_class');
+
+               // Login the user by the request instance
+               $loginInstance->doLogin($requestInstance, $responseInstance);
+
+               // Was the login fine? Then redirect here
+               if ($loginInstance->ifLoginWasSuccessfull()) {
+                       // Try to redirect here
+                       try {
+                               // Redirect...
+                               $responseInstance->redirectToConfiguredUrl('app_login_url');
+
+                               // Stop here
+                               exit();
+                       } catch (FrameworkException $e) {
+                               // Something went wrong here!
+                               $responseInstance->addFatalMessage($e->getMessage());
+                       }
+               } else {
+                       // Attach error message to the response
+                       $responseInstance->addFatalMessage('failed_login_after_registration');
+               }
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/main/actions/web/.htaccess b/inc/classes/main/actions/web/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/inc/classes/main/actions/web/class_WebLoginProfileAction.php b/inc/classes/main/actions/web/class_WebLoginProfileAction.php
new file mode 100644 (file)
index 0000000..0999886
--- /dev/null
@@ -0,0 +1,77 @@
+<?php
+/**
+ * An action for the profile page in login area
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class WebLoginProfileAction extends BaseAction implements Commandable, Registerable {
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+       }
+
+       /**
+        * Creates an instance of this action
+        *
+        * @param       $resolverInstance       An instance of an action resolver
+        * @return      $actionInstance         An instance of this action class
+        */
+       public final static function createWebLoginProfileAction (ActionResolver $resolverInstance) {
+               // Get a new instance
+               $actionInstance = new WebLoginProfileAction();
+
+               // Set the resolver instance
+               $actionInstance->setResolverInstance($resolverInstance);
+
+               // Return the instance
+               return $actionInstance;
+       }
+
+       /**
+        * Executes the 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) {
+               // Dummy method
+       }
+
+       /**
+        * Adds extra filters to the given controller instance
+        *
+        * @param       $controllerInstance             A controller instance
+        * @param       $requestInstance                An instance of a class with an Requestable interface
+        * @return      void
+        */
+       public function addExtraFilters (Controller $controllerInstance, Requestable $requestInstance) {
+               // Add user status filter here
+               $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_status_filter', array($controllerInstance)));
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/main/application/.htaccess b/inc/classes/main/application/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/inc/classes/main/application/class_BaseApplication.php b/inc/classes/main/application/class_BaseApplication.php
new file mode 100644 (file)
index 0000000..a8d5e5c
--- /dev/null
@@ -0,0 +1,48 @@
+<?php
+/**
+ * A general application class for the ApplicationHelper classes.
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+class BaseApplication extends BaseFrameworkSystem {
+       /**
+        * Protected constructor
+        *
+        * @param       $className      Name of the class
+        * @return      void
+        */
+       protected function __construct ($className) {
+               // Call parent constructor
+               parent::__construct($className);
+
+               // Clean up a little
+               $this->removeNumberFormaters();
+               $this->removeSystemArray();
+
+               // Get registry instance
+               $registryInstance = Registry::getRegistry();
+
+               // Add this instance
+               $registryInstance->addInstance('application', $this);
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/main/auth/.htaccess b/inc/classes/main/auth/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/inc/classes/main/auth/class_CookieAuth.php b/inc/classes/main/auth/class_CookieAuth.php
new file mode 100644 (file)
index 0000000..6ef5504
--- /dev/null
@@ -0,0 +1,126 @@
+<?php
+/**
+ * A cookie-bases authorization class
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class CookieAuth extends BaseFrameworkSystem implements Authorizeable, Registerable {
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+
+               // 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');
+       }
+
+       /**
+        * Updates the authorization data and/or sets additional tracking data
+        *
+        * @param       $requestInstance        An instance of a Requestable class
+        * @return      void
+        */
+       public function updateAuthData () {
+               $this->getResponseInstance()->refreshCookie('username');
+               $this->getResponseInstance()->refreshCookie('u_hash');
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/main/cache/.htaccess b/inc/classes/main/cache/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/inc/classes/main/cache/class_MemoryCache.php b/inc/classes/main/cache/class_MemoryCache.php
new file mode 100644 (file)
index 0000000..7e0dfd0
--- /dev/null
@@ -0,0 +1,114 @@
+<?php
+/**
+ * A simple memory cache (similar to a registry)
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class MemoryCache extends BaseFrameworkSystem implements Cacheable {
+       /**
+        * The "memory cache" is simply a wrapped object array
+        */
+       private $dataCache = null;
+
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+
+               // Clean up a little
+               $this->removeNumberFormaters();
+               $this->removeSystemArray();
+       }
+
+       /**
+        * Creates an instance of this class
+        *
+        * @return      $cacheInstance  An instance of this cache class
+        */
+       public final static function createMemoryCache () {
+               // Get a new instance
+               $cacheInstance = new MemoryCache();
+
+               // Initialize the cache
+               $cacheInstance->initCache();
+
+               // Return the prepared instance
+               return $cacheInstance;
+       }
+
+       /**
+        * Initialize this cache by creating an object array
+        *
+        * @return      void
+        */
+       protected function initCache () {
+               // Now create the "data cache"
+               $this->dataCache = new FrameworkArrayObject('FakedDataCache');
+       }
+
+       /**
+        * Does the specified offset exist in cache?
+        *
+        * @param       $offset         The offset we are looking for
+        * @return      $exists         Wether the offset exists
+        */
+       public final function offsetExists ($offset) {
+               $exists = $this->dataCache->offsetExists($offset);
+               return $exists;
+       }
+
+       /**
+        * Setter for cache offset
+        *
+        * @param       $offset         The offset we shall set
+        * @param       $data           Data to store in cache
+        * @return      void
+        */
+       public final function offsetSet ($offset, $data) {
+               $this->dataCache->offsetSet($offset, $data);
+       }
+
+       /**
+        * Getter for cache offset or "null" if not found
+        *
+        * @param       $offset         The offset we shall set
+        * @return      $data           Data to store in cache
+        */
+       public final function offsetGet ($offset) {
+               // Default is offset not found
+               $data = null;
+
+               // Is the offset there?
+               if ($this->offsetExists($offset)) {
+                       // Then get the data from it
+                       $data = $this->dataCache->offsetGet($offset);
+               }
+
+               // Return data
+               return $data;
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/main/class_ b/inc/classes/main/class_
new file mode 100644 (file)
index 0000000..df22004
--- /dev/null
@@ -0,0 +1,41 @@
+<?php
+/**
+ * 
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class  extends BaseFrameworkSystem {
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+
+               // Clean up a little
+               $this->removeNumberFormaters();
+               $this->removeSystemArray();
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/main/class_Base b/inc/classes/main/class_Base
new file mode 100644 (file)
index 0000000..9f3eee9
--- /dev/null
@@ -0,0 +1,42 @@
+<?php
+/**
+ * A general 
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+class Base??? extends BaseFrameworkSystem {
+       /**
+        * Protected constructor
+        *
+        * @param       $className      Name of the 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/class_BaseFrameworkSystem.php b/inc/classes/main/class_BaseFrameworkSystem.php
new file mode 100644 (file)
index 0000000..d4eabd7
--- /dev/null
@@ -0,0 +1,1077 @@
+<?php
+/**
+ * The simulator system class is the super class of all other classes. This
+ * class handles saving of games etc.
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
+       /**
+        * Instance to an application helper class
+        */
+       private static $applicationInstance = null;
+
+       /**
+        * The language instance for the template loader
+        */
+       private static $langInstance = null;
+
+       /**
+        * Debug instance
+        */
+       private static $debugInstance = null;
+
+       /**
+        * Instance of a request class
+        */
+       private $requestInstance = null;
+
+       /**
+        * Instance of a response class
+        */
+       private $responseInstance = null;
+
+       /**
+        * Search criteria instance
+        */
+       private $searchInstance = null;
+
+       /**
+        * The file I/O instance for the template loader
+        */
+       private $fileIoInstance = null;
+
+       /**
+        * Resolver instance
+        */
+       private $resolverInstance = null;
+
+       /**
+        * Template engine instance
+        */
+       private $templateInstance = null;
+
+       /**
+        * Database result instance
+        */
+       private $resultInstance = null;
+
+       /**
+        * Instance for user class
+        */
+       private $userInstance = null;
+
+       /**
+        * A controller instance
+        */
+       private $controllerInstance = null;
+
+       /**
+        * The real class name
+        */
+       private $realClass      = "FrameworkSystem";
+
+       /**
+        * Thousands seperator
+        */
+       private $thousands = "."; // German
+
+       /**
+        * Decimal seperator
+        */
+       private $decimals  = ","; // German
+
+       /***********************
+        * Exception codes.... *
+        ***********************/
+
+       const EXCEPTION_IS_NULL_POINTER              = 0x001;
+       const EXCEPTION_IS_NO_OBJECT                 = 0x002;
+       const EXCEPTION_IS_NO_ARRAY                  = 0x003;
+       const EXCEPTION_MISSING_METHOD               = 0x004;
+       const EXCEPTION_CLASSES_NOT_MATCHING         = 0x005;
+       const EXCEPTION_INDEX_OUT_OF_BOUNDS          = 0x006;
+       const EXCEPTION_DIMENSION_ARRAY_INVALID      = 0x007;
+       const EXCEPTION_ITEM_NOT_TRADEABLE           = 0x008;
+       const EXCEPTION_ITEM_NOT_IN_PRICE_LIST       = 0x009;
+       const EXCEPTION_GENDER_IS_WRONG              = 0x00a;
+       const EXCEPTION_BIRTH_DATE_IS_INVALID        = 0x00b;
+       const EXCEPTION_EMPTY_STRUCTURES_ARRAY       = 0x00c;
+       const EXCEPTION_HAS_ALREADY_PERSONELL_LIST   = 0x00d;
+       const EXCEPTION_NOT_ENOUGTH_UNEMPLOYEES      = 0x00e;
+       const EXCEPTION_TOTAL_PRICE_NOT_CALCULATED   = 0x00f;
+       const EXCEPTION_HARBOR_HAS_NO_SHIPYARDS      = 0x010;
+       const EXCEPTION_CONTRACT_PARTNER_INVALID     = 0x011;
+       const EXCEPTION_CONTRACT_PARTNER_MISMATCH    = 0x012;
+       const EXCEPTION_CONTRACT_ALREADY_SIGNED      = 0x013;
+       const EXCEPTION_UNEXPECTED_EMPTY_STRING      = 0x014;
+       const EXCEPTION_PATH_NOT_FOUND               = 0x015;
+       const EXCEPTION_INVALID_PATH_NAME            = 0x016;
+       const EXCEPTION_READ_PROTECED_PATH           = 0x017;
+       const EXCEPTION_WRITE_PROTECED_PATH          = 0x018;
+       const EXCEPTION_DIR_POINTER_INVALID          = 0x019;
+       const EXCEPTION_FILE_POINTER_INVALID         = 0x01a;
+       const EXCEPTION_INVALID_DIRECTORY_POINTER    = 0x01b;
+       const EXCEPTION_UNEXPECTED_OBJECT            = 0x01c;
+       const EXCEPTION_LIMIT_ELEMENT_IS_UNSUPPORTED = 0x01d;
+       const EXCEPTION_GETTER_IS_MISSING            = 0x01e;
+       const EXCEPTION_ARRAY_EXPECTED               = 0x01f;
+       const EXCEPTION_ARRAY_HAS_INVALID_COUNT      = 0x020;
+       const EXCEPTION_ID_IS_INVALID_FORMAT         = 0x021;
+       const EXCEPTION_MD5_CHECKSUMS_MISMATCH       = 0x022;
+       const EXCEPTION_UNEXPECTED_STRING_SIZE       = 0x023;
+       const EXCEPTION_SIMULATOR_ID_INVALID         = 0x024;
+       const EXCEPTION_MISMATCHING_COMPRESSORS      = 0x025;
+       const EXCEPTION_CONTAINER_ITEM_IS_NULL       = 0x026;
+       const EXCEPTION_ITEM_IS_NO_ARRAY             = 0x027;
+       const EXCEPTION_CONTAINER_MAYBE_DAMAGED      = 0x028;
+       const EXCEPTION_INVALID_STRING               = 0x029;
+       const EXCEPTION_VARIABLE_NOT_SET             = 0x02a;
+       const EXCEPTION_ATTRIBUTES_ARE_MISSING       = 0x02b;
+       const EXCEPTION_ARRAY_ELEMENTS_MISSING       = 0x02c;
+       const EXCEPTION_TEMPLATE_ENGINE_UNSUPPORTED  = 0x02d;
+       const EXCEPTION_MISSING_LANGUAGE_HANDLER     = 0x02e;
+       const EXCEPTION_MISSING_FILE_IO_HANDLER      = 0x02f;
+       const EXCEPTION_MISSING_ELEMENT              = 0x030;
+       const EXCEPTION_HEADERS_ALREADY_SENT         = 0x031;
+       const EXCEPTION_DEFAULT_CONTROLLER_GONE      = 0x032;
+       const EXCEPTION_CLASS_NOT_FOUND              = 0x033;
+       const EXCEPTION_REQUIRED_INTERFACE_MISSING   = 0x034;
+       const EXCEPTION_FATAL_ERROR                  = 0x035;
+       const EXCEPTION_FILE_NOT_FOUND               = 0x036;
+       const EXCEPTION_ASSERTION_FAILED             = 0x037;
+       const EXCEPTION_FILE_CANNOT_BE_READ          = 0x038;
+       const EXCEPTION_DATABASE_UPDATED_NOT_ALLOWED = 0x039;
+
+       /**
+        * In the super constructor these system classes shall be ignored or else
+        * we would get an endless calling loop.
+        *
+        *---------------------------------------------------------------------*
+        * ATTENTION: IF YOU REMOVE ONE OF THEM YOU WILL RUN YOUR SERVER IN AN *
+        * ENDLESS LOOP !!!                                                    *
+        *---------------------------------------------------------------------*
+        */
+       private $systemClasses = array(
+               "DebugMiddleware",                              // Debug middleware output sub-system
+               "Registry",                                             // Object registry
+               "ObjectFactory",                                // Object factory
+               "DebugWebOutput",                               // Debug web output sub-system
+               "WebOutput",                                    // Web output sub-system
+               "CompressorChannel",                    // Compressor sub-system
+               "DebugConsoleOutput",                   // Debug console output sub-system
+               "DebugErrorLogOutput",                  // Debug error_log() output sub-system
+               "FrameworkDirectoryPointer",    // Directory handler sub-system
+               "NullCompressor",                               // Null compressor
+               "Bzip2Compressor",                              // BZIP2 compressor
+               "GzipCompressor",                               // GZIP compressor
+       );
+
+       /* No longer used:
+       */
+
+       /**
+        * Private super constructor
+        *
+        * @param       $className      Name of the class
+        * @return      void
+        */
+       protected function __construct ($className) {
+               // Set real class
+               $this->setRealClass($className);
+
+               // Initialize the class if class Registry is there
+               if ((class_exists('Registry')) && (Registry::isInitialized() === false)) {
+                       // Initialize the registry automatically
+                       $this->initInstance();
+               } // END - if
+       }
+
+       /**
+        * Destructor reached...
+        *
+        * @return      void
+        * @todo        This is old code. Do we still need this old lost code?
+        */
+       public function __destruct() {
+               // Is this object already destroyed?
+               if ($this->__toString() != 'DestructedObject') {
+                       // Destroy all informations about this class but keep some text about it alive
+                       $this->setRealClass('DestructedObject');
+               } elseif ((defined('DEBUG_DESTRUCTOR')) && (is_object($this->getDebugInstance()))) {
+                       // Already destructed object
+                       $this->debugOutput(sprintf("[%s:] The object <span class=\"object_name\">%s</span> is already destroyed.",
+                               __CLASS__, $this->__toString()
+                       ));
+               }
+       }
+
+       /**
+        * The call method where all non-implemented methods end up
+        *
+        * @return      void
+        */
+       public final function __call ($methodName, $args) {
+               // Implode all given arguments
+               $argsString = "";
+               if (empty($args)) {
+                       // No arguments
+                       $argsString = "NULL";
+               } elseif (is_array($args)) {
+                       // Some arguments are there
+                       foreach ($args as $arg) {
+                               // Add the type
+                               $argsString .= $arg." (".gettype($arg);
+
+                               // Add length if type is string
+                               if (gettype($arg) == 'string') $argsString .= ", ".strlen($arg);
+
+                               // Closing bracket
+                               $argsString .= "), ";
+                       } // END - foreach
+
+                       // Remove last comma
+                       if (substr($argsString, -2, 1) === ",") {
+                               $argsString = substr($argsString, 0, -2);
+                       } // END - if
+               } else {
+                       // Invalid arguments!
+                       $argsString = sprintf("!INVALID:%s!", $args);
+               }
+
+               // Output stub message
+               $this->debugOutput(sprintf("[%s-&gt;%s] Stub! Args: %s",
+                       $this->__toString(),
+                       $methodName,
+                       $argsString
+               ));
+
+               // Return nothing
+               return null;
+       }
+
+       /**
+        * Private initializer for this class
+        *
+        * @return      void
+        */
+       private final function initInstance () {
+               // Is this a system class?
+               if (!in_array($this->__toString(), $this->systemClasses)) {
+                       // Set configuration instance
+                       $this->setConfigInstance(FrameworkConfiguration::getInstance());
+
+                       // Add application helper to our class
+                       $this->systemclasses[] = $this->getConfigInstance()->readConfig('app_helper_class');
+
+                       // Set debug instance
+                       $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')));
+                       $this->setWebOutputInstance($outputInstance);
+
+                       // Set the compressor channel
+                       $this->setCompressorChannel(CompressorChannel::createCompressorChannel(sprintf("%s%s",
+                               $this->getConfigInstance()->readConfig('base_path'),
+                               $this->getConfigInstance()->readConfig('compressor_base_path')
+                       )));
+
+                       // Initialization done! :D
+                       Registry::isInitialized('OK');
+               } elseif ($this->__toString() == 'DebugMiddleware') {
+                       // Set configuration instance
+                       $this->setConfigInstance(FrameworkConfiguration::getInstance());
+               }
+       }
+
+       /**
+        * Setter for database result instance
+        *
+        * @param       $resultInstance         An instance of a database result class
+        * @return      void
+        * @todo        SearchableResult and UpdateableResult shall have a super interface to use here
+        */
+       protected final function setResultInstance (SearchableResult $resultInstance) {
+               $this->resultInstance =  $resultInstance;
+       }
+
+       /**
+        * Getter for database result instance
+        *
+        * @return      $resultInstance         An instance of a database result class
+        */
+       public final function getResultInstance () {
+               return $this->resultInstance;
+       }
+
+       /**
+        * Setter for template engine instances
+        *
+        * @param       $templateInstance       An instance of a template engine class
+        * @return      void
+        */
+       protected final function setTemplateInstance (CompileableTemplate $templateInstance) {
+               $this->templateInstance = $templateInstance;
+       }
+
+       /**
+        * Getter for template engine instances
+        *
+        * @return      $templateInstance       An instance of a template engine class
+        */
+       protected final function getTemplateInstance () {
+               return $this->templateInstance;
+       }
+
+       /**
+        * Setter for search instance
+        *
+        * @param       $searchInstance         Searchable criteria instance
+        * @return      void
+        */
+       public final function setSearchInstance (LocalSearchCriteria $searchInstance) {
+               $this->searchInstance = $searchInstance;
+       }
+
+       /**
+        * Getter for search instance
+        *
+        * @return      $searchInstance         Searchable criteria instance
+        */
+       public final function getSearchInstance () {
+               return $this->searchInstance;
+       }
+
+       /**
+        * Setter for resolver instance
+        *
+        * @param       $resolverInstance               Instance of a command resolver class
+        * @return      void
+        */
+       public final function setResolverInstance (Resolver $resolverInstance) {
+               $this->resolverInstance = $resolverInstance;
+       }
+
+       /**
+        * Getter for resolver instance
+        *
+        * @return      $resolverInstance               Instance of a command resolver class
+        */
+       public final function getResolverInstance () {
+               return $this->resolverInstance;
+       }
+
+       /**
+        * Setter for language instance
+        *
+        * @param       $configInstance         The configuration instance which shall
+        *                                                              be FrameworkConfiguration
+        * @return      void
+        */
+       public final function setConfigInstance (FrameworkConfiguration $configInstance) {
+               Registry::getRegistry()->addInstance('config', $configInstance);
+       }
+
+       /**
+        * Getter for configuration instance
+        *
+        * @return      $cfgInstance    Configuration instance
+        */
+       public final function getConfigInstance () {
+               $cfgInstance = Registry::getRegistry()->getInstance('config');
+               return $cfgInstance;
+       }
+
+       /**
+        * Setter for debug instance
+        *
+        * @param       $debugInstance  The instance for debug output class
+        * @return      void
+        */
+       public final function setDebugInstance (DebugMiddleware $debugInstance) {
+               self::$debugInstance = $debugInstance;
+       }
+
+       /**
+        * Getter for debug instance
+        *
+        * @return      $debugInstance  Instance to class DebugConsoleOutput or DebugWebOutput
+        */
+       public final function getDebugInstance () {
+               return self::$debugInstance;
+       }
+
+       /**
+        * Setter for web output instance
+        *
+        * @param               $webInstance    The instance for web output class
+        * @return      void
+        */
+       public final function setWebOutputInstance (OutputStreamer $webInstance) {
+               Registry::getRegistry()->addInstance('web_output', $webInstance);
+       }
+
+       /**
+        * Getter for web output instance
+        *
+        * @return      $webOutput - Instance to class WebOutput
+        */
+       public final function getWebOutputInstance () {
+               return Registry::getRegistry()->getInstance('web_output');
+       }
+
+       /**
+        * Setter for database instance
+        *
+        * @param               $dbInstance     The instance for the database connection
+        *                                      (forced DatabaseConnection)
+        * @return      void
+        */
+       public final function setDatabaseInstance (DatabaseConnection $dbInstance) {
+               Registry::getRegistry()->addInstance('dbInstance', $dbInstance);
+       }
+
+       /**
+        * Getter for database layer
+        *
+        * @return      $dbInstance     The database layer instance
+        */
+       public final function getDatabaseInstance () {
+               // Default is invalid db instance
+               $dbInstance = null;
+
+               // Is the registry there and initialized?
+               if ((class_exists('Registry')) && (Registry::isInitialized() === true)) {
+                       $dbInstance = Registry::getRegistry()->getInstance('dbInstance');
+               } // END - if
+
+               // Return instance
+               return $dbInstance;
+       }
+
+       /**
+        * Setter for compressor channel
+        *
+        * @param               $compressorChannel      An instance of CompressorChannel
+        * @return      void
+        */
+       public final function setCompressorChannel (CompressorChannel $compressorChannel) {
+               Registry::getRegistry()->addInstance('compressor', $compressorChannel);
+       }
+
+       /**
+        * Getter for compressor channel
+        *
+        * @return      $compressor     The compressor channel
+        */
+       public final function getCompressorChannel () {
+               return Registry::getRegistry()->getInstance('compressor');
+       }
+
+       /**
+        * Protected getter for a manageable application helper class
+        *
+        * @return      $applicationInstance    An instance of a manageable application helper class
+        */
+       protected final function getApplicationInstance () {
+               return self::$applicationInstance;
+       }
+
+       /**
+        * Setter for a manageable application helper class
+        *
+        * @param       $applicationInstance    An instance of a manageable application helper class
+        * @return      void
+        */
+       public final function setApplicationInstance (ManageableApplication $applicationInstance) {
+               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
+        *
+        * @return      $realClass The name of the real class (not BaseFrameworkSystem)
+        */
+       public final function __toString () {
+               return $this->realClass;
+       }
+
+       /**
+        * Setter for the real class name
+        *
+        * @param               $realClass      Class name (string)
+        * @return      void
+        */
+       public final function setRealClass ($realClass) {
+               // Cast to string
+               $realClass = (string) $realClass;
+
+               // Set real class
+               $this->realClass = $realClass;
+       }
+
+       /**
+        * Compare class name of this and given class name
+        *
+        * @param               $className      The class name as string from the other class
+        * @return      boolean The result of comparing both class names
+        */
+       public final function isClass ($className) {
+               return ($this->__toString() == $className);
+       }
+
+       /**
+        * Stub method (only real cabins shall override it)
+        *
+        * @return      boolean false = is no cabin, true = is a cabin
+        * @deprecated
+        */
+       public function isCabin () {
+               return false;
+       }
+
+       /**
+        * Stub method for tradeable objects
+        *
+        * @return      boolean false = is not tradeable by the Merchant class,
+        *                                      true  = is a tradeable object
+        * @deprecated
+        */
+       public function isTradeable () {
+               return false;
+       }
+
+       /**
+        * Formats computer generated price values into human-understandable formats
+        * with thousand and decimal seperators.
+        *
+        * @param       $value          The in computer format value for a price
+        * @param       $currency       The currency symbol (use HTML-valid characters!)
+        * @param       $decNum         Number of decimals after commata
+        * @return      $price          The for the current language formated price string
+        * @throws      MissingDecimalsThousandsSeperatorException      If decimals or
+        *                                                                                              thousands seperator
+        *                                                                                              is missing
+        */
+       public function formatCurrency ($value, $currency = "&euro;", $decNum = 2) {
+               // Are all required attriutes set?
+               if ((!isset($this->decimals)) || (!isset($this->thousands))) {
+                       // Throw an exception
+                       throw new MissingDecimalsThousandsSeperatorException($this, self::EXCEPTION_ATTRIBUTES_ARE_MISSING);
+               }
+
+               // Cast the number
+               $value = (float) $value;
+
+               // Reformat the US number
+               $price = sprintf("%s %s",
+                       number_format($value, $decNum, $this->decimals, $this->thousands),
+                       $currency
+               );
+
+               // Return as string...
+               return $price;
+       }
+
+       /**
+        * Removes number formating characters
+        *
+        * @return      void
+        */
+       public final function removeNumberFormaters () {
+               unset($this->thousands);
+               unset($this->decimals);
+       }
+
+       /**
+        * Private getter for language instance
+        *
+        * @return      $langInstance   An instance to the language sub-system
+        */
+       protected final function getLanguageInstance () {
+               return self::$langInstance;
+       }
+
+       /**
+        * Setter for language instance
+        *
+        * @param       $langInstance   An instance to the language sub-system
+        * @return      void
+        * @see         LanguageSystem
+        */
+       public final function setLanguageInstance (ManageableLanguage $langInstance) {
+               self::$langInstance = $langInstance;
+       }
+
+       /**
+        * Remove the $systemClasses array from memory
+        *
+        * @return      void
+        */
+       public final function removeSystemArray () {
+               unset($this->systemClasses);
+       }
+
+       /**
+        * Appends a trailing slash to a string
+        *
+        * @param       $str            A string (maybe) without trailing slash
+        * @return      $str            A string with an auto-appended trailing slash
+        */
+       public final function addMissingTrailingSlash ($str) {
+               // Is there a trailing slash?
+               if (substr($str, -1, 1) != "/") $str .= "/";
+               return $str;
+       }
+
+       /**
+        * Private getter for file IO instance
+        *
+        * @return      $fileIoInstance An instance to the file I/O sub-system
+        */
+       protected final function getFileIoInstance () {
+               return $this->fileIoInstance;
+       }
+
+       /**
+        * Setter for file I/O instance
+        *
+        * @param       $fileIoInstance An instance to the file I/O sub-system
+        * @return      void
+        */
+       public final function setFileIoInstance (FileIoHandler $fileIoInstance) {
+               $this->fileIoInstance = $fileIoInstance;
+       }
+
+       /**
+        * Prepare the template engine (WebTemplateEngine by default) for a given
+        * application helper instance (ApplicationHelper by default).
+        *
+        * @param               $appInstance                    An application helper instance or
+        *                                                                              null if we shall use the default
+        * @return              $templateInstance                               The template engine instance
+        * @throws              NullPointerException    If the template engine could not
+        *                                                                              be initialized
+        * @throws              UnsupportedTemplateEngineException      If $templateInstance is an
+        *                                                                              unsupported template engine
+        * @throws              MissingLanguageHandlerException If the language sub-system
+        *                                                                              is not yet initialized
+        * @throws              NullPointerException    If the discovered application
+        *                                                                              instance is still null
+        */
+       protected function prepareTemplateInstance (BaseFrameworkSystem $appInstance=null) {
+               // Is the application instance set?
+               if (is_null($appInstance)) {
+                       // Get the current instance
+                       $appInstance = $this->getApplicationInstance();
+
+                       // Still null?
+                       if (is_null($appInstance)) {
+                               // Thrown an exception
+                               throw new NullPointerException($this, self::EXCEPTION_IS_NULL_POINTER);
+                       } // END - if
+               } // END - if
+
+               // Generate FQFN for all application templates
+               $fqfn = sprintf("%s%s/%s",
+                       $this->getConfigInstance()->readConfig('application_path'),
+                       strtolower($appInstance->getAppShortName()),
+                       $this->getConfigInstance()->readConfig('tpl_base_path')
+               );
+
+               // Are both instances set?
+               if ($appInstance->getLanguageInstance() === null) {
+                       // Invalid language instance
+                       throw new MissingLanguageHandlerException($appInstance, self::EXCEPTION_MISSING_LANGUAGE_HANDLER);
+               } elseif ($appInstance->getFileIoInstance() === null) {
+                       // Invalid language instance
+                       throw new MissingFileIoHandlerException($appInstance, self::EXCEPTION_MISSING_FILE_IO_HANDLER);
+               }
+
+               // Initialize the template engine
+               $templateInstance = ObjectFactory::createObjectByConfiguredName('template_class', array($fqfn, $appInstance->getLanguageInstance(), $appInstance->getFileIoInstance()));
+
+               // Return the prepared instance
+               return $templateInstance;
+       }
+
+       /**
+        * Debugs this instance by putting out it's full content
+        *
+        * @param       $message        Optional message to show in debug output
+        * @return      void
+        */
+       public final function debugInstance ($message = "") {
+               // Restore the error handler to avoid trouble with missing array elements or undeclared variables
+               restore_error_handler();
+
+               // Init content
+               $content = "";
+
+               // Is a message set?
+               if (!empty($message)) {
+                       // Construct message
+                       $content = sprintf("<div class=\"debug_message\">Message: %s</div>\n", $message);
+               } // END - if
+
+               // Generate the output
+               $content .= sprintf("<pre>%s</pre>",
+                       trim(
+                               htmlentities(
+                                       print_r($this, true)
+                               )
+                       )
+               );
+
+               // Output it
+               ApplicationEntryPoint::app_die(sprintf("<div class=\"debug_header\">%s debug output:</div><div class=\"debug_content\">%s</div>\nLoaded includes: <div class=\"debug_include_list\">%s</div>",
+                       $this->__toString(),
+                       $content,
+                       ClassLoader::getInstance()->getPrintableIncludeList()
+               ));
+       }
+
+       /**
+        * Output a partial stub message for the caller method
+        *
+        * @param       $message        An optional message to display
+        * @return      void
+        */
+       protected function partialStub ($message = "") {
+               // Get the backtrace
+               $backtrace = debug_backtrace();
+
+               // Generate the class::method string
+               $methodName = "UnknownClass-&gt;unknownMethod";
+               if ((isset($backtrace[1]['class'])) && (isset($backtrace[1]['function']))) {
+                       $methodName = $backtrace[1]['class']."-&gt;".$backtrace[1]['function'];
+               } // END - if
+
+               // Construct the full message
+               $stubMessage = sprintf("[%s:] Partial stub!",
+                       $methodName
+               );
+
+               // Is the extra message given?
+               if (!empty($message)) {
+                       // Then add it as well
+                       $stubMessage .= sprintf(" Message: <span id=\"stub_message\">%s</span>", $message);
+               } // END - if
+
+               // Debug instance is there?
+               if (!is_null($this->getDebugInstance())) {
+                       // Output stub message
+                       $this->debugOutput($stubMessage);
+               } else {
+                       // Trigger an error
+                       trigger_error($stubMessage."<br />\n");
+               }
+       }
+
+       /**
+        * Outputs a debug backtrace and stops further script execution
+        *
+        * @return      void
+        */
+       public function debugBackTrace () {
+               // Sorry, there is no other way getting this nice backtrace
+               print("<pre>\n");
+               debug_print_backtrace();
+               print("</pre>");
+               exit();
+       }
+
+       /**
+        * Outputs a debug message wether to debug instance (should be set!) or dies with or pints the message
+        *
+        * @param       $message        Message we shall send out...
+        * @param       $doPrint        Wether we shall print or die here which first is the default
+        * @return      void
+        */
+       public function debugOutput ($message, $doPrint = true) {
+               // Get debug instance
+               $debugInstance = $this->getDebugInstance();
+
+               // Is the debug instance there?
+               if (is_object($debugInstance)) {
+                       // Use debug output handler
+                       $debugInstance->output($message);
+                       if ($doPrint === false) die(); // Die here if not printed
+               } else {
+                       // Put directly out
+                       if ($doPrint) {
+                               print($message);
+                       } else {
+                               // DO NOT REWRITE THIS TO app_die() !!!
+                               die($message);
+                       }
+               }
+       }
+
+       /**
+        * Converts e.g. a command from URL to a valid class by keeping out bad characters
+        *
+        * @param       $str            The string, what ever it is needs to be converted
+        * @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;
+       }
+
+       /**
+        * Marks up the code by adding e.g. line numbers
+        *
+        * @param       $phpCode                Unmarked PHP code
+        * @return      $markedCode             Marked PHP code
+        */
+       public function markupCode ($phpCode) {
+               // Init marked code
+               $markedCode = "";
+
+               // Get last error
+               $errorArray = error_get_last();
+
+               // Init the code with error message
+               if (is_array($errorArray)) {
+                       // Get error infos
+                       $markedCode = sprintf("<div id=\"error_header\">File: <span id=\"error_data\">%s</span>, Line: <span id=\"error_data\">%s</span>, Message: <span id=\"error_data\">%s</span>, Type: <span id=\"error_data\">%s</span></div>",
+                               basename($errorArray['file']),
+                               $errorArray['line'],
+                               $errorArray['message'],
+                               $errorArray['type']
+                       );
+               } // END - if
+
+               // Add line number to the code
+               foreach (explode("\n", $phpCode) as $lineNo => $code) {
+                       // Add line numbers
+                       $markedCode .= sprintf("<span id=\"code_line\">%s</span>: %s\n",
+                               ($lineNo + 1),
+                               htmlentities($code, ENT_QUOTES)
+                       );
+               } // END - foreach
+
+               // Return the code
+               return $markedCode;
+       }
+
+       /**
+        * Filter a given GMT timestamp (non Uni* stamp!) to make it look more
+        * beatiful for web-based front-ends. If null is given a message id
+        * null_timestamp will be resolved and returned.
+        *
+        * @param       $timestamp      Timestamp to prepare (filter) for display
+        * @return      $readable       A readable timestamp
+        */
+       public function doFilterFormatTimestamp ($timestamp) {
+               // Default value to return
+               $readable = "???";
+
+               // Is the timestamp null?
+               if (is_null($timestamp)) {
+                       // Get a message string
+                       $readable = $this->getLanguageInstance()->getMessage('null_timestamp');
+               } else {
+                       switch ($this->getLanguageInstance()->getLanguageCode()) {
+                               case "de": // German format is a bit different to default
+                                       // Split the GMT stamp up
+                                       $dateTime = explode(" ", $timestamp);
+                                       $dateArray = explode("-", $dateTime[0]);
+                                       $timeArray = explode(":", $dateTime[1]);
+
+                                       // Construct the timestamp
+                                       $readable = sprintf($this->getConfigInstance()->readConfig('german_date_time'),
+                                               $dateArray[0],
+                                               $dateArray[1],
+                                               $dateArray[2],
+                                               $timeArray[0],
+                                               $timeArray[1],
+                                               $timeArray[2]
+                                       );
+                                       break;
+
+                               default: // Default is pass-through
+                                       $readable = $timestamp;
+                                       break;
+                       }
+               }
+
+               // Return the stamp
+               return $readable;
+       }
+
+       /**
+        * "Getter" for databse entry
+        *
+        * @return      $entry  An array with database entries
+        * @throws      NullPointerException    If the database result is not found
+        * @throws      InvalidDatabaseResultException  If the database result is invalid
+        */
+       protected final function getDatabaseEntry () {
+               // Is there an instance?
+               if (is_null($this->getResultInstance())) {
+                       // Throw an exception here
+                       throw new NullPointerException($this, self::EXCEPTION_IS_NULL_POINTER);
+               } // END - if
+
+               // Rewind it
+               $this->getResultInstance()->rewind();
+
+               // Do we have an entry?
+               if ($this->getResultInstance()->valid() === false) {
+                       throw new InvalidDatabaseResultException(array($this, $this->getResultInstance()), DatabaseResult::EXCEPTION_INVALID_DATABASE_RESULT);
+               } // END - if
+
+               // Get next entry
+               $this->getResultInstance()->next();
+
+               // Fetch it
+               $entry = $this->getResultInstance()->current();
+
+               // And return it
+               return $entry;
+       }
+
+       /**
+        * Getter for field name
+        *
+        * @param       $fieldName              Field name which we shall get
+        * @return      $fieldValue             Field value from the user
+        * @throws      NullPointerException    If the result instance is null
+        */
+       public final function getField ($fieldName) {
+               // Default field value
+               $fieldValue = null;
+
+               // Get result instance
+               $resultInstance = $this->getResultInstance();
+
+               // Is this instance null?
+               if (is_null($resultInstance)) {
+                       // Then the user instance is no longer valid (expired cookies?)
+                       throw new NullPointerException($this, self::EXCEPTION_IS_NULL_POINTER);
+               } // END - if
+
+               // Get current array
+               $fieldArray = $resultInstance->current();
+
+               // Does the field exist?
+               if (isset($fieldArray[$fieldName])) {
+                       // Get it
+                       $fieldValue = $fieldArray[$fieldName];
+               } // END - if
+
+               // Return it
+               return $fieldValue;
+       }
+
+       /**
+        * Protected setter for user instance
+        *
+        * @param       $userInstance   An instance of a user class
+        * @return      void
+        */
+       protected final function setUserInstance (ManageableAccount $userInstance) {
+               $this->userInstance = $userInstance;
+       }
+
+       /**
+        * Getter for user instance
+        *
+        * @return      $userInstance   An instance of a user class
+        */
+       public final function getUserInstance () {
+               return $this->userInstance;
+       }
+
+       /**
+        * Setter for controller instance (this surely breaks a bit the MVC patterm)
+        *
+        * @param       $controllerInstance             An instance of the controller
+        * @return      void
+        */
+       public final function setControllerInstance (Controller $controllerInstance) {
+               $this->controllerInstance = $controllerInstance;
+       }
+
+       /**
+        * Getter for controller instance (this surely breaks a bit the MVC patterm)
+        *
+        * @return      $controllerInstance             An instance of the controller
+        */
+       public final function getControllerInstance () {
+               return $this->controllerInstance;
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/main/class_FrameworkArrayObject.php b/inc/classes/main/class_FrameworkArrayObject.php
new file mode 100644 (file)
index 0000000..167423c
--- /dev/null
@@ -0,0 +1,53 @@
+<?php
+/**
+ * Class for saving arrays as an object. We need this little extension for
+ * some common methods used in whole application. Please see below if you
+ * need more details.
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class FrameworkArrayObject extends ArrayObject {
+       /**
+        * Real class name
+        */
+       private $realClass = "";
+
+       /**
+        * Public constructor for setting real class name
+        *
+        * @param       $className      Real class name
+        * @return      void
+        */
+       public function __construct ($className) {
+               $this->realClass = (string) $className;
+       }
+
+       /**
+        * Get real class' name back
+        *
+        * @return      $realClass      The class' real name
+        */
+       public function __toString () {
+               return $this->realClass;
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/main/commands/.htaccess b/inc/classes/main/commands/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/inc/classes/main/commands/class_ b/inc/classes/main/commands/class_
new file mode 100644 (file)
index 0000000..cac39ce
--- /dev/null
@@ -0,0 +1,64 @@
+<?php
+/**
+ * 
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class ???Command extends BaseCommand implements Commandable {
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+       }
+
+       /**
+        * 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 create???Command (CommandResolver $resolverInstance) {
+               // Get new instance
+               $commandInstance = new ???Command();
+
+               // 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) {
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/main/commands/class_BaseCommand.php b/inc/classes/main/commands/class_BaseCommand.php
new file mode 100644 (file)
index 0000000..7a7cc26
--- /dev/null
@@ -0,0 +1,62 @@
+<?php
+/**
+ * A general (base) command
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class BaseCommand extends BaseFrameworkSystem {
+       /**
+        * The controller we need for this command
+        */
+       private $controllerName = "";
+
+       /**
+        * Protected constructor
+        *
+        * @param       $className      Name of the class
+        * @return      void
+        */
+       protected function __construct ($className) {
+               // Call parent constructor
+               parent::__construct($className);
+       }
+
+       /**
+        * Setter for controller name
+        *
+        * @param       $controllerName         Name of the controller assigned with this command
+        * @return      void
+        */
+       public final function setControllerName ($controllerName) {
+               $this->controllerName = (string) $controllerName;
+       }
+
+       /**
+        * Getter for controller name
+        *
+        * @return      $controllerName         Name of the controller assigned with this command
+        */
+       public final function getControllerName () {
+               return $this->controllerName;
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/main/commands/image/.htaccess b/inc/classes/main/commands/image/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/inc/classes/main/commands/image/class_ImageCodeCaptchaCommand.php b/inc/classes/main/commands/image/class_ImageCodeCaptchaCommand.php
new file mode 100644 (file)
index 0000000..8c6794d
--- /dev/null
@@ -0,0 +1,98 @@
+<?php
+/**
+ * A command for creating code CAPTCHAs
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class ImageCodeCaptchaCommand extends BaseCommand implements Commandable {
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+       }
+
+       /**
+        * 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 createImageCodeCaptchaCommand (CommandResolver $resolverInstance) {
+               // Get new instance
+               $commandInstance = new ImageCodeCaptchaCommand();
+
+               // 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) {
+               // Get the decrypted string from request (previously created by a filter!)
+               $decryptedCode = $requestInstance->getRequestElement('decrypted');
+
+               // Get the application instance
+               $appInstance = $this->getResolverInstance()->getApplicationInstance();
+
+               // Prepare a template instance
+               $templateInstance = $this->prepareTemplateInstance($appInstance);
+
+               // Assign variable
+               $templateInstance->assignVariable('decrypted_code', $decryptedCode);
+
+               // Load the code (pardon, image...) template
+               $templateInstance->loadCodeTemplate('code_captcha');
+
+               // Compile the template
+               $templateInstance->compileTemplate();
+
+               // Compile all variables
+               $templateInstance->compileVariables();
+
+               // Transfer it to the response
+               $templateInstance->transferToResponse($responseInstance);
+       }
+
+       /**
+        * Adds extra filters to the given controller instance
+        *
+        * @param       $controllerInstance             A controller instance
+        * @param       $requestInstance                An instance of a class with an Requestable interface
+        * @return      void
+        */
+       public function addExtraFilters (Controller $controllerInstance, Requestable $requestInstance) {
+               // Extra filters here...
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/main/commands/web/.htaccess b/inc/classes/main/commands/web/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/inc/classes/main/commands/web/class_ b/inc/classes/main/commands/web/class_
new file mode 100644 (file)
index 0000000..d5c0bc0
--- /dev/null
@@ -0,0 +1,77 @@
+<?php
+/**
+ * A command for 
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class Web???Command extends BaseCommand implements Commandable {
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+       }
+
+       /**
+        * 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 createWeb???Command (CommandResolver $resolverInstance) {
+               // Get new instance
+               $commandInstance = new Web???Command();
+
+               // 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
+        * @todo        0% done
+        */
+       public function execute (Requestable $requestInstance, Responseable $responseInstance) {
+               $this->partialStub("Unfinished method.");
+       }
+
+       /**
+        * Adds extra filters to the given controller instance
+        *
+        * @param       $controllerInstance             A controller instance
+        * @param       $requestInstance                An instance of a class with an Requestable interface
+        * @return      void
+        */
+       public function addExtraFilters (Controller $controllerInstance, Requestable $requestInstance) {
+               // Empty for now
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/main/commands/web/class_WebConfirmCommand.php b/inc/classes/main/commands/web/class_WebConfirmCommand.php
new file mode 100644 (file)
index 0000000..ca44f8b
--- /dev/null
@@ -0,0 +1,129 @@
+<?php
+/**
+ * A command for the confirmation link handling
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class WebConfirmCommand extends BaseCommand implements Commandable {
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+       }
+
+       /**
+        * 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 createWebConfirmCommand (CommandResolver $resolverInstance) {
+               // Get new instance
+               $commandInstance = new WebConfirmCommand();
+
+               // 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) {
+               // Get the application instance
+               $appInstance = $this->getResolverInstance()->getApplicationInstance();
+
+               // Prepare a template instance
+               $templateInstance = $this->prepareTemplateInstance($appInstance);
+
+               // Assign application data with template engine
+               $templateInstance->assignApplicationData($appInstance);
+
+               // Assign base URL
+               $templateInstance->assignConfigVariable('base_url');
+
+               // 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');
+
+               // Load the home template
+               $templateInstance->loadCodeTemplate('confirm_link');
+
+               // Assign the home template with the master template as a content ... ;)
+               $templateInstance->assignTemplateWithVariable('confirm_link', 'content');
+
+               // Load the master template
+               $templateInstance->loadCodeTemplate($masterTemplate);
+
+               // Set title
+               $templateInstance->assignVariable('title', $this->getLanguageInstance()->getMessage('page_confirm_link_title'));
+
+               // Get user instance
+               $userInstance = Registry::getRegistry()->getInstance('user');
+
+               // Set username
+               $templateInstance->assignVariable('username', $userInstance->getField(UserDatabaseWrapper::DB_COLUMN_USERNAME));
+
+               // ... 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 response class
+               $templateInstance->transferToResponse($responseInstance);
+       }
+
+       /**
+        * Adds extra filters to the given controller instance
+        *
+        * @param       $controllerInstance             A controller instance
+        * @param       $requestInstance                An instance of a class with an Requestable interface
+        * @return      void
+        */
+       public function addExtraFilters (Controller $controllerInstance, Requestable $requestInstance) {
+               // Empty for now
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/main/commands/web/class_WebDoFormCommand.php b/inc/classes/main/commands/web/class_WebDoFormCommand.php
new file mode 100644 (file)
index 0000000..d34e16f
--- /dev/null
@@ -0,0 +1,78 @@
+<?php
+/**
+ * A command for the form processor
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class WebDoFormCommand extends BaseCommand implements Commandable {
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+       }
+
+       /**
+        * 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 createWebDoFormCommand (CommandResolver $resolverInstance) {
+               // Get new instance
+               $commandInstance = new WebDoFormCommand();
+
+               // 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) {
+               // Should never be executed...
+               $this->debugBackTrace();
+       }
+
+       /**
+        * Adds extra filters to the given controller instance
+        *
+        * @param       $controllerInstance             A controller instance
+        * @param       $requestInstance                An instance of a class with an Requestable interface
+        * @return      void
+        */
+       public function addExtraFilters (Controller $controllerInstance, Requestable $requestInstance) {
+               // Empty for now
+       }
+
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/main/commands/web/class_WebHomeCommand.php b/inc/classes/main/commands/web/class_WebHomeCommand.php
new file mode 100644 (file)
index 0000000..6aad8cf
--- /dev/null
@@ -0,0 +1,120 @@
+<?php
+/**
+ * A command for the home page
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class WebHomeCommand extends BaseCommand implements Commandable {
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+       }
+
+       /**
+        * 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 createWebHomeCommand (CommandResolver $resolverInstance) {
+               // Get new instance
+               $commandInstance = new WebHomeCommand();
+
+               // 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) {
+               // Get the application instance
+               $appInstance = $this->getResolverInstance()->getApplicationInstance();
+
+               // Prepare a template instance
+               $templateInstance = $this->prepareTemplateInstance($appInstance);
+
+               // Transfer application data
+               $templateInstance->assignApplicationData($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');
+
+               // Load the home template
+               $templateInstance->loadCodeTemplate('home');
+
+               // Assign the home template with the master template as a content ... ;)
+               $templateInstance->assignTemplateWithVariable('home', 'content');
+
+               // Load the master template
+               $templateInstance->loadCodeTemplate($masterTemplate);
+
+               // Set title
+               $templateInstance->assignVariable('title', $this->getLanguageInstance()->getMessage('page_home_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 response class
+               $templateInstance->transferToResponse($responseInstance);
+       }
+
+       /**
+        * Adds extra filters to the given controller instance
+        *
+        * @param       $controllerInstance             A controller instance
+        * @param       $requestInstance                An instance of a class with an Requestable interface
+        * @return      void
+        */
+       public function addExtraFilters (Controller $controllerInstance, Requestable $requestInstance) {
+               // Empty for now
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/main/commands/web/class_WebLoginAreaCommand.php b/inc/classes/main/commands/web/class_WebLoginAreaCommand.php
new file mode 100644 (file)
index 0000000..749de17
--- /dev/null
@@ -0,0 +1,197 @@
+<?php
+/**
+ * A command for the login area (member/gamer area)
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class WebLoginAreaCommand extends BaseCommand implements Commandable {
+       /**
+        * Name of the action
+        */
+       private $actionName = "";
+
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+       }
+
+       /**
+        * 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);
+
+               // Load general data like user status and such
+               $commandInstance->prepareCommand();
+
+               // Return the prepared instance
+               return $commandInstance;
+       }
+
+       /**
+        * Prepares some general data which shall be displayed on every page
+        *
+        * @return      void
+        * @todo        Add some stuff here: Some personal data, app/game related data
+        */
+       protected function prepareCommand () {
+       }
+
+       /**
+        * 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) {
+               // Get the action instance from registry
+               $actionInstance = Registry::getRegistry()->getInstance('action');
+
+               // Do we have an action here?
+               if ($actionInstance instanceof PerformableAction) {
+                       // Execute the action (shall not output anything, see below why)
+                       $actionInstance->execute($requestInstance, $responseInstance);
+               } // END - if
+
+               // Get the application instance
+               $appInstance = $this->getResolverInstance()->getApplicationInstance();
+
+               // Prepare a template instance
+               $templateInstance = $this->prepareTemplateInstance($appInstance);
+
+               // Assign base URL
+               $templateInstance->assignConfigVariable('base_url');
+
+               // Assign all the application's data with template variables
+               $templateInstance->assignApplicationData($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');
+
+               // Load the matching template
+               $templateInstance->loadCodeTemplate('action_' . $this->actionName);
+
+               // Assign the template with the master template as a content ... ;)
+               $templateInstance->compileTemplate();
+               $templateInstance->assignTemplateWithVariable('action_' . $this->actionName, 'login_content');
+
+               // Load main template
+               $templateInstance->loadCodeTemplate('login_main');
+
+               // Assign the main template with the master template as a content ... ;)
+               $templateInstance->compileTemplate();
+               $templateInstance->assignTemplateWithVariable('login_main', 'content');
+
+               // Load the master template
+               $templateInstance->loadCodeTemplate($masterTemplate);
+
+               // Set title
+               $templateInstance->assignVariable('title', $this->getLanguageInstance()->getMessage($this->actionName . '_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 response class
+               $templateInstance->transferToResponse($responseInstance);
+       }
+
+       /**
+        * Adds extra filters to the given controller instance. An corresponding action class must now exist!
+        *
+        * @param       $controllerInstance             A controller instance
+        * @param       $requestInstance                An instance of a class with an Requestable interface
+        * @return      void
+        */
+       public function addExtraFilters (Controller $controllerInstance, Requestable $requestInstance) {
+               // Default is no action
+               $actionInstance = null;
+
+               // Get registry
+               $registryInstance = Registry::getRegistry();
+
+               // Get our application instance from the registry
+               $appInstance = $registryInstance->getInstance('application');
+
+               // Default action is the one from configuration
+               $this->actionName = sprintf("%s_login_%s",
+                       str_replace("-", "_", $appInstance->getAppShortName()),
+                       $this->getConfigInstance()->readConfig('login_default_action')
+               );
+
+               // Get "action" from request
+               $actReq = $requestInstance->getRequestElement('action');
+
+               // Do we have a "action" parameter set?
+               if ((is_string($actReq)) && (!empty($actReq))) {
+                       // Then use it with prefix
+                       $this->actionName = sprintf("%s_login_%s",
+                               str_replace("-", "_", $appInstance->getAppShortName()),
+                               $actReq
+                       );
+               } // END - if
+
+               // Get application instance
+               $applicationInstance = $this->getResolverInstance()->getApplicationInstance();
+
+               // Get a resolver
+               $actionResolver = WebActionResolver::createWebActionResolver($this->actionName, $applicationInstance);
+
+               // Resolve the action
+               $actionInstance = $actionResolver->resolveAction();
+
+               // Add more action-specific filters
+               $actionInstance->addExtraFilters($controllerInstance, $requestInstance);
+
+               // Remember this action in registry
+               Registry::getRegistry()->addInstance('action', $actionInstance);
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/main/commands/web/class_WebLoginCommand.php b/inc/classes/main/commands/web/class_WebLoginCommand.php
new file mode 100644 (file)
index 0000000..9726e84
--- /dev/null
@@ -0,0 +1,123 @@
+<?php
+/**
+ * A command for the login form
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class WebLoginCommand extends BaseCommand implements Commandable {
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+       }
+
+       /**
+        * 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 createWebLoginCommand (CommandResolver $resolverInstance) {
+               // Get new instance
+               $commandInstance = new WebLoginCommand();
+
+               // 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) {
+               // Get the application instance
+               $appInstance = $this->getResolverInstance()->getApplicationInstance();
+
+               // Prepare a template instance
+               $templateInstance = $this->prepareTemplateInstance($appInstance);
+
+               // Assign application data with template engine
+               $templateInstance->assignApplicationData($appInstance);
+
+               // Assign base URL
+               $templateInstance->assignConfigVariable('base_url');
+
+               // 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');
+
+               // Load the home template
+               $templateInstance->loadCodeTemplate('login_form');
+
+               // Assign the home template with the master template as a content ... ;)
+               $templateInstance->assignTemplateWithVariable('login_form', 'content');
+
+               // Load the master template
+               $templateInstance->loadCodeTemplate($masterTemplate);
+
+               // Set title
+               $templateInstance->assignVariable('title', $this->getLanguageInstance()->getMessage('page_login_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 response class
+               $templateInstance->transferToResponse($responseInstance);
+       }
+
+       /**
+        * Adds extra filters to the given controller instance
+        *
+        * @param       $controllerInstance             A controller instance
+        * @param       $requestInstance                An instance of a class with an Requestable interface
+        * @return      void
+        */
+       public function addExtraFilters (Controller $controllerInstance, Requestable $requestInstance) {
+               // Empty for now
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/main/commands/web/class_WebLoginFailedCommand.php b/inc/classes/main/commands/web/class_WebLoginFailedCommand.php
new file mode 100644 (file)
index 0000000..f2b6b81
--- /dev/null
@@ -0,0 +1,123 @@
+<?php
+/**
+ * A command for the login failed page
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class WebLoginFailedCommand extends BaseCommand implements Commandable {
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+       }
+
+       /**
+        * 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 createWebLoginFailedCommand (CommandResolver $resolverInstance) {
+               // Get new instance
+               $commandInstance = new WebLoginFailedCommand();
+
+               // 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) {
+               // Get the application instance
+               $appInstance = $this->getResolverInstance()->getApplicationInstance();
+
+               // Prepare a template instance
+               $templateInstance = $this->prepareTemplateInstance($appInstance);
+
+               // Assign application data with template engine
+               $templateInstance->assignApplicationData($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');
+
+               // Load the login_failed template
+               $templateInstance->loadCodeTemplate('login_failed');
+
+               // Assign the login_failed template with the master template as a content ... ;)
+               $templateInstance->assignTemplateWithVariable('login_failed', 'content');
+
+               // Load the master template
+               $templateInstance->loadCodeTemplate($masterTemplate);
+
+               // Set title
+               $templateInstance->assignVariable('title', $this->getLanguageInstance()->getMessage('login_failed_title'));
+
+               // Assign base URL
+               $templateInstance->assignConfigVariable('base_url');
+
+               // ... 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 response class
+               $templateInstance->transferToResponse($responseInstance);
+       }
+
+       /**
+        * Adds extra filters to the given controller instance
+        *
+        * @param       $controllerInstance             A controller instance
+        * @param       $requestInstance                An instance of a class with an Requestable interface
+        * @return      void
+        */
+       public function addExtraFilters (Controller $controllerInstance, Requestable $requestInstance) {
+               // Empty for now
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/main/commands/web/class_WebLogoutCommand.php b/inc/classes/main/commands/web/class_WebLogoutCommand.php
new file mode 100644 (file)
index 0000000..91a9d51
--- /dev/null
@@ -0,0 +1,89 @@
+<?php
+/**
+ * A command for logout
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class WebLogoutCommand extends BaseCommand implements Commandable {
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+       }
+
+       /**
+        * 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 createWebLogoutCommand (CommandResolver $resolverInstance) {
+               // Get new instance
+               $commandInstance = new WebLogoutCommand();
+
+               // 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) {
+               // Get an auth instance for checking and updating the auth cookies
+               $authInstance = ObjectFactory::createObjectByConfiguredName('auth_method_class', array($responseInstance));
+
+               // Set request instance
+               $authInstance->setRequestInstance($requestInstance);
+
+               // Destroy the auth data
+               $authInstance->destroyAuthData();
+
+               // Redirect to "logout done" page
+               $responseInstance->redirectToConfiguredUrl('logout_done_url');
+
+               // Exit here
+               exit();
+       }
+
+       /**
+        * Adds extra filters to the given controller instance
+        *
+        * @param       $controllerInstance             A controller instance
+        * @param       $requestInstance                An instance of a class with an Requestable interface
+        * @return      void
+        */
+       public function addExtraFilters (Controller $controllerInstance, Requestable $requestInstance) {
+               // Empty for now
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/main/commands/web/class_WebLogoutDoneCommand.php b/inc/classes/main/commands/web/class_WebLogoutDoneCommand.php
new file mode 100644 (file)
index 0000000..8dfdee3
--- /dev/null
@@ -0,0 +1,123 @@
+<?php
+/**
+ * A command for the login failed page
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class WebLogoutDoneCommand extends BaseCommand implements Commandable {
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+       }
+
+       /**
+        * 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 createWebLogoutDoneCommand (CommandResolver $resolverInstance) {
+               // Get new instance
+               $commandInstance = new WebLogoutDoneCommand();
+
+               // 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) {
+               // Get the application instance
+               $appInstance = $this->getResolverInstance()->getApplicationInstance();
+
+               // Prepare a template instance
+               $templateInstance = $this->prepareTemplateInstance($appInstance);
+
+               // Assign application data
+               $templateInstance->assignApplicationData($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');
+
+               // Load the logout_done template
+               $templateInstance->loadCodeTemplate('logout_done');
+
+               // Assign the logout_done template with the master template as a content ... ;)
+               $templateInstance->assignTemplateWithVariable('logout_done', 'content');
+
+               // Load the master template
+               $templateInstance->loadCodeTemplate($masterTemplate);
+
+               // Set title
+               $templateInstance->assignVariable('title', $this->getLanguageInstance()->getMessage('logout_done_title'));
+
+               // Assign base URL
+               $templateInstance->assignConfigVariable('base_url');
+
+               // ... 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 response class
+               $templateInstance->transferToResponse($responseInstance);
+       }
+
+       /**
+        * Adds extra filters to the given controller instance
+        *
+        * @param       $controllerInstance             A controller instance
+        * @param       $requestInstance                An instance of a class with an Requestable interface
+        * @return      void
+        */
+       public function addExtraFilters (Controller $controllerInstance, Requestable $requestInstance) {
+               // Empty for now
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/main/commands/web/class_WebRegisterCommand.php b/inc/classes/main/commands/web/class_WebRegisterCommand.php
new file mode 100644 (file)
index 0000000..c23b647
--- /dev/null
@@ -0,0 +1,127 @@
+<?php
+/**
+ * A command class for the registration form
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class WebRegisterCommand extends BaseCommand implements Commandable, Registerable {
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+       }
+
+       /**
+        * 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 createWebRegisterCommand (CommandResolver $resolverInstance) {
+               // Get new instance
+               $commandInstance = new WebRegisterCommand();
+
+               // 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) {
+               // Set request instance as extra instance
+               Registry::getRegistry()->addInstance('extra', $this);
+
+               // Get the application instance
+               $appInstance = $this->getResolverInstance()->getApplicationInstance();
+
+               // Prepare a template instance
+               $templateInstance = $this->prepareTemplateInstance($appInstance);
+
+               // Assign all the application's data with template variables
+               $templateInstance->assignApplicationData($appInstance);
+
+               // Assign base URL
+               $templateInstance->assignConfigVariable('base_url');
+
+               // 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');
+
+               // Load the register template
+               $templateInstance->loadCodeTemplate('register_form');
+
+               // Assign the register template with the master template as a content ... ;)
+               $templateInstance->compileTemplate();
+               $templateInstance->assignTemplateWithVariable('register_form', 'content');
+
+               // Load the master template
+               $templateInstance->loadCodeTemplate($masterTemplate);
+
+               // Set title
+               $templateInstance->assignVariable('title', $this->getLanguageInstance()->getMessage('page_register_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 response class
+               $templateInstance->transferToResponse($responseInstance);
+       }
+
+       /**
+        * Adds extra filters to the given controller instance
+        *
+        * @param       $controllerInstance             A controller instance
+        * @param       $requestInstance                An instance of a class with an Requestable interface
+        * @return      void
+        */
+       public function addExtraFilters (Controller $controllerInstance, Requestable $requestInstance) {
+               // Empty class
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/main/commands/web/class_WebResendLinkCommand.php b/inc/classes/main/commands/web/class_WebResendLinkCommand.php
new file mode 100644 (file)
index 0000000..c66a39b
--- /dev/null
@@ -0,0 +1,142 @@
+<?php
+/**
+ * A command class for resending the confirmation link
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class WebResendLinkCommand extends BaseCommand implements Commandable {
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+       }
+
+       /**
+        * 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 createWebResendLinkCommand (CommandResolver $resolverInstance) {
+               // Get new instance
+               $commandInstance = new WebResendLinkCommand();
+
+               // 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
+        * @throws      InvalidInterfaceException       If the user class does not implement ManageableMember
+        */
+       public function execute (Requestable $requestInstance, Responseable $responseInstance) {
+               // Get user instance from registry
+               $userInstance = Registry::getRegistry()->getInstance('user');
+
+               // Does the user instance implement ManageableMember?
+               if (!$userInstance instanceof ManageableMember) {
+                       // Throw exception here
+                       throw new InvalidInterfaceException(array($userInstance, 'ManageableMember'), self::EXCEPTION_REQUIRED_INTERFACE_MISSING);
+               } // END - if
+
+               // Get an application instance
+               $appInstance = $this->getResolverInstance()->getApplicationInstance();
+
+               // Get a RNG instance (Random Number Generator)
+               $rngInstance = ObjectFactory::createObjectByConfiguredName('rng_class');
+
+               // Generate a pseudo-random string
+               $randomString = $rngInstance->randomString(255);
+
+               // Get a crypto instance
+               $cryptoInstance = ObjectFactory::createObjectByConfiguredName('crypto_class');
+
+               // Hash and encrypt the string
+               $hashedString = $cryptoInstance->hashString($cryptoInstance->encryptString($randomString));
+
+               // Update the user class
+               $userInstance->updateDatabaseField(UserDatabaseWrapper::DB_COLUMN_CONFIRM_HASH, $hashedString);
+
+               // Re-set config entry to mailer engine
+               $this->getConfigInstance()->setConfigEntry('template_class', $this->getConfigInstance()->readConfig('mail_template_class'));
+
+               // Prepare the template engine
+               $templateInstance = $this->prepareTemplateInstance($appInstance);
+
+               // Assign the application data with the template engine
+               $templateInstance->assignApplicationData($appInstance);
+
+               // Get a mailer class
+               $mailerInstance = ObjectFactory::createObjectByConfiguredName('mailer_class', array($templateInstance, $appInstance, 'resend_link'));
+
+               // Set this mailer in our template engine
+               $templateInstance->setMailerInstance($mailerInstance);
+
+               // Add template variables we shall get
+               $mailerInstance->addConfigTemplateVariable('base_url');
+               $mailerInstance->addConfigTemplateVariable('admin_email');
+               $mailerInstance->addValueTemplateVariable('confirm_hash');
+               $mailerInstance->addValueTemplateVariable('username');
+               $mailerInstance->addValueTemplateVariable('email');
+
+               // Add the value instance for the confirmation hash
+               $mailerInstance->addValueInstance('confirm_hash', $userInstance);
+               $mailerInstance->addValueInstance('username', $userInstance);
+               $mailerInstance->addValueInstance('email', $userInstance);
+
+               // Add the recipient
+               $mailerInstance->addRecipientByUserInstance($userInstance);
+
+               // Use subject line from template
+               $mailerInstance->useSubjectFromTemplate();
+
+               // Send the email out
+               $mailerInstance->deliverEmail($responseInstance);
+
+               // Send out notification to admin (depends on settings)
+               $mailerInstance->sendAdminNotification($responseInstance);
+       }
+
+       /**
+        * Adds extra filters to the given controller instance
+        *
+        * @param       $controllerInstance             A controller instance
+        * @param       $requestInstance                An instance of a class with an Requestable interface
+        * @return      void
+        */
+       public function addExtraFilters (Controller $controllerInstance, Requestable $requestInstance) {
+               // Filter for checking if account is unconfirmed
+               $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_unconfirmed_filter', array($controllerInstance)));
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/main/compressor/.htaccess b/inc/classes/main/compressor/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/inc/classes/main/compressor/class_Bzip2Compressor.php b/inc/classes/main/compressor/class_Bzip2Compressor.php
new file mode 100644 (file)
index 0000000..50a4bad
--- /dev/null
@@ -0,0 +1,99 @@
+<?php
+/**
+ * BZIP2 compression and decompression class
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class Bzip2Compressor extends BaseFrameworkSystem implements Compressor {
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor!
+               parent::__construct(__CLASS__);
+       }
+
+       /**
+        * Create a new compressor channel based a given compression handler
+        *
+        * @return      $cInstance      An instance of this class
+        */
+       public final static function createBzip2Compressor () {
+               // Get new instance
+               if ((function_exists('bzcompress')) && (function_exists('bzdecompress'))) {
+                       // Compressor can maybe be used
+                       $cInstance = new Bzip2Compressor();
+               } else {
+                       // Routines not found!
+                       $cInstance = null;
+               }
+
+               // Return the compressor instance
+               return $cInstance;
+       }
+
+       /**
+        * BZIP2 compression stream
+        *
+        * @param               $streamData                     Mixed non-object stream data
+        * @return      $streamData                     The compressed stream data      
+        * @throws      InvalidObjectException  If the stream is an object
+        */
+       public function compressStream ($streamData) {
+               if (is_object($streamData)) {
+                       // Throw an exception
+                       throw new InvalidObjectException($streamData, self::EXCEPTION_UNEXPECTED_OBJECT);
+               }
+
+               // Return the compressed stream
+               return bzcompress($streamData, 1);
+       }
+
+       /**
+        * BZIP2 decompression stream
+        *
+        * @param               $streamData                     Mixed non-object stream data
+        * @return      $streamData                     The decompressed stream data    
+        * @throws      InvalidObjectException  If the stream is an object
+        */
+       public function decompressStream ($streamData) {
+               if (is_object($streamData)) {
+                       // Throw an exception
+                       throw new InvalidObjectException($streamData, self::EXCEPTION_UNEXPECTED_OBJECT);
+               }
+
+               // Return the decompressed stream
+               return bzdecompress($streamData);
+       }
+
+       /**
+        * Getter for the file extension of this compressor
+        *
+        * @return      $string Returns always "bz2"
+        */
+       public final function getCompressorExtension () {
+               return "bz2";
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/main/compressor/class_GzipCompressor.php b/inc/classes/main/compressor/class_GzipCompressor.php
new file mode 100644 (file)
index 0000000..b4a3025
--- /dev/null
@@ -0,0 +1,99 @@
+<?php
+/**
+ * GZIP compression and decompression class
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class GzipCompressor extends BaseFrameworkSystem implements Compressor {
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor!
+               parent::__construct(__CLASS__);
+       }
+
+       /**
+        * Create a new compressor channel based a given compression handler
+        *
+        * @return      $cInstance      An instance of this class
+        */
+       public final static function createGzipCompressor () {
+               // Get new instance
+               if ((function_exists('gzcompress')) && (function_exists('gzuncompress'))) {
+                       // Compressor can maybe be used
+                       $cInstance = new GzipCompressor();
+               } else {
+                       // Routines not found!
+                       $cInstance = null;
+               }
+
+               // Return the compressor instance
+               return $cInstance;
+       }
+
+       /**
+        * GZIP compression stream
+        *
+        * @param       $streamData             Mixed non-object stream data
+        * @return      $streamData             The compressed stream data      
+        * @throws      InvalidObjectException  If the stream is an object
+        */
+       public function compressStream ($streamData) {
+               if (is_object($streamData)) {
+                       // Throw an exception
+                       throw new InvalidObjectException($streamData, self::EXCEPTION_UNEXPECTED_OBJECT);
+               }
+
+               // Return the compressed stream
+               return gzcompress($streamData, 1);
+       }
+
+       /**
+        * GZIP decompression stream
+        *
+        * @param       $streamData             Mixed non-object stream data
+        * @return      $streamData             The decompressed stream data    
+        * @throws      InvalidObjectException  If the stream is an object
+        */
+       public function decompressStream ($streamData) {
+               if (is_object($streamData)) {
+                       // Throw an exception
+                       throw new InvalidObjectException($streamData, self::EXCEPTION_UNEXPECTED_OBJECT);
+               }
+
+               // Return the decompressed stream
+               return gzuncompress($streamData);
+       }
+
+       /**
+        * Getter for the file extension of this compressor
+        *
+        * @return      $string Returns always "gz"
+        */
+       public final function getCompressorExtension () {
+               return "gz";
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/main/compressor/class_NullCompressor.php b/inc/classes/main/compressor/class_NullCompressor.php
new file mode 100644 (file)
index 0000000..24128bc
--- /dev/null
@@ -0,0 +1,93 @@
+<?php
+/**
+ * Null compression and decompression class
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class NullCompressor extends BaseFrameworkSystem implements Compressor {
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor!
+               parent::__construct(__CLASS__);
+       }
+
+       /**
+        * Create a new compressor channel based a given compression handler
+        *
+        * @return      $cInstance      An instance of this class
+        */
+       public final static function createNullCompressor () {
+               // Get new instance
+               $cInstance = new NullCompressor();
+
+               // Return the compressor instance
+               return $cInstance;
+       }
+
+       /**
+        * Null compression stream
+        *
+        * @param       $streamData             Mixed non-object stream data
+        * @return      $streamData             The compressed stream data      
+        * @throws      InvalidObjectException  If the stream is an object
+        */
+       public function compressStream ($streamData) {
+               if (is_object($streamData)) {
+                       // Throw an exception
+                       throw new InvalidObjectException($streamData, self::EXCEPTION_UNEXPECTED_OBJECT);
+               }
+
+               // Return the compressed stream
+               return $streamData;
+       }
+
+       /**
+        * Null decompression stream
+        *
+        * @param       $streamData             Mixed non-object stream data
+        * @return      $streamData             The decompressed stream data    
+        * @throws      InvalidObjectException  If the stream is an object
+        */
+       public function decompressStream ($streamData) {
+               if (is_object($streamData)) {
+                       // Throw an exception
+                       throw new InvalidObjectException($streamData, self::EXCEPTION_UNEXPECTED_OBJECT);
+               }
+
+               // Return the decompressed stream
+               return $streamData;
+       }
+
+       /**
+        * Getter for the file extension of this compressor
+        *
+        * @return      $string         Returns always "null"
+        */
+       public final function getCompressorExtension () {
+               return "null";
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/main/console/.htaccess b/inc/classes/main/console/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/inc/classes/main/console/class_ConsoleTools.php b/inc/classes/main/console/class_ConsoleTools.php
new file mode 100644 (file)
index 0000000..d037d40
--- /dev/null
@@ -0,0 +1,83 @@
+<?php
+/**
+ * This class contains static helper functions for console applications
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class ConsoleTools extends BaseFrameworkSystem {
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+       }
+
+       /**
+        * Aquires the IP address of this host by reading the /etc/hostname file and solving it
+        *
+        * @return      $ip             The resolved IP address
+        */
+       public static function aquireSelfIPAddress () {
+               // Local IP by default
+               $ip = "127.0.0.1";
+
+               // Get a new instance
+               $helper = new ConsoleTools();
+
+               try {
+                       // Get a file pointer
+                       $io = FrameworkFileInputPointer::createFrameworkFileInputPointer("/etc/hostname");
+
+                       // Read the file
+                       $hostname = trim($io->readFromFile());
+                       $helper->debugOutput(sprintf("[%s:] Our host name is: <span class=\"data\">%s</span>",
+                               $helper->__toString(),
+                               $hostname
+                       ));
+
+                       // Close the file
+                       $io->closeFile();
+
+                       // Resolve it
+                       $ipResolved = gethostbyname($hostname);
+                       if (($ipResolved !== false) && ($ipResolved != $hostname)) {
+                               // Okay, this works!
+                               $ip = $ipResolved;
+
+                               // Debug message
+                               $helper->debugOutput(sprintf("[%s:] Resolved IP address is: <span class=\"data\">%s</span>\n",
+                                       $helper->__toString(),
+                                       $ip
+                               ));
+                       }
+               } catch (FrameworkException $e) {
+                       // Do nothing here
+               }
+
+               // Return the IP address
+               return $ip;
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/main/controller/.htaccess b/inc/classes/main/controller/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/inc/classes/main/controller/captcha/.htaccess b/inc/classes/main/controller/captcha/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/inc/classes/main/controller/captcha/class_ImageCodeCaptchaController.php b/inc/classes/main/controller/captcha/class_ImageCodeCaptchaController.php
new file mode 100644 (file)
index 0000000..64e1a1a
--- /dev/null
@@ -0,0 +1,84 @@
+<?php
+/**
+ * A controller for a code-based CAPTCHA where the user has to repeat a shown code
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class ImageCodeCaptchaController extends BaseController implements Controller {
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+       }
+
+       /**
+        * 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 createImageCodeCaptchaController (CommandResolver $resolverInstance) {
+               // Create the instance
+               $controllerInstance = new ImageCodeCaptchaController();
+
+               // Set the command resolver
+               $controllerInstance->setResolverInstance($resolverInstance);
+
+               // Add filter for checking the "encrypt" string
+               $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('captcha_encrypt_validator_filter', array($controllerInstance)));
+
+               // 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) {
+               // Execute pre filters
+               $this->executePreFilters($requestInstance, $responseInstance);
+
+               // Get the command instance
+               $commandInstance = $this->getResolverInstance()->resolveCommandByRequest($requestInstance);
+
+               // This request was valid! :-D
+               $requestInstance->requestIsValid();
+
+               // Execute the command
+               $commandInstance->execute($requestInstance, $responseInstance);
+
+               // Execute post filters
+               $this->executePostFilters($requestInstance, $responseInstance);
+
+               // Flush the response out
+               $responseInstance->flushBuffer();
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/main/controller/class_ b/inc/classes/main/controller/class_
new file mode 100644 (file)
index 0000000..a6cea16
--- /dev/null
@@ -0,0 +1,75 @@
+<?php
+/**
+ * 
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class ???Controller extends BaseController implements Controller {
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+       }
+
+       /**
+        * 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 create???Controller (CommandResolver $resolverInstance) {
+               // Create the instance
+               $controllerInstance = new ???Controller();
+
+               // Set the command resolver
+               $controllerInstance->setResolverInstance($resolverInstance);
+
+               // 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) {
+               // Get the command instance
+               $commandInstance = $this->getResolverInstance()->resolveCommandByRequest($requestInstance);
+
+               // This request was valid! :-D
+               $requestInstance->requestIsValid();
+
+               // Execute the command
+               $commandInstance->execute($requestInstance, $responseInstance);
+
+               // Flush the response out
+               $responseInstance->flushBuffer();
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/main/controller/class_BaseController.php b/inc/classes/main/controller/class_BaseController.php
new file mode 100644 (file)
index 0000000..69fa4d1
--- /dev/null
@@ -0,0 +1,112 @@
+<?php
+/**
+ * A generic controller class. You should extend this base class if you want to
+ * write your own controller. You get the advantage that you can use the pre and
+ * post filters.
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class BaseController extends BaseFrameworkSystem implements Registerable {
+       /**
+        * Generic filter chains
+        */
+       private $filterChains = array();
+
+       /**
+        * Protected constructor
+        *
+        * @param       $className      Name of the class
+        * @return      void
+        */
+       protected function __construct ($className) {
+               // Call parent constructor
+               parent::__construct($className);
+
+               // Clean up a little
+               $this->removeNumberFormaters();
+               $this->removeSystemArray();
+
+               // Initialize both filter chains
+               $this->initFilterChain('pre');
+               $this->initFilterChain('post');
+
+               // Add this controller to the registry
+               Registry::getRegistry()->addInstance('controller', $this);
+       }
+
+       /**
+        * Private method to initialize a given filter chain
+        *
+        * @param       $filterChain    Name of the filter chain
+        * @return      void
+        */
+       private function initFilterChain ($filterChain) {
+               $this->filterChains[$filterChain] = ObjectFactory::createObjectByConfiguredName('filter_chain_class');
+       }
+
+       /**
+        * Adds a filter to the pre filter chain
+        *
+        * @param       $filterInstance         An instance of a filter
+        * @return      void
+        */
+       public function addPreFilter (Filterable $filterInstance) {
+               // Add the pre filter
+               $this->filterChains['pre']->addFilter($filterInstance);
+       }
+
+       /**
+        * Adds a filter to the post filter chain
+        *
+        * @param       $filterInstance         An instance of a filter
+        * @return      void
+        */
+       public function addPostFilter (Filterable $filterInstance) {
+               // Add the post filter
+               $this->filterChains['post']->addFilter($filterInstance);
+       }
+
+       /**
+        * Executes all pre filters
+        *
+        * @param       $requestInstance        An instance of a request class
+        * @param       $responseInstance       An instance of a response class
+        * @return      void
+        */
+       protected function executePreFilters (Requestable $requestInstance, Responseable $responseInstance) {
+               // Execute all pre filters
+               $this->filterChains['pre']->processFilters($requestInstance, $responseInstance);
+       }
+
+       /**
+        * Executes all post filters
+        *
+        * @param       $requestInstance        An instance of a request class
+        * @param       $responseInstance       An instance of a response class
+        * @return      void
+        */
+       protected function executePostFilters (Requestable $requestInstance, Responseable $responseInstance) {
+               // Execute all post filters
+               $this->filterChains['post']->processFilters($requestInstance, $responseInstance);
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/main/controller/form/.htaccess b/inc/classes/main/controller/form/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/inc/classes/main/controller/form/class_WebDoFormController.php b/inc/classes/main/controller/form/class_WebDoFormController.php
new file mode 100644 (file)
index 0000000..8691c3d
--- /dev/null
@@ -0,0 +1,100 @@
+<?php
+/**
+ * A controller for handling sent forms
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class WebDoFormController extends BaseController implements Controller {
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+       }
+
+       /**
+        * Creates an instance of this class
+        *
+        * @param       $resolverInstance               An instance of a resolver class
+        * @return      $controllerInstance             A prepared instance of this class
+        */
+       public final static function createWebDoFormController (CommandResolver $resolverInstance) {
+               // Create the instance
+               $controllerInstance = new WebDoFormController();
+
+               // Set resolver instance
+               $controllerInstance->setResolverInstance($resolverInstance);
+
+               // We need the controller instance in resolver class so set it here
+               $resolverInstance->setControllerInstance($controllerInstance);
+
+               // 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) {
+               // Get the "form action"
+               $formAction = $requestInstance->getRequestElement('form');
+
+               // Get command instance from resolver
+               $commandInstance = $this->getResolverInstance()->resolveCommand($formAction);
+
+               // Add more filters by the command
+               $commandInstance->addExtraFilters($this, $requestInstance);
+
+               // Try to run the pre filters, if auth exceptions come through redirect here
+               try {
+                       // Run the pre filters
+                       $this->executePreFilters($requestInstance, $responseInstance);
+               } catch (UserAuthorizationException $e) {
+                       // Redirect to main page
+                       $responseInstance->redirectToConfiguredUrl('login_failed_url');
+
+                       // Exit here
+                       exit();
+               }
+
+               // Is the request still valid? Post filters shall only be executed of
+               // the request is valid
+               if ($requestInstance->isRequestValid()) {
+                       // Execute the command
+                       $commandInstance->execute($requestInstance, $responseInstance);
+
+                       // Execute *very* generic ppost filters
+                       $this->executePostFilters($requestInstance, $responseInstance);
+               }
+
+               // Flush the buffer out
+               $responseInstance->flushBuffer();
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/main/controller/image/.htaccess b/inc/classes/main/controller/image/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/inc/classes/main/controller/image/class_ImageDefaultController.php b/inc/classes/main/controller/image/class_ImageDefaultController.php
new file mode 100644 (file)
index 0000000..689cee4
--- /dev/null
@@ -0,0 +1,75 @@
+<?php
+/**
+ * A default controller for images
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class ImageDefaultController extends BaseController implements Controller {
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+       }
+
+       /**
+        * 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 createImageDefaultController (CommandResolver $resolverInstance) {
+               // Create the instance
+               $controllerInstance = new ImageDefaultController();
+
+               // Set the command resolver
+               $controllerInstance->setResolverInstance($resolverInstance);
+
+               // 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) {
+               // Get the command instance
+               $commandInstance = $this->getResolverInstance()->resolveCommandByRequest($requestInstance);
+
+               // This request was valid! :-D
+               $requestInstance->requestIsValid();
+
+               // Execute the command
+               $commandInstance->execute($requestInstance, $responseInstance);
+
+               // Flush the response out
+               $responseInstance->flushBuffer();
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/main/controller/login/.htaccess b/inc/classes/main/controller/login/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/inc/classes/main/controller/login/class_WebLoginAreaController.php b/inc/classes/main/controller/login/class_WebLoginAreaController.php
new file mode 100644 (file)
index 0000000..0ad97f0
--- /dev/null
@@ -0,0 +1,106 @@
+<?php
+/**
+ * Controller for login area with news
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class WebLoginAreaController extends BaseController implements Controller {
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+       }
+
+       /**
+        * Creates an instance of this class
+        *
+        * @param       $resolverInstance               An instance of a command resolver class
+        * @return      $controllerInstance             A prepared instance of this class
+        * @todo        Add some morer filters to this controller
+        */
+       public final static function createWebLoginAreaController (CommandResolver $resolverInstance) {
+               // Create the instance
+               $controllerInstance = new WebLoginAreaController();
+
+               // Set the command resolver
+               $controllerInstance->setResolverInstance($resolverInstance);
+
+               // User auth filter
+               $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_auth_filter', array($controllerInstance)));
+
+               // User update filter
+               $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_update_filter', array($controllerInstance)));
+
+               // News fetcher filter
+               $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('news_download_filter', array($controllerInstance)));
+
+               // News proccess/display-preparation
+               $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('news_process_filter', array($controllerInstance)));
+
+               // 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) {
+               // Get the command instance from the resolver by sending a request instance to the resolver
+               $commandInstance = $this->getResolverInstance()->resolveCommandByRequest($requestInstance);
+
+               // Add more filters by the command
+               $commandInstance->addExtraFilters($this, $requestInstance);
+
+               // Try to run the pre filters, if auth exceptions come through redirect here
+               try {
+                       // Run the pre filters
+                       $this->executePreFilters($requestInstance, $responseInstance);
+               } catch (UserAuthorizationException $e) {
+                       // Redirect to main page
+                       $responseInstance->redirectToConfiguredUrl('login_failed_url');
+
+                       // Exit here
+                       exit();
+               }
+
+               // 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/controller/web/.htaccess b/inc/classes/main/controller/web/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/inc/classes/main/controller/web/class_ b/inc/classes/main/controller/web/class_
new file mode 100644 (file)
index 0000000..4e5bdee
--- /dev/null
@@ -0,0 +1,85 @@
+<?php
+/**
+ * Controller for 
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class Web???Controller extends BaseController implements Controller {
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+       }
+
+       /**
+        * Creates an instance of this class
+        *
+        * @param       $resolverInstance               An instance of a command resolver class
+        * @return      $controllerInstance             A prepared instance of this class
+        * @todo        Add some filters to this controller
+        */
+       public final static function createWeb???Controller (CommandResolver $resolverInstance) {
+               // Create the instance
+               $controllerInstance = new Web???Controller();
+
+               // Set the command resolver
+               $controllerInstance->setResolverInstance($resolverInstance);
+
+               // Add filters
+               //$controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_status_confirmed_filter'));
+
+               // 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) {
+               // Get the command instance from the resolver by sending a request instance to the resolver
+               $commandInstance = $this->getResolverInstance()->resolveCommandByRequest($requestInstance);
+
+               // Run the pre filters
+               $this->executePreFilters($requestInstance, $responseInstance);
+
+               // 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/controller/web/class_WebConfirmController.php b/inc/classes/main/controller/web/class_WebConfirmController.php
new file mode 100644 (file)
index 0000000..ebdd150
--- /dev/null
@@ -0,0 +1,88 @@
+<?php
+/**
+ * Controller for confirmation link
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class WebConfirmController extends BaseController implements Controller {
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+       }
+
+       /**
+        * Creates an instance of this class
+        *
+        * @param       $resolverInstance               An instance of a command resolver class
+        * @return      $controllerInstance             A prepared instance of this class
+        * @todo        Add some filters to this controller
+        */
+       public final static function createWebConfirmController (CommandResolver $resolverInstance) {
+               // Create the instance
+               $controllerInstance = new WebConfirmController();
+
+               // Set the command resolver
+               $controllerInstance->setResolverInstance($resolverInstance);
+
+               // Add filters for handling confirmation code and username
+               $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('username_verifier_filter', array($controllerInstance)));
+               $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_unconfirmed_filter', array($controllerInstance)));
+               $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('confirm_code_verifier_filter', array($controllerInstance)));
+               $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_status_confirmed_filter', array($controllerInstance)));
+
+               // Return the prepared instance
+               return $controllerInstance;
+       }
+
+       /**
+        * 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) {
+               // Get the command instance from the resolver by sending a request instance to the resolver
+               $commandInstance = $this->getResolverInstance()->resolveCommandByRequest($requestInstance);
+
+               // Run the pre filters
+               $this->executePreFilters($requestInstance, $responseInstance);
+
+               // 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/controller/web/class_WebDefaultController.php b/inc/classes/main/controller/web/class_WebDefaultController.php
new file mode 100644 (file)
index 0000000..37cf3d9
--- /dev/null
@@ -0,0 +1,76 @@
+<?php
+/**
+ * The default controller for all other web requests
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ * @todo               This controller shall still provide some headlines for sidebars
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class WebDefaultController extends BaseController implements Controller {
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+       }
+
+       /**
+        * 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 createWebDefaultController (CommandResolver $resolverInstance) {
+               // Create the instance
+               $controllerInstance = new WebDefaultController();
+
+               // Set the command resolver
+               $controllerInstance->setResolverInstance($resolverInstance);
+
+               // 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) {
+               // Get the command instance
+               $commandInstance = $this->getResolverInstance()->resolveCommandByRequest($requestInstance);
+
+               // This request was valid! :-D
+               $requestInstance->requestIsValid();
+
+               // Execute the command
+               $commandInstance->execute($requestInstance, $responseInstance);
+
+               // Flush the response out
+               $responseInstance->flushBuffer();
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/main/controller/web/class_WebDefaultNewsController.php b/inc/classes/main/controller/web/class_WebDefaultNewsController.php
new file mode 100644 (file)
index 0000000..8d7255d
--- /dev/null
@@ -0,0 +1,88 @@
+<?php
+/**
+ * The default controller with news for e.g. home or news page
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class WebDefaultNewsController extends BaseController implements Controller {
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+       }
+
+       /**
+        * 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 createWebDefaultNewsController (CommandResolver $resolverInstance) {
+               // Create the instance
+               $controllerInstance = new WebDefaultNewsController();
+
+               // Set the command resolver
+               $controllerInstance->setResolverInstance($resolverInstance);
+
+               // Add news filters to this controller
+               $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('news_download_filter', array($controllerInstance)));
+               $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('news_process_filter', array($controllerInstance)));
+
+               // 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) {
+               // Get the command instance from the resolver by sending a request instance to the resolver
+               $commandInstance = $this->getResolverInstance()->resolveCommandByRequest($requestInstance);
+
+               // Add more filters by the command
+               $commandInstance->addExtraFilters($this, $requestInstance);
+
+               // Run the pre filters
+               $this->executePreFilters($requestInstance, $responseInstance);
+
+               // 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/controller/web/class_WebLoginController.php b/inc/classes/main/controller/web/class_WebLoginController.php
new file mode 100644 (file)
index 0000000..f4ce053
--- /dev/null
@@ -0,0 +1,86 @@
+<?php
+/**
+ * Controller for login form with password reminder and maybe enabled
+ * "guest-login" button
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class WebLoginController extends BaseController implements Controller {
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+       }
+
+       /**
+        * Creates an instance of this class
+        *
+        * @param       $resolverInstance               An instance of a command resolver class
+        * @return      $controllerInstance             A prepared instance of this class
+        * @todo        Add some filters to this controller
+        */
+       public final static function createWebLoginController (CommandResolver $resolverInstance) {
+               // Create the instance
+               $controllerInstance = new WebLoginController();
+
+               // Set the command resolver
+               $controllerInstance->setResolverInstance($resolverInstance);
+
+               // 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) {
+               // Get the command instance from the resolver by sending a request instance to the resolver
+               $commandInstance = $this->getResolverInstance()->resolveCommandByRequest($requestInstance);
+
+               // Add more filters by the command
+               $commandInstance->addExtraFilters($this, $requestInstance);
+
+               // Run the pre filters
+               $this->executePreFilters($requestInstance, $responseInstance);
+
+               // 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/controller/web/class_WebLoginFailedController.php b/inc/classes/main/controller/web/class_WebLoginFailedController.php
new file mode 100644 (file)
index 0000000..5b39ab0
--- /dev/null
@@ -0,0 +1,75 @@
+<?php
+/**
+ * A controller for login failed page
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class WebLoginFailedController extends BaseController implements Controller {
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+       }
+
+       /**
+        * 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 createWebLoginFailedController (CommandResolver $resolverInstance) {
+               // Create the instance
+               $controllerInstance = new WebLoginFailedController();
+
+               // Set the command resolver
+               $controllerInstance->setResolverInstance($resolverInstance);
+
+               // 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) {
+               // Get the command instance
+               $commandInstance = $this->getResolverInstance()->resolveCommandByRequest($requestInstance);
+
+               // This request was valid! :-D
+               $requestInstance->requestIsValid();
+
+               // Execute the command
+               $commandInstance->execute($requestInstance, $responseInstance);
+
+               // Flush the response out
+               $responseInstance->flushBuffer();
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/main/controller/web/class_WebLogoutController.php b/inc/classes/main/controller/web/class_WebLogoutController.php
new file mode 100644 (file)
index 0000000..258d199
--- /dev/null
@@ -0,0 +1,82 @@
+<?php
+/**
+ * The default controller for logout page
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ * @todo               This controller shall still provide some headlines for sidebars
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class WebLogoutController extends BaseController implements Controller {
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+       }
+
+       /**
+        * 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 createWebLogoutController (CommandResolver $resolverInstance) {
+               // Create the instance
+               $controllerInstance = new WebLogoutController();
+
+               // Set the command resolver
+               $controllerInstance->setResolverInstance($resolverInstance);
+
+               // Add user auth filter (we don't need an update of the user here because it will be redirected)
+               $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_auth_filter', array($controllerInstance)));
+
+               // User status filter
+               $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_status_filter', array($controllerInstance)));
+
+               // 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) {
+               // Get the command instance
+               $commandInstance = $this->getResolverInstance()->resolveCommandByRequest($requestInstance);
+
+               // This request was valid! :-D
+               $requestInstance->requestIsValid();
+
+               // Execute the command
+               $commandInstance->execute($requestInstance, $responseInstance);
+
+               // Flush the response out
+               $responseInstance->flushBuffer();
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/main/controller/web/class_WebLogoutDoneController.php b/inc/classes/main/controller/web/class_WebLogoutDoneController.php
new file mode 100644 (file)
index 0000000..58058b1
--- /dev/null
@@ -0,0 +1,86 @@
+<?php
+/**
+ * Controller for logout done page
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class WebLogoutDoneController extends BaseController implements Controller {
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+       }
+
+       /**
+        * Creates an instance of this class
+        *
+        * @param       $resolverInstance               An instance of a command resolver class
+        * @return      $controllerInstance             A prepared instance of this class
+        * @todo        Add some filters to this controller
+        */
+       public final static function createWebLogoutDoneController (CommandResolver $resolverInstance) {
+               // Create the instance
+               $controllerInstance = new WebLogoutDoneController();
+
+               // Set the command resolver
+               $controllerInstance->setResolverInstance($resolverInstance);
+
+
+               // 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) {
+               // Get the command instance from the resolver by sending a request instance to the resolver
+               $commandInstance = $this->getResolverInstance()->resolveCommandByRequest($requestInstance);
+
+               // Add more filters by the command
+               $commandInstance->addExtraFilters($this, $requestInstance);
+
+               // Run the pre filters
+               $this->executePreFilters($requestInstance, $responseInstance);
+
+               // 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/controller/web/class_WebRegisterController.php b/inc/classes/main/controller/web/class_WebRegisterController.php
new file mode 100644 (file)
index 0000000..c848c47
--- /dev/null
@@ -0,0 +1,86 @@
+<?php
+/**
+ * Controller for register form
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class WebRegisterController extends BaseController implements Controller {
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+       }
+
+       /**
+        * Creates an instance of this class
+        *
+        * @param       $resolverInstance               An instance of a command resolver class
+        * @return      $controllerInstance             A prepared instance of this class
+        * @todo        Add some filters to this controller
+        */
+       public final static function createWebRegisterController (CommandResolver $resolverInstance) {
+               // Create the instance
+               $controllerInstance = new WebRegisterController();
+
+               // Set the command resolver
+               $controllerInstance->setResolverInstance($resolverInstance);
+
+
+               // 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) {
+               // Get the command instance from the resolver by sending a request instance to the resolver
+               $commandInstance = $this->getResolverInstance()->resolveCommandByRequest($requestInstance);
+
+               // Add more filters by the command
+               $commandInstance->addExtraFilters($this, $requestInstance);
+
+               // Run the pre filters
+               $this->executePreFilters($requestInstance, $responseInstance);
+
+               // 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/controller/web/class_WebStatusController.php b/inc/classes/main/controller/web/class_WebStatusController.php
new file mode 100644 (file)
index 0000000..843e05c
--- /dev/null
@@ -0,0 +1,76 @@
+<?php
+/**
+ * Controller for changing user status
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ * @todo               This controller shall still provide some headlines for sidebars
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class WebStatusController extends BaseController implements Controller {
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+       }
+
+       /**
+        * 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 createWebStatusController (CommandResolver $resolverInstance) {
+               // Create the instance
+               $controllerInstance = new WebStatusController();
+
+               // Set the command resolver
+               $controllerInstance->setResolverInstance($resolverInstance);
+
+               // 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) {
+               // Get the command instance
+               $commandInstance = $this->getResolverInstance()->resolveCommandByRequest($requestInstance);
+
+               // This request was valid! :-D
+               $requestInstance->requestIsValid();
+
+               // Execute the command
+               $commandInstance->execute($requestInstance, $responseInstance);
+
+               // Flush the response out
+               $responseInstance->flushBuffer();
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/main/criteria/.htaccess b/inc/classes/main/criteria/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/inc/classes/main/criteria/class_DataSetCriteria.php b/inc/classes/main/criteria/class_DataSetCriteria.php
new file mode 100644 (file)
index 0000000..34715c5
--- /dev/null
@@ -0,0 +1,187 @@
+<?php
+/**
+ * A set of data storeable in databases
+ *
+ * @see                        DatabaseFrontendInterface - An interface for database frontends (front-end to the application)
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class DataSetCriteria extends BaseFrameworkSystem implements StoreableCriteria {
+       /**
+        * Table name
+        */
+       private $tableName = "";
+
+       /**
+        * Table columns (criteria) to store
+        */
+       private $tableColumns = array();
+
+       /**
+        * Unique key
+        */
+       private $uniqueKey = "";
+
+       /**
+        * Primary key
+        */
+       private $primaryKey = "";
+
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct() {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+
+               // Clean up a little
+               $this->removeNumberFormaters();
+               $this->removeSystemArray();
+       }
+
+       /**
+        * Creates an instance of this criteria
+        *
+        * @param       $tableName                      Name of the table
+        * @return      $criteriaInstance       An instance of this criteria
+        */
+       public final static function createDataSetCriteria ($tableName) {
+               // Get a new instance
+               $criteriaInstance = new DataSetCriteria();
+
+               // Set table name
+               $criteriaInstance->setTableName($tableName);
+
+               // Return the instance
+               return $criteriaInstance;
+       }
+
+       /**
+        * Add criteria
+        *
+        * @param       $criteriaKey    Criteria key
+        * @param       $criteriaValue  Criteria value
+        * @return      void
+        */
+       public function addCriteria ($criteriaKey, $criteriaValue) {
+               $this->tableColumns[(string) $criteriaKey] = $criteriaValue;
+       }
+
+       /**
+        * Add configured criteria
+        *
+        * @param       $criteriaKey    Criteria key
+        * @param       $configEntry    Configuration entry
+        * @return      void
+        */
+       public function addConfiguredCriteria ($criteriaKey, $configEntry) {
+               // Add configuration entry as criteria
+               $value = $this->getConfigInstance()->readConfig($configEntry);
+               $this->addCriteria($criteriaKey, $value);
+       }
+
+       /**
+        * Setter for table name
+        *
+        * @param       $tableName      Name of the table to set
+        * @return      void
+        */
+       public final function setTableName ($tableName) {
+               $this->tableName = (string) $tableName;
+       }
+
+       /**
+        * Getter for table name
+        *
+        * @return      $tableName      Name of the table to set
+        */
+       public final function getTableName () {
+               return $this->tableName;
+       }
+
+       /**
+        * Setter for unique key
+        *
+        * @param       $uniqueKey      Column to use as unique key
+        * @return      void
+        */
+       public final function setUniqueKey ($uniqueKey) {
+               $this->uniqueKey = (string) $uniqueKey;
+       }
+
+       /**
+        * Getter for unique key
+        *
+        * @return      $uniqueKey      Column to use as unique key
+        */
+       public final function getUniqueKey () {
+               return $this->uniqueKey;
+       }
+
+       /**
+        * Getter for unique key value
+        *
+        * @return      $uniqueValue    Value of the unique key
+        */
+       public final function getUniqueValue () {
+               return $this->tableColumns[$this->getUniqueKey()];
+       }
+
+       /**
+        * Getter for criteria array
+        *
+        * @return      $tableColumns
+        */
+       public final function getCriteriaArray () {
+               return $this->tableColumns;
+       }
+
+       /**
+        * Getter for primary key or unique key if not set
+        *
+        * @return      $primaryKey             Primary key or unique key if not set
+        */
+       public final function getPrimaryKey () {
+               // Get primary key by default
+               $primaryKey = $this->primaryKey;
+
+               if (empty($primaryKey)) {
+                       // Get uniqueKey
+                       $primaryKey = $this->getUniqueKey();
+               } // END - if
+
+               // Return it
+               return $primaryKey;
+       }
+
+       /**
+        * Setter for primary key
+        *
+        * @param       $primaryKey             Primary key to set
+        * @return      void
+        */
+       public final function setPrimaryKey ($primaryKey) {
+               $this->primaryKey = (string) $primaryKey;
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/main/criteria/class_SearchCriteria.php b/inc/classes/main/criteria/class_SearchCriteria.php
new file mode 100644 (file)
index 0000000..faeb8be
--- /dev/null
@@ -0,0 +1,213 @@
+<?php
+/**
+ * Search criteria for e.g. searching in databases. Do not use this class if
+ * you are looking for a ship or company, or what ever. Instead use this class
+ * for looking in storages like the database.
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class SearchCriteria extends BaseFrameworkSystem implements LocalSearchCriteria {
+       /**
+        * Criteria to handle
+        */
+       private $searchCriteria = array();
+
+       /**
+        * Limitation for the search
+        */
+       private $limit = 0;
+
+       /**
+        * Skip these entries before using them
+        */
+       private $skip = 0;
+
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+
+               // Clean up a little
+               $this->removeNumberFormaters();
+               $this->removeSystemArray();
+       }
+
+       /**
+        * Create an instance of this class
+        *
+        * @return      $criteriaInstance       An instance of this criteria
+        */
+       public final static function createSearchCriteria () {
+               // Get a new instance
+               $criteriaInstance = new SearchCriteria();
+
+               // Return this instance
+               return $criteriaInstance;
+       }
+
+       /**
+        * Add criteria
+        *
+        * @param       $criteriaKey    Criteria key
+        * @param       $criteriaValue  Criteria value
+        * @return      void
+        */
+       public final function addCriteria ($criteriaKey, $criteriaValue) {
+               $this->searchCriteria[(string)$criteriaKey] = (string)$criteriaValue;
+       }
+
+       /**
+        * Add configured criteria
+        *
+        * @param       $criteriaKey    Criteria key
+        * @param       $configEntry    Configuration entry
+        * @return      void
+        */
+       public final function addConfiguredCriteria ($criteriaKey, $configEntry) {
+               // Add the configuration entry as a criteria
+               $value = $this->getConfigInstance()->readConfig($configEntry);
+               $this->addCriteria($criteriaKey, $value);
+       }
+
+       /**
+        * Setter for limit
+        *
+        * @param       $limit  Search limit
+        * @return      void
+        * @todo        Find a nice casting here. (int) allows until and including 32766.
+        */
+       public final function setLimit ($limit) {
+               $this->limit = $limit;
+       }
+
+       /**
+        * Getter for limit
+        *
+        * @return      $limit  Search limit
+        */
+       public final function getLimit () {
+               return $this->limit;
+       }
+
+       /**
+        * Setter for skip
+        *
+        * @param       $skip   Search skip
+        * @return      void
+        * @todo        Find a nice casting here. (int) allows until and including 32766.
+        */
+       public final function setSkip ($skip) {
+               $this->skip = $skip;
+       }
+
+       /**
+        * Getter for skip
+        *
+        * @return      $skip   Search skip
+        */
+       public final function getSkip () {
+               return $this->skip;
+       }
+
+       /**
+        * "Getter" for a cache key
+        *
+        * @return      $cacheKey       The key suitable for the cache system
+        */
+       public function getCacheKey () {
+               // Initialize the key
+               $cacheKey = "";
+
+               // Now walk through all criterias
+               foreach ($this->searchCriteria as $criteriaKey => $criteriaValue) {
+                       // Add the value URL encoded to avoid any trouble with special characters
+                       $cacheKey .= sprintf("%s=%s;",
+                               $criteriaKey,
+                               urlencode($criteriaValue)
+                       );
+               }
+
+               // Add limit and skip values
+               $cacheKey .= sprintf("%%limit%%=%s;%%skip%%=%s",
+                       $this->limit,
+                       $this->skip
+               );
+
+               // Return the cache key
+               return $cacheKey;
+       }
+
+       /**
+        * Get criteria element or null if not found
+        *
+        * @param       $criteria       The criteria we want to have
+        * @return      $value          Wether the value of the critera or null
+        */
+       public function getCriteriaElemnent ($criteria) {
+               // Default is not found
+               $value = null;
+
+               // Is the criteria there?
+               if (isset($this->searchCriteria[$criteria])) {
+                       // Then use it
+                       $value = $this->searchCriteria[$criteria];
+               }
+
+               // Return the value
+               return $value;
+       }
+
+       /**
+        * Checks wether given array entry matches
+        *
+        * @param       $entryArray             Array with the entries to find
+        * @return      $matches                Wether the entry matches or not
+        */
+       public function ifEntryMatches (array $entryArray) {
+               // First nothing matches and nothing is counted
+               $matches = false;
+               $counted = 0;
+
+               // Walk through all entries
+               foreach ($entryArray as $key => $entry) {
+                       // Then walk through all search criteria
+                       foreach ($this->searchCriteria as $criteriaKey => $criteriaValue) {
+                               // Is the element found and does it match?
+                               if (($key == $criteriaKey) && ($criteriaValue == $entry)) {
+                                       // Then count this one up
+                                       $counted++;
+                               } // END - if
+                       } // END - foreach
+               } // END - foreach
+
+               // Now check if expected criteria counts match
+               $matches = ($counted == count($this->searchCriteria));
+
+               // Return the result
+               return $matches;
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/main/criteria/class_UpdateCriteria.php b/inc/classes/main/criteria/class_UpdateCriteria.php
new file mode 100644 (file)
index 0000000..af3f6a5
--- /dev/null
@@ -0,0 +1,104 @@
+<?php
+/**
+ * Search criteria for e.g. searching in databases. Do not use this class if
+ * you are looking for a ship or company, or what ever. Instead use this class
+ * for looking in storages like the database.
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class UpdateCriteria extends BaseFrameworkSystem implements LocalUpdateCriteria {
+       /**
+        * Criteria to handle
+        */
+       private $updateCriteria = array();
+
+       /**
+        * Limitation for the update
+        */
+       private $limit = 0;
+
+       /**
+        * Skip these entries before using them
+        */
+       private $skip = 0;
+
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+
+               // Clean up a little
+               $this->removeNumberFormaters();
+               $this->removeSystemArray();
+       }
+
+       /**
+        * Create an instance of this class
+        *
+        * @return      $criteriaInstance       An instance of this criteria
+        */
+       public final static function createUpdateCriteria () {
+               // Get a new instance
+               $criteriaInstance = new UpdateCriteria();
+
+               // Return this instance
+               return $criteriaInstance;
+       }
+
+       /**
+        * Add criteria
+        *
+        * @param       $criteriaKey    Criteria key
+        * @param       $criteriaValue  Criteria value
+        * @return      void
+        */
+       public function addCriteria ($criteriaKey, $criteriaValue) {
+               $this->updateCriteria[$criteriaKey] = $criteriaValue;
+       }
+
+       /**
+        * Add configured criteria
+        *
+        * @param       $criteriaKey    Criteria key
+        * @param       $configEntry    Configuration entry
+        * @return      void
+        */
+       public function addConfiguredCriteria ($criteriaKey, $configEntry) {
+               // Add the configuration entry as a criteria
+               $value = $this->getConfigInstance()->readConfig($configEntry);
+               $this->addCriteria($criteriaKey, $value);
+       }
+
+       /**
+        * Getter for update criteria array
+        *
+        * @return      $updateCriteria         Array holding the update criteria
+        */
+       public final function getUpdateCriteria () {
+               return $this->updateCriteria;
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/main/crypto/.htaccess b/inc/classes/main/crypto/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/inc/classes/main/crypto/class_CryptoHelper.php b/inc/classes/main/crypto/class_CryptoHelper.php
new file mode 100644 (file)
index 0000000..0456e10
--- /dev/null
@@ -0,0 +1,260 @@
+<?php
+/**
+ * A helper class for cryptographical things like hashing passwords and so on
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class CryptoHelper extends BaseFrameworkSystem implements Cryptable {
+       // Exception constants
+       const EXCEPTION_ENCRYPT_MISSING = 0x1f0;
+       const EXCEPTION_ENCRYPT_INVALID = 0x1f1;
+
+       /**
+        * An instance of this own clas
+        */
+       private static $selfInstance = null;
+
+       /**
+        * Instance of the random number generator
+        */
+       private $rngInstance = null;
+
+       /**
+        * Salt for hashing operations
+        */
+       private $salt = "";
+
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+
+               // Clean up a little
+               $this->removeNumberFormaters();
+               $this->removeSystemArray();
+       }
+
+       /**
+        * Creates an instance of this class
+        *
+        * @return      $cryptoInstance         An instance of this crypto helper class
+        */
+       public final static function createCryptoHelper () {
+               // Get a new instance
+               $cryptoInstance = new CryptoHelper();
+
+               // Initialize the hasher
+               $cryptoInstance->initHasher();
+
+               // Return the instance
+               return $cryptoInstance;
+       }
+
+       /**
+        * Get a singleton instance of this class
+        *
+        * @return      $selfInstance   An instance of this crypto helper class
+        */
+       public final static function getInstance () {
+               // Is no instance there?
+               if (is_null(self::$selfInstance)) {
+                       // Then get a new one
+                       self::$selfInstance = self::createCryptoHelper();
+               }
+
+               // Return the instance
+               return self::$selfInstance;
+       }
+
+       /**
+        * Initializes the hasher for different purposes.
+        *
+        * @return      void
+        */
+       protected function initHasher () {
+               // Initialize the random number generator which is required by some crypto methods
+               $this->rngInstance = ObjectFactory::createObjectByConfiguredName('rng_class');
+
+               // Generate a salt for the hasher
+               $this->generateSalt();
+       }
+
+       /**
+        * Generates the salt based on configured length
+        *
+        * @return      void
+        */
+       private function generateSalt () {
+               // Get a random string from the RNG
+               $randomString = $this->rngInstance->randomString();
+
+               // Get config entry for salt length
+               $length = $this->getConfigInstance()->readConfig('salt_length');
+
+               // Keep only defined number of characters
+               $this->salt = substr(sha1($randomString), -$length, $length);
+       }
+
+       /**
+        * Hashes a string with salt and returns the hash. If an old previous hash
+        * is supplied the method will use the first X chars of that hash for hashing
+        * the password. This is useful if you want to check if password is identical
+        * for authorization purposes.
+        *
+        * @param       $str            Unhashed string
+        * @param       $oldHash        A hash from previous hashed string
+        * @return      $hashed         The hashed and salted string
+        */
+       public function hashString ($str, $oldHash = "") {
+               // Cast the string
+               $str = (string) $str;
+
+               // Default is the default salt ;-)
+               $salt = $this->salt;
+
+               // Is the old password set?
+               if (!empty($oldHash)) {
+                       // Use the salt from hash, first get length
+                       $length = $this->getConfigInstance()->readConfig('salt_length');
+
+                       // Then extract the X first characters from the hash as our salt
+                       $salt = substr($oldHash, 0, $length);
+               } // END - if
+
+               // Hash the password with salt
+               //* DEBUG: */ echo "salt=".$salt."/plain=".$str."<br />\n";
+               $hashed = $salt . md5(sprintf($this->getConfigInstance()->readConfig('hash_mask'),
+                       $salt,
+                       $this->rngInstance->getFixedSalt(),
+                       $str
+               ));
+
+               // And return it
+               return $hashed;
+       }
+
+       /**
+        * Encrypt the string with fixed salt
+        *
+        * @param       $str            The unencrypted string
+        * @return      $encrypted      Encrypted string
+        */
+       public function encryptString ($str) {
+               // Init crypto module
+               $iv_size = mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_ECB);
+               $iv = mcrypt_create_iv($iv_size, MCRYPT_RAND);
+
+               // Get key
+               if ($this->getConfigInstance()->readConfig('crypt_fixed_salt') === "Y") {
+                       $key = md5($this->rngInstance->getFixedSalt());
+               } else {
+                       $key = md5($this->rngInstance->getExtraSalt());
+               }
+
+               // Add some "garbage" to the string
+               switch ($this->rngInstance->randomNumber(0, 8)) {
+                       case 0:
+                               $garbageString = crc32($this->rngInstance->randomString(10))."|".base64_encode($str)."|".crc32($this->rngInstance->randomString(20));
+                               break;
+
+                       case 1:
+                               $garbageString = crc32($this->rngInstance->randomString(10))."|".base64_encode($str)."|".md5($this->rngInstance->randomString(20));
+                               break;
+
+                       case 2:
+                               $garbageString = crc32($this->rngInstance->randomString(10))."|".base64_encode($str)."|".sha1($this->rngInstance->randomString(20));
+                               break;
+
+                       case 3:
+                               $garbageString = md5($this->rngInstance->randomString(10))."|".base64_encode($str)."|".crc32($this->rngInstance->randomString(20));
+                               break;
+
+                       case 4:
+                               $garbageString = md5($this->rngInstance->randomString(10))."|".base64_encode($str)."|".md5($this->rngInstance->randomString(20));
+                               break;
+
+                       case 5:
+                               $garbageString = md5($this->rngInstance->randomString(10))."|".base64_encode($str)."|".sha1($this->rngInstance->randomString(20));
+                               break;
+
+                       case 6:
+                               $garbageString = sha1($this->rngInstance->randomString(10))."|".base64_encode($str)."|".crc32($this->rngInstance->randomString(20));
+                               break;
+
+                       case 7:
+                               $garbageString = sha1($this->rngInstance->randomString(10))."|".base64_encode($str)."|".md5($this->rngInstance->randomString(20));
+                               break;
+
+                       case 8:
+                               $garbageString = sha1($this->rngInstance->randomString(10))."|".base64_encode($str)."|".sha1($this->rngInstance->randomString(20));
+                               break;
+               }
+
+               // Encrypt the string
+               $encrypted = mcrypt_encrypt(MCRYPT_RIJNDAEL_256, $key, $garbageString, MCRYPT_MODE_ECB, $iv);
+
+               // Return the string
+               return $encrypted;
+       }
+
+       /**
+        * Decrypt the string with fixed salt
+        *
+        * @param       $encrypted      Encrypted string
+        * @return      $str            The unencrypted string
+        */
+       public function decryptString ($encrypted) {
+               // Init crypto module
+               $iv_size = mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_ECB);
+               $iv = mcrypt_create_iv($iv_size, MCRYPT_RAND);
+
+               // Get key
+               if ($this->getConfigInstance()->readConfig('crypt_fixed_salt') === "Y") {
+                       $key = md5($this->rngInstance->getFixedSalt());
+               } else {
+                       $key = md5($this->rngInstance->getExtraSalt());
+               }
+
+               // Decrypt the string
+               $garbageString = mcrypt_decrypt(MCRYPT_RIJNDAEL_256, $key, $encrypted, MCRYPT_MODE_ECB, $iv);
+
+               // Get the real string out
+               $strArray = explode("|", $garbageString);
+
+               // Does the element count match?
+               assert(count($strArray) == 3);
+
+               // Decode the string
+               $str = base64_decode($strArray[1]);
+
+               // Trim trailing nulls away
+               $str = rtrim($str, "\0");
+
+               // Return the string
+               return $str;
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/main/database/.htaccess b/inc/classes/main/database/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/inc/classes/main/database/class_ b/inc/classes/main/database/class_
new file mode 100644 (file)
index 0000000..1fdbd07
--- /dev/null
@@ -0,0 +1,42 @@
+<?php
+/**
+ * 
+ *
+ * @see                        DatabaseFrontendInterface - An interface for database frontends (front-end to the application)
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class  extends BaseDatabaseFrontend {
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct($class = __CLASS__) {
+               // Call parent constructor
+               parent::__construct($class);
+
+               // Clean up a little
+               $this->removeNumberFormaters();
+               $this->removeSystemArray();
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/main/database/class_BaseDatabaseFrontend.php b/inc/classes/main/database/class_BaseDatabaseFrontend.php
new file mode 100644 (file)
index 0000000..57a5d54
--- /dev/null
@@ -0,0 +1,50 @@
+<?php
+/**
+ * An abstract database access class for handling database I/O requests
+ *
+ * @see                        DatabaseFrontendInterface - An interface for database frontends (front-end to the application)
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+abstract class BaseDatabaseFrontend extends BaseFrameworkSystem implements DatabaseFrontendInterface {
+       // Constants for exceptions
+       const EXCEPTION_SQL_QUERY = 0x140;
+
+       /**
+        * The limiter instance
+        */
+       private $limitInstance = null;
+
+       /**
+        * Protected constructor
+        *
+        * @param       $className      Name of the class
+        * @return      void
+        */
+       protected function __construct($className) {
+               // Call parent constructor
+               parent::__construct($className);
+
+               // Clean up a little
+               $this->removeNumberFormaters();
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/main/database/class_BaseDatabaseWrapper.php b/inc/classes/main/database/class_BaseDatabaseWrapper.php
new file mode 100644 (file)
index 0000000..e406938
--- /dev/null
@@ -0,0 +1,161 @@
+<?php
+/**
+ * A generic database wrapper
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class BaseDatabaseWrapper extends BaseFrameworkSystem {
+       /**
+        * Cache instance
+        */
+       private $cacheInstance = null;
+
+       /**
+        * Current table name to use
+        */
+       private $tableName = "unknown";
+
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct($class) {
+               // Call parent constructor
+               parent::__construct($class);
+
+               // Initialize the cache instance
+               $this->initCacheInstance();
+
+               // Clean up a little
+               $this->removeNumberFormaters();
+               $this->removeSystemArray();
+       }
+
+       /**
+        * Initializes the cache instance with a new object
+        *
+        * @return      void
+        */
+       private final function initCacheInstance () {
+               // Set the new instance
+               $this->cacheInstance = CacheFactory::getFactory()->createConfiguredCache();
+       }
+
+       /**
+        * Do a "select" query on the current table with the given search criteria and
+        * store it in cache for later usage
+        *
+        * @param       $criteriaInstance       An instance of a Criteria class
+        * @return      $resultInstance         An instance of a database result class
+        */
+       public function doSelectByCriteria (Criteria $criteriaInstance) {
+               // First get a key suitable for our cache and extend it with this class name
+               $cacheKey = sprintf("%s@%s",
+                       $this->__toString(),
+                       $criteriaInstance->getCacheKey()
+               );
+
+               // Does this key exists in cache?
+               if ($this->cacheInstance->offsetExists($cacheKey)) {
+                       // Then use this result
+                       $result = $cacheInstance->offsetGet($cacheKey);
+               } else {
+                       // Now it's time to ask the database layer for this select statement
+                       $result = $this->getDatabaseInstance()->doSelectByTableCriteria($this->getTableName(), $criteriaInstance);
+
+                       // Cache the result if not null
+                       if (!is_null($result)) {
+                               // A valid result has returned from the database layer
+                               $this->cacheInstance->offsetSet($cacheKey, $result);
+                       } else {
+                               // This invalid result must be wrapped
+                               $result = array(
+                                       'status'                => "invalid",
+                                       'exception'             => $this->getDatabaseInstance()->getLastException()
+                               );
+                       }
+               }
+
+               // Create an instance of a DatabaseResult class with the given result
+               $resultInstance = DatabaseResult::createDatabaseResult($result);
+
+               // And return the instance
+               return $resultInstance;
+       }
+
+       /**
+        * Count the numbers of rows we shall receive
+        *
+        * @param       $criteriaInstance       An instance of a Criteria class
+        * @return      $numRows                        Numbers of rows of database entries
+        */
+       public function doSelectCountByCriteria (Criteria $criteriaInstance) {
+               // Total numbers is zero by default
+               $numRows = 0;
+
+               // Get the result from above method
+               $resultInstance = $this->doSelectByCriteria($criteriaInstance);
+
+               // Was that query fine?
+               if ($resultInstance->ifStatusIsOkay()) {
+                       // Then get the number of rows
+                       $numRows = $resultInstance->getAffectedRows();
+               } // END - if
+
+               // Return the result
+               return $numRows;
+       }
+
+       /**
+        * Setter for table name
+        *
+        * @param       $tableName      Name of table name to set
+        * @return      void
+        */
+       protected final function setTableName ($tableName) {
+               $this->tableName = (string) $tableName;
+       }
+
+       /**
+        * Getter for table name
+        *
+        * @return      $tableName      Name of table name to set
+        */
+       protected final function getTableName () {
+               return $this->tableName;
+       }
+
+       /**
+        * Getter for primary key used in wrapped table
+        *
+        * @return      $primaryKey             Primary key used in wrapped table
+        */
+       public final function getPrimaryKeyValue () {
+               // Get the table name and a database instance and ask for it
+               $primaryKey = $this->getDatabaseInstance()->getPrimaryKeyOfTable($this->getTableName());
+
+               // Return value
+               return $primaryKey;
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/main/database/databases/.htaccess b/inc/classes/main/database/databases/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/inc/classes/main/database/databases/class_LocalFileDatabase.php b/inc/classes/main/database/databases/class_LocalFileDatabase.php
new file mode 100644 (file)
index 0000000..dc4371e
--- /dev/null
@@ -0,0 +1,611 @@
+<?php
+/**
+ * Database backend class for storing objects in locally created files.
+ *
+ * This class serializes objects and saves them to local files.
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class LocalFileDatabase extends BaseDatabaseFrontend implements DatabaseFrontendInterface {
+
+       // Constants for MySQL backward-compatiblity (PLEASE FIX THEM!)
+       const DB_CODE_TABLE_MISSING     = 0x100;
+       const DB_CODE_TABLE_UNWRITEABLE = 0x101;
+       const DB_CODE_DATA_FILE_CORRUPT = 0x102;
+
+       /**
+        * Save path for "file database"
+        */
+       private $savePath = "";
+
+       /**
+        * The file's extension
+        */
+       private $fileExtension = "serialized";
+
+       /**
+        * The last read file's name
+        */
+       private $lastFile = "";
+
+       /**
+        * The last read file's content including header information
+        */
+       private $lastContents = array();
+
+       /**
+        * Wether the "connection is already up
+        */
+       private $alreadyConnected = false;
+
+       /**
+        * Last error message
+        */
+       private $lastError = "";
+
+       /**
+        * Last exception
+        */
+       private $lastException = null;
+
+       /**
+        * Table information array
+        */
+       private $tableInfo = array();
+
+       /**
+        * Element for index
+        */
+       private $indexKey = "__idx";
+
+       /**
+        * The protected constructor. Do never instance from outside! You need to
+        * set a local file path. The class will then validate it.
+        *
+        * @return      void
+        */
+       protected function __construct() {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+
+               // Clean up a little
+               $this->removeNumberFormaters();
+               $this->removeSystemArray();
+       }
+
+       /**
+        * Create an object of LocalFileDatabase and set the save path for local files.
+        * This method also validates the given file path.
+        *
+        * @param               $savePath                                       The local file path string
+        * @param               $ioInstance                             The input/output handler. This
+        *                                                                      should be FileIoHandler
+        * @return      $dbInstance                             An instance of LocalFileDatabase
+        */
+       public final static function createLocalFileDatabase ($savePath, FileIoHandler $ioInstance) {
+               // Get an instance
+               $dbInstance = new LocalFileDatabase();
+
+               // Set save path and IO instance
+               $dbInstance->setSavePath($savePath);
+               $dbInstance->setFileIoInstance($ioInstance);
+
+               // "Connect" to the database
+               $dbInstance->connectToDatabase();
+
+               // Return database instance
+               return $dbInstance;
+       }
+
+       /**
+        * Setter for save path
+        *
+        * @param               $savePath               The local save path where we shall put our serialized classes
+        * @return      void
+        */
+       public final function setSavePath ($savePath) {
+               // Secure string
+               $savePath = (string) $savePath;
+
+               // Set save path
+               $this->savePath = $savePath;
+       }
+
+       /**
+        * Getter for save path
+        *
+        * @return      $savePath               The local save path where we shall put our serialized classes
+        */
+       public final function getSavePath () {
+               return $this->savePath;
+       }
+
+       /**
+        * Getter for last error message
+        *
+        * @return      $lastError      Last error message
+        */
+       public final function getLastError () {
+               return $this->lastError;
+       }
+
+       /**
+        * Getter for last exception
+        *
+        * @return      $lastException  Last thrown exception
+        */
+       public final function getLastException () {
+               return $this->lastException;
+       }
+
+       /**
+        * Setter for the last read file
+        *
+        * @param       $fqfn   The FQFN of the last read file
+        * @return      void
+        */
+       private final function setLastFile ($fqfn) {
+               // Cast string and set it
+               $this->lastFile = (string) $fqfn;
+       }
+
+       /**
+        * Reset the last error and exception instance. This should be done after
+        * a successfull "query"
+        *
+        * @return      void
+        */
+       private final function resetLastError () {
+               $this->lastError = "";
+               $this->lastException = null;
+       }
+
+       /**
+        * Getter for last read file
+        *
+        * @return      $lastFile               The last read file's name with full path
+        */
+       public final function getLastFile () {
+               return $this->lastFile;
+       }
+
+       /**
+        * Setter for contents of the last read file
+        *
+        * @param               $contents               An array with header and data elements
+        * @return      void
+        */
+       private final function setLastFileContents (array $contents) {
+               // Set array
+               $this->lastContents = $contents;
+       }
+
+       /**
+        * Getter for last read file's content as an array
+        *
+        * @return      $lastContent    The array with elements 'header' and 'data'.
+        */
+       public final function getLastContents () {
+               return $this->lastContents;
+       }
+
+       /**
+        * Getter for file extension
+        *
+        * @return      $fileExtension  The array with elements 'header' and 'data'.
+        */
+       public final function getFileExtension () {
+               return $this->fileExtension;
+       }
+
+       /**
+        * Getter for index key
+        *
+        * @return      $indexKey       Index key
+        */
+       public final function getIndexKey () {
+               return $this->indexKey;
+       }
+
+       /**
+        * Reads a local data file  and returns it's contents in an array
+        *
+        * @param       $fqfn   The FQFN for the requested file
+        * @return      $dataArray
+        */
+       private function getDataArrayFromFile ($fqfn) {
+               // Get a file pointer
+               $fileInstance = FrameworkFileInputPointer::createFrameworkFileInputPointer($fqfn);
+
+               // Get the raw data and BASE64-decode it
+               $compressedData = base64_decode($fileInstance->readLinesFromFile());
+
+               // Close the file and throw the instance away
+               $fileInstance->closeFile();
+               unset($fileInstance);
+
+               // Decompress it
+               $serializedData = $this->getCompressorChannel()->getCompressor()->decompressStream($compressedData);
+
+               // Unserialize it
+               $dataArray = unserialize($serializedData);
+
+               // Finally return it
+               return $dataArray;
+       }
+
+       /**
+        * Writes data array to local file
+        *
+        * @param       $fqfn           The FQFN of the local file
+        * @param       $dataArray      An array with all the data we shall write
+        * @return      void
+        */
+       private function writeDataArrayToFqfn ($fqfn, array $dataArray) {
+               // Get a file pointer instance
+               $fileInstance = FrameworkFileOutputPointer::createFrameworkFileOutputPointer($fqfn, 'w');
+
+               // Serialize and compress it
+               $compressedData = $this->getCompressorChannel()->getCompressor()->compressStream(serialize($dataArray));
+
+               // Write this data BASE64 encoded to the file
+               $fileInstance->writeToFile(base64_encode($compressedData));
+
+               // Close the file pointer
+               $fileInstance->closeFile();
+       }
+
+       /**
+        * Getter for table information file contents or an empty if info file was not created
+        *
+        * @param       $dataSetInstance        An instance of a database set class
+        * @return      $infoArray                      An array with all table informations
+        */
+       private function getContentsFromTableInfoFile (StoreableCriteria $dataSetInstance) {
+               // Default content is no data
+               $infoArray = array();
+
+               // Create FQFN for getting the table information file
+               $fqfn = $this->getSavePath() . $dataSetInstance->getTableName() . '/info.' . $this->getFileExtension();
+
+               // Get the file contents
+               try {
+                       $infoArray = $this->getDataArrayFromFile($fqfn);
+               } catch (FileNotFoundException $e) {
+                       // Not found, so ignore it here
+               }
+
+               // ... and return it
+               return $infoArray;
+       }
+
+       /**
+        * Creates the table info file from given dataset instance
+        *
+        * @param       $dataSetInstance        An instance of a database set class
+        * @return      void
+        */
+       private function createTableInfoFile (StoreableCriteria $dataSetInstance) {
+               // Create FQFN for creating the table information file
+               $fqfn = $this->getSavePath() . $dataSetInstance->getTableName() . '/info.' . $this->getFileExtension();
+
+               // Get the data out from dataset in a local array
+               $this->tableInfo[$dataSetInstance->getTableName()] = array(
+                       'primary'      => $dataSetInstance->getPrimaryKey(),
+                       'created'      => time(),
+                       'last_updated' => time()
+               );
+
+               // Write the data to the file
+               $this->writeDataArrayToFqfn($fqfn, $this->tableInfo[$dataSetInstance->getTableName()]);
+       }
+
+       /**
+        * Updates the primary key information or creates the table info file if not found
+        *
+        * @param       $dataSetInstance        An instance of a database set class
+        * @return      void
+        */
+       private function updatePrimaryKey (StoreableCriteria $dataSetInstance) {
+               // Get the information array from lower method
+               $infoArray = $this->getContentsFromTableInfoFile($dataSetInstance);
+
+               // Is the primary key there?
+               if (!isset($this->tableInfo['primary'])) {
+                       // Then create the info file
+                       $this->createTableInfoFile($dataSetInstance);
+               } elseif (($this->getConfigInstance()->readConfig('db_update_primary_forced') === "Y") && ($dataSetInstance->getPrimaryKey() != $this->tableInfo['primary'])) {
+                       // Set the array element
+                       $this->tableInfo[$dataSetInstance->getTableName()]['primary'] = $dataSetInstance->getPrimaryKey();
+
+                       // Update the entry
+                       $this->updateTableInfoFile($dataSetInstance);
+               }
+       }
+
+       /**
+        * Makes sure that the database connection is alive
+        *
+        * @return      void
+        * @todo        Do some checks on the database directory and files here
+        */
+       public function connectToDatabase () {
+       }
+
+       /**
+        * Starts a SELECT query on the database by given return type, table name
+        * and search criteria
+        *
+        * @param       $resultType             Result type ("array", "object" and "indexed" are valid)
+        * @param       $tableName              Name of the database table
+        * @param       $criteria               Local search criteria class
+        * @return      $resultData             Result data of the query
+        * @throws      UnsupportedCriteriaException    If the criteria is unsupported
+        * @throws      SqlException                                    If an "SQL error" occurs
+        */
+       public function querySelect ($resultType, $tableName, LocalSearchCriteria $criteriaInstance) {
+               // The result is null by any errors
+               $resultData = null;
+
+               // Create full path name
+               $pathName = $this->getSavePath() . $tableName . '/';
+
+               // A "select" query is not that easy on local files, so first try to
+               // find the "table" which is in fact a directory on the server
+               try {
+                       // Get a directory pointer instance
+                       $directoryInstance = FrameworkDirectoryPointer::createFrameworkDirectoryPointer($pathName);
+
+                       // Initialize the result data, this need to be rewritten e.g. if a local file cannot be read
+                       $resultData = array(
+                               'status'        => "ok",
+                               'rows'          => array()
+                       );
+
+                       // Initialize limit/skip
+                       $limitFound = 0;
+                       $skipFound = 0;
+                       $idx = 1;
+
+                       // Read the directory with some exceptions
+                       while (($dataFile = $directoryInstance->readDirectoryExcept(array(".", "..", ".htaccess", ".svn", "info." . $this->getFileExtension()))) && ($limitFound < $criteriaInstance->getLimit())) {
+                               // Does the extension match?
+                               if (substr($dataFile, -(strlen($this->getFileExtension()))) !== $this->getFileExtension()) {
+                                       // Skip this file!
+                                       continue;
+                               } // END - if
+
+                               // Read the file
+                               $dataArray = $this->getDataArrayFromFile($pathName . $dataFile);
+
+                               // Is this an array?
+                               if (is_array($dataArray)) {
+                                       // Search in the criteria with FMFW (First Matches, First Wins)
+                                       foreach ($dataArray as $key => $value) {
+                                               // Get criteria element
+                                               $criteria = $criteriaInstance->getCriteriaElemnent($key);
+
+                                               // Is the criteria met?
+                                               if ((!is_null($criteria)) && ($criteria == $value))  {
+
+                                                       // Shall we skip this entry?
+                                                       if ($criteriaInstance->getSkip() > 0) {
+                                                               // We shall skip some entries
+                                                               if ($skipFound < $criteriaInstance->getSkip()) {
+                                                                       // Skip this entry
+                                                                       $skipFound++;
+                                                                       break;
+                                                               } // END - if
+                                                       } // END - if
+
+                                                       // Set id number
+                                                       $dataArray[$this->getIndexKey()] = $idx;
+
+                                                       // Entry found!
+                                                       $resultData['rows'][] = $dataArray;
+
+                                                       // Count found entries up
+                                                       $limitFound++;
+                                                       break;
+                                               } // END - if
+                                       } // END - foreach
+                               } else {
+                                       // Throw an exception here
+                                       throw new SqlException(array($this, sprintf("File &#39;%s&#39; contains invalid data.", $dataFile), self::DB_CODE_DATA_FILE_CORRUPT), self::EXCEPTION_SQL_QUERY);
+                               }
+
+                               // Count entry up
+                               $idx++;
+                       } // END - while
+
+                       // Close directory and throw the instance away
+                       $directoryInstance->closeDirectory();
+                       unset($directoryInstance);
+
+                       // Reset last error message and exception
+                       $this->resetLastError();
+               } catch (PathIsNoDirectoryException $e) {
+                       // Path not found means "table not found" for real databases...
+                       $this->lastException = $e;
+                       $this->lastError = $e->getMessage();
+
+                       // So throw an SqlException here with faked error message
+                       throw new SqlException (array($this, sprintf("Table &#39;%s&#39; not found", $tableName), self::DB_CODE_TABLE_MISSING), self::EXCEPTION_SQL_QUERY);
+               } catch (FrameworkException $e) {
+                       // Catch all exceptions and store them in last error
+                       $this->lastException = $e;
+                       $this->lastError = $e->getMessage();
+               }
+
+               // Return the gathered result
+               return $resultData;
+       }
+
+       /**
+        * "Inserts" a data set instance into a local file database folder
+        *
+        * @param       $dataSetInstance        A storeable data set
+        * @return      void
+        * @throws      SqlException    If an SQL error occurs
+        */
+       public function queryInsertDataSet (StoreableCriteria $dataSetInstance) {
+               // Create full path name
+               $fqfn = sprintf("%s%s/%s.%s",
+                       $this->getSavePath(),
+                       $dataSetInstance->getTableName(),
+                       md5($dataSetInstance->getUniqueValue()),
+                       $this->getFileExtension()
+               );
+
+               // Try to save the request away
+               try {
+                       // Write the data away
+                       $this->writeDataArrayToFqfn($fqfn, $dataSetInstance->getCriteriaArray());
+
+                       // Update the primary key
+                       $this->updatePrimaryKey($dataSetInstance);
+
+                       // Reset last error message and exception
+                       $this->resetLastError();
+               } catch (FrameworkException $e) {
+                       // Catch all exceptions and store them in last error
+                       $this->lastException = $e;
+                       $this->lastError = $e->getMessage();
+
+                       // Throw an SQL exception
+                       throw new SqlException (array($this, sprintf("Cannot write data to table &#39;%s&#39;", $tableName), self::DB_CODE_TABLE_UNWRITEABLE), self::EXCEPTION_SQL_QUERY);
+               }
+       }
+
+       /**
+        * "Updates" a data set instance with a database layer
+        *
+        * @param       $dataSetInstance        A storeable data set
+        * @return      void
+        * @throws      SqlException    If an SQL error occurs
+        */
+       public function queryUpdateDataSet (StoreableCriteria $dataSetInstance) {
+               // Create full path name
+               $pathName = $this->getSavePath() . $dataSetInstance->getTableName() . '/';
+
+               // Try all the requests
+               try {
+                       // Get a file pointer instance
+                       $directoryInstance = FrameworkDirectoryPointer::createFrameworkDirectoryPointer($pathName);
+
+                       // Initialize limit/skip
+                       $limitFound = 0;
+                       $skipFound = 0;
+
+                       // Get the criteria array from the dataset
+                       $criteriaArray = $dataSetInstance->getCriteriaArray();
+
+                       // Get search criteria
+                       $searchInstance = $dataSetInstance->getSearchInstance();
+
+                       // Read the directory with some exceptions
+                       while (($dataFile = $directoryInstance->readDirectoryExcept(array(".", "..", ".htaccess", ".svn", "info." . $this->getFileExtension()))) && ($limitFound < $searchInstance->getLimit())) {
+                               // Does the extension match?
+                               if (substr($dataFile, -(strlen($this->getFileExtension()))) !== $this->getFileExtension()) {
+                                       // Skip this file!
+                                       continue;
+                               }
+
+                               // Open this file for reading
+                               $dataArray = $this->getDataArrayFromFile($pathName . $dataFile);
+
+                               // Is this an array?
+                               if (is_array($dataArray)) {
+                                       // Search in the criteria with FMFW (First Matches, First Wins)
+                                       foreach ($dataArray as $key => $value) {
+                                               // Get criteria element
+                                               $criteria = $searchInstance->getCriteriaElemnent($key);
+
+                                               // Is the criteria met?
+                                               if ((!is_null($criteria)) && ($criteria == $value))  {
+
+                                                       // Shall we skip this entry?
+                                                       if ($searchInstance->getSkip() > 0) {
+                                                               // We shall skip some entries
+                                                               if ($skipFound < $searchInstance->getSkip()) {
+                                                                       // Skip this entry
+                                                                       $skipFound++;
+                                                                       break;
+                                                               } // END - if
+                                                       } // END - if
+
+                                                       // Entry found, so update it
+                                                       foreach ($criteriaArray as $criteriaKey => $criteriaValue) {
+                                                               $dataArray[$criteriaKey] = $criteriaValue;
+                                                       } // END - foreach
+
+                                                       // Write the data to a local file
+                                                       $this->writeDataArrayToFqfn($pathName . $dataFile, $dataArray);
+
+                                                       // Count it
+                                                       $limitFound++;
+                                                       break;
+                                               } // END - if
+                                       } // END - foreach
+                               } // END - if
+                       } // END - while
+
+                       // Close the file pointer
+                       $directoryInstance->closeDirectory();
+
+                       // Update the primary key
+                       $this->updatePrimaryKey($dataSetInstance);
+
+                       // Reset last error message and exception
+                       $this->resetLastError();
+               } catch (FrameworkException $e) {
+                       // Catch all exceptions and store them in last error
+                       $this->lastException = $e;
+                       $this->lastError = $e->getMessage();
+
+                       // Throw an SQL exception
+                       throw new SqlException (array($this, sprintf("Cannot write data to table &#39;%s&#39;", $dataSetInstance->getTableName()), self::DB_CODE_TABLE_UNWRITEABLE), self::EXCEPTION_SQL_QUERY);
+               }
+       }
+
+       /**
+        * Getter for primary key of specified table or if not found null will be
+        * returned. This must be database-specific.
+        *
+        * @param       $tableName              Name of the table we need the primary key from
+        * @return      $primaryKey             Primary key column of the given table
+        */
+       public function getPrimaryKeyOfTable ($tableName) {
+               // Default key is null
+               $primaryKey = null;
+
+               // Does the table information exist?
+               if (isset($this->tableInfo[$tableName])) {
+                       // Then return the primary key
+                       $primaryKey = $this->tableInfo[$tableName]['primary'];
+               } // END - if
+
+               // Return the column
+               return $primaryKey;
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/main/database/wrapper/.htaccess b/inc/classes/main/database/wrapper/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/inc/classes/main/database/wrapper/class_NewsDatabaseWrapper.php b/inc/classes/main/database/wrapper/class_NewsDatabaseWrapper.php
new file mode 100644 (file)
index 0000000..9a87e6a
--- /dev/null
@@ -0,0 +1,56 @@
+<?php
+/**
+ * A database wrapper for news classes
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class NewsDatabaseWrapper extends BaseDatabaseWrapper {
+       // Constants for database table names
+       const DB_TABLE_NEWS = "news";
+
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct() {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+       }
+
+       /**
+        * Creates an instance of this database wrapper by a provided user class
+        *
+        * @return      $wrapperInstance        An instance of the created wrapper class
+        */
+       public final static function createNewsDatabaseWrapper () {
+               // Get a new instance
+               $wrapperInstance = new NewsDatabaseWrapper();
+
+               // Set (primary!) table name
+               $wrapperInstance->setTableName(self::DB_TABLE_NEWS);
+
+               // Return the instance
+               return $wrapperInstance;
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/main/database/wrapper/class_PaymentsDatabaseWrapper.php b/inc/classes/main/database/wrapper/class_PaymentsDatabaseWrapper.php
new file mode 100644 (file)
index 0000000..52f3646
--- /dev/null
@@ -0,0 +1,59 @@
+<?php
+/**
+ * A database wrapper for payments
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class PaymentsDatabaseWrapper extends BaseDatabaseWrapper {
+       // Constants for exceptions
+       const EXCEPTION_CLIENT_USERNAME_NOT_FOUND = 0x180;
+
+       // Constants for database table names
+       const DB_TABLE_PAYMENTS = "payments";
+
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct() {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+       }
+
+       /**
+        * Creates an instance of this database wrapper by a provided user class
+        *
+        * @return      $wrapperInstance        An instance of the created wrapper class
+        */
+       public final static function createPaymentsDatabaseWrapper () {
+               // Get a new instance
+               $wrapperInstance = new PaymentsDatabaseWrapper();
+
+               // Set (primary!) table name
+               $wrapperInstance->setTableName(self::DB_TABLE_PAYMENTS);
+
+               // Return the instance
+               return $wrapperInstance;
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/main/database/wrapper/class_UserDatabaseWrapper.php b/inc/classes/main/database/wrapper/class_UserDatabaseWrapper.php
new file mode 100644 (file)
index 0000000..503fbad
--- /dev/null
@@ -0,0 +1,118 @@
+<?php
+/**
+ * A database wrapper for the User class
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class UserDatabaseWrapper extends BaseDatabaseWrapper {
+       // Constants for exceptions
+       const EXCEPTION_CLIENT_USERNAME_NOT_FOUND = 0x180;
+
+       // Constants for database columns
+       const DB_COLUMN_USERID       = "userid";
+       const DB_COLUMN_USERNAME     = "username";
+       const DB_COLUMN_EMAIL        = "email";
+       const DB_COLUMN_CONFIRM_HASH = "confirm_hash";
+       const DB_COLUMN_USER_STATUS  = "user_status";
+
+       // Constants for database table names
+       const DB_TABLE_USER = "user";
+
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct() {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+       }
+
+       /**
+        * Creates an instance of this database wrapper by a provided user class
+        *
+        * @return      $wrapperInstance        An instance of the created wrapper class
+        */
+       public final static function createUserDatabaseWrapper () {
+               // Get a new instance
+               $wrapperInstance = new UserDatabaseWrapper();
+
+               // Set (primary!) table name
+               $wrapperInstance->setTableName(self::DB_TABLE_USER);
+
+               // Return the instance
+               return $wrapperInstance;
+       }
+
+       /**
+        * Getter for index key
+        *
+        * @return      $indexKey       Index key
+        */
+       public final function getIndexKey () {
+               return $this->getDatabaseInstance()->getIndexKey();
+       }
+
+       /**
+        * Handles inserting the registration data from a registration instance into the database
+        *
+        * @param       $registrationInstance   An instance of a registration class
+        * @return      void
+        */
+       public function insertRegistrationObject (UserRegister $registrationInstance) {
+               // Generate a data set for the request
+               $dataSetInstance = ObjectFactory::createObjectByConfiguredName('dataset_criteria_class', array(self::DB_TABLE_USER));
+
+               // Set the primary key
+               $dataSetInstance->setUniqueKey('username');
+
+               // Add registration elements to the dataset
+               $registrationInstance->addElementsToDataSet($dataSetInstance);
+
+               // "Insert" this request instance completely into the database
+               $this->getDatabaseInstance()->queryInsertDataSet($dataSetInstance);
+       }
+
+       /**
+        * Updates an user database entry with given result
+        *
+        * @param       $resultInstance         An instance of a Updateable database result
+        * @return      void
+        */
+       public function doUpdateByResult (UpdateableResult $resultInstance) {
+               // Generate a data set object
+               $dataSetInstance = ObjectFactory::createObjectByConfiguredName('dataset_criteria_class', array(self::DB_TABLE_USER));
+
+               // Add all update criteria to the database set
+               $resultInstance->addElementsToDataSet($dataSetInstance);
+
+               // Add seach criteria
+               $dataSetInstance->setSearchInstance($resultInstance->getSearchInstance());
+
+               // Set the primary key
+               $dataSetInstance->setUniqueKey('username');
+
+               // "Update" this request with the database
+               $this->getDatabaseInstance()->queryUpdateDataSet($dataSetInstance);
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/main/database/wrapper/class_UserPointsDatabaseWrapper.php b/inc/classes/main/database/wrapper/class_UserPointsDatabaseWrapper.php
new file mode 100644 (file)
index 0000000..0a8af18
--- /dev/null
@@ -0,0 +1,56 @@
+<?php
+/**
+ * A database wrapper for user points classes
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class UserPointsDatabaseWrapper extends BaseDatabaseWrapper {
+       // Constants for database table names
+       const DB_TABLE_USER_POINTS = "user_points";
+
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct() {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+       }
+
+       /**
+        * Creates an instance of this database wrapper by a provided user class
+        *
+        * @return      $wrapperInstance        An instance of the created wrapper class
+        */
+       public final static function createUserPointsDatabaseWrapper () {
+               // Get a new instance
+               $wrapperInstance = new UserPointsDatabaseWrapper();
+
+               // Set (primary!) table name
+               $wrapperInstance->setTableName(self::DB_TABLE_USER_POINTS);
+
+               // Return the instance
+               return $wrapperInstance;
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/main/debug/.htaccess b/inc/classes/main/debug/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/inc/classes/main/debug/class_DebugConsoleOutput.php b/inc/classes/main/debug/class_DebugConsoleOutput.php
new file mode 100644 (file)
index 0000000..08e6d42
--- /dev/null
@@ -0,0 +1,84 @@
+<?php
+/**
+ * A debug output class for the console (e.g. hub software)
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class DebugConsoleOutput extends BaseFrameworkSystem implements Debugger, OutputStreamer, Registerable {
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+       }
+
+       /**
+        * Creates an instance of this class
+        *
+        * @return      $debugInstance          The prepared debug instance
+        */
+       public final static function createDebugConsoleOutput () {
+               // Get a new instance
+               $debugInstance = new DebugConsoleOutput();
+
+               // Return it
+               return $debugInstance;
+       }
+
+       /**
+        * Outputs the given data without HTML tags
+        *
+        * @param               $output The HTML'ed output
+        * @return      void
+        */
+       public final function outputStream ($output) {
+               print(html_entity_decode(strip_tags(stripslashes($output))));
+       }
+
+       /**
+        * Assigns a variable for output
+        *
+        * @param               $var            The variable we shall assign
+        * @param               $value  The value to store in the variable
+        * @return      void
+        */
+       public final function assignVariable ($var, $value) {
+               // Empty stub!
+               trigger_error(__METHOD__.": Stub!");
+       }
+
+       /**
+        * Output the code
+        *
+        * @return      void
+        */
+       public final function output ($outStream=false) {
+               // Empty output will be silently ignored
+               if ($outStream !== false) {
+                       $this->outputStream($outStream);
+               }
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/main/debug/class_DebugErrorLogOutput.php b/inc/classes/main/debug/class_DebugErrorLogOutput.php
new file mode 100644 (file)
index 0000000..0d30d4f
--- /dev/null
@@ -0,0 +1,93 @@
+<?php
+/**
+ * A debug output class for PHP's error_log() command
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class DebugErrorLogOutput extends BaseFrameworkSystem implements Debugger, OutputStreamer {
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+       }
+
+       /**
+        * Creates an instance of this class
+        *
+        * @return      $debugInstance          The prepared debug instance
+        */
+       public final static function createDebugErrorLogOutput () {
+               // Get a new instance
+               $debugInstance = new DebugErrorLogOutput();
+
+               // Return it
+               return $debugInstance;
+       }
+
+       /**
+        * Outputs the given data without HTML tags
+        *
+        * @param               $output The HTML'ed output
+        * @return      void
+        */
+       public final function outputStream ($output) {
+               // Split multiple lines into and array to put them out line-by-line
+               $errorLines = explode("\n", $output);
+               foreach ($errorLines as $err) {
+                       $err = trim($err);
+                       // Log only none-empty lines
+                       if (!empty($err)) {
+                               // Log this line
+                               error_log(html_entity_decode(strip_tags($err)), 0);
+                       }
+               }
+       }
+
+       /**
+        * Assigns a variable for output
+        *
+        * @param               $var            The variable we shall assign
+        * @param               $value  The value to store in the variable
+        * @return      void
+        */
+       public final function assignVariable ($var, $value) {
+               // Empty stub!
+               trigger_error(__METHOD__.": Stub!");
+       }
+
+       /**
+        * Output the code
+        *
+        * @return      void
+        */
+       public final function output ($outStream=false) {
+               // Empty output will be silently ignored
+               if ($outStream !== false) {
+                       $this->outputStream($outStream);
+               }
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/main/debug/class_DebugWebOutput.php b/inc/classes/main/debug/class_DebugWebOutput.php
new file mode 100644 (file)
index 0000000..433f68e
--- /dev/null
@@ -0,0 +1,86 @@
+<?php
+/**
+ * A debug output class for the web browser
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class DebugWebOutput extends BaseFrameworkSystem implements Debugger, OutputStreamer {
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+       }
+
+       /**
+        * Creates an instance of this class
+        *
+        * @return      $debugInstance          The prepared debug instance
+        */
+       public final static function createDebugWebOutput () {
+               // Get a new instance
+               $debugInstance = new DebugWebOutput();
+
+               // Return it
+               return $debugInstance;
+       }
+
+       /**
+        * Outputs the given data directly
+        *
+        * @param               $output The HTML output
+        * @return      void
+        */
+       public final function outputStream ($output) {
+               // Strip out <br />
+               $output = str_replace("<br />", "", $output);
+               print(stripslashes($output)."<br />\n");
+       }
+
+       /**
+        * Assigns a variable for output
+        *
+        * @param               $var            The variable we shall assign
+        * @param               $value  The value to store in the variable
+        * @return      void
+        */
+       public final function assignVariable ($var, $value) {
+               // Empty stub!
+               trigger_error(__METHOD__.": Stub!");
+       }
+
+       /**
+        * Output the code
+        *
+        * @return      void
+        */
+       public final function output ($outStream=false) {
+               // Empty output will be silently ignored
+               if ($outStream !== false) {
+                       $this->outputStream($outStream);
+               }
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/main/discovery/.htaccess b/inc/classes/main/discovery/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/inc/classes/main/discovery/class_ b/inc/classes/main/discovery/class_
new file mode 100644 (file)
index 0000000..890d650
--- /dev/null
@@ -0,0 +1,78 @@
+<?php
+/**
+ * A local payment discovery class. This class looks in local database for
+ * registered payment types and like all the others it at least returns the
+ * money bank transfer type.
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class ???Discovery extends BaseDiscovery implements Discoverable {
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+
+               // Clean up a little
+               $this->removeNumberFormaters();
+               $this->removeSystemArray();
+       }
+
+       /**
+        * Create an instance of this class
+        *
+        * @return      $discoveryInstance      An instance of this discovery class
+        */
+       public final static function create???Discovery () {
+               // Get an instance of this class
+               $discoveryInstance = new ???Discovery();
+
+               // Return the prepared instance
+               return $discoveryInstance;
+       }
+
+       /**
+        * Discovers the request
+        *
+        * @param       $requestInstance        An instance of a Requestable class
+        * @return      void
+        * @todo        0% done
+        */
+       public function discover (Requestable $requestInstance) {
+               $this->partialStub("Please implement this method.");
+       }
+
+       /**
+        * Adds the database result in a human-readable format to the helper class
+        *
+        * @param       $helperInstance         An instance of a helper class
+        * @return      void
+        * @todo        0% done
+        */
+       public function addResultsToHelper (HelpableTemplate $helperInstance) {
+               $this->partialStub("Please implement this method.");
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/main/discovery/class_BaseDiscovery.php b/inc/classes/main/discovery/class_BaseDiscovery.php
new file mode 100644 (file)
index 0000000..48164e1
--- /dev/null
@@ -0,0 +1,66 @@
+<?php
+/**
+ * A general discovery class
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+class BaseDiscovery extends BaseFrameworkSystem {
+       /**
+        * Action name for payment discovery
+        */
+       private $actionName = "";
+
+       /**
+        * Protected constructor
+        *
+        * @param       $className      Name of the class
+        * @return      void
+        */
+       protected function __construct ($className) {
+               // Call parent constructor
+               parent::__construct($className);
+
+               // Clean up a little
+               $this->removeNumberFormaters();
+               $this->removeSystemArray();
+       }
+
+       /**
+        * Protected setter for action name
+        *
+        * @param       $actionName             Action name to set
+        * @return      void
+        */
+       protected final function setActionName ($actionName) {
+               $this->actionName = (string) $actionName;
+       }
+
+       /**
+        * Private getter for action name
+        *
+        * @return      $actionName             Action name to set
+        */
+       protected final function getActionName () {
+               return $this->actionName;
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/main/discovery/payment/.htaccess b/inc/classes/main/discovery/payment/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/inc/classes/main/discovery/payment/class_LocalPaymentDiscovery.php b/inc/classes/main/discovery/payment/class_LocalPaymentDiscovery.php
new file mode 100644 (file)
index 0000000..129dd3b
--- /dev/null
@@ -0,0 +1,94 @@
+<?php
+/**
+ * A local payment discovery class. This class looks in local database for
+ * registered payment types and like all the others it at least returns the
+ * money bank transfer type.
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class LocalPaymentDiscovery extends BaseDiscovery implements Discoverable, Registerable {
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+
+               // Clean up a little
+               $this->removeNumberFormaters();
+               $this->removeSystemArray();
+       }
+
+       /**
+        * Create an instance of this class
+        *
+        * @param       $filterInstance         An instance of a filter
+        * @return      $discoveryInstance      An instance of this discovery class
+        */
+       public final static function createLocalPaymentDiscovery (Filterable $filterInstance) {
+               // Get an instance of this class
+               $discoveryInstance = new LocalPaymentDiscovery();
+
+               // Set the action from filter
+               $discoveryInstance->setActionName($filterInstance->getActionName());
+
+               // Return the prepared instance
+               return $discoveryInstance;
+       }
+
+       /**
+        * Discovers the request
+        *
+        * @param       $requestInstance        An instance of a Requestable class
+        * @return      void
+        */
+       public function discover (Requestable $requestInstance) {
+               // Now get a search criteria and set app name and payment action as search critera
+               $criteriaInstance = ObjectFactory::createObjectByConfiguredName('search_criteria_class');
+               $criteriaInstance->addCriteria("app_name", $requestInstance->getRequestElement('app'));
+               $criteriaInstance->addCriteria("payment_action", $this->getActionName().'_action');
+               $criteriaInstance->setLimit(1);
+
+               // Get a wrapper instance
+               $wrapperInstance = ObjectFactory::createObjectByConfiguredName('payment_db_wrapper_class');
+
+               // Get result back
+               $resultInstance = $wrapperInstance->doSelectByCriteria($criteriaInstance);
+
+               // Set the result instance
+               $this->setResultInstance($resultInstance);
+       }
+
+       /**
+        * Adds the database result in a human-readable format to the helper class
+        *
+        * @param       $helperInstance         An instance of a helper class
+        * @return      void
+        * @todo        0% done
+        */
+       public function addResultsToHelper (HelpableTemplate $helperInstance) {
+               // Undone part
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/main/factories/.htaccess b/inc/classes/main/factories/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/inc/classes/main/factories/cache/.htaccess b/inc/classes/main/factories/cache/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/inc/classes/main/factories/cache/class_CacheFactory.php b/inc/classes/main/factories/cache/class_CacheFactory.php
new file mode 100644 (file)
index 0000000..2938b87
--- /dev/null
@@ -0,0 +1,74 @@
+<?php
+/**
+ * A cache factory
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class CacheFactory extends BaseFactory {
+       /**
+        * Singleton instance
+        */
+       private static $selfInstance = null;
+
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+       }
+
+       /**
+        * Singleton getter for this class
+        *
+        * @return      $selfInstance   An instance of this class
+        */
+       public final static function getFactory () {
+               // Is the instance null?
+               if (is_null(self::$selfInstance)) {
+                       // Set a new one
+                       self::$selfInstance = new CacheFactory();
+               }
+
+               // Return the instance
+               return self::$selfInstance;
+       }
+
+       /**
+        * Creates a configured cache instance
+        *
+        * @return      $cacheInstance  An instance of the configured cache
+        */
+       public function createConfiguredCache () {
+               // Read the config entry
+               $cacheType = $this->getConfigInstance()->readConfig('cache_class');
+
+               // And get a new instance
+               $cacheInstance = ObjectFactory::createObjectByName($cacheType);
+
+               // Return the instance
+               return $cacheInstance;
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/main/factories/class_BaseFactory.php b/inc/classes/main/factories/class_BaseFactory.php
new file mode 100644 (file)
index 0000000..3fd5510
--- /dev/null
@@ -0,0 +1,66 @@
+<?php
+/**
+ * A general (base) factory
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class BaseFactory extends BaseFrameworkSystem {
+       /**
+        * An instance of the real factory class
+        */
+       private $realFactoryInstance = null;
+
+       /**
+        * Protected constructor
+        *
+        * @param       $className      Name of the real class (not BaseFactory)
+        * @return      void
+        */
+       protected function __construct ($className) {
+               // Call parent constructor
+               parent::__construct($className);
+
+               // Clean up a little
+               $this->removeNumberFormaters();
+               $this->removeSystemArray();
+       }
+
+       /**
+        * Setter for the *real* factory instance
+        *
+        * @param       $realFactoryInstance    An instance of the real factory class
+        * @return      void
+        */
+       public final function setRealFactoryInstance (BaseFrameworkSystem $realFactoryInstance) {
+               $this->realFactoryInstance = $realFactoryInstance;
+       }
+
+       /**
+        * Getter for the *real* factory instance
+        *
+        * @return      $realFactoryInstance    An instance of the real factory class
+        */
+       protected final function getRealFactoryInstance () {
+               return $this->realFactoryInstance;
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/main/factories/objects/.htaccess b/inc/classes/main/factories/objects/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/inc/classes/main/factories/objects/class_ObjectFactory.php b/inc/classes/main/factories/objects/class_ObjectFactory.php
new file mode 100644 (file)
index 0000000..0848e79
--- /dev/null
@@ -0,0 +1,111 @@
+<?php
+/**
+ * An general object factory
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class ObjectFactory extends BaseFactory {
+       /**
+        * Total objects generated
+        */
+       private static $total = 0;
+
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+       }
+
+       /**
+        * Creates a new object given by the name or throws an exception if
+        * the class was not found. No parameters for the object are currently
+        * supported.
+        *
+        * @param       $className                      Name of the class we shall construct
+        * @param       $args                           Arguments in an indexed array
+        * @return      $objectInstance         An instance of the requested object
+        * @throws      ClassNotFoundException  If the requested class was not found
+        * @throws      EmptyVariableException  If a variable is empty unexpectly
+        */
+       public final static function createObjectByName ($className, array $args=array()) {
+               // 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);
+               }
+
+               // Create method name
+               $methodName = sprintf("create%s",
+                       $className
+               );
+
+               // Run the user function
+               $objectInstance = call_user_func_array(array($className, $methodName), $args);
+
+               // Count generated objects up
+               self::$total++;
+
+               // Return the prepared instance
+               return $objectInstance;
+       }
+
+       /**
+        * Creates an object by it's configured name
+        *
+        * @param       $configEnttry           Configuration entry to read
+        * @param       $args                           Arguments in an indexed array
+        * @return      $objectInstance         An instance of the requested object
+        */
+       public final static function createObjectByConfiguredName ($configEntry, array $args=array()) {
+               // Read the configuration entry
+               $className = FrameworkConfiguration::getInstance()->readConfig($configEntry);
+
+               // Send this to the other factory...
+               $objectInstance = self::createObjectByName($className, $args);
+
+               // Return the instance
+               return $objectInstance;
+       }
+
+       /**
+        * Static getter for total object count
+        *
+        * @return      $total  Total amount of generated objects
+        */
+       public final static function getTotal () {
+               return self::$total;
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/main/factories/web/.htaccess b/inc/classes/main/factories/web/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/inc/classes/main/factories/web/class_WebNewsFactory.php b/inc/classes/main/factories/web/class_WebNewsFactory.php
new file mode 100644 (file)
index 0000000..1dace4e
--- /dev/null
@@ -0,0 +1,84 @@
+<?php
+/**
+ * A news factory for web pages
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class WebNewsFactory extends BaseFactory {
+       /**
+        * Instance of a request class
+        */
+       private $requestInstance = null;
+
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+       }
+
+       /**
+        * Singleton getter for a special factory instance depending on the given
+        * request
+        *
+        * @param       $requestInstance        An instance of a request class
+        * @return      $factoryInstance        An instance of a WebNewsFactory class
+        */
+       public final static function createFactoryByRequest (Requestable $requestInstance) {
+               // Set default news reader class
+               $configEntry = "news_reader_class";
+
+               // Get "page"
+               $page = $requestInstance->getRequestElement('page');
+
+               // Is "page" used?
+               if (!empty($page)) {
+                       // Then add it
+                       $configEntry = sprintf("news_reader_%s_class", $page);
+
+                       // Get "action"
+                       $action = $requestInstance->getRequestElement('action');
+
+                       // Is it also there?
+                       if (!empty($action)) {
+                               // Then use both for config entry
+                               $configEntry = sprintf("news_reader_%s_%s_class", $page, $action);
+                       } // END - if
+               } // END - if
+
+               // Get the news reader class name from config
+               $className = $requestInstance->getConfigInstance()->readConfig($configEntry);
+
+               // Once we have that name, try to load initialize it
+               $newsInstance = ObjectFactory::createObjectByName($className, array($requestInstance));
+
+               // Initialize the reader
+               $newsInstance->initializeReader();
+
+               // Return the prepared factory instance
+               return $newsInstance;
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/main/filter/.htaccess b/inc/classes/main/filter/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/inc/classes/main/filter/auth/.htaccess b/inc/classes/main/filter/auth/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/inc/classes/main/filter/auth/class_UserAuthFilter.php b/inc/classes/main/filter/auth/class_UserAuthFilter.php
new file mode 100644 (file)
index 0000000..c2b0ac4
--- /dev/null
@@ -0,0 +1,141 @@
+<?php
+/**
+ * A filter for checking user permissions
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class UserAuthFilter extends BaseFilter implements Filterable {
+       // Exception constants
+       const EXCEPTION_AUTH_DATA_INVALID = 0x1b0;
+
+       /**
+        * The login method we shall choose
+        */
+       private $authMethod = "";
+
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+       }
+
+       /**
+        * Creates an instance of this filter class
+        *
+        * @param       $controllerInstance             An instance of a Controller class
+        * @return      $filterInstance                 An instance of this filter class
+        */
+       public final static function createUserAuthFilter (Controller $controllerInstance) {
+               // Get a new instance
+               $filterInstance = new UserAuthFilter();
+
+               // Set the controller
+               $filterInstance->setControllerInstance($controllerInstance);
+
+               // 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
+        * @throws      UserPasswordMismatchException   If the supplied password hash does not match
+        * @throws      ClassNotFoundException  If the user (guest/member) class was not found
+        */
+       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);
+               } // END - if
+
+               // Regular user account
+               $className = $this->getConfigInstance()->readConfig('user_class');
+               $methodName = 'createMemberByUserName';
+
+               // Now, try to get a user or guest instance
+               if ($authLogin == $this->getConfigInstance()->readConfig('guest_login_user')) {
+                       // Set class
+                       $className = $this->getConfigInstance()->readConfig('guest_class');
+                       $methodName = 'createGuestByUserName';
+               } // END - if
+
+               // Does the guest class exist?
+               if (!class_exists($className)) {
+                       // Then abort here
+                       throw new ClassNotFoundException (array($this, $className), self::EXCEPTION_CLASS_NOT_FOUND);
+               } // END - if
+
+               // Now try the dynamic login
+               $userInstance = call_user_func_array(array($className, $methodName), array($authLogin));
+
+               // Is the password correct?
+               if ($userInstance->getPasswordHash() !== $authHash) {
+                       // Mismatching password
+                       throw new UserPasswordMismatchException(array($this, $userInstance), BaseUser::EXCEPTION_USER_PASS_MISMATCH);
+               } // END - if
+
+               // Remember auth and user instances in registry
+               Registry::getRegistry()->addInstance('auth', $authInstance);
+               Registry::getRegistry()->addInstance('user', $userInstance);
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/main/filter/change/.htaccess b/inc/classes/main/filter/change/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/inc/classes/main/filter/change/class_EmailChangeFilter.php b/inc/classes/main/filter/change/class_EmailChangeFilter.php
new file mode 100644 (file)
index 0000000..bc481dd
--- /dev/null
@@ -0,0 +1,125 @@
+<?php
+/**
+ * A filter for detecting email changes
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class EmailChangeFilter extends BaseFilter implements Filterable {
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+       }
+
+       /**
+        * Creates an instance of this filter class
+        *
+        * @param       $controllerInstance             An instance of a Controller class
+        * @return      $filterInstance                 An instance of this filter class
+        */
+       public final static function createEmailChangeFilter (Controller $controllerInstance) {
+               // Get a new instance
+               $filterInstance = new EmailChangeFilter();
+
+               // Set the controller
+               $filterInstance->setControllerInstance($controllerInstance);
+
+               // 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
+        * @todo        Implement email change of the user here. HINT: Use the User class!
+        */
+       public function execute (Requestable $requestInstance, Responseable $responseInstance) {
+               // Get both emails
+               $email1 = $requestInstance->getRequestElement('email1');
+               $email2 = $requestInstance->getRequestElement('email2');
+
+               // Is only first email set?
+               if ((!empty($email1)) && (empty($email2))) {
+                       // Request is invalid!
+                       $requestInstance->requestIsValid(false);
+
+                       // Email 2 is empty
+                       $responseInstance->addFatalMessage('email2_empty');
+
+                       // Stop processing here
+                       return false;
+               } // END - if
+
+               // Is only second email set?
+               if ((empty($email1)) && (!empty($email2))) {
+                       // Request is invalid!
+                       $requestInstance->requestIsValid(false);
+
+                       // Email 1 is empty
+                       $responseInstance->addFatalMessage('email1_empty');
+
+                       // Stop processing here
+                       return false;
+               } // END - if
+
+               // Do both match?
+               if ($email1 != $email2) {
+                       // Request is invalid!
+                       $requestInstance->requestIsValid(false);
+
+                       // Emails are mismatching
+                       $responseInstance->addFatalMessage('emails_mismatch');
+
+                       // Stop processing here
+                       return false;
+               } // END - if
+
+               // Are email and confirmation empty?
+               if ((empty($email1)) && (empty($email2))) {
+                       // No email change required!
+                       return true;
+               } // END - if
+
+               // Now, get a user instance for comparison
+               $userInstance = Registry::getRegistry()->getInstance('user');
+
+               // Get the email field
+               $userEmail = $userInstance->getField('email');
+
+               // Are they different?
+               if ($userEmail == $email1) {
+                       // Nothing has been changed is fine...
+                       return true;
+               } // END - if
+
+               // Update the "new_email" field
+               $this->partialStub("Unfinished part.");
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/main/filter/change/class_PasswordChangeFilter.php b/inc/classes/main/filter/change/class_PasswordChangeFilter.php
new file mode 100644 (file)
index 0000000..e7b8b50
--- /dev/null
@@ -0,0 +1,116 @@
+<?php
+/**
+ * A filter for password change detection
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class PasswordChangeFilter extends BaseFilter implements Filterable {
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+       }
+
+       /**
+        * Creates an instance of this filter class
+        *
+        * @param       $controllerInstance             An instance of a controller class
+        * @return      $filterInstance                 An instance of this filter class
+        */
+       public final static function createPasswordChangeFilter (Controller $controllerInstance) {
+               // Get a new instance
+               $filterInstance = new PasswordChangeFilter();
+
+               // Set the controller
+               $filterInstance->setControllerInstance($controllerInstance);
+
+               // 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
+        * @todo        Finished updating user password hash here. HINT: Use the User class again.
+        */
+       public function execute (Requestable $requestInstance, Responseable $responseInstance) {
+               // Get both passwords
+               $pass1 = $requestInstance->getRequestElement('pass1');
+               $pass2 = $requestInstance->getRequestElement('pass2');
+
+               // Is only first email set?
+               if ((!empty($pass1)) && (empty($pass2))) {
+                       // Request is invalid!
+                       $requestInstance->requestIsValid(false);
+
+                       // Email 2 is empty
+                       $responseInstance->addFatalMessage('pass2_empty');
+
+                       // Stop processing here
+                       return false;
+               } // END - if
+
+               // Is only second pass set?
+               if ((empty($pass1)) && (!empty($pass2))) {
+                       // Request is invalid!
+                       $requestInstance->requestIsValid(false);
+
+                       // Email 1 is empty
+                       $responseInstance->addFatalMessage('pass1_empty');
+
+                       // Stop processing here
+                       return false;
+               } // END - if
+
+               // Are password and confirmation empty?
+               if ((empty($pass1)) && (empty($pass2))) {
+                       // Don't change password here
+                       return true;
+               } // END - if
+
+               // Do both match?
+               if ($pass1 != $pass2) {
+                       // Request is invalid!
+                       $requestInstance->requestIsValid(false);
+
+                       // Emails are mismatching
+                       $responseInstance->addFatalMessage('pass_mismatch');
+
+                       // Stop processing here
+                       return false;
+               } // END - if
+
+               // Now, get a user instance for comparison
+               $userInstance = Registry::getRegistry()->getInstance('user');
+
+               // Update the "password" field
+               $this->partialStub("Unfinished part.");
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/main/filter/checkboxes/.htaccess b/inc/classes/main/filter/checkboxes/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/inc/classes/main/filter/checkboxes/class_RulesAcceptedFilter.php b/inc/classes/main/filter/checkboxes/class_RulesAcceptedFilter.php
new file mode 100644 (file)
index 0000000..03b769a
--- /dev/null
@@ -0,0 +1,80 @@
+<?php
+/**
+ * A filter for checking if the user has accepted the rules. This is mainly
+ * used and done in registration process and should not be removed from your
+ * application.
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class RulesAcceptedFilter extends BaseFilter implements Filterable {
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+       }
+
+       /**
+        * Creates an instance of this filter class
+        *
+        * @param       $controllerInstance             An instance of a Controller class
+        * @return      $filterInstance                 An instance of this filter class
+        */
+       public final static function createRulesAcceptedFilter (Controller $controllerInstance) {
+               // Get a new instance
+               $filterInstance = new RulesAcceptedFilter();
+
+               // Set the controller
+               $filterInstance->setControllerInstance($controllerInstance);
+
+               // 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 the "rules" value from request
+               $rules = $requestInstance->getRequestElement('rules');
+
+               // Was the "rules" value found in form? And is it set?
+               if (is_null($rules)) {
+                       // Not found in form so stop processing here
+                       $requestInstance->requestIsValid(false);
+
+                       // Add a message to the response
+                       $responseInstance->addFatalMessage('rules_unchecked');
+
+                       // Skip further processing
+                       return false;
+               }
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/main/filter/class_ b/inc/classes/main/filter/class_
new file mode 100644 (file)
index 0000000..bd14a20
--- /dev/null
@@ -0,0 +1,67 @@
+<?php
+/**
+ * 
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class ???Filter extends BaseFrameworkSystem implements Filterable {
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+       }
+
+       /**
+        * Creates an instance of this filter class
+        *
+        * @param       $controllerInstance             An instance of a Controller class
+        * @return      $filterInstance                 An instance of this filter class
+        */
+       public final static function create???Filter (Controller $controllerInstance) {
+               // Get a new instance
+               $filterInstance = new ???Filter();
+
+               // Set the controller
+               $filterInstance->setControllerInstance($controllerInstance);
+
+               // 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
+        * @todo        0% done
+        */
+       public function execute (Requestable $requestInstance, Responseable $responseInstance) {
+               // Implement this!
+               $this->partialStub("Please implement this method.");
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/main/filter/class_AbstractFilterDecorator.php b/inc/classes/main/filter/class_AbstractFilterDecorator.php
new file mode 100644 (file)
index 0000000..e003ce2
--- /dev/null
@@ -0,0 +1,87 @@
+<?php
+/**
+ * An abstract filter decorator for decorating filters with other filters
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+abstract class AbstractFilterDecorator extends BaseFrameworkSystem implements Filterable {
+       /**
+        * The decorated filter instance
+        */
+       private $filterInstance = null;
+
+       /**
+        * Protected constructor
+        *
+        * @param       $className      Name of the real class' name
+        * @return      void
+        */
+       protected function __construct ($className) {
+               // Call parent constructor
+               parent::__construct($className);
+
+               // Clean up a little
+               $this->removeNumberFormaters();
+               $this->removeSystemArray();
+       }
+
+       /**
+        * Setter for the decorated filter instance
+        *
+        * @param       $filterInstance         An instance of a filter
+        * @return      void
+        */
+       protected final function setFilterInstance (Filterable $filterInstance) {
+               $this->filterInstance = $filterInstance;
+       }
+
+       /**
+        * Getter for the decorated filter instance
+        *
+        * @return      $filterInstance         An instance of a filter
+        */
+       protected final function getFilterInstance () {
+               return $this->filterInstance;
+       }
+
+       /**
+        * Execute the inner filter
+        *
+        * @param       $requestInstance        An instance of a request class
+        * @param       $responseInstance       An instance of a response class
+        * @return      void
+        */
+       public final function execute (Requestable $requestInstance, Responseable $responseInstance) {
+               $this->getFilterInstance()->execute($requestInstance, $responseInstance);
+       }
+
+
+       /**
+        * Do the execution of the filter
+        *
+        * @param       $requestInstance        An instance of a request class
+        * @param       $responseInstance       An instance of a response class
+        * @return      void
+        */
+       abstract public function doExecute (Requestable $requestInstance, Responseable $responseInstance);
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/main/filter/class_BaseFilter.php b/inc/classes/main/filter/class_BaseFilter.php
new file mode 100644 (file)
index 0000000..0f3a478
--- /dev/null
@@ -0,0 +1,45 @@
+<?php
+/**
+ * A general filter class
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class BaseFilter extends BaseFrameworkSystem {
+       // Exception constants
+       const EXCEPTION_FILTER_CHAIN_ABORTED = 0x1a0;
+
+       /**
+        * 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
new file mode 100644 (file)
index 0000000..b3825da
--- /dev/null
@@ -0,0 +1,92 @@
+<?php
+/**
+ * A filter chain for pre and post filters
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class FilterChain extends BaseFrameworkSystem {
+       /**
+        * All filters together
+        */
+       private $filters = array();
+
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+
+               // Clean up a little
+               $this->removeNumberFormaters();
+               $this->removeSystemArray();
+       }
+
+       /**
+        * Creates an instance of this class
+        *
+        * @return      $chainInstance  An instance of this class
+        */
+       public final static function createFilterChain () {
+               // Get a new instance
+               $chainInstance = new FilterChain();
+
+               // Return the prepared instance
+               return $chainInstance;
+       }
+
+       /**
+        * Add a new filter
+        *
+        * @param       $filerInstance  An instance of a filter class
+        * @return      void
+        */
+       public final function addFilter (Filterable $filterInstance) {
+               $this->filters[] = $filterInstance;
+       }
+
+       /**
+        * Process all added filters
+        *
+        * @param       $requestInstance        An instance of a request class
+        * @param       $responseInstance       An instance of a response class
+        * @return      void
+        */
+       public function processFilters (Requestable $requestInstance, Responseable $responseInstance) {
+               // Run all filters
+               //* DEBUG */ echo "COUNT=".count($this->filters)."<br />\n";
+               foreach ($this->filters as $filterInstance) {
+                       // Try to execute this filter
+                       try {
+                               //* DEBUG */ echo "FILTER: ".$filterInstance->__toString().": Processing started.<br />\n";
+                               $filterInstance->execute($requestInstance, $responseInstance);
+                               //* DEBUG */ echo "FILTER: ".$filterInstance->__toString().": Processing ended.<br />\n";
+                       } catch (FilterChainException $e) {
+                               // This exception can be thrown to just skip any further processing
+                               break;
+                       }
+               } // END - foreach
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/main/filter/crypto/.htaccess b/inc/classes/main/filter/crypto/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/inc/classes/main/filter/crypto/class_CaptchaEncryptFilter.php b/inc/classes/main/filter/crypto/class_CaptchaEncryptFilter.php
new file mode 100644 (file)
index 0000000..3a20eb2
--- /dev/null
@@ -0,0 +1,94 @@
+<?php
+/**
+ * A filter for checking if value "encrypt" is set and fine
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class CaptchaEncryptFilter extends BaseFilter implements Filterable {
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+       }
+
+       /**
+        * Creates an instance of this filter class
+        *
+        * @param       $controllerInstance             An instance of a Controller class
+        * @return      $filterInstance                 An instance of this filter class
+        */
+       public final static function createCaptchaEncryptFilter (Controller $controllerInstance) {
+               // Get a new instance
+               $filterInstance = new CaptchaEncryptFilter();
+
+               // Set the controller
+               $filterInstance->setControllerInstance($controllerInstance);
+
+               // 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
+        * @throws      EncryptMissingException         If the "encrypt" value is not set
+        */
+       public function execute (Requestable $requestInstance, Responseable $responseInstance) {
+               // Get "encrypt" string barely from the request
+               $encryptRequest = $requestInstance->getRequestElement('encrypt');
+
+               // Is it there?
+               if (is_null($encryptRequest)) {
+                       // Not found, so request is invalid
+                       $requestInstance->requestIsValid(false);
+
+                       // Throw exception
+                       throw new EncryptMissingException($this, CryptoHelper::EXCEPTION_ENCRYPT_MISSING);
+               } // END - if
+
+               // Decode it fully
+               $encryptDecoded = base64_decode(str_replace(" ", "+", urldecode($encryptRequest)));
+
+               // Get a crypto helper and decrypt the string
+               $decryptedString = ObjectFactory::createObjectByConfiguredName('crypto_class')->decryptString($encryptDecoded);
+
+               // Is it the expected length?
+               if (strlen($decryptedString) != $this->getConfigInstance()->readConfig('captcha_string_length')) {
+                       // Not found, so request is invalid
+                       $requestInstance->requestIsValid(false);
+
+                       // Throw exception
+                       throw new EncryptInvalidLengthException($this, CryptoHelper::EXCEPTION_ENCRYPT_INVALID);
+               } // END - if
+
+               // Write it to the request
+               $requestInstance->setRequestElement('decrypted', $decryptedString);
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/main/filter/decorator/.htaccess b/inc/classes/main/filter/decorator/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/inc/classes/main/filter/guest/.htaccess b/inc/classes/main/filter/guest/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/inc/classes/main/filter/guest/class_UserNameIsGuestFilter.php b/inc/classes/main/filter/guest/class_UserNameIsGuestFilter.php
new file mode 100644 (file)
index 0000000..20155ac
--- /dev/null
@@ -0,0 +1,74 @@
+<?php
+/**
+ * A filter for checking if username "guest" has been choosen as configured. If
+ * so the password will be set to the configured password.
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class UserNameIsGuestFilter extends BaseFilter implements Filterable {
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+       }
+
+       /**
+        * Creates an instance of this filter class
+        *
+        * @param       $controllerInstance             An instance of a Controller class
+        * @return      $filterInstance                 An instance of this filter class
+        */
+       public final static function createUserNameIsGuestFilter (Controller $controllerInstance) {
+               // Get a new instance
+               $filterInstance = new UserNameIsGuestFilter();
+
+               // Set the controller
+               $filterInstance->setControllerInstance($controllerInstance);
+
+               // 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 username from request
+               $userName = $requestInstance->getRequestElement('username');
+
+               // Does the user name match the guest login?
+               if ($userName == $this->getConfigInstance()->readConfig('guest_login_user')) {
+                       // Then set the password to the configured password
+                       $requestInstance->setRequestElement('pass1', $this->getConfigInstance()->readConfig('guest_login_passwd'));
+                       $requestInstance->setRequestElement('pass2', $this->getConfigInstance()->readConfig('guest_login_passwd'));
+               } // END - if
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/main/filter/news/.htaccess b/inc/classes/main/filter/news/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/inc/classes/main/filter/news/class_NewsDownloadFilter.php b/inc/classes/main/filter/news/class_NewsDownloadFilter.php
new file mode 100644 (file)
index 0000000..8799398
--- /dev/null
@@ -0,0 +1,71 @@
+<?php
+/**
+ * A pre-filter for downloading news from a source. This can be a XML feed or
+ * the local database. You *can* register this filter as post filter but for
+ * output on web pages it makes no sense.
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class NewsDownloadFilter extends BaseFilter implements Filterable {
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+       }
+
+       /**
+        * Creates an instance of this filter class
+        *
+        * @param       $controllerInstance             An instance of a Controller class
+        * @return      $filterInstance                 An instance of this filter class
+        */
+       public final static function createNewsDownloadFilter (Controller $controllerInstance) {
+               // Get a new instance
+               $filterInstance = new NewsDownloadFilter();
+
+               // Set the controller
+               $filterInstance->setControllerInstance($controllerInstance);
+
+               // 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);
+
+               // Store the news instance in registry
+               Registry::getRegistry()->addInstance('news', $newsInstance);
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/main/filter/news/class_NewsProcessFilter.php b/inc/classes/main/filter/news/class_NewsProcessFilter.php
new file mode 100644 (file)
index 0000000..5ecb096
--- /dev/null
@@ -0,0 +1,66 @@
+<?php
+/**
+ * A post-filter for processing downloaded news. This will prepare the news fir
+ * output to the template engine.
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class NewsProcessFilter extends BaseFilter implements Filterable {
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+       }
+
+       /**
+        * Creates an instance of this filter class
+        *
+        * @param       $controllerInstance             An instance of a Controller class
+        * @return      $filterInstance                 An instance of this filter class
+        */
+       public final static function createNewsProcessFilter (Controller $controllerInstance) {
+               // Get a new instance
+               $filterInstance = new NewsProcessFilter();
+
+               // Set the controller
+               $filterInstance->setControllerInstance($controllerInstance);
+
+               // 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
+        * @todo        Unfinished stub, add functionality here
+        */
+       public function execute (Requestable $requestInstance, Responseable $responseInstance) {
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/main/filter/null/.htaccess b/inc/classes/main/filter/null/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/inc/classes/main/filter/null/class_NullFilter.php b/inc/classes/main/filter/null/class_NullFilter.php
new file mode 100644 (file)
index 0000000..3dd8382
--- /dev/null
@@ -0,0 +1,66 @@
+<?php
+/**
+ * As the name said: A null filter does just pass through the data. This is
+ * useful to make other filters switch on/off-able.
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class NullFilter extends BaseFilter implements Filterable {
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+       }
+
+       /**
+        * Creates an instance of this filter class
+        *
+        * @param       $controllerInstance             An instance of a Controller class
+        * @return      $filterInstance                 An instance of this filter class
+        */
+       public final static function createNullFilter (Controller $controllerInstance) {
+               // Get a new instance
+               $filterInstance = new NullFilter();
+
+               // Set the controller
+               $filterInstance->setControllerInstance($controllerInstance);
+
+               // 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) {
+               // Not implemented, just passing through
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/main/filter/payment/.htaccess b/inc/classes/main/filter/payment/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/inc/classes/main/filter/payment/class_PaymentDiscoveryFilter.php b/inc/classes/main/filter/payment/class_PaymentDiscoveryFilter.php
new file mode 100644 (file)
index 0000000..38fb46e
--- /dev/null
@@ -0,0 +1,135 @@
+<?php
+/**
+ * A filter for payment discovery. This class discovers the payment type and
+ * returns an object holding all available payment system for the requested
+ * type.
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class PaymentDiscoveryFilter extends BaseFilter implements Filterable {
+       /**
+        * Action name for payment discovery
+        */
+       private $actionName = "";
+
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+       }
+
+       /**
+        * Creates an instance of this filter class
+        *
+        * @param       $actionInstance         A performable action
+        * @return      $filterInstance         An instance of this filter class
+        * @throws      NullPointerException    If the resolver is not set
+        */
+       public final static function createPaymentDiscoveryFilter (PerformableAction $actionInstance) {
+               // Get a new instance
+               $filterInstance = new PaymentDiscoveryFilter();
+
+               // Get resolver from action
+               $resolverInstance = $actionInstance->getResolverInstance();
+
+               // Is the resolver set?
+               if (is_null($resolverInstance)) {
+                       // Throw an exception here
+                       throw new NullPointerException($filterInstance, self::EXCEPTION_IS_NULL_POINTER);
+               } // END - if
+
+               // Get the action name from resolver
+               $actionName = $resolverInstance->getActionName();
+
+               // Store it away in this class
+               $filterInstance->setActionName($actionName);
+
+               // Return the instance
+               return $filterInstance;
+       }
+
+       /**
+        * Protected setter for action name
+        *
+        * @param       $actionName             Action name to set
+        * @return      void
+        */
+       protected final function setActionName ($actionName) {
+               $this->actionName = (string) $actionName;
+       }
+
+       /**
+        * Getter for action name
+        *
+        * @return      $actionName             Action name to set
+        */
+       public final function getActionName () {
+               return $this->actionName;
+       }
+
+       /**
+        * 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
+        * @todo        0% done
+        */
+       public function execute (Requestable $requestInstance, Responseable $responseInstance) {
+               // Try to get real discovery class
+               try {
+                       // Get an instance from the object factory
+                       $discoveryInstance = ObjectFactory::createObjectByConfiguredName($this->getActionName().'_payment_discovery', array($this));
+
+                       // Call the discovery method
+                       $discoveryInstance->discover($requestInstance);
+
+                       // Remember this instance if all wents fine
+                       Registry::getRegistry()->addInstance('payments', $discoveryInstance);
+               } catch (ConfigEntryNotFoundException $e) {
+                       // Something bad happend
+                       $requestInstance->requestIsValid(false);
+
+                       // Add a message to the response
+                       $responseInstance->addFatalMessage('payment_config_entry_error');
+                       $responseInstance->addFatalMessagePlain($e->getMessage());
+
+                       // Abort here
+                       return false;
+               } catch (ClassNotFoundException $e) {
+                       // Something bad happend
+                       $requestInstance->requestIsValid(false);
+
+                       // Add a message to the response
+                       $responseInstance->addFatalMessage('payment_class_error');
+                       $responseInstance->addFatalMessagePlain($e->getMessage());
+
+                       // Abort here
+                       return false;
+               }
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/main/filter/update/.htaccess b/inc/classes/main/filter/update/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/inc/classes/main/filter/update/class_UserStatusConfimedUpdateFilter.php b/inc/classes/main/filter/update/class_UserStatusConfimedUpdateFilter.php
new file mode 100644 (file)
index 0000000..a7e409b
--- /dev/null
@@ -0,0 +1,78 @@
+<?php
+/**
+ * A filter for updating the user account status to confirmed
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class UserStatusConfimedUpdateFilter extends BaseFilter implements Filterable {
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+       }
+
+       /**
+        * Creates an instance of this filter class
+        *
+        * @param       $controllerInstance             An instance of a Controller class
+        * @return      $filterInstance                 An instance of this filter class
+        */
+       public final static function createUserStatusConfimedUpdateFilter (Controller $controllerInstance) {
+               // Get a new instance
+               $filterInstance = new UserStatusConfimedUpdateFilter();
+
+               // Set the controller
+               $filterInstance->setControllerInstance($controllerInstance);
+
+               // 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 user instance from registry
+               $userInstance = Registry::getRegistry()->getInstance('user');
+
+               // Get "confirmed" status from config
+               $confirmed = $this->getConfigInstance()->readConfig('user_status_confirmed');
+
+               // Update the user status to "confirmed" here
+               $userInstance->updateDatabaseField(UserDatabaseWrapper::DB_COLUMN_USER_STATUS, $confirmed);
+
+               // Wipe out the confirm hash for extra security
+               $userInstance->updateDatabaseField(UserDatabaseWrapper::DB_COLUMN_CONFIRM_HASH, "");
+
+               // Write all updates to the database
+               $userInstance->flushPendingUpdates();
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/main/filter/update/class_UserUpdateFilter.php b/inc/classes/main/filter/update/class_UserUpdateFilter.php
new file mode 100644 (file)
index 0000000..69c62d8
--- /dev/null
@@ -0,0 +1,78 @@
+<?php
+/**
+ * A filter for updating the user account like last activity, last action
+ * performed and so on.
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class UserUpdateFilter extends BaseFilter implements Filterable {
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+       }
+
+       /**
+        * Creates an instance of this filter class
+        *
+        * @param       $controllerInstance             An instance of a Controller class
+        * @return      $filterInstance                 An instance of this filter class
+        */
+       public final static function createUserUpdateFilter (Controller $controllerInstance) {
+               // Get a new instance
+               $filterInstance = new UserUpdateFilter();
+
+               // Set the controller
+               $filterInstance->setControllerInstance($controllerInstance);
+
+               // 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
+        * @todo        Add more user updates here
+        */
+       public function execute (Requestable $requestInstance, Responseable $responseInstance) {
+               // Get user instance from registry
+               $userInstance = Registry::getRegistry()->getInstance('user');
+
+               // Now update last activity
+               $userInstance->updateLastActivity($requestInstance);
+
+               // Update auth data as well
+               $authInstance = Registry::getRegistry()->getInstance('auth');
+               $authInstance->updateAuthData();
+
+               // Write all updates to the database
+               $userInstance->flushPendingUpdates();
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/main/filter/validator/.htaccess b/inc/classes/main/filter/validator/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/inc/classes/main/filter/validator/class_EmailValidatorFilter.php b/inc/classes/main/filter/validator/class_EmailValidatorFilter.php
new file mode 100644 (file)
index 0000000..6183b33
--- /dev/null
@@ -0,0 +1,172 @@
+<?php
+/**
+ * A concrete filter for validating the email address. This filter may intercept
+ * the filter chain if no email address is given or if supplied email has an
+ * invalid form. It could also intercept our filter chain if email address is
+ * already used by some one if configuration requires this.
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class EmailValidatorFilter extends BaseFilter implements Filterable {
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+       }
+
+       /**
+        * Creates an instance of this filter class
+        *
+        * @param       $controllerInstance             An instance of a Controller class
+        * @return      $filterInstance                 An instance of this filter class
+        */
+       public final static function createEmailValidatorFilter (Controller $controllerInstance) {
+               // Get a new instance
+               $filterInstance = new EmailValidatorFilter();
+
+               // Set the controller
+               $filterInstance->setControllerInstance($controllerInstance);
+
+               // 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 Email from request
+               $email = $requestInstance->getRequestElement('email');
+
+               // Is the Email set?
+               if ((is_null($email)) || ($this->getConfigInstance()->readConfig('register_email_unique') === "Y")) {
+                       // Try it again
+                       $email1 = $requestInstance->getRequestElement('email1');
+                       $email2 = $requestInstance->getRequestElement('email2');
+
+                       // Is the email still not set?
+                       if ((is_null($email1)) || (is_null($email2))) {
+                               // Not found in form so stop the filtering process
+                               $requestInstance->requestIsValid(false);
+
+                               // Add a message to the response
+                               $responseInstance->addFatalMessage('email_unset');
+
+                               // Abort here
+                               return false;
+                       } elseif ((empty($email1)) || (empty($email2))) {
+                               // Email is empty
+                               $requestInstance->requestIsValid(false);
+
+                               // Is the email empty?
+                               if (empty($email1)) {
+                                       // Add a message to the response
+                                       $responseInstance->addFatalMessage('email1_empty');
+                               } // END - if
+
+                               // Is the confirmation empty?
+                               if (empty($email2)) {
+                                       // Add a message to the response
+                                       $responseInstance->addFatalMessage('email2_empty');
+                               } // END - if
+
+                               // Abort here
+                               return false;
+                       } elseif ($this->ifEmailIsTaken($email1)) {
+                               // Email is already taken
+                               $requestInstance->requestIsValid(false);
+
+                               // Add a message to the response
+                               $responseInstance->addFatalMessage('email_taken');
+
+                               // Abort here
+                               return false;
+                       } elseif ($email1 != $email2) {
+                               // Emails didn't match
+                               $requestInstance->requestIsValid(false);
+
+                               // Add a message to the response
+                               $responseInstance->addFatalMessage('emails_mismatch');
+
+                               // Abort here
+                               return false;
+                       } // END - elseif
+               } elseif (empty($email)) {
+                       // Empty field!
+                       $requestInstance->requestIsValid(false);
+
+                       // Add a message to the response
+                       $responseInstance->addFatalMessage('email_empty');
+
+                       // Abort here
+                       return false;
+               } // END - elseif
+       }
+
+       /**
+        * Check wether the email as already been taken
+        *
+        * @param       $email                  Email to check for existence
+        * @return      $alreadyTaken   Wether the email has been taken
+        */
+       private function ifEmailIsTaken ($email) {
+               // Default is already taken
+               $alreadyTaken = true;
+
+               // Initialize instance
+               $userInstance = null;
+
+               // Get a registry instance
+               $registry = Registry::getRegistry();
+
+               // Is the user already there?
+               if ($registry->instanceExists('user')) {
+                       // Use the instance for checking for the email
+                       $userInstance = $registry->getInstance('user');
+                       $userInstance->setEmailAddress($email);
+               } else {
+                       // If this instance is created then the username *does* exist
+                       $userInstance = call_user_func_array(array($this->getConfigInstance()->readConfig('user_class'), 'createMemberByEmail'), array($email));
+
+                       // Remember this user instance in our registry for later usage
+                       $registry->addInstance('user', $userInstance);
+               }
+
+               // Does the email exist?
+               if ($userInstance->ifEmailAddressExists() === false) {
+                       // This email has not being used yet
+                       $alreadyTaken = false;
+               }
+
+               // Return the result
+               return $alreadyTaken;
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/main/filter/validator/class_PasswordValidatorFilter.php b/inc/classes/main/filter/validator/class_PasswordValidatorFilter.php
new file mode 100644 (file)
index 0000000..2591f1e
--- /dev/null
@@ -0,0 +1,107 @@
+<?php
+/**
+ * A concrete filter for validating the password. This filter may intercept
+ * the filter chain if no password is given or if both passwords didn't match.
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class PasswordValidatorFilter extends BaseFilter implements Filterable {
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+       }
+
+       /**
+        * Creates an instance of this filter class
+        *
+        * @param       $controllerInstance             An instance of a Controller class
+        * @return      $filterInstance                 An instance of this filter class
+        */
+       public final static function createPasswordValidatorFilter (Controller $controllerInstance) {
+               // Get a new instance
+               $filterInstance = new PasswordValidatorFilter();
+
+               // Set the controller
+               $filterInstance->setControllerInstance($controllerInstance);
+
+               // 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 passwords
+               $password1 = $requestInstance->getRequestElement('pass1');
+               $password2 = $requestInstance->getRequestElement('pass2');
+
+               // Is the password still not set?
+               if ((is_null($password1)) || (is_null($password2))) {
+                       // Not found in form so stop the filtering process
+                       $requestInstance->requestIsValid(false);
+
+                       // Add a message to the response
+                       $responseInstance->addFatalMessage('password_unset');
+
+                       // Abort here
+                       return false;
+               } elseif ((empty($password1)) || (empty($password2))) {
+                       // Password is empty
+                       $requestInstance->requestIsValid(false);
+
+                       // Is the password empty?
+                       if (empty($password1)) {
+                               // Add a message to the response
+                               $responseInstance->addFatalMessage('pass1_empty');
+                       } // END - if
+
+                       // Is the confirmation empty?
+                       if (empty($password2)) {
+                               // Add a message to the response
+                               $responseInstance->addFatalMessage('pass2_empty');
+                       } // END - if
+
+                       // Abort here
+                       return false;
+               } elseif ($password1 != $password2) {
+                       // Passwords didn't match
+                       $requestInstance->requestIsValid(false);
+
+                       // Add a message to the response
+                       $responseInstance->addFatalMessage('pass_mismatch');
+
+                       // Abort here
+                       return false;
+               } // END - elseif
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/main/filter/validator/class_UserNameValidatorFilter.php b/inc/classes/main/filter/validator/class_UserNameValidatorFilter.php
new file mode 100644 (file)
index 0000000..8d0445f
--- /dev/null
@@ -0,0 +1,142 @@
+<?php
+/**
+ * A concrete filter for validating the username. This filter may intercept the
+ * filter chain if no username is given or if supplied username has an invalid
+ * form. It could also intercept our filter chain if username is already taken.
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class UserNameValidatorFilter extends BaseFilter implements Filterable {
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+       }
+
+       /**
+        * Creates an instance of this filter class
+        *
+        * @param       $controllerInstance             An instance of a Controller class
+        * @return      $filterInstance                 An instance of this filter class
+        */
+       public final static function createUserNameValidatorFilter (Controller $controllerInstance) {
+               // Get a new instance
+               $filterInstance = new UserNameValidatorFilter();
+
+               // Set the controller
+               $filterInstance->setControllerInstance($controllerInstance);
+
+               // 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 username from request
+               $userName = $requestInstance->getRequestElement('username');
+
+               // Is the username set?
+               if (is_null($userName)) {
+                       // Not found in form so stop the filtering process
+                       $requestInstance->requestIsValid(false);
+
+                       // Add a message to the response
+                       $responseInstance->addFatalMessage('username_unset');
+
+                       // Abort here
+                       return false;
+               } elseif (empty($userName)) {
+                       // Empty field!
+                       $requestInstance->requestIsValid(false);
+
+                       // Add a message to the response
+                       $responseInstance->addFatalMessage('username_empty');
+
+                       // Abort here
+                       return false;
+               } elseif ($this->ifUserNameIsTaken($userName)) {
+                       // Username is already taken
+                       $requestInstance->requestIsValid(false);
+
+                       // Add a message to the response
+                       $responseInstance->addFatalMessage('username_taken');
+
+                       // Abort here
+                       return false;
+               }
+       }
+
+       /**
+        * Check wether the username as already been taken
+        *
+        * @param       $userName               Username to check for existence
+        * @return      $alreadyTaken   Wether the username has been taken
+        */
+       private function ifUserNameIsTaken ($userName) {
+               // Default is already taken
+               $alreadyTaken = true;
+
+               // Initialize instance
+               $userInstance = null;
+
+               // Get a registry instance
+               $registry = Registry::getRegistry();
+
+               // Is the user already there?
+               if ($registry->instanceExists('user')) {
+                       // Use the instance for checking for the email
+                       $userInstance = $registry->getInstance('user');
+                       $userInstance->setUserName($userName);
+               } else {
+                       // If this instance is created then the username *does* exist
+                       try {
+                               // Get a new instance
+                               $userInstance = call_user_func_array(array($this->getConfigInstance()->readConfig('user_class'), 'createMemberByUsername'), array($userName));
+
+                               // Remember this user instance in our registry for later usage
+                               $registry->addInstance('user', $userInstance);
+                       } catch (UsernameMissingException $e) {
+                               // User was not found
+                       }
+               }
+
+               // Does the username exist?
+               if ((is_null($userInstance)) || ($userInstance->ifUsernameExists() === false)) {
+                       // This username is still available
+                       $alreadyTaken = false;
+               } // END - if
+
+               // Return the result
+               return $alreadyTaken;
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/main/filter/verifier/.htaccess b/inc/classes/main/filter/verifier/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/inc/classes/main/filter/verifier/class_AccountPasswordVerifierFilter.php b/inc/classes/main/filter/verifier/class_AccountPasswordVerifierFilter.php
new file mode 100644 (file)
index 0000000..44fdcfc
--- /dev/null
@@ -0,0 +1,113 @@
+<?php
+/**
+ * A concrete filter for validating the password. This filter may intercept
+ * the filter chain if no password is given or the password is invalid
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class AccountPasswordVerifierFilter extends BaseFilter implements Filterable {
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+       }
+
+       /**
+        * Creates an instance of this filter class
+        *
+        * @param       $controllerInstance             An instance of a Controller class
+        * @return      $filterInstance                 An instance of this filter class
+        */
+       public final static function createAccountPasswordVerifierFilter (Controller $controllerInstance) {
+               // Get a new instance
+               $filterInstance = new AccountPasswordVerifierFilter();
+
+               // Set the controller
+               $filterInstance->setControllerInstance($controllerInstance);
+
+               // 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
+        * @throws      AccountPasswordMismatchException        If the account password does not match
+        * @todo        Rewrite handling of different password fields
+        */
+       public function execute (Requestable $requestInstance, Responseable $responseInstance) {
+               // Get password
+               $password = $requestInstance->getRequestElement('pass_old');
+
+               // Is the password still not set?
+               if (is_null($password)) {
+                       // Get password from alternative location
+                       $password = $requestInstance->getRequestElement('password');
+
+                       // Is the password still not set?
+                       if (is_null($password)) {
+                               // Not found in form so stop the filtering process
+                               $requestInstance->requestIsValid(false);
+
+                               // Add a message to the response
+                               $responseInstance->addFatalMessage('password_unset');
+
+                               // Abort here
+                               return false;
+                       } // END - if
+               } // END - if
+
+               if (empty($password)) {
+                       // Password is empty
+                       $requestInstance->requestIsValid(false);
+
+                       // Add a message to the response
+                       $responseInstance->addFatalMessage('password_empty');
+
+                       // Abort here
+                       return false;
+               }
+
+               // Get a user instance
+               $userInstance = Registry::getRegistry()->getInstance('user');
+
+               // Get current hash
+               $currentHash = $userInstance->getField('pass_hash');
+
+               // Get an encryption helper and encrypt the password
+               $passHash = ObjectFactory::createObjectByConfiguredName('crypto_class')->hashString($password, $currentHash);
+
+               // Does it match?
+               if ($currentHash != $passHash) {
+                       // Throw an exception here to stop the proccessing
+                       throw new AccountPasswordMismatchException($this, BaseUser::EXCEPTION_USER_PASS_MISMATCH);
+               } // END - if
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/main/filter/verifier/class_ConfirmCodeVerifierFilter.php b/inc/classes/main/filter/verifier/class_ConfirmCodeVerifierFilter.php
new file mode 100644 (file)
index 0000000..09a13d0
--- /dev/null
@@ -0,0 +1,112 @@
+<?php
+/**
+ * A filter for checking if supplied confirmation code is valid.
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class ConfirmCodeVerifierFilter extends BaseFilter implements Filterable {
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+       }
+
+       /**
+        * Creates an instance of this filter class
+        *
+        * @param       $controllerInstance             An instance of a Controller class
+        * @return      $filterInstance                 An instance of this filter class
+        */
+       public final static function createConfirmCodeVerifierFilter (Controller $controllerInstance) {
+               // Get a new instance
+               $filterInstance = new ConfirmCodeVerifierFilter();
+
+               // Set the controller
+               $filterInstance->setControllerInstance($controllerInstance);
+
+               // 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
+        * @throws      NullPointerException    If the user instance from registry is null
+        */
+       public function execute (Requestable $requestInstance, Responseable $responseInstance) {
+               // Get confirmation code from request
+               $confirmCode = $requestInstance->getRequestElement('confirm');
+
+               // Is this code set?
+               if (is_null($confirmCode)) {
+                       // Is not in request
+                       $requestInstance->requestIsValid(false);
+
+                       // Add a message to the response
+                       $responseInstance->addFatalMessage('confirm_code_unset');
+
+                       // Abort here
+                       return false;
+               } elseif (empty($confirmCode)) {
+                       // Email is empty
+                       $requestInstance->requestIsValid(false);
+
+                       // Add a message to the response
+                       $responseInstance->addFatalMessage('confirm_code_empty');
+
+                       // Abort here
+                       return false;
+               }
+
+               // Get a user instance from registry
+               $userInstance = Registry::getRegistry()->getInstance('user');
+
+               // Is the instance there?
+               if (is_null($userInstance)) {
+                       // Throw an exception here
+                       throw new NullPointerException ($this, self::EXCEPTION_IS_NULL_POINTER);
+               } // END - if
+
+               // Get the confirm code from user for comparison
+               $userCode = $userInstance->getField(UserDatabaseWrapper::DB_COLUMN_CONFIRM_HASH);
+
+               // Do we have the same code or different?
+               if ($userCode != $confirmCode) {
+                       // Email is empty
+                       $requestInstance->requestIsValid(false);
+
+                       // Redirect to error page
+                       $responseInstance->redirectToConfiguredUrl('confirm_code_invalid_url');
+
+                       // Stop processing here
+                       exit();
+               } // END - if
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/main/filter/verifier/class_GraphicalCodeCaptchaVerifierFilter.php b/inc/classes/main/filter/verifier/class_GraphicalCodeCaptchaVerifierFilter.php
new file mode 100644 (file)
index 0000000..27fe8a3
--- /dev/null
@@ -0,0 +1,126 @@
+<?php
+/**
+ * A concrete filter for validating code graphical CAPTCHAs with hashes
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class GraphicalCodeCaptchaVerifierFilter extends BaseFilter implements Filterable {
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+       }
+
+       /**
+        * Creates an instance of this filter class
+        *
+        * @param       $controllerInstance             An instance of a Controller class
+        * @return      $filterInstance                 An instance of this filter class
+        */
+       public final static function createGraphicalCodeCaptchaVerifierFilter (Controller $controllerInstance) {
+               // Get a new instance
+               $filterInstance = new GraphicalCodeCaptchaVerifierFilter();
+
+               // Set the controller
+               $filterInstance->setControllerInstance($controllerInstance);
+
+               // 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 the captcha code
+               $captchaCode = $requestInstance->getRequestElement('c_code');
+
+               // Is this set?
+               if (is_null($captchaCode)) {
+                       // Not set so request is invalid
+                       $requestInstance->requestIsValid(false);
+
+                       // Add fatal message
+                       $responseInstance->addFatalMessage('captcha_code_unset');
+
+                       // Skip further processing
+                       return false;
+               } elseif (empty($captchaCode)) {
+                       // Empty value so request is invalid
+                       $requestInstance->requestIsValid(false);
+
+                       // Add fatal message
+                       $responseInstance->addFatalMessage('captcha_code_empty');
+
+                       // Skip further processing
+                       return false;
+               }
+
+               // Get the hash as well
+               $captchaHash = $requestInstance->getRequestElement('hash');
+
+               // Is this set?
+               if (is_null($captchaHash)) {
+                       // Not set so request is invalid
+                       $requestInstance->requestIsValid(false);
+
+                       // Add fatal message
+                       $responseInstance->addFatalMessage('captcha_hash_unset');
+
+                       // Skip further processing
+                       return false;
+               } elseif (empty($captchaHash)) {
+                       // Empty value so request is invalid
+                       $requestInstance->requestIsValid(false);
+
+                       // Add fatal message
+                       $responseInstance->addFatalMessage('captcha_hash_empty');
+
+                       // Skip further processing
+                       return false;
+               }
+
+               // Now, both are set hash the given one. First get a crypto instance
+               $cryptoInstance = ObjectFactory::createObjectByConfiguredName('crypto_class');
+
+               // Then hash the code
+               $hashedCode = $cryptoInstance->hashString($captchaCode, $captchaHash);
+
+               // Is this CAPTCHA valid?
+               if ($hashedCode != $captchaHash) {
+                       // Not the same so request is invalid
+                       $requestInstance->requestIsValid(false);
+
+                       // Add fatal message
+                       $responseInstance->addFatalMessage('captcha_hash_mismatch');
+               } // END - not the same!
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/main/filter/verifier/class_PasswordGuestVerifierFilter.php b/inc/classes/main/filter/verifier/class_PasswordGuestVerifierFilter.php
new file mode 100644 (file)
index 0000000..abe338d
--- /dev/null
@@ -0,0 +1,88 @@
+<?php
+/**
+ * A concrete filter for validating the guest password. This filter may intercept
+ * the filter chain if no password is given or the password is invalid
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class PasswordGuestVerifierFilter extends BaseFilter implements Filterable {
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+       }
+
+       /**
+        * Creates an instance of this filter class
+        *
+        * @param       $controllerInstance             An instance of a Controller class
+        * @return      $filterInstance                 An instance of this filter class
+        */
+       public final static function createPasswordGuestVerifierFilter (Controller $controllerInstance) {
+               // Get a new instance
+               $filterInstance = new PasswordGuestVerifierFilter();
+
+               // Set the controller
+               $filterInstance->setControllerInstance($controllerInstance);
+
+               // 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 password
+               $password = $requestInstance->getRequestElement('passwd');
+
+               // Is the password still not set?
+               if (is_null($password)) {
+                       // Not found in form so stop the filtering process
+                       $requestInstance->requestIsValid(false);
+
+                       // Add a message to the response
+                       $responseInstance->addFatalMessage('password_unset');
+
+                       // Abort here
+                       return false;
+               } elseif (empty($password)) {
+                       // Password is empty
+                       $requestInstance->requestIsValid(false);
+
+                       // Add a message to the response
+                       $responseInstance->addFatalMessage('password_empty');
+
+                       // Abort here
+                       return false;
+               }
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/main/filter/verifier/class_PasswordVerifierFilter.php b/inc/classes/main/filter/verifier/class_PasswordVerifierFilter.php
new file mode 100644 (file)
index 0000000..cea7d21
--- /dev/null
@@ -0,0 +1,88 @@
+<?php
+/**
+ * A concrete filter for validating the password. This filter may intercept
+ * the filter chain if no password is given or the password is invalid
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class PasswordVerifierFilter extends BaseFilter implements Filterable {
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+       }
+
+       /**
+        * Creates an instance of this filter class
+        *
+        * @param       $controllerInstance             An instance of a Controller class
+        * @return      $filterInstance                 An instance of this filter class
+        */
+       public final static function createPasswordVerifierFilter (Controller $controllerInstance) {
+               // Get a new instance
+               $filterInstance = new PasswordVerifierFilter();
+
+               // Set the controller
+               $filterInstance->setControllerInstance($controllerInstance);
+
+               // 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 password
+               $password = $requestInstance->getRequestElement('pass');
+
+               // Is the password still not set?
+               if (is_null($password)) {
+                       // Not found in form so stop the filtering process
+                       $requestInstance->requestIsValid(false);
+
+                       // Add a message to the response
+                       $responseInstance->addFatalMessage('password_unset');
+
+                       // Abort here
+                       return false;
+               } elseif (empty($password)) {
+                       // Password is empty
+                       $requestInstance->requestIsValid(false);
+
+                       // Add a message to the response
+                       $responseInstance->addFatalMessage('password_empty');
+
+                       // Abort here
+                       return false;
+               }
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/main/filter/verifier/class_UserGuestVerifierFilter.php b/inc/classes/main/filter/verifier/class_UserGuestVerifierFilter.php
new file mode 100644 (file)
index 0000000..8e2b952
--- /dev/null
@@ -0,0 +1,145 @@
+<?php
+/**
+ * A concrete filter for verfying the guest username. This filter may intercept the
+ * filter chain if no username is given or if supplied username has an invalid
+ * form. It could also intercept our filter chain if username was not found.
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class UserGuestVerifierFilter extends BaseFilter implements Filterable {
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+       }
+
+       /**
+        * Creates an instance of this filter class
+        *
+        * @param       $controllerInstance             An instance of a Controller class
+        * @return      $filterInstance                 An instance of this filter class
+        */
+       public final static function createUserGuestVerifierFilter (Controller $controllerInstance) {
+               // Get a new instance
+               $filterInstance = new UserGuestVerifierFilter();
+
+               // Set the controller
+               $filterInstance->setControllerInstance($controllerInstance);
+
+               // 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 username from request
+               $userName = $requestInstance->getRequestElement('user');
+
+               // Is the username set?
+               if (is_null($userName)) {
+                       // Not found in form so stop the filtering process
+                       $requestInstance->requestIsValid(false);
+
+                       // Add a message to the response
+                       $responseInstance->addFatalMessage('username_guest_unset');
+
+                       // Abort here
+                       return false;
+               } elseif (empty($userName)) {
+                       // Empty field!
+                       $requestInstance->requestIsValid(false);
+
+                       // Add a message to the response
+                       $responseInstance->addFatalMessage('username_guest_empty');
+
+                       // Abort here
+                       return false;
+               } elseif ($this->ifUserGuestIsTaken($userName) === false) {
+                       // Username is already taken
+                       $requestInstance->requestIsValid(false);
+
+                       // Add a message to the response
+                       $responseInstance->addFatalMessage('username_guest_not_found');
+
+                       // Abort here
+                       return false;
+               }
+
+               // Set the element for compatiblity reasons
+               $requestInstance->setRequestElement('username', $userName);
+       }
+
+       /**
+        * Check wether the username as already been taken
+        *
+        * @param       $userName               Username to check for existence
+        * @return      $alreadyTaken   Wether the username has been taken
+        */
+       private function ifUserGuestIsTaken ($userName) {
+               // Default is already taken
+               $alreadyTaken = true;
+
+               // Initialize instance
+               $userInstance = null;
+
+               // Get a registry instance
+               $registry = Registry::getRegistry();
+
+               // Is the user already there?
+               if ($registry->instanceExists('user')) {
+                       // Use the instance for checking for the email
+                       $userInstance = $registry->getInstance('user');
+                       $userInstance->setUserGuest($userName);
+               } else {
+                       // If this instance is created then the username *does* exist
+                       try {
+                               // Get a new instance
+                               $userInstance = call_user_func_array(array($this->getConfigInstance()->readConfig('guest_class'), 'createGuestByUsername'), array($userName));
+
+                               // Remember this user instance in our registry for later usage
+                               $registry->addInstance('user', $userInstance);
+                       } catch (UsernameMissingException $e) {
+                               // User was not found
+                       }
+               }
+
+               // Does the username exist?
+               if ((is_null($userInstance)) || ($userInstance->ifUsernameExists() === false)) {
+                       // This username is still available
+                       $alreadyTaken = false;
+               }
+
+               // Return the result
+               return $alreadyTaken;
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/main/filter/verifier/class_UserNameVerifierFilter.php b/inc/classes/main/filter/verifier/class_UserNameVerifierFilter.php
new file mode 100644 (file)
index 0000000..a3b12a9
--- /dev/null
@@ -0,0 +1,142 @@
+<?php
+/**
+ * A concrete filter for verfying the username. This filter may intercept the
+ * filter chain if no username is given or if supplied username has an invalid
+ * form. It could also intercept our filter chain if username was not found.
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class UserNameVerifierFilter extends BaseFilter implements Filterable {
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+       }
+
+       /**
+        * Creates an instance of this filter class
+        *
+        * @param       $controllerInstance             An instance of a Controller class
+        * @return      $filterInstance                 An instance of this filter class
+        */
+       public final static function createUserNameVerifierFilter (Controller $controllerInstance) {
+               // Get a new instance
+               $filterInstance = new UserNameVerifierFilter();
+
+               // Set the controller
+               $filterInstance->setControllerInstance($controllerInstance);
+
+               // 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 username from request
+               $userName = $requestInstance->getRequestElement('username');
+
+               // Is the username set?
+               if (is_null($userName)) {
+                       // Not found in form so stop the filtering process
+                       $requestInstance->requestIsValid(false);
+
+                       // Add a message to the response
+                       $responseInstance->addFatalMessage('username_unset');
+
+                       // Abort here
+                       return false;
+               } elseif (empty($userName)) {
+                       // Empty field!
+                       $requestInstance->requestIsValid(false);
+
+                       // Add a message to the response
+                       $responseInstance->addFatalMessage('username_empty');
+
+                       // Abort here
+                       return false;
+               } elseif ($this->ifUserNameIsTaken($userName) === false) {
+                       // Username is already taken
+                       $requestInstance->requestIsValid(false);
+
+                       // Add a message to the response
+                       $responseInstance->addFatalMessage('username_not_found');
+
+                       // Abort here
+                       return false;
+               }
+       }
+
+       /**
+        * Check wether the username as already been taken
+        *
+        * @param       $userName               Username to check for existence
+        * @return      $alreadyTaken   Wether the username has been taken
+        */
+       private function ifUserNameIsTaken ($userName) {
+               // Default is already taken
+               $alreadyTaken = true;
+
+               // Initialize instance
+               $userInstance = null;
+
+               // Get a registry instance
+               $registry = Registry::getRegistry();
+
+               // Is the user already there?
+               if ($registry->instanceExists('user')) {
+                       // Use the instance for checking for the email
+                       $userInstance = $registry->getInstance('user');
+                       $userInstance->setUserName($userName);
+               } else {
+                       // If this instance is created then the username *does* exist
+                       try {
+                               // Get a new instance
+                               $userInstance = call_user_func_array(array($this->getConfigInstance()->readConfig('user_class'), 'createMemberByUsername'), array($userName));
+
+                               // Remember this user instance in our registry for later usage
+                               $registry->addInstance('user', $userInstance);
+                       } catch (UsernameMissingException $e) {
+                               // User was not found
+                       }
+               }
+
+               // Does the username exist?
+               if ((is_null($userInstance)) || ($userInstance->ifUsernameExists() === false)) {
+                       // This username is still available
+                       $alreadyTaken = false;
+               } // END - if
+
+               // Return the result
+               return $alreadyTaken;
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/main/filter/verifier/class_UserStatusVerifierFilter.php b/inc/classes/main/filter/verifier/class_UserStatusVerifierFilter.php
new file mode 100644 (file)
index 0000000..a058aa0
--- /dev/null
@@ -0,0 +1,78 @@
+<?php
+/**
+ * A filter for checking if user status is GUEST or CONFIRMED.
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class UserStatusVerifierFilter extends BaseFilter implements Filterable {
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+       }
+
+       /**
+        * Creates an instance of this filter class
+        *
+        * @param       $controllerInstance             An instance of a Controller class
+        * @return      $filterInstance                 An instance of this filter class
+        */
+       public final static function createUserStatusVerifierFilter (Controller $controllerInstance) {
+               // Get a new instance
+               $filterInstance = new UserStatusVerifierFilter();
+
+               // Set the controller
+               $filterInstance->setControllerInstance($controllerInstance);
+
+               // 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 user instance for comparison
+               $userInstance = Registry::getRegistry()->getInstance('user');
+
+               // Is the user account confirmed?
+               if (($userInstance->getField(UserDatabaseWrapper::DB_COLUMN_USER_STATUS) != $this->getConfigInstance()->readConfig('user_status_confirmed')) && ($userInstance->getField(UserDatabaseWrapper::DB_COLUMN_USER_STATUS) != $this->getConfigInstance()->readConfig('user_status_guest'))) {
+                       // Request is invalid!
+                       $requestInstance->requestIsValid(false);
+
+                       // Redirect to configured URL
+                       $responseInstance->redirectToConfiguredUrl('login_user_status_url');
+
+                       // Stop processing here
+                       exit();
+               } // END - if
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/main/filter/verifier/class_UserUnconfirmedVerifierFilter.php b/inc/classes/main/filter/verifier/class_UserUnconfirmedVerifierFilter.php
new file mode 100644 (file)
index 0000000..0845c85
--- /dev/null
@@ -0,0 +1,96 @@
+<?php
+/**
+ * A filter for checking if user status is UNCONFIRMED.
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class UserUnconfirmedVerifierFilter extends BaseFilter implements Filterable {
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+       }
+
+       /**
+        * Creates an instance of this filter class
+        *
+        * @param       $controllerInstance             An instance of a Controller class
+        * @return      $filterInstance                 An instance of this filter class
+        */
+       public final static function createUserUnconfirmedVerifierFilter (Controller $controllerInstance) {
+               // Get a new instance
+               $filterInstance = new UserUnconfirmedVerifierFilter();
+
+               // Set the controller
+               $filterInstance->setControllerInstance($controllerInstance);
+
+               // 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 member class
+               $userClass = $this->getConfigInstance()->readConfig('user_class');
+
+               // Get a user instance for comparison
+               $userInstance = call_user_func_array(array($userClass, 'createMemberByRequest'), array($requestInstance));
+
+               // Is the email address valid?
+               if ($userInstance->ifEmailAddressExists() === false) {
+                       // Request is invalid!
+                       $requestInstance->requestIsValid(false);
+
+                       // Redirect to configured URL
+                       $responseInstance->redirectToConfiguredUrl('user_unconfirmed_email_missing_url');
+
+                       // Stop processing here
+                       exit();
+               } // END - if
+
+               // Is the user account confirmed?
+               if ($userInstance->getField(UserDatabaseWrapper::DB_COLUMN_USER_STATUS) != $this->getConfigInstance()->readConfig('user_status_unconfirmed')) {
+                       // Request is invalid!
+                       $requestInstance->requestIsValid(false);
+
+                       // Redirect to configured URL
+                       $responseInstance->redirectToConfiguredUrl('user_not_unconfirmed_url');
+
+                       // Stop processing here
+                       exit();
+               } // END - if
+
+               // Add this instance to registry
+               Registry::getRegistry()->addInstance('user', $userInstance);
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/main/helper/.htaccess b/inc/classes/main/helper/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/inc/classes/main/helper/captcha/.htaccess b/inc/classes/main/helper/captcha/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/inc/classes/main/helper/captcha/class_ b/inc/classes/main/helper/captcha/class_
new file mode 100644 (file)
index 0000000..5dca7ba
--- /dev/null
@@ -0,0 +1,78 @@
+<?php
+/**
+ * A solveable CAPTCHA
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class ???Captcha extends BaseCaptcha implements SolveableCaptcha {
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+       }
+
+       /**
+        * Creates an instance of this captcha class
+        *
+        * @param       $templateInstance       An instance of a template engine
+        * @param       $extraInstance          An extra instance, just for better hash data
+        * @return      $captchaInstance        An instance of this captcha class
+        */
+       public final static function create???Captcha (CompileableTemplate $templateInstance, FrameworkInterface $extraInstance = null) {
+               // Get a new instance
+               $captchaInstance = new ???Captcha();
+
+               // Set template instance
+               $captchaInstance->setTemplateInstance($templateInstance);
+
+               // Initialize the RNG
+               $captchaInstance->initializeRandomNumberGenerator($extraInstance);
+
+               // Return the instance
+               return $captchaInstance;
+       }
+
+       /**
+        * Initiates the CAPTCHA
+        *
+        * @return      void
+        * @todo        0% done
+        */
+       public function initiateCaptcha () {
+               $this->partialStub("Please implement this method.");
+       }
+
+       /**
+        * Render the CAPTCHA code
+        *
+        * @return      void
+        * @todo        0% done
+        */
+       public function renderCode () {
+               $this->partialStub("Please implement this method.");
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/main/helper/captcha/class_BaseCaptcha.php b/inc/classes/main/helper/captcha/class_BaseCaptcha.php
new file mode 100644 (file)
index 0000000..8cb138e
--- /dev/null
@@ -0,0 +1,87 @@
+<?php
+/**
+ * A general captcha
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class BaseCaptcha extends BaseHelper {
+       /**
+        * A helper instance for the form
+        */
+       private $helperInstance = null;
+
+       /**
+        * Instance of an RNG
+        */
+       private $rngInstance = null;
+
+       /**
+        * Protected constructor
+        *
+        * @param       $className      Name of the class
+        * @return      void
+        */
+       protected function __construct ($className) {
+               // Call parent constructor
+               parent::__construct($className);
+       }
+
+       /**
+        * Initializes the random number generator (RNG)
+        *
+        * @param       $extraInstance  An extra instance, just for better hash data
+        * @return      void
+        */
+       protected final function initializeRandomNumberGenerator (FrameworkInterface $extraInstance = null) {
+               // Get an RNG from factory
+               $this->rngInstance = ObjectFactory::createObjectByConfiguredName('rng_class', array($extraInstance));
+       }
+
+       /**
+        * Getter for RNG instance
+        *
+        * @return      $rngInstance    An instance of a random number generator (RNG)
+        */
+       public final function getRngInstance () {
+               return $this->rngInstance;
+       }
+
+       /**
+        * Setter for helper instance
+        *
+        * @param       $helperInstance         An instance of a helper class
+        * @return      void
+        */
+       protected final function setHelperInstance (HelpableTemplate $helperInstance) {
+               $this->helperInstance = $helperInstance;
+       }
+
+       /**
+        * Getter for helper instance
+        *
+        * @return      $helperInstance         An instance of a helper class
+        */
+       public final function getHelperInstance () {
+               return $this->helperInstance;
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/main/helper/captcha/images/.htaccess b/inc/classes/main/helper/captcha/images/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/inc/classes/main/helper/captcha/images/class_ImageHelper.php b/inc/classes/main/helper/captcha/images/class_ImageHelper.php
new file mode 100644 (file)
index 0000000..fa8bd85
--- /dev/null
@@ -0,0 +1,391 @@
+<?php
+/**
+ * A helper for creating images
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class ImageHelper extends BaseCaptcha implements HelpableTemplate {
+       /**
+        * The image type
+        */
+       private $imageType = "png";
+
+       /**
+        * The image name
+        */
+       private $imageName = "";
+
+       /**
+        * Width of the image in pixel
+        */
+       private $width = 0;
+
+       /**
+        * Height of the image in pixel
+        */
+       private $height = 0;
+
+       /**
+        * Array for background color values
+        */
+       private $backgroundColor = array(
+               'red'   => 0,
+               'green' => 0,
+               'blue'  => 0
+       );
+
+       /**
+        * Array for foreground color values
+        */
+       private $foregroundColor = array(
+               'red'   => 0,
+               'green' => 0,
+               'blue'  => 0
+       );
+
+       /**
+        * All image strings
+        */
+       private $imageStrings = array();
+
+       /**
+        * Current string name
+        */
+       private $currString = "";
+
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+       }
+
+       /**
+        * Creates the helper class
+        *
+        * @param       $templateInstance       An instance of a template engine
+        * @param       $imageType                      Type of the image
+        * @return      $helperInstance         A preparedf instance of this helper
+        */
+       public final static function createImageHelper (CompileableTemplate $templateInstance, $imageType) {
+               // Get new instance
+               $helperInstance = new ImageHelper();
+
+               // Set template instance
+               $helperInstance->setTemplateInstance($templateInstance);
+
+               // Set image type (blindly)
+               $helperInstance->setImageType($imageType);
+
+               // Initialize RNG
+               $helperInstance->initializeRandomNumberGenerator($templateInstance);
+
+               // Return the prepared instance
+               return $helperInstance;
+       }
+
+       /**
+        * Setter for image type
+        *
+        * @param       $imageType      Type of the image
+        * @return      void
+        */
+       protected final function setImageType ($imageType) {
+               $this->imageType = (string) $imageType;
+       }
+
+       /**
+        * Getter for image name
+        *
+        * @return      $imageType      Type of the image
+        */
+       public final function getImageType () {
+               return $this->imageType;
+       }
+
+       /**
+        * Setter for base image
+        *
+        * @param       $baseImage      A base image template
+        * @return      void
+        */
+       public final function setBaseImage ($baseImage) {
+               $this->baseImage = (string) $baseImage;
+       }
+
+       /**
+        * Getter for base image
+        *
+        * @return      $baseImage      A base image template
+        */
+       public final function getBaseImage () {
+               return $this->baseImage;
+       }
+
+       /**
+        * Setter for image name
+        *
+        * @param       $imageName      Name of the image
+        * @return      void
+        */
+       public final function setImageName ($imageName) {
+               $this->imageName = (string) $imageName;
+       }
+
+       /**
+        * Getter for image name
+        *
+        * @return      $imageName      Name of the image
+        */
+       protected final function getImageName () {
+               return $this->imageName;
+       }
+
+       /**
+        * Setter for image width
+        *
+        * @param       $width  Width of the image
+        * @return      void
+        */
+       public final function setWidth ($width) {
+               $this->width = (int) $width;
+       }
+
+       /**
+        * Getter for image width
+        *
+        * @return      $width  Width of the image
+        */
+       public final function getWidth () {
+               return $this->width;
+       }
+
+       /**
+        * Setter for image height
+        *
+        * @param       $height         Height of the image
+        * @return      void
+        */
+       public final function setHeight ($height) {
+               $this->height = (int) $height;
+       }
+
+       /**
+        * Getter for image height
+        *
+        * @return      $height         Height of the image
+        */
+       public final function getHeight () {
+               return $this->height;
+       }
+
+       /**
+        * Setter for RGB of background color
+        *
+        * @param       $red    Color value for red
+        * @param       $green  Color value for green
+        * @param       $blue   Color value for blue
+        * @return      void
+        */
+       public final function setBackgroundColorRedGreenBlue ($red, $green, $blue) {
+               // Random numbers?
+               if ($red === "rand") {
+                       $red = $this->getRngInstance()->randomNumber(0, 255);
+               } // END - if
+               if ($green === "rand") {
+                       $green = $this->getRngInstance()->randomNumber(0, 255);
+               } // END - if
+               if ($blue === "rand") {
+                       $blue = $this->getRngInstance()->randomNumber(0, 255);
+               } // END - if
+
+               $this->backgroundColor['red']   = (int) $red;
+               $this->backgroundColor['green'] = (int) $green;
+               $this->backgroundColor['blue']  = (int) $blue;
+       }
+
+       /**
+        * Setter for RGB of foreground color
+        *
+        * @param       $red    Color value for red
+        * @param       $green  Color value for green
+        * @param       $blue   Color value for blue
+        * @return      void
+        */
+       public final function setForegroundColorRedGreenBlue ($red, $green, $blue) {
+               // Random numbers?
+               if ($red === "rand") {
+                       $red = $this->getRngInstance()->randomNumber(0, 255);
+               } // END - if
+               if ($green === "rand") {
+                       $green = $this->getRngInstance()->randomNumber(0, 255);
+               } // END - if
+               if ($blue === "rand") {
+                       $blue = $this->getRngInstance()->randomNumber(0, 255);
+               } // END - if
+
+               $this->foregroundColor['red']   = (int) $red;
+               $this->foregroundColor['green'] = (int) $green;
+               $this->foregroundColor['blue']  = (int) $blue;
+       }
+
+       /**
+        * Adds an image string to the buffer by the given string name
+        *
+        * @param       $stringName             String name (identifier)
+        */
+       public function addTextLine ($stringName) {
+               // Create the image string
+               $this->imageStrings[$stringName] = array(
+                       'x'      => "",
+                       'y'      => "",
+                       'size'   => "",
+                       'string' => ""
+               );
+
+               // Set current string name
+               $this->currString = $stringName;
+       }
+
+       /**
+        * Setter for image message string
+        *
+        * @param       $imageString    A message to display in image
+        * @return      void
+        */
+       public final function setImageString ($imageString) {
+               $this->imageStrings[$this->currString]['string'] = (string) $imageString;
+       }
+
+       /**
+        * Getter for image message string
+        *
+        * @return      $imageString    A message to display in image
+        */
+       public final function getImageString () {
+               return $this->imageStrings[$this->currString]['string'];
+       }
+
+       /**
+        * Setter for X/Y coordinates for strings
+        *
+        * @param       $x      X coordinate
+        * @param       $y      Y coordinate
+        * @return      void
+        */
+       public final function setCoord ($x, $y) {
+               $this->imageStrings[$this->currString]['x'] = (int) $x;
+               $this->imageStrings[$this->currString]['y'] = (int) $y;
+       }
+
+       /**
+        * Getter for X coordinate
+        *
+        * @return      $x      X coordinate
+        */
+       public final function getX () {
+               return $this->imageStrings[$this->currString]['x'];
+       }
+
+       /**
+        * Getter for Y coordinate
+        *
+        * @return      $y      Y coordinate
+        */
+       public final function getY () {
+               return $this->imageStrings[$this->currString]['y'];
+       }
+
+       /**
+        * Setter for font size
+        *
+        * @param       $fontSize       Font size for strings
+        * @return      void
+        */
+       public final function setFontSize ($fontSize) {
+               // Random font size?
+               if ($fontSize === "rand") {
+                       $fontSize = $this->getRngInstance()->randomNumber(4, 9);
+               } // END - if
+
+               $this->imageStrings[$this->currString]['size'] = (int) $fontSize;
+       }
+
+       /**
+        * Getter for font size
+        *
+        * @return      $fontSize       Font size for strings
+        */
+       public final function getFontSize () {
+               return $this->imageStrings[$this->currString]['size'];
+       }
+
+       /**
+        * Flushs the content out
+        *
+        * @return      void
+        */
+       public function flushContent () {
+               // Get a template instance
+               $templateInstance = $this->getTemplateInstance();
+
+               // Get the base image
+               $templateInstance->loadCodeTemplate($this->getBaseImage());
+
+               // Assign all the image values with the template
+               $templateInstance->assignVariable('image_name'    , $this->getImageName());
+               $templateInstance->assignVariable('image_type'    , $this->getImageType());
+               $templateInstance->assignVariable('image_width'   , $this->getWidth());
+               $templateInstance->assignVariable('image_height'  , $this->getHeight());
+               $templateInstance->assignVariable('image_bg_red'  , $this->backgroundColor['red']);
+               $templateInstance->assignVariable('image_bg_green', $this->backgroundColor['green']);
+               $templateInstance->assignVariable('image_bg_blue' , $this->backgroundColor['blue']);
+               $templateInstance->assignVariable('image_fg_red'  , $this->foregroundColor['red']);
+               $templateInstance->assignVariable('image_fg_green', $this->foregroundColor['green']);
+               $templateInstance->assignVariable('image_fg_blue' , $this->foregroundColor['blue']);
+
+               // Add all strings
+               foreach ($this->imageStrings as $id => $imageString) {
+                       // Set current string id to keep this helper in sync with template engine
+                       $this->currString = $id;
+
+                       // Set variable group
+                       $templateInstance->setVariableGroup($id);
+
+                       // Add group variables
+                       $templateInstance->addGroupVariable('image_x'     , $this->getX());
+                       $templateInstance->addGroupVariable('image_y'     , $this->getY());
+                       $templateInstance->addGroupVariable('image_size'  , $this->getFontSize());
+                       $templateInstance->addGroupVariable('image_string', $this->getImageString());
+               } // END - foreach
+
+               // Get the raw content
+               $imageContent = $templateInstance->getRawTemplateData();
+
+               // Transfer all to the template engine
+               $templateInstance->renderXmlContent($imageContent);
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/main/helper/captcha/web/.htaccess b/inc/classes/main/helper/captcha/web/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/inc/classes/main/helper/captcha/web/class_GraphicalCodeCaptcha.php b/inc/classes/main/helper/captcha/web/class_GraphicalCodeCaptcha.php
new file mode 100644 (file)
index 0000000..37a206c
--- /dev/null
@@ -0,0 +1,157 @@
+<?php
+/**
+ * A solveable graphical code CAPTCHA
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class GraphicalCodeCaptcha extends BaseCaptcha implements SolveableCaptcha {
+       /**
+        * Hash of the CAPTCHA string
+        */
+       private $hashedString = "";
+
+       /**
+        * Encrypted string
+        */
+       private $encryptedString = "";
+
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+       }
+
+       /**
+        * Creates an instance of this captcha class
+        *
+        * @param       $helperInstance         An instance of a helper class
+        * @param       $extraInstance          An extra instance, just for better hash data
+        * @return      $captchaInstance        An instance of this captcha class
+        */
+       public final static function createGraphicalCodeCaptcha (HelpableTemplate $helperInstance, FrameworkInterface $extraInstance = null) {
+               // Get a new instance
+               $captchaInstance = new GraphicalCodeCaptcha();
+
+               // Set template instance
+               $captchaInstance->setHelperInstance($helperInstance);
+
+               // Initialize the RNG
+               $captchaInstance->initializeRandomNumberGenerator($extraInstance);
+
+               // Return the instance
+               return $captchaInstance;
+       }
+
+       /**
+        * Initiates the CAPTCHA
+        *
+        * @return      void
+        */
+       public function initiateCaptcha () {
+               // Get total length
+               $captchaLength = $this->getConfigInstance()->readConfig('captcha_string_length');
+
+               // Get max string length
+               $strLength = $this->getConfigInstance()->readConfig('random_string_length');
+
+               // Calculate starting position based on random place
+               $start = $this->getRngInstance()->randomNumber(0, ($strLength - $captchaLength));
+
+               // Test it
+               assert($start >= 0);
+
+               // Generate a random string for confirmation
+               $randomString = $this->getRngInstance()->randomString($strLength);
+
+               // Encode the string with BASE64
+               $base64String = base64_encode($randomString);
+
+               // Make this string a bit more readable for humans
+               $captchaString = substr($base64String, $start, $captchaLength);
+
+               // Get all characters we want to replace
+               $searchChars = $this->getConfigInstance()->readConfig('captcha_search_chars');
+
+               // Get fixed salt and use it as "replacement characters"
+               $replaceChars = $this->getRngInstance()->getExtraSalt();
+
+               // Remove any plus, equals or slashes
+               for ($searchIdx = 0; $searchIdx < strlen($searchChars); $searchIdx++) {
+                       // Get search character
+                       $search = substr($searchChars, $searchIdx, 1);
+
+                       // Random array index
+                       $charIdx = $this->getRngInstance()->randomNumber(0, (strlen($replaceChars) - 1));
+
+                       // Get replacement
+                       $replace = substr($replaceChars, $charIdx, 1);
+
+                       // Replace character
+                       $captchaString = str_replace($search, $replace, $captchaString, $captchaLength);
+               } // END - foreach
+
+               // Get crypto instance
+               $cryptoInstance = ObjectFactory::createObjectByConfiguredName('crypto_class');
+
+               // Hash the CAPTCHA code for later comparison
+               $this->hashedString = $cryptoInstance->hashString($captchaString);
+
+               // Encrypt the string for later usage
+               $this->encryptedString = $cryptoInstance->encryptString($captchaString);
+       }
+
+       /**
+        * Render the CAPTCHA code
+        *
+        * @return      void
+        */
+       public function renderCode () {
+               // Get helper instance
+               $helperInstance = $this->getHelperInstance();
+
+               // Get template instance
+               $templateInstance = $helperInstance->getTemplateInstance();
+
+               // Load a template for this CAPTCHA
+               $templateInstance->loadCodeTemplate('captch_graphic_code');
+
+               // Rename variable
+               $templateInstance->renameVariable('captcha_code', $helperInstance->getFormName().'_captcha');
+               $templateInstance->renameVariable('captcha_hash', $helperInstance->getFormName().'_hash');
+               $templateInstance->renameVariable('encrypted_code', $helperInstance->getFormName().'_encrypt');
+
+               // Assign variables
+               $templateInstance->assignVariable($helperInstance->getFormName().'_encrypt', urlencode(base64_encode($this->encryptedString)));
+               $templateInstance->assignVariable($helperInstance->getFormName().'_hash', $this->hashedString);
+
+               // Compile the template
+               $templateInstance->compileTemplate();
+
+               // Get the content back
+               $this->addContent($templateInstance->getRawTemplateData());
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/main/helper/class_ b/inc/classes/main/helper/class_
new file mode 100644 (file)
index 0000000..94f912f
--- /dev/null
@@ -0,0 +1,63 @@
+<?php
+/**
+ * 
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class ???Helper extends BaseHelper {
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+
+               // Set part description
+               $this->setObjectDescription("");
+       }
+
+       /**
+        * Creates the helper class
+        *
+        * @return      $helperInstance         A prepared instance of this helper
+        */
+       public final static function create???Helper () {
+               // Get new instance
+               $helperInstance = new ???Helper();
+
+               // Return the prepared instance
+               return $helperInstance;
+       }
+
+       /**
+        * Flush the content out,e g. to a template variable
+        *
+        * @return      void
+        * @todo        0% done
+        */
+       public function flushContent () {
+               $this->partialStub("Please implement this method.");
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/main/helper/class_BaseHelper.php b/inc/classes/main/helper/class_BaseHelper.php
new file mode 100644 (file)
index 0000000..b4e893f
--- /dev/null
@@ -0,0 +1,503 @@
+<?php
+/**
+ * A generic helper class with generic methods
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class BaseHelper extends BaseFrameworkSystem {
+       /**
+        * Instance to the class which provides field values
+        */
+       private $valueInstance = null;
+
+       /**
+        * Rendered content created by the helper class
+        */
+       private $content = "";
+
+       /**
+        * Array with groups
+        */
+       private $groups = array();
+
+       /**
+        * Array with sub group
+        */
+       private $subGroups = array();
+
+       /**
+        * Previously opened group
+        */
+       private $previousGroupId = "";
+
+       /**
+        * Previously opened sub group
+        */
+       private $previousSubGroupId = "";
+
+       /**
+        * Total counter for groups and sub groups
+        */
+       private $totalCounter = 0;
+
+       // Exception constants
+       const EXCEPTION_XML_PARSER_ERROR             = 0x1e0;
+       const EXCEPTION_XML_NODE_UNKNOWN             = 0x1e1;
+       const EXCEPTION_XML_NODE_MISMATCH            = 0x1e2;
+       const EXCEPTION_GROUP_NOT_OPENED             = 0x1e3;
+       const EXCEPTION_GROUP_ALREADY_FOUND          = 0x1e4;
+       const EXCEPTION_SUB_GROUP_ALREADY_FOUND      = 0x1e5;
+       const EXCEPTION_NO_PREVIOUS_SUB_GROUP_OPENED = 0x1e6;
+       const EXCEPTION_NO_PREVIOUS_GROUP_OPENED     = 0x1e7;
+
+       /**
+        * Protected constructor
+        *
+        * @param       $className      Real name of the class
+        * @return      void
+        */
+       protected function __construct ($className) {
+               // Call parent constructor
+               parent::__construct($className);
+
+               // Clean up a little
+               $this->removeNumberFormaters();
+               $this->removeSystemArray();
+       }
+
+       /**
+        * Adds content directly
+        *
+        * @param       $newContent             New content to add
+        * @return      void
+        */
+       protected final function addContent ($newContent) {
+               $this->content .= (string) trim($newContent)."\n";
+       }
+
+       /**
+        * Add header content to the helper
+        *
+        * @param       $content        Content to to the base
+        * @return      void
+        */
+       protected function addHeaderContent ($content) {
+               // Add the header content
+               $this->groups['header']['content'] = (string) trim($content);
+       }
+
+       /**
+        * Add footer content to the helper
+        *
+        * @param       $content        Content to to the base
+        * @return      void
+        */
+       protected function addFooterContent ($content) {
+               // Add the footer content
+               $this->groups['footer']['content'] = (string) trim($content);
+       }
+
+       /**
+        * Adds content to the previously opened group or sub group. If a sub group
+        * was found it will be taken. If no group/sub group is opened at the moment
+        * the code will be passed to addContent().
+        *
+        * @param       $newContent             New content to add
+        * @return      void
+        */
+       protected final function addContentToPreviousGroup ($newContent) {
+               // Check for sub/group
+               if ($this->ifSubGroupOpenedPreviously()) {
+                       // Get sub group id
+                       $subGroupId = $this->getPreviousSubGroupId();
+
+                       // Add the content
+                       $this->subGroups[$subGroupId]['content'] .= $newContent;
+               } elseif ($this->ifGroupOpenedPreviously()) {
+                       // Get group id
+                       $groupId = $this->getPreviousGroupId();
+
+                       // Add the content
+                       $this->groups[$groupId]['content'] .= $newContent;
+               } else {
+                       // Add it directly
+                       $this->addContent($newContent);
+               }
+       }
+
+       /**
+        * Getter for content
+        *
+        * @return      $content        The rendered content by this helper
+        */
+       protected final function getContent () {
+               return $this->content;
+       }
+
+       /**
+        *  Assigns a field from the value instance with a template variable
+        *
+        * @param       $fieldName      Name of the field to assign
+        * @return      void
+        */
+       public function assignField ($fieldName) {
+               // Get the value from value instance
+               $fieldValue = $this->getValueField($fieldName);
+
+               // Assign it with a template variable
+               $this->getTemplateInstance()->assignVariable('block_' . $fieldName, $fieldValue);
+       }
+
+       /**
+        * Assigns a field from the value instance with a template variable but
+        * parses its content through a given filter method of the value instance
+        *
+        * @param       $fieldName              Name of the field to assign
+        * @param       $filterMethod   Method name to call of the value instance
+        * @return      void
+        * @todo        Rewrite this method using a helper class for filtering data
+        */
+       public function assignFieldWithFilter ($fieldName, $filterMethod) {
+               // Get the value
+               $fieldValue = $this->getValueField($fieldName);
+
+               // Now filter it through the value through the filter method
+               $filteredValue = call_user_func_array(array($this, 'doFilter' . $this->convertToClassName($filterMethod)), array($fieldValue));
+
+               // Assign it with a template variable
+               $this->getTemplateInstance()->assignVariable('block_' . $fieldName, $filteredValue);
+       }
+
+       /**
+        * Pre-fetches field default values from the given registry key instance into this class
+        *
+        * @param       $registryKey    Registry key which holds an object with values
+        * @param       $extraKey               Extra value instance key used if registryKey is null
+        * @return      void
+        * @throws      NullPointerException    If recovery of requested value instance failed
+        */
+       public function prefetchValueInstance ($registryKey, $extraKey = null) {
+               // Get the required instance
+               $this->valueInstance = Registry::getRegistry()->getInstance($registryKey);
+
+               // Is the value instance valid?
+               if (is_null($this->valueInstance)) {
+                       // Try to create it "from scratch", by first init extra instance
+                       $extraInstance = null;
+
+                       // Shall we get an extra instance?
+                       if (!is_null($extraKey)) {
+                               // Get the extra instance.
+                               $extraInstance = Registry::getRegistry()->getInstance($extraKey);
+                       } // END - if
+
+                       // Get the requested instance
+                       try {
+                               $this->valueInstance = ObjectFactory::createObjectByConfiguredName($registryKey . '_class', array($extraInstance));
+
+                       } catch (FrameworkException $e) {
+                               // Okay, nothing found so throw a null pointer exception here
+                               throw new NullPointerException($this, self::EXCEPTION_IS_NULL_POINTER);
+                       }
+               } // END - if
+       }
+
+       /**
+        * Opens a helper group with given group id and content or throws an
+        * exception if that group is already found regardless if it is open or
+        * closed.
+        *
+        * @param       $groupId        Group id to open
+        * @param       $content        Initial content to add to the group
+        * @param       $tag            HTML tag used to open this group
+        * @return      void
+        * @throws      HelperGroupAlreadyCreatedException      If the group was already created before
+        */
+       protected function openGroupByIdContent ($groupId, $content, $tag) {
+               //* DEBUG: */ echo "OPEN:groupId={$groupId},content=<pre>".htmlentities($content)."</pre>\n";
+               // Is the group already there?
+               if (isset($this->groups[$groupId])) {
+                       // Then throw an exception here
+                       throw new HelperGroupAlreadyCreatedException(array($this, $groupId), self::EXCEPTION_GROUP_ALREADY_FOUND);
+               } // END - if
+
+               // Count one up
+               $this->totalCounter++;
+
+               // Add the group to the stack
+               $this->groups[$this->totalCounter] = $groupId;
+               $this->groups[$groupId]['opened']  = true;
+               $this->groups[$groupId]['content'] = sprintf("<!-- group %s opened (length: %s, tag: %s) //-->%s\n", $groupId, strlen($content), $tag, $content);
+               $this->groups[$groupId]['tag'] = $tag;
+
+               // Mark this group as previously opened
+               $this->setPreviousGroupId($groupId);
+       }
+
+       /**
+        * Closes the previously opened group by added given content to it or
+        * throws an exception if no previous group was opened
+        *
+        * @param       $content        Content for previously opened group, or empty to use tag of opener
+        * @return      void
+        * @throws      HelperNoPreviousOpenedGroupException    If no previously opened group was found
+        */
+       public function closePreviousGroupByContent ($content = "") {
+               // Check if any sub group was opened before
+               if ($this->ifSubGroupOpenedPreviously()) {
+                       // Close it automatically
+                       $this->closePreviousSubGroupByContent();
+               } // END - if
+
+               // Check if any group was opened before
+               if ($this->ifGroupOpenedPreviously() === false) {
+                       // Then throw an exception
+                       throw new HelperNoPreviousOpenedGroupException(array($this, $content), self::EXCEPTION_NO_PREVIOUS_SUB_GROUP_OPENED);
+               } // END - if
+
+               // Get previous group
+               $groupId = $this->getPreviousGroupId();
+
+               // Is the content empty?
+               if ((empty($content)) && (!empty($this->groups[$groupId]['tag']))) {
+                       // Get it from opener
+                       $content = sprintf("<!-- group %s auto-closed //--></%s>", $groupId, $this->groups[$groupId]['tag']);
+               } // END - if
+
+               // Add content to it and mark it as closed
+               $this->groups[$groupId]['content'] .= sprintf("<!-- group %s closed (length: %s, tag: %s) //-->%s\n", $groupId, strlen($content), $this->groups[$groupId]['tag'], $content);
+               $this->groups[$groupId]['opened'] = false;
+
+               // Mark previous group as closed
+               $this->setPreviousGroupId("");
+               //* DEBUG: */ echo "CLOSE:groupId={$groupId}<br />\n";
+       }
+
+       /**
+        * Opens a helper sub group with given group id and content or throws an
+        * exception if that sub group is already found regardless if it is open or
+        * closed.
+        *
+        * @param       $subGroupId             Sub group id to open
+        * @param       $content                Initial content to add to the sub group
+        * @param       $tag                    HTML tag used to open this group
+        * @return      void
+        * @throws      HelperSubGroupAlreadyCreatedException   If the sub group was already created before
+        */
+       protected function openSubGroupByIdContent ($subGroupId, $content, $tag) {
+               //* DEBUG: */ echo "OPEN:subGroupId={$subGroupId},content=".htmlentities($content)."<br />\n";
+               // Is the group already there?
+               if (isset($this->subGroups[$subGroupId])) {
+                       // Then throw an exception here
+                       throw new HelperSubGroupAlreadyCreatedException(array($this, $subGroupId), self::EXCEPTION_SUB_GROUP_ALREADY_FOUND);
+               } // END - if
+
+               // Count one up
+               $this->totalCounter++;
+
+               // Add the group to the stack
+               $this->subGroups[$this->totalCounter] = $subGroupId;
+               $this->subGroups[$subGroupId]['opened']  = true;
+               $this->subGroups[$subGroupId]['content'] = sprintf("<!-- sub-group %s opened (length: %s, tag: %s) //-->%s\n", $subGroupId, strlen($content), $tag, $content);
+               $this->subGroups[$subGroupId]['tag'] = $tag;
+
+               // Mark this group as previously opened
+               $this->setPreviousSubGroupId($subGroupId);
+       }
+
+       /**
+        * Closes the previously opened sub group by added given content to it or
+        * throws an exception if no previous sub group was opened
+        *
+        * @param       $content        Content for previously opened sub group, or leave empty to use div/span of openener
+        * @return      void
+        * @throws      HelperNoPreviousOpenedSubGroupException If no previously opened sub group was found
+        */
+       public function closePreviousSubGroupByContent ($content = "") {
+               // Check if any sub group was opened before
+               if ($this->ifSubGroupOpenedPreviously() === false) {
+                       // Then throw an exception
+                       throw new HelperNoPreviousOpenedSubGroupException(array($this, $content), self::EXCEPTION_NO_PREVIOUS_SUB_GROUP_OPENED);
+               } // END - if
+
+               // Get previous sub group
+               $subGroupId = $this->getPreviousSubGroupId();
+
+               // Is the content empty?
+               if ((empty($content)) && (!empty($this->subGroups[$subGroupId]['tag']))) {
+                       // Get it from opener
+                       $content = sprintf("<!-- sub-group %s auto-closed //--></%s>", $subGroupId, $this->subGroups[$subGroupId]['tag']);
+               } // END - if
+
+               // Add content to it and mark it as closed
+               $this->subGroups[$subGroupId]['content'] .= sprintf("<!-- sub-group %s closed (length: %s, tag: %s) //-->%s\n", $subGroupId, strlen($content), $this->subGroups[$subGroupId]['tag'], $content);
+               $this->subGroups[$subGroupId]['opened'] = false;
+
+               // Mark previous sub group as closed
+               $this->setPreviousSubGroupId("");
+               //* DEBUG: */ echo "CLOSE:subGroupId={$subGroupId}<br />\n";
+       }
+
+       /**
+        * Renders all group and sub group in their order
+        *
+        * @return      $content        Rendered HTML content
+        */
+       public function renderContent () {
+               // Initialize content
+               $content = "";
+
+               // Is header content there?
+               if (isset($this->groups['header'])) {
+                       // Then add it
+                       $content .= $this->groups['header']['content']."\n";
+               } // END - if
+
+               // Initiate content
+               $content .= $this->getContent();
+
+               // Now "walk" through all groups and sub-groups
+               for ($idx = 1; $idx <= $this->totalCounter; $idx++) {
+                       // Is this a group and is it closed?
+                       if ((isset($this->groups[$idx])) && ($this->groups[$this->groups[$idx]]['opened'] === false)) {
+                               // Then add it's content
+                               $groupContent = trim($this->groups[$this->groups[$idx]]['content']);
+                               //* DEBUG: */ echo "group={$this->groups[$idx]},content=<pre>".htmlentities($groupContent)."</pre><br />\n";
+                               $content .= $groupContent;
+                       } elseif ((isset($this->subGroups[$idx])) && ($this->subGroups[$this->subGroups[$idx]]['opened'] === false)) {
+                               // Then add it's content
+                               $subGroupContent = $this->subGroups[$this->subGroups[$idx]]['content'];
+                               //* DEBUG: */ echo "subgroup={$this->subGroups[$idx]},content=<pre>".htmlentities($subGroupContent)."</pre><br />\n";
+                               $content .= trim($subGroupContent);
+                       } else {
+                               // Something went wrong
+                               $this->debugInstance(__METHOD__."(): Something unexpected happened here.");
+                       }
+               } // END - for
+
+               // Is footer content there?
+               if (isset($this->groups['footer'])) {
+                       // Then add it
+                       $content .= $this->groups['footer']['content']."\n";
+               } // END - if
+
+               // Return it
+               //* DEBUG: */ echo "content=<pre>".htmlentities($content)."</pre> (".strlen($content).")<br />\n";
+               return $content;
+       }
+
+       /**
+        * Checks wether the specified group is opened
+        *
+        * @param       $groupId        Id of group to check
+        * @return      $isOpened       Wether the specified group is open
+        */
+       protected function ifGroupIsOpened ($groupId) {
+               // Is the group open?
+               $isOpened = ((isset($this->groups[$groupId])) && ($this->groups[$groupId]['opened'] === true));
+
+               // Return status
+               return $isOpened;
+       }
+
+       /**
+        * Getter for direct field values
+        *
+        * @param       $fieldName              Name of the field we shall fetch
+        * @return      $fieldValue             Value from field
+        */
+       public function getValueField ($fieldName) {
+               // Get the field value
+               $fieldValue = call_user_func_array(array($this->valueInstance, 'getField'), array($fieldName));
+
+               // Return it
+               return $fieldValue;
+       }
+
+       /**
+        * Getter for value instance
+        *
+        * @return      $valueInstance  Instance of the class holding our values
+        */
+       public final function getValueInstance () {
+               return $this->valueInstance;
+       }
+
+       /**
+        * Check wether a group was opened previously
+        *
+        * @return      $groupOpened    Wether any group was opened before
+        */
+       protected final function ifGroupOpenedPreviously () {
+               $groupOpened = (!empty($this->previousGroupId));
+               return $groupOpened;
+       }
+
+       /**
+        * Check wether a group was opened previously
+        *
+        * @return      $subGroupOpened         Wether any group was opened before
+        */
+       protected final function ifSubGroupOpenedPreviously () {
+               $subGroupOpened = (!empty($this->previousSubGroupId));
+               return $subGroupOpened;
+       }
+
+       /**
+        * Getter for previous group id
+        *
+        * @return      $previousGroupId        Id of previously opened group
+        */
+       protected final function getPreviousGroupId () {
+               return $this->previousGroupId;
+       }
+
+       /**
+        * Setter for previous group id
+        *
+        * @param       $previousGroupId        Id of previously opened group
+        * @return      void
+        */
+       protected final function setPreviousGroupId ($previousGroupId) {
+               $this->previousGroupId = (string) $previousGroupId;
+       }
+
+       /**
+        * Getter for previous sub group id
+        *
+        * @return      $previousSubGroupId             Id of previously opened sub group
+        */
+       protected final function getPreviousSubGroupId () {
+               return $this->previousSubGroupId;
+       }
+
+       /**
+        * Setter for previous sub group id
+        *
+        * @param       $previousSubGroupId             Id of previously opened sub group
+        * @return      void
+        */
+       protected final function setPreviousSubGroupId ($previousSubGroupId) {
+               $this->previousSubGroupId = (string) $previousSubGroupId;
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/main/helper/login/.htaccess b/inc/classes/main/helper/login/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/inc/classes/main/helper/login/class_BaseLoginHelper.php b/inc/classes/main/helper/login/class_BaseLoginHelper.php
new file mode 100644 (file)
index 0000000..8fdd13d
--- /dev/null
@@ -0,0 +1,38 @@
+<?php
+/**
+ * A general login helper class
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class BaseLoginHelper extends BaseHelper {
+       /**
+        * Protected constructor
+        *
+        * @param       $className      Real name of the class
+        * @return      void
+        */
+       protected function __construct ($className) {
+               // Call parent constructor
+               parent::__construct($className);
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/main/helper/web/.htaccess b/inc/classes/main/helper/web/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/inc/classes/main/helper/web/blocks/.htaccess b/inc/classes/main/helper/web/blocks/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/inc/classes/main/helper/web/blocks/class_WebBlockHelper.php b/inc/classes/main/helper/web/blocks/class_WebBlockHelper.php
new file mode 100644 (file)
index 0000000..48b32d8
--- /dev/null
@@ -0,0 +1,151 @@
+<?php
+/**
+ * A helper for generating blocks (div or span) on web pages
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class WebBlockHelper extends BaseWebHelper implements HelpableTemplate {
+       /**
+        * Name of the block
+        */
+       private $blockName = "";
+
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+       }
+
+       /**
+        * Creates the helper class
+        *
+        * @param       $templateInstance       An instance of a template engine
+        * @param       $blockName                      Name of the block we shall generate
+        * @return      $helperInstance         A prepared instance of this helper
+        */
+       public final static function createWebBlockHelper (CompileableTemplate $templateInstance, $blockName) {
+               // Get new instance
+               $helperInstance = new WebBlockHelper();
+
+               // Set template instance
+               $helperInstance->setTemplateInstance($templateInstance);
+
+               // Set block name
+               $helperInstance->setBlockName($blockName);
+
+               // Return the prepared instance
+               return $helperInstance;
+       }
+
+       /**
+        * Setter for block name
+        *
+        * @param       $blockName      Name of the block we shall generate
+        * @return      void
+        */
+       protected final function setBlockName ($blockName) {
+               $this->blockName = (string) $blockName;
+       }
+
+       /**
+        * Getter for block name
+        *
+        * @return      $blockName      Name of the block we shall generate
+        */
+       public final function getBlockName () {
+               return $this->blockName;
+       }
+
+       /**
+        * Checks wether include registration date in this block
+        *
+        * @return      $withRegistration       Wether with registration date
+        */
+       public function ifIncludeRegistrationStamp () {
+               $withRegistration = ($this->getConfigInstance()->readConfig('block_shows_registration') === "Y");
+               return $withRegistration;
+       }
+
+       /**
+        * Assignes a template variable with a message from a given message id
+        *
+        * @param       $templateVariable       Template variable to assign
+        * @param       $messageId                      Message id to load an assign
+        * @return      void
+        */
+       public function assignMessageField ($templateVariable, $messageId) {
+               // Get message
+               $message = $this->getLanguageInstance()->getMessage($messageId);
+
+               // And assign it
+               $this->getTemplateInstance()->assignVariable($templateVariable, $message);
+       }
+
+       /**
+        * Assigns a link field with a given value
+        *
+        * @param       $linkField              "Link field" (variable) to assign
+        * @param       $actionValue    Action value to assign
+        * @return      void
+        */
+       public function assignLinkFieldWithAction ($linkField, $actionValue) {
+               $this->getTemplateInstance()->assignVariable($linkField . '_action', $actionValue);
+       }
+
+       /**
+        * "Filter" method for translating the raw user status into something human-readable
+        *
+        * @param       $userStatus             Raw user status from database layer
+        * @return      $translated             Translated user status
+        */
+       protected function doFilterUserStatusTranslator ($userStatus) {
+               // Generate message id
+               $messageId = 'user_status_' . strtolower($userStatus);
+
+               // Get that message
+               $translated = $this->getLanguageInstance()->getMessage($messageId);
+
+               // Return it
+               return $translated;
+       }
+
+       /**
+        * Flush the content out,e g. to a template variable
+        *
+        * @return      void
+        */
+       public function flushContent () {
+               // Get template instance
+               $templateInstance = $this->getTemplateInstance();
+
+               // Get the template named like this block
+               $templateInstance->loadCodeTemplate("block_" . $this->getBlockName());
+
+               // Transfer it to the template instance
+               $templateInstance->assignVariable($this->getBlockName(), $templateInstance->getRawTemplateData());
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/main/helper/web/class_ b/inc/classes/main/helper/web/class_
new file mode 100644 (file)
index 0000000..635066a
--- /dev/null
@@ -0,0 +1,76 @@
+<?php
+/**
+ * 
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class Web???Helper extends BaseWebHelper implements HelpableTemplate {
+       /**
+        * Name of the ???
+        */
+       private $???Name = "";
+
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+
+               // Set part description
+               $this->setObjectDescription("");
+       }
+
+       /**
+        * Creates the helper class
+        *
+        * @param       $templateInstance       An instance of a template engine
+        * @param       $???Name                        Name of the ??? we shall generate
+        * @return      $helperInstance         A prepared instance of this helper
+        */
+       public final static function createWeb???Helper (CompileableTemplate $templateInstance, $???Name) {
+               // Get new instance
+               $helperInstance = new Web???Helper();
+
+               // Set template instance
+               $helperInstance->setTemplateInstance($templateInstance);
+
+               // Set ??? name
+               $helperInstance->set???Name($???Name);
+
+               // Return the prepared instance
+               return $helperInstance;
+       }
+
+       /**
+        * Flush the content out,e g. to a template variable
+        *
+        * @return      void
+        * @todo        0% done
+        */
+       public function flushContent () {
+               $this->partialStub("Please implement this method.");
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/main/helper/web/class_BaseWebHelper.php b/inc/classes/main/helper/web/class_BaseWebHelper.php
new file mode 100644 (file)
index 0000000..0da3e0a
--- /dev/null
@@ -0,0 +1,210 @@
+<?php
+/**
+ * A general purpose web helper. You should not instance this like all the other
+ * base classes. Instead write your own web helper class and inherit this class.
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class BaseWebHelper extends BaseHelper {
+       /**
+        * Protected constructor
+        *
+        * @param       $className      The real class name
+        * @return      void
+        */
+       protected function __construct ($className) {
+               // Call parent constructor
+               parent::__construct($className);
+       }
+
+       /**
+        * Checks wether the registration requires a valid email address
+        *
+        * @return      $required       Wether the email address is required
+        */
+       public function ifRegisterRequiresEmailVerification () {
+               $required = ($this->getConfigInstance()->readConfig('register_requires_email') === "Y");
+               return $required;
+       }
+
+       /**
+        * Checks wether profile data shall be asked
+        *
+        * @return      $required       Wether profile shall be asked
+        */
+       public function ifRegisterIncludesProfile () {
+               $required = ($this->getConfigInstance()->readConfig('register_includes_profile') === "Y");
+               return $required;
+       }
+
+       /**
+        * Checks wether personal data shall be asked
+        *
+        * @return      $required       Wether personal data shall be asked
+        */
+       public function ifRegisterIncludesPersonaData () {
+               $required = ($this->getConfigInstance()->readConfig('register_personal_data') === "Y");
+               return $required;
+       }
+
+       /**
+        * Checks wether for birthday shall be asked
+        *
+        * @return      $required       Wether birthday shall be asked
+        */
+       public function ifProfileIncludesBirthDay () {
+               $required = ($this->getConfigInstance()->readConfig('profile_includes_birthday') === "Y");
+               return $required;
+       }
+
+       /**
+        * Checks wether email addresses can only be once used
+        *
+        * @return      $isUnique
+        */
+       public function ifEmailMustBeUnique () {
+               $isUnique = ($this->getConfigInstance()->readConfig('register_email_unique') === "Y");
+               return $isUnique;
+       }
+
+       /**
+        * Checks wether the specified chat protocol is enabled in this form
+        *
+        * @return      $required       Wether the specified chat protocol is enabled
+        */
+       public function ifChatEnabled ($chatProtocol) {
+               $required = ($this->getConfigInstance()->readConfig(sprintf("chat_enabled_%s", $chatProtocol)) == "Y");
+               return $required;
+       }
+
+       /**
+        * Checks wether login is enabled or disabled
+        *
+        * @return      $isEnabled      Wether the login is enabled or disabled
+        */
+       public function ifLoginIsEnabled () {
+               $isEnabled = ($this->getConfigInstance()->readConfig('login_enabled') === "Y");
+               return $isEnabled;
+       }
+
+       /**
+        * Checks wether login shall be done by username
+        *
+        * @return      $isEnabled      Wether the login shall be done by username
+        */
+       public function ifLoginWithUsername () {
+               $isEnabled = ($this->getConfigInstance()->readConfig('login_type') == "username");
+               return $isEnabled;
+       }
+
+       /**
+        * Checks wether login shall be done by email
+        *
+        * @return      $isEnabled      Wether the login shall be done by email
+        */
+       public function ifLoginWithEmail () {
+               $isEnabled = ($this->getConfigInstance()->readConfig('login_type') == "email");
+               return $isEnabled;
+       }
+
+       /**
+        * Checks wether guest login is allowed
+        *
+        * @return      $isAllowed      Wether guest login is allowed
+        */
+       public function ifGuestLoginAllowed () {
+               $isAllowed = ($this->getConfigInstance()->readConfig('guest_login_allowed') === "Y");
+               return $isAllowed;
+       }
+
+       /**
+        * Checks wether the email address change must be confirmed
+        *
+        * @return      $requireConfirm         Wether email change must be confirmed
+        */
+       public function ifEmailChangeRequireConfirmation () {
+               $requireConfirm = ($this->getConfigInstance()->readConfig('email_change_confirmation') === "Y");
+               return $requireConfirm;
+       }
+
+       /**
+        * Checks wether the rules has been updated
+        *
+        * @return      $rulesUpdated   Wether rules has been updated
+        * @todo        Implement check if rules have been changed
+        */
+       public function ifRulesHaveChanged () {
+               return false;
+       }
+
+       /**
+        * Checks wether email change is allowed
+        *
+        * @return      $emailChange    Wether changing email address is allowed
+        */
+       public function ifEmailChangeAllowed () {
+               $emailChange = ($this->getConfigInstance()->readConfig('email_change_allowed') === "Y");
+               return $emailChange;
+       }
+
+       /**
+        * Checks wether the user account is unconfirmed
+        *
+        * @return      $isUnconfirmed  Wether the user account is unconfirmed
+        */
+       public function ifUserAccountUnconfirmed () {
+               $isUnconfirmed = ($this->getValueField(UserDatabaseWrapper::DB_COLUMN_USER_STATUS) === $this->getConfigInstance()->readConfig('user_status_unconfirmed'));
+               return $isUnconfirmed;
+       }
+
+       /**
+        * Checks wether the user account is locked
+        *
+        * @return      $isUnconfirmed  Wether the user account is locked
+        */
+       public function ifUserAccountLocked () {
+               $isUnconfirmed = ($this->getValueField(UserDatabaseWrapper::DB_COLUMN_USER_STATUS) === $this->getConfigInstance()->readConfig('user_status_locked'));
+               return $isUnconfirmed;
+       }
+
+       /**
+        * Checks wether the user account is a guest
+        *
+        * @return      $isUnconfirmed  Wether the user account is a guest
+        */
+       public function ifUserAccountGuest () {
+               $isUnconfirmed = ($this->getValueField(UserDatabaseWrapper::DB_COLUMN_USER_STATUS) === $this->getConfigInstance()->readConfig('user_status_guest'));
+               return $isUnconfirmed;
+       }
+
+       /**
+        * Checks wether the refill page is active which should be not the default
+        * on non-web applications.
+        *
+        * @return      $refillActive   Wether the refill page is active
+        */
+       public function ifRefillPageActive () {
+               $refillActive = ($this->getConfigInstance()->readConfig('refill_page_active') === "Y");
+               return $refillActive;
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/main/helper/web/forms/.htaccess b/inc/classes/main/helper/web/forms/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/inc/classes/main/helper/web/forms/class_WebFormHelper.php b/inc/classes/main/helper/web/forms/class_WebFormHelper.php
new file mode 100644 (file)
index 0000000..1fffb7a
--- /dev/null
@@ -0,0 +1,779 @@
+<?php
+/**
+ * A helper for constructing web forms
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class WebFormHelper extends BaseWebHelper implements HelpableTemplate {
+       /**
+        * Wether the form tag is opened (keep at false or else your forms will
+        * never work!)
+        */
+       private $formOpened = false;
+
+       /**
+        * Name of the form
+        */
+       private $formName = "";
+
+       /**
+        * Wether form tag is enabled (default: true)
+        */
+       private $formEnabled = true;
+
+       // Class Constants
+       const EXCEPTION_FORM_NAME_INVALID       = 0x120;
+       const EXCEPTION_CLOSED_FORM             = 0x121;
+       const EXCEPTION_OPENED_FORM             = 0x122;
+       const EXCEPTION_UNEXPECTED_CLOSED_GROUP = 0x123;
+
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+       }
+
+       /**
+        * Creates the helper class with the given template engine instance and form name
+        *
+        * @param       $templateInstance       An instance of a valid template engine
+        * @param       $formName                       Name of the form
+        * @param       $formId                         Value for "id" attribute (default: $formName)
+        * @param       $withForm                       Wether include the form tag
+        * @return      $helperInstance         A preparedf instance of this helper
+        */
+       public final static function createWebFormHelper (CompileableTemplate $templateInstance, $formName, $formId = false, $withForm = true) {
+               // Get new instance
+               $helperInstance = new WebFormHelper();
+
+               // Set template instance
+               $helperInstance->setTemplateInstance($templateInstance);
+
+               // Is the form id not set?
+               if ($formId === false) {
+                       // Use form id from form name
+                       $formId = $formName;
+               } // END - if
+
+               // Set form name
+               $helperInstance->setFormName($formName);
+
+               // A form-less field may say "false" here...
+               if ($withForm === true) {
+                       // Create the form
+                       $helperInstance->addFormTag($formName, $formId);
+               } else {
+                       // Disable form
+                       $helperInstance->enableForm(false);
+               }
+
+               // Return the prepared instance
+               return $helperInstance;
+       }
+
+       /**
+        * Add the form tag or close it an already opened form tag
+        *
+        * @param       $formName       Name of the form (default: false)
+        * @param       $formId         Id of the form (attribute "id"; default: false)
+        * @return      void
+        * @throws      InvalidFormNameException        If the form name is invalid (=false)
+        * @todo        Add some unique PIN here to bypass problems with some browser and/or extensions
+        */
+       public function addFormTag ($formName = false, $formId = false) {
+               // When the form is not yet opened at least form name must be valid
+               if (($this->formOpened === false) && ($formName === false)) {
+                       // Thrown an exception
+                       throw new InvalidFormNameException ($this, self::EXCEPTION_FORM_NAME_INVALID);
+               } // END - if
+
+               // Close the form is default
+               $formContent = "</form>";
+
+               // Check wether we shall open or close the form
+               if (($this->formOpened === false) && ($this->formEnabled === true)) {
+                       // Add HTML code
+                       $formContent = sprintf("<form name=\"%s\" class=\"forms\" action=\"%s/%s\" method=\"%s\" target=\"%s\"",
+                               $formName,
+                               $this->getConfigInstance()->readConfig('base_url'),
+                               $this->getConfigInstance()->readConfig('form_action'),
+                               $this->getConfigInstance()->readConfig('form_method'),
+                               $this->getConfigInstance()->readConfig('form_target')
+                       );
+
+                       // Add form id as well
+                       $formContent .= sprintf(" id=\"%s_form\"",
+                               $formId
+                       );
+
+                       // Add close bracket
+                       $formContent .= ">";
+
+                       // Open the form and remeber the form name
+                       $this->formOpened = true;
+
+                       // Add it to the content
+                       $this->addHeaderContent($formContent);
+               } else {
+                       // Add the hidden field required to identify safely this form
+                       $this->addInputHiddenField('form', $this->getFormName());
+
+                       // Is a group open?
+                       if ($this->ifGroupOpenedPreviously()) {
+                               // Then automatically close it here
+                               $this->addFormGroup();
+                       } // END - if
+
+                       // Simply close it
+                       $this->formOpened = false;
+
+                       // Add it to the content
+                       $this->addFooterContent($formContent);
+               }
+       }
+
+       /**
+        * Add a text input tag to the form or throw an exception if it is not yet
+        * opened. The field's name will be set as id.
+        *
+        * @param       $fieldName              Input field name
+        * @param       $fieldValue             Input default value (default: empty)
+        * @return      void
+        * @throws      FormClosedException             If the form is not yet opened
+        */
+       public function addInputTextField ($fieldName, $fieldValue = "") {
+               // Is the form opened?
+               if (($this->formOpened === false) && ($this->formEnabled === true)) {
+                       // Throw an exception
+                       throw new FormClosedException (array($this, $fieldName), self::EXCEPTION_CLOSED_FORM);
+               } // END - if
+
+               // Generate the content
+               $inputContent = sprintf("<input type=\"text\" class=\"textfield %s_field\" name=\"%s\" value=\"%s\" />",
+                       $fieldName,
+                       $fieldName,
+                       $fieldValue
+               );
+
+               // And add it maybe with a "li" tag
+               $this->addContentToPreviousGroup($inputContent);
+       }
+
+       /**
+        * Add a text input tag to the form with pre-loaded default value
+        *
+        * @param       $fieldName      Input field name
+        * @return      void
+        */
+       public function addInputTextFieldWithDefault ($fieldName) {
+               // Get the value from instance
+               $fieldValue = $this->getValueField($fieldName);
+               //* DEBUG: */ echo __METHOD__.":".$fieldName."=".$fieldValue."<br />\n";
+
+               // Add the text field
+               $this->addInputTextField($fieldName, $fieldValue);
+       }
+
+       /**
+        * Add a password input tag to the form or throw an exception if it is not
+        * yet opened. The field's name will be set as id.
+        *
+        * @param       $fieldName              Input field name
+        * @param       $fieldValue             Input default value (default: empty)
+        * @return      void
+        * @throws      FormClosedException             If the form is not yet opened
+        */
+       public function addInputPasswordField ($fieldName, $fieldValue = "") {
+               // Is the form opened?
+               if (($this->formOpened === false) && ($this->formEnabled === true)) {
+                       // Throw an exception
+                       throw new FormClosedException (array($this, $fieldName), self::EXCEPTION_CLOSED_FORM);
+               } // END - if
+
+               // Generate the content
+               $inputContent = sprintf("<input type=\"password\" class=\"password %s_field\" name=\"%s\" value=\"%s\" />",
+                       $fieldName,
+                       $fieldName,
+                       $fieldValue
+               );
+
+               // And add it
+               $this->addContentToPreviousGroup($inputContent);
+       }
+
+       /**
+        * Add a hidden input tag to the form or throw an exception if it is not
+        * yet opened. The field's name will be set as id.
+        *
+        * @param       $fieldName              Input field name
+        * @param       $fieldValue             Input default value (default: empty)
+        * @return      void
+        * @throws      FormClosedException             If the form is not yet opened
+        */
+       public function addInputHiddenField ($fieldName, $fieldValue = "") {
+               // Is the form opened?
+               if (($this->formOpened === false) && ($this->formEnabled === true)) {
+                       // Throw an exception
+                       throw new FormClosedException (array($this, $fieldName), self::EXCEPTION_CLOSED_FORM);
+               } // END - if
+
+               // Generate the content
+               $inputContent = sprintf("<input type=\"hidden\" name=\"%s\" value=\"%s\" />",
+                       $fieldName,
+                       $fieldValue
+               );
+
+               // And add it
+               $this->addContentToPreviousGroup($inputContent);
+       }
+
+       /**
+        * Add a hidden input tag to the form with pre-loaded default value
+        *
+        * @param       $fieldName      Input field name
+        * @return      void
+        */
+       public function addInputHiddenFieldWithDefault ($fieldName) {
+               // Get the value from instance
+               $fieldValue = $this->getValueField($fieldName);
+               //* DEBUG: */ echo __METHOD__.":".$fieldName."=".$fieldValue."<br />\n";
+
+               // Add the text field
+               $this->addInputHiddenField($fieldName, $fieldValue);
+       }
+
+       /**
+        * Add a hidden input tag to the form with configuration value
+        *
+        * @param       $fieldName      Input field name
+        * @param       $prefix         Prefix for configuration without trailing _
+        * @return      void
+        */
+       public function addInputHiddenConfiguredField ($fieldName, $prefix) {
+               // Get the value from instance
+               $fieldValue = $this->getConfigInstance()->readConfig("{$prefix}_{$fieldName}");
+               //* DEBUG: */ echo __METHOD__.":".$fieldName."=".$fieldValue."<br />\n";
+
+               // Add the text field
+               $this->addInputHiddenField($fieldName, $fieldValue);
+       }
+
+       /**
+        * Add a checkbox input tag to the form or throw an exception if it is not
+        * yet opened. The field's name will be set as id.
+        *
+        * @param       $fieldName              Input field name
+        * @param       $fieldChecked   Wether the field is checked (defaut: checked)
+        * @return      void
+        * @throws      FormClosedException             If the form is not yet opened
+        */
+       public function addInputCheckboxField ($fieldName, $fieldChecked = true) {
+               // Is the form opened?
+               if (($this->formOpened === false) && ($this->formEnabled === true)) {
+                       // Throw an exception
+                       throw new FormClosedException (array($this, $fieldName), self::EXCEPTION_CLOSED_FORM);
+               } // END - if
+
+               // Set wether the check box is checked...
+               $checked = " checked=\"checked\"";
+               if ($fieldChecked === false) $checked = " ";
+
+               // Generate the content
+               $inputContent = sprintf("<input type=\"checkbox\" name=\"%s\" class=\"checkbox %s_field\" value=\"1\"%s/>",
+                       $fieldName,
+                       $fieldName,
+                       $checked
+               );
+
+               // And add it
+               $this->addContentToPreviousGroup($inputContent);
+       }
+
+       /**
+        * Add a reset input tag to the form or throw an exception if it is not
+        * yet opened. The field's name will be set as id.
+        *
+        * @param       $buttonText             Text displayed on the button
+        * @return      void
+        * @throws      FormClosedException             If the form is not yet opened
+        */
+       public function addInputResetButton ($buttonText) {
+               // Is the form opened?
+               if (($this->formOpened === false) && ($this->formEnabled === true)) {
+                       // Throw an exception
+                       throw new FormClosedException (array($this, "reset"), self::EXCEPTION_CLOSED_FORM);
+               } // END - if
+
+               // Generate the content
+               $inputContent = sprintf("<input type=\"reset\" class=\"reset_button\" id=\"%s_reset\" value=\"%s\" />",
+                       $this->getFormName(),
+                       $buttonText
+               );
+
+               // And add it
+               $this->addContentToPreviousGroup($inputContent);
+       }
+
+       /**
+        * Add a reset input tag to the form or throw an exception if it is not
+        * yet opened. The field's name will be set as id.
+        *
+        * @param       $buttonText             Text displayed on the button
+        * @return      void
+        * @throws      FormClosedException             If the form is not yet opened
+        */
+       public function addInputSubmitButton ($buttonText) {
+               // Is the form opened?
+               if (($this->formOpened === false) && ($this->formEnabled === true)) {
+                       // Throw an exception
+                       throw new FormClosedException (array($this, "submit"), self::EXCEPTION_CLOSED_FORM);
+               } // END - if
+
+               // Generate the content
+               $inputContent = sprintf("<input type=\"submit\" class=\"submit_button\" id=\"%s_submit\" name=\"%s_button\" value=\"%s\" />",
+                       $this->getFormName(),
+                       $this->getFormName(),
+                       $buttonText
+               );
+
+               // And add it
+               $this->addContentToPreviousGroup($inputContent);
+       }
+
+       /**
+        * Add a form group or close an already opened and open a new one
+        *
+        * @param       $groupId        Name of the group or last opened if empty
+        * @param       $groupText      Text including HTML to show above this group
+        * @return      void
+        * @throws      FormClosedException             If no form has been opened before
+        * @throws      EmptyVariableException  If $groupId is not set
+        */
+       public function addFormGroup ($groupId = "", $groupText = "") {
+               // Is a form opened?
+               if (($this->formOpened === false) && ($this->formEnabled === true)) {
+                       // Throw exception here
+                       throw new FormClosedException(array($this, $groupId), self::EXCEPTION_CLOSED_FORM);
+               } // END - if
+
+               // At least the group name should be set
+               if ((empty($groupId)) && ($this->ifGroupOpenedPreviously() === false)) {
+                       // Throw exception here
+                       throw new EmptyVariableException(array($this, 'groupId'), self::EXCEPTION_UNEXPECTED_EMPTY_STRING);
+               } elseif (empty($groupId)) {
+                       // Close the last opened
+                       $groupId = $this->getPreviousGroupId();
+               }
+
+               // Same group to open?
+               if (($this->ifGroupOpenedPreviously() === false) && ($groupId === $this->getPreviousGroupId())) {
+                       // Abort here silently
+                       return false;
+               } // END - if
+
+               // Initialize content with closing div by default
+               $content = "    </div>\n</div><!-- Group - CLOSE //-->";
+
+               // Is this group opened?
+               if ($this->ifGroupOpenedPreviously() === false) {
+                       // Begin the div/span blocks
+                       $content = sprintf("<!-- Group %s - OPEN //-->
+<div class=\"group_box\" id=\"%s_group_box\">
+       <span class=\"group_text\" id=\"%s_group_text\">
+               %s
+       </span>
+       <div class=\"group_field\" id=\"%s_group_field\">",
+                               $groupId,
+                               $groupId,
+                               $groupId,
+                               $groupText,
+                               $groupId
+                       );
+
+                       // Switch the state
+                       $this->openGroupByIdContent($groupId, $content, "div");
+               } else {
+                       // Is a sub group opened?
+                       if ($this->ifSubGroupOpenedPreviously()) {
+                               // Close it here
+                               $this->addFormSubGroup();
+                       } // END - if
+
+                       // Get previous group id
+                       $prevGroupId = $this->getPreviousGroupId();
+
+                       // Switch the state
+                       $this->closePreviousGroupByContent($content);
+
+                       // All call it again if group name is not empty
+                       if ((!empty($groupId)) && ($groupId != $prevGroupId)) {
+                               //* DEBUG: */ echo $groupId."/".$prevGroupId."<br />\n";
+                               $this->addFormGroup($groupId, $groupText);
+                       } // END - if
+               }
+       }
+
+       /**
+        * Add a form sub group or close an already opened and open a new one or
+        * throws an exception if no group has been opened before or if sub group
+        * name is empty.
+        *
+        * @param       $subGroupId             Name of the group or last opened if empty
+        * @param       $subGroupText   Text including HTML to show above this group
+        * @return      void
+        * @throws      FormFormClosedException         If no group has been opened before
+        * @throws      EmptyVariableException          If $subGroupId is not set
+        */
+       public function addFormSubGroup ($subGroupId = "", $subGroupText = "") {
+               // Is a group opened?
+               if ($this->ifGroupOpenedPreviously() === false) {
+                       // Throw exception here
+                       throw new FormFormClosedException(array($this, $subGroupId), self::EXCEPTION_UNEXPECTED_CLOSED_GROUP);
+               } // END - if
+
+               // At least the sub group name should be set
+               if ((empty($subGroupId)) && ($this->ifSubGroupOpenedPreviously() === false)) {
+                       // Throw exception here
+                       throw new EmptyVariableException(array($this, 'subGroupId'), self::EXCEPTION_UNEXPECTED_EMPTY_STRING);
+               } elseif (empty($subGroupId)) {
+                       // Close the last opened
+                       $subGroupId = $this->getPreviousSubGroupId();
+               }
+
+               // Same sub group to open?
+               if (($this->ifSubGroupOpenedPreviously() === false) && ($subGroupId == $this->getPreviousSubGroupId())) {
+                       // Abort here silently
+                       return false;
+               } // END - if
+
+               // Initialize content with closing div by default
+               $content = "    </div>\n</div><!-- Sub group- CLOSE //-->";
+
+               // Is this group opened?
+               if ($this->ifSubGroupOpenedPreviously() === false) {
+                       // Begin the span block
+                       $content = sprintf("<!-- Sub group %s - OPEN //-->
+<div class=\"subgroup_box\" id=\"%s_subgroup_box\">
+       <span class=\"subgroup_text\" id=\"%s_subgroup_text\">
+               %s
+       </span>
+       <div class=\"subgroup_field\" id=\"%s_subgroup_field\">",
+                               $subGroupId,
+                               $subGroupId,
+                               $subGroupId,
+                               $subGroupText,
+                               $subGroupId
+                       );
+
+                       // Switch the state and remeber the name
+                       $this->openSubGroupByIdContent($subGroupId, $content, "div");
+               } else {
+                       // Get previous sub group id
+                       $prevSubGroupId = $this->getPreviousSubGroupId();
+
+                       // Switch the state
+                       $this->closePreviousSubGroupByContent($content);
+
+                       // All call it again if sub group name is not empty
+                       if ((!empty($subGroupId)) && ($subGroupId != $prevSubGroupId)) {
+                               $this->addFormSubGroup($subGroupId, $subGroupText);
+                       } // END - if
+               }
+       }
+
+       /**
+        * Add text surrounded by a span block when there is a group opened before
+        * or else by a div block.
+        *
+        * @param       $fieldName                      Field name
+        * @param       $fieldText                      Text for the field
+        * @return      void
+        * @throws      FormClosedException             If the form is not yet opened
+        */
+       public function addFieldText ($fieldName, $fieldText) {
+               // Is the form opened?
+               if (($this->formOpened === false) && ($this->formEnabled === true)) {
+                       // Throw an exception
+                       throw new FormClosedException (array($this, $fieldName), self::EXCEPTION_CLOSED_FORM);
+               } // END - if
+
+               // Set the block type
+               $block = "div";
+               if ($this->ifGroupOpenedPreviously()) $block = "span";
+
+               // Generate the content
+               $inputContent = sprintf("       <%s id=\"%s_text\">
+               %s
+       </%s>",
+                       $block,
+                       $fieldName,
+                       $fieldText,
+                       $block
+               );
+
+               // And add it
+               $this->addContentToPreviousGroup($inputContent);
+       }
+
+       /**
+        * Add text (notes) surrounded by a div block. Still opened groups or sub
+        * groups will be automatically closed.
+        *
+        * @param       $noteId         Id for this note
+        * @param       $formNotes      The form notes we shell addd
+        * @return      void
+        * @throws      FormClosedException             If the form is not yet opened
+        */
+       public function addFormNote ($noteId, $formNotes) {
+               // Is the form opened?
+               if (($this->formOpened === false) && ($this->formEnabled === true)) {
+                       // Throw an exception
+                       throw new FormClosedException (array($this, "form_notes"), self::EXCEPTION_CLOSED_FORM);
+               } // END - if
+
+               // Generate the content
+               $inputContent = sprintf("       <div id=\"form_note_%s\">
+               %s
+       </div>",
+                       $noteId,
+                       $formNotes
+               );
+
+               // And add it
+               $this->addContentToPreviousGroup($inputContent);
+       }
+
+       /**
+        * Adds a selection box as a sub group to the form. Do not box this into
+        * another sub group. Sub-sub groups are not (yet) supported.
+        *
+        * @param       $selectId               Id of the selection box
+        * @param       $firstEntry             Content to be added as first non-selectable entry
+        * @return      void
+        * @throws      FormClosedException             If the form is not yet opened
+        */
+       public function addInputSelectField ($selectId, $firstEntry) {
+               // Is the form group opened?
+               if (($this->formOpened === false) && ($this->formEnabled === true)) {
+                       // Throw an exception
+                       throw new FormClosedException (array($this, "form_notes"), self::EXCEPTION_CLOSED_FORM);
+               } // END - if
+
+               // Shall we close or open the sub group?
+               if (($this->ifSubGroupOpenedPreviously() === false) && ($this->getPreviousSubGroupId() !== $selectId)) {
+                       // Initialize first entry (which might be non-selectable if content is provided
+                       if (!empty($firstEntry)) {
+                               // Add selection around it
+                               $firstEntry = sprintf("<option value=\"invalid\" disabled=\"disabled\">%s</option>\n",
+                                       $firstEntry
+                               );
+                       } // END - if
+
+                       // Construct the opening select tag
+                       $content = sprintf("<select class=\"select_box\" id=\"%s_%s\" name=\"%s\">\n%s",
+                               $this->getFormName(),
+                               $selectId,
+                               $selectId,
+                               $firstEntry
+                       );
+
+                       // Open the sub group
+                       $this->openSubGroupByIdContent($selectId, $content, "select");
+               } elseif ($this->getPreviousSubGroupId() != $selectId) {
+                       // Something went wrong!
+                       $this->debugInstance(__METHOD__."(): Previous sub group id {$this->getPreviousSubGroupId()} does not match current id {$selectId}.");
+               } else {
+                       // Close the sub group
+                       $this->closePreviousSubGroupByContent("</select>");
+               }
+       }
+
+       /**
+        * Adds a non-selectable sub option to a previously added selection box.
+        * This method does *not* validate if there is already a sub option added
+        * with the same name. We need to finish this here!
+        *
+        * @param       $subName        Name of the sub action
+        * @param       $subValue       Value of the sub action
+        * @return      void
+        * @throws      HelperNoPreviousOpenedSubGroupException If no previously opened sub group was found
+        * @todo        Add checking if sub option is already added
+        */
+       public function addSelectSubOption ($subName, $subValue) {
+               // Is there a sub group (shall be a selection box!)
+               if ($this->ifSubGroupOpenedPreviously() === false) {
+                       // Then throw an exception here
+                       throw new HelperNoPreviousOpenedSubGroupException(array($this, $content), self::EXCEPTION_NO_PREVIOUS_SUB_GROUP_OPENED);
+               } // END - if
+
+               // Render the content
+               $content = sprintf("<option value=\"invalid\" class=\"suboption suboption_%s\" disabled=\"disabled\">%s</option>\n",
+                       $subName,
+                       $subValue
+               );
+
+               // Add the content to the previously opened sub group
+               $this->addContentToPreviousGroup($content);
+       }
+
+       /**
+        * Adds a selectable option to a previously added selection box. This method
+        * does *not* validate if there is already a sub option added with the same
+        * name. We need to finish this here!
+        *
+        * @param       $optionName     Name of the sub action
+        * @param       $optionValue    Value of the sub action
+        * @return      void
+        * @throws      HelperNoPreviousOpenedSubGroupException If no previously opened sub group was found
+        * @todo        Add checking if sub option is already added
+        */
+       public function addSelectOption ($optionName, $optionValue) {
+               // Is there a sub group (shall be a selection box!)
+               if ($this->ifSubGroupOpenedPreviously() === false) {
+                       // Then throw an exception here
+                       throw new HelperNoPreviousOpenedSubGroupException(array($this, $content), self::EXCEPTION_NO_PREVIOUS_SUB_GROUP_OPENED);
+               } // END - if
+
+               // Render the content
+               $content = sprintf("<option value=\"%s\" class=\"option option_%s\">%s</option>\n",
+                       $optionName,
+                       $optionName,
+                       $optionValue
+               );
+
+               // Add the content to the previously opened sub group
+               $this->addContentToPreviousGroup($content);
+       }
+
+       /**
+        * Adds a pre-configured CAPTCHA
+        *
+        * @return      void
+        */
+       public function addCaptcha () {
+               // Get last executed pre filter
+               $extraInstance = Registry::getRegistry()->getInstance('extra');
+
+               // Get a configured instance
+               $captchaInstance = ObjectFactory::createObjectByConfiguredName($this->getFormName().'_captcha', array($this, $extraInstance));
+
+               // Initiate the CAPTCHA
+               $captchaInstance->initiateCaptcha();
+
+               // Render the CAPTCHA code
+               $captchaInstance->renderCode();
+
+               // Get the content and add it to the helper
+               $this->addContentToPreviousGroup($captchaInstance->renderContent());
+       }
+
+       /**
+        * Enables/disables the form tag usage
+        *
+        * @param       $formEnabled    Wether form is enabled or disabled
+        * @return      void
+        */
+       public final function enableForm ($formEnabled = true) {
+               $this->formEnabled = (bool) $formEnabled;
+       }
+
+       /**
+        * Setter for form name
+        *
+        * @param       $formName       Name of this form
+        * @return      void
+        */
+       public final function setFormName ($formName) {
+               $this->formName = (string) $formName;
+       }
+
+       /**
+        * Getter for form name
+        *
+        * @return      $formName       Name of this form
+        */
+       public final function getFormName () {
+               return $this->formName;
+       }
+
+       /**
+        * Checks wether the registration requires a valid email address
+        *
+        * @return      $required       Wether the email address is required
+        */
+       public function ifRegisterRequiresEmailVerification () {
+               $required = ($this->getConfigInstance()->readConfig('register_requires_email') === "Y");
+               return $required;
+       }
+
+       /**
+        * Checks wether profile data shall be asked
+        *
+        * @return      $required       Wether profile data shall be asked
+        */
+       public function ifRegisterIncludesProfile () {
+               $required = ($this->getConfigInstance()->readConfig('register_includes_profile') === "Y");
+               return $required;
+       }
+
+       /**
+        * Checks wether this form is secured by a CAPTCHA
+        *
+        * @return      $isSecured      Wether this form is secured by a CAPTCHA
+        */
+       public function ifFormSecuredWithCaptcha () {
+               $isSecured = ($this->getConfigInstance()->readConfig($this->getFormName().'_captcha_secured') === "Y");
+               return $isSecured;
+       }
+
+       /**
+        * Flushs the content out (not yet secured against open forms, etc.!) or
+        * close the form automatically
+        *
+        * @return      void
+        * @throws      FormOpenedException             If the form is still open
+        */
+       public function flushContent () {
+               // Is the form still open?
+               if (($this->formOpened === true) && ($this->formEnabled === true)) {
+                       // Close the form automatically
+                       $this->addFormTag();
+               } elseif ($this->formEnabled === false) {
+                       if ($this->ifSubGroupOpenedPreviously()) {
+                               // Close sub group
+                               $this->addFormSubGroup();
+                       } elseif ($this->ifGroupOpenedPreviously()) {
+                               // Close group
+                               $this->addFormGroup();
+                       }
+               }
+
+               // Send content to template engine
+               //* DEBUG: */ echo __METHOD__.": form=".$this->getFormName().", size=".strlen($this->renderContent())."<br />\n";
+               $this->getTemplateInstance()->assignVariable($this->getFormName(), $this->renderContent());
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/main/helper/web/links/.htaccess b/inc/classes/main/helper/web/links/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/inc/classes/main/helper/web/links/class_WebLinkHelper.php b/inc/classes/main/helper/web/links/class_WebLinkHelper.php
new file mode 100644 (file)
index 0000000..1a238a6
--- /dev/null
@@ -0,0 +1,289 @@
+<?php
+/**
+ * A helper for web links
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class WebLinkHelper extends BaseWebHelper implements HelpableTemplate {
+       /**
+        * Name of the link
+        */
+       private $linkName = "";
+
+       /**
+        * Base of the link
+        */
+       private $linkBase = "";
+
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+       }
+
+       /**
+        * Creates the helper class
+        *
+        * @param       $templateInstance       An instance of a template engine
+        * @param       $linkName                       Name of the link we shall generate
+        * @param       $linkBase                       Link base for all generated links
+        * @return      $helperInstance         A prepared instance of this helper
+        */
+       public final static function createWebLinkHelper (CompileableTemplate $templateInstance, $linkName, $linkBase) {
+               // Get new instance
+               $helperInstance = new WebLinkHelper();
+
+               // Set template instance
+               $helperInstance->setTemplateInstance($templateInstance);
+
+               // Set link name
+               $helperInstance->setLinkName($linkName);
+
+               // Set link base
+               $helperInstance->setLinkBase($linkBase);
+
+               // Add default group
+               $helperInstance->openGroupByIdContent('main', "", "");
+
+               // Return the prepared instance
+               return $helperInstance;
+       }
+
+       /**
+        * Renders the link content (HTML code) with given link text and optional
+        * extra content
+        *
+        * @param       $linkText               Link text to set in link
+        * @param       $extraContent   Optional extra HTML content
+        * @return      $linkContent    Rendered text link content
+        */
+       private function renderLinkContentWithTextExtraContent ($linkText, $extraContent="") {
+               // Construct link content
+               $linkContent = sprintf("<a href=\"%s%s\" title=\"%s\">%s</a>",
+                       $this->getLinkBase(),
+                       $extraContent,
+                       $linkText,
+                       $linkText
+               );
+
+               // Return it
+               return $linkContent;
+       }
+
+       /**
+        * Setter for link name
+        *
+        * @param       $linkName       Name of the link we shall generate
+        * @return      void
+        */
+       protected final function setLinkName ($linkName) {
+               $this->linkName = (string) $linkName;
+       }
+
+       /**
+        * Getter for link name
+        *
+        * @return      $linkName       Name of the link we shall generate
+        */
+       public final function getLinkName () {
+               return $this->linkName;
+       }
+
+       /**
+        * Setter for link base
+        *
+        * @param       $linkBase       Base of the link we shall generate
+        * @return      void
+        */
+       protected final function setLinkBase ($linkBase) {
+               $this->linkBase = (string) $linkBase;
+       }
+
+       /**
+        * Getter for link base
+        *
+        * @return      $linkBase       Base of the link we shall generate
+        */
+       public final function getLinkBase () {
+               return $this->linkBase;
+       }
+
+       /**
+        * Flush the content out,e g. to a template variable
+        *
+        * @return      void
+        * @todo        Completely unimplemented
+        */
+       public function flushContent () {
+               // Is a previous opened group still open?
+               if ($this->ifGroupOpenedPreviously()) {
+                       // Then close it
+                       $this->closePreviousGroupByContent("");
+               } // END - if
+
+               // Get the content
+               $content = $this->renderContent();
+
+               // Get template engine
+               $templateInstance = $this->getTemplateInstance();
+
+               // Add content to variable
+               $templateInstance->assignVariable($this->getLinkName(), $content);
+       }
+
+       /**
+        * Adds a link group (like the form group is) with some raw language to the
+        * helper.
+        *
+        * @param       $groupId        Id string of the group
+        * @param       $groupText      Text for this group to add
+        * @param       $groupCode      Code to open and close groups
+        * @return      void
+        */
+       public function addLinkGroup ($groupId, $groupText, $groupCode = "div") {
+               // Is a group with that name open?
+               if ($this->ifGroupOpenedPreviously()) {
+                       // Then close it here
+                       $this->closePreviousGroupByContent("");
+               } // END - if
+
+               // Generate the group content
+               $content = sprintf("<{$groupCode} id=\"group_%s_%s\">%s",
+                       $this->getLinkName(),
+                       $groupId,
+                       $groupText
+               );
+
+               // Open the new group
+               $this->openGroupByIdContent($groupId, $content, $groupCode);
+       }
+
+       /**
+        * Adds text (note) to the previously opened group or throws an exception
+        * if no previous group was opened.
+        *
+        * @param       $groupId        Group id to set
+        * @param       $groupNote      Note to be added to a group
+        * @param       $groupCode      Code to open and close groups
+        * @return      void
+        * @throws      NoGroupOpenedException  If no previous group was opened
+        */
+       public function addLinkNote ($groupId, $groupNote, $groupCode = "div") {
+               // Check if a previous group was opened
+               if ($this->ifGroupOpenedPreviously() === false) {
+                       // No group was opened before!
+                       throw new NoGroupOpenedException(array($this, $groupNote), self::EXCEPTION_GROUP_NOT_OPENED);
+               } // END - if
+
+               // Is a previous sub group open?
+               if ($this->ifSubGroupOpenedPreviously()) {
+                       // Then close it
+                       $this->closePreviousSubGroupByContent("</{$groupCode}>");
+               } // END - if
+
+               // Generate the group content
+               $content = sprintf("<{$groupCode} id=\"subgroup_%s_%s\">%s",
+                       $this->getLinkName(),
+                       $groupId,
+                       $groupNote
+               );
+
+               // Open the sub group
+               $this->openSubGroupByIdContent($groupId, $content, $groupCode);
+       }
+
+       /**
+        * Adds a link to the previously opened group or throws an exception if no group has been opened
+        *
+        * @param       $linkAction             Action (action=xxx) value for the link
+        * @param       $linkText               Link text and title (title="xxx") for the link
+        * @return      void
+        * @throws      NoGroupOpenedException  If no previous group was opened
+        */
+       public function addActionLink ($linkAction, $linkText) {
+               // Check if a previous group was opened
+               if ($this->ifGroupOpenedPreviously() === false) {
+                       // No group was opened before!
+                       throw new NoGroupOpenedException(array($this, $linkAction."(".$linkText.")"), self::EXCEPTION_GROUP_NOT_OPENED);
+               } // END - if
+
+               // Default parameter seperator is &amp;
+               $seperator = "&amp;";
+
+               // Is there a question mark in?
+               $linkArray = explode("?", $this->getLinkBase());
+               if (count($linkArray) == 0) {
+                       // No question mark
+                       $seperator = "?";
+               } // END - if
+
+               // Prepare action
+               $action = sprintf("%saction=%s",
+                       $seperator,
+                       $linkAction
+               );
+
+               // Renders the link content
+               $linkContent = $this->renderLinkContentWithTextExtraContent($linkText, $action);
+
+               // Add the content to the previous group
+               $this->addContentToPreviousGroup($linkContent);
+       }
+
+       /**
+        * Adds a link to the previously opened group with a text from language system
+        *
+        * @param       $linkAction             Action (action=xxx) value for the link
+        * @param       $languageId             Language id string to use
+        * @return      void
+        */
+       public function addActionLinkById ($linkAction, $languageId) {
+               // Resolve the language string
+               $languageResolved = $this->getLanguageInstance()->getMessage($languageId);
+
+               // Add the action link
+               $this->addActionLink($linkAction, $languageResolved);
+       }
+
+       /**
+        * Adds a default link (no extra parameters) to the content with specified
+        * language id string.
+        *
+        * @param       $languageId             Language id string to use
+        * @return      void
+        */
+       public function addLinkWithTextById ($languageId) {
+               // Resolve the language string
+               $languageResolved = $this->getLanguageInstance()->getMessage($languageId);
+
+               // Now add the link
+               $linkContent = $this->renderLinkContentWithTextExtraContent($languageResolved);
+
+               // Add the content to the previous group
+               $this->addContentToPreviousGroup($linkContent);
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/main/images/.htaccess b/inc/classes/main/images/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/inc/classes/main/images/class_ b/inc/classes/main/images/class_
new file mode 100644 (file)
index 0000000..69b4100
--- /dev/null
@@ -0,0 +1,53 @@
+<?php
+/**
+ * 
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class ???Image extends BaseImage {
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+       }
+
+       /**
+        * Creates an instance of this image class
+        *
+        * @return      $imageInstance  An instance of this image class
+        */
+       public final static function create???Image() {
+               // Get a new instance
+               $imageInstance = new ???Image();
+
+               // Set image type
+               $imageInstance->setImageType("???");
+
+               // Return the instance
+               return $imageInstance;
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/main/images/class_BaseImage.php b/inc/classes/main/images/class_BaseImage.php
new file mode 100644 (file)
index 0000000..7f667cd
--- /dev/null
@@ -0,0 +1,549 @@
+<?php
+/**
+ * A general image class
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class BaseImage extends BaseFrameworkSystem implements Registerable {
+       /**
+        * Image type
+        */
+       private $imageType = "";
+
+       /**
+        * Width of the image
+        */
+       private $width = "";
+
+       /**
+        * Height of the image
+        */
+       private $height = "";
+
+       /**
+        * Background color in RGB
+        */
+       private $backgroundColor = array(
+               'red'   => "",
+               'green' => "",
+               'blue'  => ""
+       );
+
+       /**
+        * Foreground color in RGB
+        */
+       private $foregroundColor = array(
+               'red'   => "",
+               'green' => "",
+               'blue'  => ""
+       );
+
+       /**
+        * Current choosen color array
+        */
+       private $colorMode = "";
+
+       /**
+        * Image resource
+        */
+       private $imageResource = null;
+
+       /**
+        * Image name
+        */
+       private $imageName = "";
+
+       /**
+        * String name
+        */
+       private $stringName = "";
+
+       /**
+        * Groupable image strings?
+        */
+       private $groupable = "single";
+
+       /**
+        * Protected constructor
+        *
+        * @param       $className      Name of the class
+        * @return      void
+        */
+       protected function __construct ($className) {
+               // Call parent constructor
+               parent::__construct($className);
+
+               // Clean up a little
+               $this->removeNumberFormaters();
+               $this->removeSystemArray();
+       }
+
+       /**
+        * Private setter for all colors
+        *
+        * @param       $colorMode              Wether background or foreground color
+        * @param       $colorChannel   Red, green or blue channel?
+        * @param       $colorValue             Value to set
+        */
+       private final function setColor ($colorMode, $colorChannel, $colorValue) {
+               // Construct the eval() command
+               $eval = sprintf("\$this->%s['%s'] = \"%s\";",
+                       $colorMode,
+                       $colorChannel,
+                       $colorValue
+               );
+
+               // Run the command
+               //* DEBUG: */ echo "mode={$colorMode}, channel={$colorChannel}, value={$colorValue}<br />\n";
+               eval($eval);
+       }
+
+       /**
+        * Setter for image width
+        *
+        * @param       $width  Width of the image
+        * @return      void
+        */
+       public final function setWidth ($width) {
+               $this->width = $width;
+       }
+
+       /**
+        * Getter for image width
+        *
+        * @return      $width  Width of the image
+        */
+       public final function getWidth () {
+               return $this->width;
+       }
+
+       /**
+        * Setter for image height
+        *
+        * @param       $height Height of the image
+        * @return      void
+        */
+       public final function setHeight ($height) {
+               $this->height = $height;
+       }
+
+       /**
+        * Getter for image height
+        *
+        * @return      $height Height of the image
+        */
+       public final function getHeight () {
+               return $this->height;
+       }
+
+       /**
+        * Finish the type handling (unused at the moment)
+        *
+        * @return      void
+        * @todo        Find something usefull for this method.
+        */
+       public function finishType () {
+               // Empty at the momemt
+       }
+
+       /**
+        * Prepares the class for resolution (unused at the moment)
+        *
+        * @return      void
+        * @todo        Find something usefull for this method.
+        */
+       public function initResolution () {
+               // Empty at the momemt
+       }
+
+       /**
+        * Finish resolution handling (unused at the moment)
+        *
+        * @return      void
+        * @todo        Find something usefull for this method.
+        */
+       public function finishResolution () {
+               // Empty at the momemt
+       }
+
+       /**
+        * Prepares the class for base (unused at the moment)
+        *
+        * @return      void
+        * @todo        Find something usefull for this method.
+        */
+       public function initBase () {
+               // Empty at the momemt
+       }
+
+       /**
+        * Finish base handling (unused at the moment)
+        *
+        * @return      void
+        * @todo        Find something usefull for this method.
+        */
+       public function finishBase () {
+               // Empty at the momemt
+       }
+
+       /**
+        * Prepares the class for background color
+        *
+        * @return      void
+        */
+       public function initBackgroundColor () {
+               $this->colorMode = "backgroundColor";
+       }
+
+       /**
+        * Finish background color handling
+        *
+        * @return      void
+        * @todo        Find something usefull for this method.
+        */
+       public function finishBackgroundColor () {
+               // Empty at the moment
+       }
+
+       /**
+        * Prepares the class for foreground color
+        *
+        * @return      void
+        */
+       public function initForegroundColor () {
+               $this->colorMode = "foregroundColor";
+       }
+
+       /**
+        * Finish foreground color handling
+        *
+        * @return      void
+        * @todo        Find something usefull for this method.
+        */
+       public function finishForegroundColor () {
+               // Empty at the moment
+       }
+
+       /**
+        * Prepares the class for string (unused at the moment)
+        *
+        * @param       $groupable      Wether this image string is groupable or single
+        * @return      void
+        * @todo        Find something usefull for this method.
+        */
+       public function initImageString ($groupable = "single") {
+               $this->groupable = $groupable;
+       }
+
+       /**
+        * Finish string handling (unused at the moment)
+        *
+        * @return      void
+        * @todo        Find something usefull for this method.
+        */
+       public function finishImageString () {
+               // Empty at the momemt
+       }
+
+       /**
+        * Setter for red color
+        *
+        * @param       $red    Red color value
+        * @return      void
+        */
+       public final function setRed ($red) {
+               // Get array name
+               $arrayName = $this->colorMode;
+
+               // Set image color
+               $this->setColor($arrayName, 'red', $red);
+       }
+
+       /**
+        * Setter for green color
+        *
+        * @param       $green  Green color value
+        * @return      void
+        */
+       public final function setGreen ($green) {
+               // Get array name
+               $arrayName = $this->colorMode;
+
+               // Set image color
+               $this->setColor($arrayName, 'green', $green);
+       }
+
+       /**
+        * Setter for blue color
+        *
+        * @param       $blue   Blue color value
+        * @return      void
+        */
+       public final function setBlue ($blue) {
+               // Get array name
+               $arrayName = $this->colorMode;
+
+               // Set image color
+               $this->setColor($arrayName, 'blue', $blue);
+       }
+
+       /**
+        * Setter for image string
+        *
+        * @param       $string         String to set in image
+        * @return      void
+        */
+       public final function setString ($string) {
+               $this->imageString = (string) $string;
+       }
+
+       /**
+        * Getter for image string
+        *
+        * @return      $string         String to set in image
+        */
+       public final function getString () {
+               return $this->imageString;
+       }
+
+       /**
+        * Setter for image type
+        *
+        * @param       $imageType              Type to set in image
+        * @return      void
+        */
+       protected final function setImageType ($imageType) {
+               $this->imageType = (string) $imageType;
+       }
+
+       /**
+        * Getter for image type
+        *
+        * @return      $imageType              Type to set in image
+        */
+       public final function getImageType () {
+               return $this->imageType;
+       }
+
+       /**
+        * Setter for image name
+        *
+        * @param       $name   Name of the image
+        * @return      void
+        */
+       public final function setImageName ($name) {
+               $this->imageName = (string) $name;
+       }
+
+       /**
+        * Getter for image name
+        *
+        * @return      $name   Name of the image
+        */
+       public final function getImageName () {
+               return $this->imageName;
+       }
+
+       /**
+        * Getter for image resource
+        *
+        * @return      $imageResource  An image resource from imagecreatetruecolor() function
+        */
+       public final function getImageResource() {
+               return $this->imageResource;
+       }
+
+       /**
+        * Setter for X coordinate
+        *
+        * @param       $x      X coordinate
+        * @return      void
+        */
+       public final function setX ($x) {
+               $this->x = $x;
+       }
+
+       /**
+        * Getter for X coordinate
+        *
+        * @return      $x      X coordinate
+        */
+       public final function getX () {
+               return $this->x;
+       }
+
+       /**
+        * Setter for Y coordinate
+        *
+        * @param       $y      Y coordinate
+        * @return      void
+        */
+       public final function setY ($y) {
+               $this->y = $y;
+       }
+
+       /**
+        * Getter for Y coordinate
+        *
+        * @return      $y      Y coordinate
+        */
+       public final function getY () {
+               return $this->y;
+       }
+
+       /**
+        * Setter for font size
+        *
+        * @param       $fontSize       Font size for strings
+        * @return      void
+        */
+       public final function setFontSize ($fontSize) {
+               $this->fontSize = $fontSize;
+       }
+
+       /**
+        * Getter for font size
+        *
+        * @return      $fontSize       Font size for strings
+        */
+       public final function getFontSize () {
+               return $this->fontSize;
+       }
+
+       /**
+        * Setter for string name
+        *
+        * @param       $stringName             String name to set
+        * @return      void
+        */
+       public final function setStringName($stringName) {
+               $this->stringName = $stringName;
+       }
+
+       /**
+        * Finish this image by producing it
+        *
+        * @return      void
+        */
+       public function finishImage () {
+               // Get template instance
+               $templateInstance = $this->getTemplateInstance();
+
+               // Compile width and height
+               $width = $templateInstance->compileRawCode($this->getWidth());
+               $height = $templateInstance->compileRawCode($this->getHeight());
+
+               // Set both again
+               $this->setWidth($width);
+               $this->setHeight($height);
+
+               // Get a image resource
+               $this->imageResource = imagecreatetruecolor($width, $height);
+
+               // Compile background colors
+               $red   = $templateInstance->compileRawCode($this->backgroundColor['red']);
+               $green = $templateInstance->compileRawCode($this->backgroundColor['green']);
+               $blue  = $templateInstance->compileRawCode($this->backgroundColor['blue']);
+
+               // Set all back
+               $this->initBackgroundColor();
+               $this->setRed($red);
+               $this->setGreen($green);
+               $this->setBlue($blue);
+
+               // Get a pointer for background color
+               $backColor = imagecolorallocate($this->getImageResource(), $red, $green, $blue);
+
+               // Fill the image
+               imagefill($this->getImageResource(), 0, 0, $backColor);
+
+               // Compile foreground colors
+               $red   = $templateInstance->compileRawCode($this->foregroundColor['red']);
+               $green = $templateInstance->compileRawCode($this->foregroundColor['green']);
+               $blue  = $templateInstance->compileRawCode($this->foregroundColor['blue']);
+
+               // Set all fore
+               $this->initForegroundColor();
+               $this->setRed($red);
+               $this->setGreen($green);
+               $this->setBlue($blue);
+
+               // Get a pointer for foreground color
+               $foreColor = imagecolorallocate($this->getImageResource(), $red, $green, $blue);
+
+               switch ($this->groupable) {
+                       case "single": // Single image string
+                               // Compile image string
+                               $imageString = $templateInstance->compileRawCode($this->getString());
+
+                               // Set it back
+                               $this->setString($imageString);
+
+                               // Compile X/Y coordinates and font size
+                               $x    = $templateInstance->compileRawCode($this->getX());
+                               $y    = $templateInstance->compileRawCode($this->getY());
+                               $size = $templateInstance->compileRawCode($this->getFontSize());
+
+                               // Set the image string
+                               imagestring($this->getImageResource(), $size, $x, $y, $imageString, $foreColor);
+                               break;
+
+                       case "groupable": // More than one string allowed
+                               // Walk through all groups
+                               foreach ($templateInstance->getVariableGroups() as $group => $set) {
+                                       // Set the group
+                                       $templateInstance->setVariableGroup($group, false);
+
+                                       // Compile image string
+                                       $imageString = $templateInstance->compileRawCode($this->getString());
+
+                                       // Compile X/Y coordinates and font size
+                                       $x    = $templateInstance->compileRawCode($this->getX());
+                                       $y    = $templateInstance->compileRawCode($this->getY());
+                                       $size = $templateInstance->compileRawCode($this->getFontSize());
+
+                                       // Set the image string
+                                       //* DEBUG: */ echo __METHOD__.": size={$size}, x={$x}, y={$y}, string={$imageString}<br />\n";
+                                       imagestring($this->getImageResource(), $size, $x, $y, $imageString, $foreColor);
+                               } // END - foreach
+                               break;
+               }
+
+               // You need finishing in your image class!
+       }
+
+       /**
+        * Getter for full created image content
+        *
+        * @return      $imageContent   The raw image content
+        */
+       public function getContent () {
+               // Get cache file name
+               $cacheFile = $this->getTemplateInstance()->getImageCacheFqfn();
+
+               // Load the content
+               $imageContent = file_get_contents($cacheFile);
+
+               // And return it
+               return $imageContent;
+       }
+}
+// [EOF]
+?>
diff --git a/inc/classes/main/images/extended/.htaccess b/inc/classes/main/images/extended/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/inc/classes/main/images/extended/class_PngImage.php b/inc/classes/main/images/extended/class_PngImage.php
new file mode 100644 (file)
index 0000000..8b03320
--- /dev/null
@@ -0,0 +1,79 @@
+<?php
+/**
+ * A PNG image generator
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class PngImage extends BaseImage {
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+       }
+
+       /**
+        * Creates an instance of this image class
+        *
+        * @param       $templateInstance       A template instance
+        * @return      $imageInstance          An instance of this image class
+        */
+       public final static function createPngImage(CompileableTemplate $templateInstance) {
+               // Get a new instance
+               $imageInstance = new PngImage();
+
+               // Set template instance
+               $imageInstance->setTemplateInstance($templateInstance);
+
+               // Set image type
+               $imageInstance->setImageType('png');
+
+               // Return the instance
+               return $imageInstance;
+       }
+
+       /**
+        * Finish this image by producing it
+        *
+        * @return      void
+        */
+       public function finishImage () {
+               // Call parent method
+               parent::finishImage();
+
+               // Get a file name for our image
+               $cacheFile = $this->getTemplateInstance()->getImageCacheFqfn();
+
+               // Does it exist?
+               if (file_exists($cacheFile)) {
+                       // Remove it
+                       @unlink($cacheFile);
+               } // END - if
+
+               // Finish the image and send it to a cache file
+               imagepng($this->getImageResource(), $cacheFile, 9, PNG_ALL_FILTERS);
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/main/io/.htaccess b/inc/classes/main/io/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/inc/classes/main/io/class_FileIoStream.php b/inc/classes/main/io/class_FileIoStream.php
new file mode 100644 (file)
index 0000000..7e257be
--- /dev/null
@@ -0,0 +1,226 @@
+<?php
+/**
+ * An universal class for file input/output streams.
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class FileIoStream extends BaseFrameworkSystem implements FileInputStreamer, FileOutputStreamer {
+       /**
+        * Protected constructor
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+
+               // Clean-up a little
+               $this->removeNumberFormaters();
+               $this->removeSystemArray();
+       }
+
+       /**
+        * Create a file IO stream. This is a class for performing all actions
+        * on files like creating, deleting and loading them.
+        *
+        * @return      $ioInstance     An instance of FileIoStream
+        */
+       public final static function createFileIoStream () {
+               // Create new instance
+               $ioInstance = new FileIoStream();
+
+               // Return the instance
+               return $ioInstance;
+       }
+
+       /**
+        * Saves data to a given local file
+        *
+        * @param               $fileName               The file name for the to be saved file
+        * @param               $dataArray      The data we shall store to the file
+        * @return      void
+        * @see         FileOutputStreamer
+        */
+       public final function saveFile ($fileName, $dataArray) {
+               // Try it five times
+               $dirName = ""; $fileInstance = null;
+               for ($idx = 0; $idx < 5; $idx++) {
+                       // Get a file output pointer
+                       try {
+                               $fileInstance = FrameworkFileOutputPointer::createFrameworkFileOutputPointer($fileName, 'w');
+                       } catch (FilePointerNotOpenedException $e) {
+                               // Create missing directory
+                               $dirName = dirname($fileName);
+                               for ($idx2 = 0; $idx2 < (2 - $idx); $idx2++) {
+                                       $dirName = dirname($dirName);
+                               }
+                               // Try to create it
+                               @mkdir($dirName);
+                       }
+               }
+
+               // Write a header information for validation purposes
+               $fileInstance->writeToFile(sprintf("@head^%s:%s:%s:%s\n",
+                       $dataArray[0],
+                       time(),
+                       strlen($dataArray[1]),
+                       md5($dataArray[1])
+               ));
+
+               // Encode the (maybe) binary stream with Base64
+               $b64Stream = base64_encode($dataArray[1]);
+
+               // write the data line by line
+               $line = str_repeat(" ", 50); $idx = 0;
+               while (strlen($line) == 50) {
+                       // Get 50 chars or less
+                       $line = substr($b64Stream, $idx, 50);
+
+                       // Save it to the stream
+                       $fileInstance->writeToFile(sprintf("@data^%s:%s\n",
+                               $line,
+                               md5($line)
+                       ));
+
+                       // Advance to the next 50-chars block
+                       $idx += 50;
+               }
+
+               // Close the file
+               $fileInstance->closeFile();
+       }
+
+       /**
+        * Reads from a local file
+        *
+        * @param               $fqfn   The full-qualified file-name which we shall load
+        * @return      $array  An array with the element 'header' and 'data'
+        * @see         FileInputStreamer
+        */
+       public final function loadFileContents ($fqfn) {
+               // Initialize some variables and arrays
+               $inputBuffer = "";
+               $lastBuffer = "";
+               $header = array();
+               $data = array();
+               $readData = ""; // This will contain our read data
+
+               // Get a file input handler
+               $fileInstance = FrameworkFileInputPointer::createFrameworkFileInputPointer($fqfn);
+
+               // Read all it's contents (we very and transparently decompress it below)
+               while ($readRawLine = $fileInstance->readFromFile()) {
+                       // Add the read line to the buffer
+                       $inputBuffer .= $readRawLine;
+
+                       // Break infinite loop maybe caused by the input handler
+                       if ($lastBuffer == $inputBuffer) break;
+
+                       // Remember last read line for avoiding possible infinite loops
+                       $lastBuffer = $inputBuffer;
+               }
+
+               // Close directory handle
+               $fileInstance->closeFile();
+
+               // Convert it into an array
+               $inputBuffer = explode("\n", $inputBuffer);
+
+               // Now process the read lines and verify it's content
+               foreach ($inputBuffer as $rawLine) {
+                       // Trim it a little but not the leading spaces/tab-stops
+                       $rawLine = rtrim($rawLine);
+
+                       // Analyze this line
+                       if (substr($rawLine, 0, 5) == "@head") {
+                               // Header found, so let's extract it
+                               $header = explode("^", $rawLine);
+                               $header = trim($header[1]);
+
+                               // Now we must convert it again into an array
+                               $header = explode(":", $header);
+
+                               // Is the header (maybe) valid?
+                               if (count($header) != 4) {
+                                       // Throw an exception
+                                       throw new InvalidArrayCountException(array($this, 'header', count($header), 4), self::EXCEPTION_ARRAY_HAS_INVALID_COUNT);
+                               }
+                       } elseif (substr($rawLine, 0, 5) == "@data") {
+                               // Is a data line!
+                               $data = explode("^", $rawLine);
+                               $data = $data[1];
+
+                               // First element is the data, second the MD5 checksum
+                               $data = explode(":", $data);
+
+                               // Validate the read line
+                               if (count($data) == 2) {
+                                       if (md5($data[0]) != $data[1]) {
+                                               // MD5 hash did not match!
+                                               throw new InvalidMD5ChecksumException(array($this, md5($data[0]), $data[1]), self::EXCEPTION_MD5_CHECKSUMS_MISMATCH);
+                                       }
+                               } else {
+                                       // Invalid count!
+                                       throw new InvalidArrayCountException(array($this, "data", count($data), 2), self::EXCEPTION_ARRAY_HAS_INVALID_COUNT);
+                               }
+
+                               // Add this to the readData string
+                               $readData .= $data[0];
+                       } else {
+                               // Other raw lines than header/data tagged lines and re-add the new-line char
+                               $readData .= $rawLine."\n";
+                       }
+               }
+
+               // Was raw lines read and no header/data?
+               if ((!empty($readData)) && (count($header) == 0) && (count($data) == 0)) {
+                       // Return raw lines back
+                       return $readData;
+               }
+
+               // Was a header found?
+               if (count($header) != 4) {
+                       // Throw an exception
+                       throw new InvalidArrayCountException(array($this, 'header', count($header), 4), self::EXCEPTION_ARRAY_HAS_INVALID_COUNT);
+               }
+
+               // Decode all from Base64
+               $readData = @base64_decode($readData);
+
+               // Does the size match?
+               if (strlen($readData) != $header[2]) {
+                       // Size did not match
+                       throw new InvalidDataLengthException(array($this, strlen($readData), $header[2]), self::EXCEPTION_UNEXPECTED_STRING_SIZE);
+               }
+
+               // Validate the decoded data with the final MD5 hash
+               if (md5($readData) != $header[3]) {
+                       // MD5 hash did not match!
+                       throw new InvalidMD5ChecksumException(array($this, md5($readData), $header[3]), self::EXCEPTION_MD5_CHECKSUMS_MISMATCH);
+               }
+
+               // Return all in an array
+               return array(
+                       'header' => $header,
+                       'data'   => $readData
+               );
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/main/io/class_FrameworkDirectoryPointer.php b/inc/classes/main/io/class_FrameworkDirectoryPointer.php
new file mode 100644 (file)
index 0000000..ccbb545
--- /dev/null
@@ -0,0 +1,240 @@
+<?php
+/**
+ * A class for directory reading and getting its contents
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class FrameworkDirectoryPointer extends BaseFrameworkSystem {
+       /**
+        * The current path we are working in
+        */
+       private $pathName = "";
+
+       /**
+        * The directory pointer
+        */
+       private $dirPointer = null;
+
+       /**
+        * Protected constructor
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+
+               // Clean-up a little
+               $this->removeNumberFormaters();
+               $this->removeSystemArray();
+       }
+
+       /**
+        * Destructor for cleaning purposes, etc
+        */
+       public function __destruct() {
+               // Is there a resource pointer? Then we have to close the directory here!
+               if (is_resource($this->getPointer())) {
+                       // Try to close a directory
+                       $this->closeDirectory();
+               }
+
+               // Call the parent destructor
+               parent::__destruct();
+       }
+
+       /**
+        * Create a directory pointer based on the given path. The path will also
+        * be verified here.
+        *
+        * @param               $pathName                                       The path name we shall pass
+        *                                                                      to opendir()
+        * @param               $inConstructor                          If we are in de/con-structor
+        *                                                                      or from somewhere else
+        * @throws      PathIsEmptyException            If the provided path name
+        *                                                                      is empty
+        * @throws      InvalidPathStringException      If the provided path name is
+        *                                                                      not a string
+        * @throws      PathIsNoDirectoryException      If the provided path name is
+        *                                                                      not valid
+        * @throws      PathReadProtectedException      If the provided path name is
+        *                                                                      read-protected
+        * @throws      DirPointerNotOpened                     If opendir() returns not a
+        *                                                                      directory resource
+        * @return      $pointerInstance                        A prepared instance of
+        *                                                                      FrameworkDirectoryPointer
+        */
+       public final static function createFrameworkDirectoryPointer ($pathName, $inConstructor = false) {
+               // Some pre-sanity checks...
+               if (is_null($pathName)) {
+                       // No pathname given
+                       if ($inConstructor) {
+                               return null;
+                       } else {
+                               throw new PathIsEmptyException(null, self::EXCEPTION_UNEXPECTED_EMPTY_STRING);
+                       }
+               } elseif (!is_string($pathName)) {
+                       // Is not a string
+                       if ($inConstructor) {
+                               return null;
+                       } else {
+                               throw new InvalidPathStringException(null, self::EXCEPTION_INVALID_STRING);
+                       }
+               } elseif (!is_dir($pathName)) {
+                       // Not a directory
+                       if ($inConstructor) {
+                               return null;
+                       } else {
+                               throw new PathIsNoDirectoryException($pathName, self::EXCEPTION_INVALID_PATH_NAME);
+                       }
+               } elseif (!is_readable($pathName)) {
+                       // Not readable
+                       if ($inConstructor) {
+                               return null;
+                       } else {
+                               throw new PathReadProtectedException($pathName, self::EXCEPTION_READ_PROTECED_PATH);
+                       }
+               }
+
+               // Try to open a handler
+               $dirPointer = @opendir($pathName);
+               if (!is_resource($dirPointer)) {
+                       // Something bad happend
+                       if ($inConstructor) {
+                               return null;
+                       } else {
+                               throw new DirPointerNotOpenedException($pathName, self::EXCEPTION_DIR_POINTER_INVALID);
+                       }
+               }
+
+               // Create new instance
+               $pointerInstance = new FrameworkDirectoryPointer();
+
+               // Set directory pointer and path name
+               $pointerInstance->setPointer($dirPointer);
+               $pointerInstance->setPathName($pathName);
+
+               // Return the instance
+               return $pointerInstance;
+       }
+
+       /**
+        * Read raw lines of data from a directory pointer and return the data
+        *
+        * @return      string  Directory and/or file names read from the current
+        *                                      directory pointer
+        */
+       public function readRawDirectory () {
+               // Read data from the directory pointer and return it
+               return readdir($this->getPointer());
+       }
+
+       /**
+        * Read lines from the current directory pointer except some parts
+        *
+        * @param               $except Some parts of a directory we want to ignore.
+        *                                      Valid: dirs
+        *                                      Other values will be silently ignored
+        * @return      string  Directory and/or file names read from the current
+        *                                      directory pointer
+        */
+       public function readDirectoryExcept ($except = "") {
+               if ((empty($except)) || (!is_array($except)) || (count($except) == 0)) {
+                       // No exception given, so read all data
+                       return $this->readRawDirectory();
+               }
+
+               // Read a raw line...
+               $rawLine = $this->readRawDirectory();
+
+               // Shall we exclude directories?
+               if ((!is_null($rawLine)) && ($rawLine !== false) && (in_array($rawLine, $except))) {
+                       // Exclude this part
+                       return $this->readDirectoryExcept($except);
+               } elseif ((!is_null($rawLine)) && ($rawLine !== false)) {
+                       // Return read data
+                       return $rawLine;
+               }
+
+               // End pointer reached
+               return null;
+       }
+
+       /**
+        * Close a directory source and set it's instance to null and the path name
+        * to empty
+        *
+        * @return      void
+        */
+       public function closeDirectory () {
+               // Close the directory pointer and reset the instance variable
+               @closedir($this->getPointer());
+               $this->setPointer(null);
+               $this->setPathName("");
+       }
+
+       /**
+        * Setter for the directory pointer
+        *
+        * @param               $dirPointer     The directory resource
+        * @return      void
+        */
+       public final function setPointer ($dirPointer) {
+               // Sanity-check if pointer is a valid directory resource
+               if (is_resource($dirPointer) || is_null($dirPointer)) {
+                       // Is a valid resource
+                       $this->dirPointer = $dirPointer;
+               } else {
+                       // Throw exception
+                       throw new InvalidDirectoryResourceException($this, self::EXCEPTION_INVALID_DIRECTORY_POINTER);
+               }
+       }
+
+       /**
+        * Getter for the directory pointer
+        *
+        * @return      $dirPointer     The directory pointer which shall be a valid
+        *                                              directory resource
+        */
+       public final function getPointer () {
+               return $this->dirPointer;
+       }
+
+       /**
+        * Setter for path name
+        *
+        * @param               $pathName               The new path name
+        * @return      void
+        */
+       public final function setPathName ($pathName) {
+               $pathName = (string) $pathName;
+               $this->pathName = $pathName;
+       }
+
+       /**
+        * Getter for path name
+        *
+        * @return      $pathName               The current path name
+        */
+       public final function getPathName () {
+               return $this->pathName;
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/main/io/class_FrameworkFileInputPointer.php b/inc/classes/main/io/class_FrameworkFileInputPointer.php
new file mode 100644 (file)
index 0000000..35376e9
--- /dev/null
@@ -0,0 +1,223 @@
+<?php
+/**
+ * A class for reading files
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class FrameworkFileInputPointer extends BaseFrameworkSystem {
+       /**
+        * The current file we are working in
+        */
+       private $fileName = "";
+
+       /**
+        * The file pointer
+        */
+       private $filePointer = null;
+
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+
+               // Clean-up a little
+               $this->removeNumberFormaters();
+               $this->removeSystemArray();
+       }
+
+       /**
+        * Destructor for cleaning purposes, etc
+        *
+        * @return      void
+        */
+       public final function __destruct() {
+               // Is there a resource pointer? Then we have to close the file here!
+               if (is_resource($this->getPointer())) {
+                       // Try to close a file
+                       $this->closeFile();
+               }
+
+               // Call the parent destructor
+               parent::__destruct();
+       }
+
+       /**
+        * Create a file pointer based on the given file. The file will also
+        * be verified here.
+        *
+        * @param               $fileName       The file name we shall pass to fopen()
+        * @throws      FileIsEmptyException    If the provided file name is empty.
+        * @throws      FilePointerNotOpenedException   If fopen() returns not a
+        *                                                                                      file resource
+        * @return      void
+        */
+       public final static function createFrameworkFileInputPointer ($fileName) {
+               // Some pre-sanity checks...
+               if ((is_null($fileName)) || (empty($fileName))) {
+                       // No filename given
+                       throw new FileIsEmptyException(null, self::EXCEPTION_UNEXPECTED_EMPTY_STRING);
+               } elseif (!file_exists($fileName)) {
+                       // File does not exist!
+                       throw new FileNotFoundException($fileName, self::EXCEPTION_FILE_NOT_FOUND);
+               } elseif (!is_readable($fileName)) {
+                       // File does not exist!
+                       throw new FileReadProtectedException($fileName, self::EXCEPTION_FILE_CANNOT_BE_READ);
+               }
+
+               // Try to open a handler
+               $filePointer = @fopen($fileName, 'rb');
+               if ((is_null($filePointer)) || ($filePointer === false)) {
+                       // Something bad happend
+                       throw new FilePointerNotOpenedException ($fileName, self::EXCEPTION_FILE_POINTER_INVALID);
+               } // END - if
+
+               // Create new instance
+               $pointerInstance = new FrameworkFileInputPointer();
+
+               // Set file pointer and file name
+               $pointerInstance->setPointer($filePointer);
+               $pointerInstance->setFileName($fileName);
+
+               // Return the instance
+               return $pointerInstance;
+       }
+
+       /**
+        * Read data a file pointer
+        *
+        * @return      mixed   The result of fread()
+        * @throws      NullPointerException    If the file pointer instance
+        *                                                                      is not set by setPointer()
+        * @throws      InvalidFileResourceException    If there is being set
+        *                                                                      an invalid file resource
+        */
+       public function readFromFile () {
+               if (is_null($this->getPointer())) {
+                       // Pointer not initialized
+                       throw new NullPointerException($this, self::EXCEPTION_IS_NULL_POINTER);
+               } elseif (!is_resource($this->getPointer())) {
+                       // Pointer is not a valid resource!
+                       throw new InvalidFileResourceException($this, self::EXCEPTION_INVALID_DIRECTORY_POINTER);
+               }
+
+               // Read data from the file pointer and return it
+               return fread($this->getPointer(), 1024);
+       }
+
+       /**
+        * Read lines from a file pointer
+        *
+        * @return      mixed   The result of fread()
+        * @throws      NullPointerException    If the file pointer instance
+        *                                                                      is not set by setPointer()
+        * @throws      InvalidFileResourceException    If there is being set
+        *                                                                      an invalid file resource
+        */
+       public function readLinesFromFile () {
+               if (is_null($this->getPointer())) {
+                       // Pointer not initialized
+                       throw new NullPointerException($this, self::EXCEPTION_IS_NULL_POINTER);
+               } elseif (!is_resource($this->getPointer())) {
+                       // Pointer is not a valid resource!
+                       throw new InvalidFileResourceException($this, self::EXCEPTION_INVALID_DIRECTORY_POINTER);
+               }
+
+               // Read data from the file pointer and return it
+               return fgets($this->getPointer(), 1024);
+       }
+
+       /**
+        * Close a file source and set it's instance to null and the file name
+        * to empty
+        *
+        * @return      void
+        * @throws      NullPointerException    If the file pointer instance
+        *                                                                      is not set by setPointer()
+        * @throws      InvalidFileResourceException    If there is being set
+        */
+       public function closeFile () {
+               if (is_null($this->getPointer())) {
+                       // Pointer not initialized
+                       throw new NullPointerException($this, self::EXCEPTION_IS_NULL_POINTER);
+               } elseif (!is_resource($this->getPointer())) {
+                       // Pointer is not a valid resource!
+                       throw new InvalidFileResourceException($this, self::EXCEPTION_INVALID_DIRECTORY_POINTER);
+               }
+
+               // Close the file pointer and reset the instance variable
+               @fclose($this->getPointer());
+               $this->setPointer(null);
+               $this->setFileName("");
+       }
+
+       /**
+        * Setter for the file pointer
+        *
+        * @param       $filePointer    File resource
+        * @return      void
+        */
+       public final function setPointer ($filePointer) {
+               // Sanity-check if pointer is a valid file resource
+               if (is_resource($filePointer) || is_null($filePointer)) {
+                       // Is a valid resource
+                       $this->filePointer = $filePointer;
+               } else {
+                       // Throw exception
+                       throw new InvalidFileResourceException($this, self::EXCEPTION_INVALID_DIRECTORY_POINTER);
+               }
+       }
+
+       /**
+        * Getter for the file pointer
+        *
+        * @return      $filePointer    The file pointer which shall be a valid
+        *                                                      file resource
+        */
+       public final function getPointer () {
+               return $this->filePointer;
+       }
+
+       /**
+        * Setter for file name
+        *
+        * @param       $fileName       The new file name
+        * @return      void
+        */
+       public final function setFileName ($fileName) {
+               $fileName = (string) $fileName;
+               $this->fileName = $fileName;
+       }
+
+       /**
+        * Getter for file name
+        *
+        * @return      $fileName       The current file name
+        */
+       public final function getFileName () {
+               return $this->fileName;
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/main/io/class_FrameworkFileOutputPointer.php b/inc/classes/main/io/class_FrameworkFileOutputPointer.php
new file mode 100644 (file)
index 0000000..84c8ed4
--- /dev/null
@@ -0,0 +1,193 @@
+<?php
+/**
+ * A class for writing files
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class FrameworkFileOutputPointer extends BaseFrameworkSystem {
+       /**
+        * The current file we are working in
+        */
+       private $fileName = "";
+
+       /**
+        * The file pointer
+        */
+       private $filePointer = null;
+
+       /**
+        * Protected constructor
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+
+               // Clean-up a little
+               $this->removeNumberFormaters();
+               $this->removeSystemArray();
+       }
+
+       /**
+        * Destructor for cleaning purposes, etc
+        */
+       public final function __destruct() {
+               // Is there a resource pointer? Then we have to close the file here!
+               if (is_resource($this->getPointer())) {
+                       // Try to close a file
+                       $this->closeFile();
+               }
+
+               // Call the parent destructor
+               parent::__destruct();
+       }
+
+       /**
+        * Create a file pointer based on the given file. The file will also
+        * be verified here.
+        *
+        * @param       $fileName       The file name we shall pass to fopen()
+        * @param       $mode           The output mode ('w', 'a' are valid)
+        * @throws      FileIsEmptyException    If the provided file name is empty.
+        * @throws      FilePointerNotOpened    If fopen() returns not a file
+        *                                                                      resource
+        * @return      void
+        */
+       public final static function createFrameworkFileOutputPointer ($fileName, $mode) {
+               // Some pre-sanity checks...
+               if (is_null($fileName)) {
+                       // No filename given
+                       throw new FileIsEmptyException(null, self::EXCEPTION_UNEXPECTED_EMPTY_STRING);
+               }
+
+               // Try to open a handler
+               $filePointer = @fopen($fileName, $mode);
+               if (($filePointer === null) || ($filePointer === false)) {
+                       // Something bad happend
+                       throw new FilePointerNotOpenedException ($fileName, self::EXCEPTION_FILE_POINTER_INVALID);
+               }
+
+               // Create new instance
+               $pointerInstance = new FrameworkFileOutputPointer();
+
+               // Set file pointer and file name
+               $pointerInstance->setPointer($filePointer);
+               $pointerInstance->setFileName($fileName);
+
+               // Return the instance
+               return $pointerInstance;
+       }
+
+       /**
+        * Write data to a file pointer
+        *
+        * @param       $dataStream             The data stream we shall write to the file
+        * @return      mixed                   The result of fwrite()
+        * @throws      NullPointerException    If the file pointer instance
+        *                                                                      is not set by setPointer()
+        * @throws      InvalidFileResourceException    If there is being set
+        *                                                                                      an invalid file resource
+        */
+       public function writeToFile ($dataStream) {
+               if (is_null($this->getPointer())) {
+                       // Pointer not initialized
+                       throw new NullPointerException($this, self::EXCEPTION_IS_NULL_POINTER);
+               } elseif (!is_resource($this->getPointer())) {
+                       // Pointer is not a valid resource!
+                       throw new InvalidFileResourceException($this, self::EXCEPTION_INVALID_DIRECTORY_POINTER);
+               }
+
+               // Read data from the file pointer and return it
+               return fwrite($this->getPointer(), $dataStream);
+       }
+
+       /**
+        * Close a file source and set it's instance to null and the file name
+        * to empty
+        *
+        * @return      void
+        * @throws      NullPointerException    If the file pointer instance
+        *                                                                      is not set by setPointer()
+        * @throws      InvalidFileResourceException    If there is being set
+        */
+       public function closeFile () {
+               if (is_null($this->getPointer())) {
+                       // Pointer not initialized
+                       throw new NullPointerException($this, self::EXCEPTION_IS_NULL_POINTER);
+               } elseif (!is_resource($this->getPointer())) {
+                       // Pointer is not a valid resource!
+                       throw new InvalidFileResourceException($this, self::EXCEPTION_INVALID_DIRECTORY_POINTER);
+               }
+
+               // Close the file pointer and reset the instance variable
+               @fclose($this->getPointer());
+               $this->setPointer(null);
+               $this->setFileName("");
+       }
+
+       /**
+        * Setter for the file pointer
+        *
+        * @param       $filePointer    File resource
+        * @return      void
+        */
+       public final function setPointer ($filePointer) {
+               // Sanity-check if pointer is a valid file resource
+               if (is_resource($filePointer) || is_null($filePointer)) {
+                       // Is a valid resource
+                       $this->filePointer = $filePointer;
+               } else {
+                       // Throw exception
+                       throw new InvalidFileResourceException($this, self::EXCEPTION_INVALID_DIRECTORY_POINTER);
+               }
+       }
+
+       /**
+        * Getter for the file pointer
+        *
+        * @return      $filePointer    The file pointer which shall be a valid
+        *                                                      file resource
+        */
+       public final function getPointer () {
+               return $this->filePointer;
+       }
+
+       /**
+        * Setter for file name
+        *
+        * @param       $fileName       The new file name
+        * @return      void
+        */
+       public final function setFileName ($fileName) {
+               $fileName = (string) $fileName;
+               $this->fileName = $fileName;
+       }
+
+       /**
+        * Getter for file name
+        *
+        * @return      $fileName       The current file name
+        */
+       public final function getFileName () {
+               return $this->fileName;
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/main/language/.htaccess b/inc/classes/main/language/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/inc/classes/main/language/class_LanguageSystem.php b/inc/classes/main/language/class_LanguageSystem.php
new file mode 100644 (file)
index 0000000..befccdb
--- /dev/null
@@ -0,0 +1,183 @@
+<?php
+/**
+ * The language sub-system for handling language strings being used in the
+ * application and whole framework
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class LanguageSystem extends BaseFrameworkSystem implements ManageableLanguage {
+       /**
+        * The full-qualified base path for the language include files
+        */
+       private $basePath = "";
+
+       /**
+        * The 2-char language code
+        */
+       private $langCode = "xx"; // This will later be overwritten!
+
+       /**
+        * The array-object for all language strings
+        */
+       private $langStrings = null;
+
+       /**
+        * An instance of this class
+        */
+       private static $thisInstance = null;
+
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+
+               // Clean up a little
+               $this->removeNumberFormaters();
+               $this->removeSystemArray();
+       }
+
+       /**
+        * Creates an instance of the class LanguageSystem and prepares it for usage
+        *
+        * @param       $basePath               The local base path for all language strings
+        * @return      $langInstance   An instance of LanguageSystem
+        * @throws      LanguagePathIsEmptyException            If the provided $basePath is empty
+        * @throws      InvalidLanguagePathStringException      If $basePath is no string
+        * @throws      LanguagePathIsNoDirectoryException      If $basePath is no
+        *                                                                              directory or not found
+        * @throws      LanguagePathReadProtectedException      If $basePath is
+        *                                                                              read-protected
+        */
+       public final static function createLanguageSystem ($basePath) {
+               // Get a new instance
+               $langInstance = new LanguageSystem();
+
+               // Is the base path valid?
+               if (empty($basePath)) {
+                       // Language path is empty
+                       throw new LanguagePathIsEmptyException($langInstance, self::EXCEPTION_UNEXPECTED_EMPTY_STRING);
+               } elseif (!is_string($basePath)) {
+                       // Is not a string
+                       throw new InvalidLanguagePathStringException(array($langInstance, $basePath), self::EXCEPTION_INVALID_STRING);
+               } elseif (!is_dir($basePath)) {
+                       // Is not a path
+                       throw new LanguagePathIsNoDirectoryException(array($langInstance, $basePath), self::EXCEPTION_INVALID_PATH_NAME);
+               } elseif (!is_readable($basePath)) {
+                       // Is not readable
+                       throw new LanguagePathReadProtectedException(array($langInstance, $basePath), self::EXCEPTION_READ_PROTECED_PATH);
+               }
+
+               // Set the base path
+               $langInstance->setBasePath($basePath);
+
+               // Initialize the variable stack
+               $langInstance->initLanguageStrings();
+
+               // Set language code from default config
+               $langInstance->setLanguageCode(FrameworkConfiguration::getInstance()->readConfig('default_lang'));
+
+               // Remember this instance
+               self::$thisInstance = $langInstance;
+
+               // Return the prepared instance
+               return $langInstance;
+       }
+
+       /**
+        * Singleton getter for this instance
+        *
+        * @return      $thisInstance           An instance of this class
+        */
+       public final static function getInstance () {
+               return self::$thisInstance;
+       }
+
+       /**
+        * Setter for base path
+        *
+        * @param               $basePath               The local base path for all templates
+        * @return      void
+        */
+       protected final function setBasePath ($basePath) {
+               // And set it
+               $this->basePath = (string) $basePath;
+       }
+
+       /**
+        * Setter for language code
+        *
+        * @param               $langCode               The language code for the current application
+        * @return      void
+        */
+       protected final function setLanguageCode ($langCode) {
+               // Cast it
+               $langCode = (string) $langCode;
+
+               // And set it (only 2 chars)
+               $this->langCode = substr($langCode, 0, 2);
+       }
+
+       /**
+        * Initialize the array-object for all later language strings
+        *
+        * @return      void
+        */
+       public function initLanguageStrings () {
+               $this->langStrings = new FrameworkArrayObject("FakedLanguageStrings");
+       }
+
+       /**
+        * Getter for language code
+        *
+        * @return      $langCode               The language code for the current application
+        */
+       public final function getLanguageCode () {
+               return $this->langCode;
+       }
+
+       /**
+        * Get the plain message from the cache variable for the given message id
+        *
+        * @param       $messageId              The message id we shall find in the cache variable
+        * @return      $messageText    The plain message text
+        */
+       public function getMessage ($messageId) {
+               // Default is missing message text
+               $messageText = sprintf("!%s!",
+                       $messageId
+               );
+
+               // Try to look it up in the cache variable
+               if ($this->langStrings->offsetExists($messageId)) {
+                       // Return the message string
+                       $messageText = $this->langStrings->offsetGet($messageId);
+               }
+
+               // Return the text
+               return $messageText;
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/main/mailer/.htaccess b/inc/classes/main/mailer/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/inc/classes/main/mailer/class_ b/inc/classes/main/mailer/class_
new file mode 100644 (file)
index 0000000..5cf368f
--- /dev/null
@@ -0,0 +1,70 @@
+<?php
+/**
+ * 
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class ???Mailer extends BaseMailer implements DeliverableMail {
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+       }
+
+       /**
+        * Creates an instance of this mailer class
+        *
+        * @return      $mailerInstance         An instance of this mailer class
+        */
+       public final static function create???Mailer () {
+               // Get a new instance
+               $mailerInstance = new ???Mailer();
+
+               // Return the instance
+               return $mailerInstance;
+       }
+
+       /**
+        * Deliver email to the recipient(s)
+        *
+        * @return      void
+        * @todo        0% done
+        */
+       public function deliverEmail() {
+               $this->partialStub("You have to implement this method.");
+       }
+
+       /**
+        * Send notification to the admin
+        *
+        * @return      void
+        * @todo        0% done
+        */
+       public function sendAdminNotification() {
+               $this->partialStub("You have to implement this method.");
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/main/mailer/class_BaseMailer.php b/inc/classes/main/mailer/class_BaseMailer.php
new file mode 100644 (file)
index 0000000..4230fbc
--- /dev/null
@@ -0,0 +1,214 @@
+<?php
+/**
+ * A general mailer class for all other mailers
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class BaseMailer extends BaseFrameworkSystem {
+       /**
+        * Iterateable list of recipients
+        */
+       private $recipientList = array();
+
+       /**
+        * Template name
+        */
+       private $templateName = "";
+
+       /**
+        * Protected constructor
+        *
+        * @param       $className      Name of the class
+        * @return      void
+        */
+       protected function __construct ($className) {
+               // Call parent constructor
+               parent::__construct($className);
+
+               // Clean up a little
+               $this->removeNumberFormaters();
+               $this->removeSystemArray();
+       }
+
+       /**
+        * Loads a text or HTML template depending on configuration into the template engine
+        *
+        * @param       $templateName   Name of the template we shall load
+        * @return      void
+        */
+       protected final function loadTemplate ($templateName) {
+               // Set template name
+               $this->setTemplateName($templateName);
+
+               // Get configuration entry
+               $templatePrefix = $this->getConfigInstance()->readConfig('email_tpl_' . $templateName);
+
+               // Load this email template
+               $this->getTemplateInstance()->loadEmailTemplate($templatePrefix . '_' . $templateName);
+       }
+
+       /**
+        * Adds a user class to the recipient list for current template
+        *
+        * @param       $userInstance   An instance of a user class
+        * @return      void
+        */
+       public function addRecipientByUserInstance (ManageableMember $userInstance) {
+               // Get template name
+               $templateName = $this->getTemplateName();
+
+               // Is the list initialized?
+               if (!isset($this->recipientList[$templateName]['recipients'])) {
+                       // Then initialize it here
+                       $this->recipientList[$templateName]['recipients'] = array();
+               } // END - if
+
+               // Add it as a recipient
+               $this->recipientList[$templateName]['recipients'][] = $userInstance;
+       }
+
+       /**
+        * Adds a template variable (just the name) to the recipient list in given section of current template
+        *
+        * @param       $section                Section can be "config" or "value" currently
+        * @param       $variableName   Template variable name to add
+        * @return      void
+        */
+       private final function addTemplateVariable ($section, $variableName) {
+               // Get template name
+               $templateName = $this->getTemplateName();
+
+               // Generate full section name
+               $sectionName = $section . '_vars';
+
+               // Is the list initialized?
+               if (!isset($this->recipientList[$templateName][$sectionName])) {
+                       // Then initialize it here
+                       $this->recipientList[$templateName][$sectionName] = array();
+               } // END - if
+
+               // Add the variable to the list
+               $this->recipientList[$templateName][$sectionName][$variableName] = 'OK';
+       }
+
+       /**
+        * Adds a config template variable to the recipient list of current template
+        *
+        * @param       $variableName   Template variable name to add
+        * @return      void
+        */
+       public final function addConfigTemplateVariable ($variableName) {
+               $this->addTemplateVariable("config", $variableName);
+       }
+
+       /**
+        * Adds a "value" template variable to the recipient list of current template
+        *
+        * @param       $variableName   Template variable name to add
+        * @return      void
+        */
+       public final function addValueTemplateVariable ($variableName) {
+               $this->addTemplateVariable("value", $variableName);
+       }
+
+       /**
+        * Adds a value instance for a given variable name. It should be set!
+        *
+        * @param       $variableName   Template variable we want to assign a value instance
+        * @param       $valueInstance  An object instance which can provide "field values"
+        * @return      void
+        */
+       public final function addValueInstance ($variableName, FrameworkInterface $valueInstance) {
+               $this->recipientList[$this->getTemplateName()]['values'][$variableName] = $valueInstance;
+       }
+
+       /**
+        * Protected setter for template name
+        *
+        * @param       $templateName   Name of email template
+        * @return      void
+        */
+       public final function setTemplateName ($templateName) {
+               $this->templateName = (string) $templateName;
+       }
+
+       /**
+        * Protected getter for template name
+        *
+        * @return      $templateName   Name of email template
+        */
+       protected final function getTemplateName () {
+               return $this->templateName;
+       }
+
+       /**
+        * Setter for subject line
+        *
+        * @param       $subjectLine    Subject line to set
+        * @return      void
+        */
+       public final function setSubjectLine ($subjectLine) {
+               $this->recipientList[$this->getTemplateName()]['subject'] = (string) $subjectLine;
+       }
+
+       /**
+        * Getter for subject line or null if not found
+        *
+        * @return      $subjectLine    Subject line to set
+        */
+       public final function getSubjectLine () {
+               // Default subject is null
+               $subjectLine = null;
+
+               // Get template name
+               $templateName = $this->getTemplateName();
+
+               // Does the subject line exist?
+               if ((!empty($templateName)) && (isset($this->recipientList[$templateName]['subject']))) {
+                       // Then use it
+                       $subjectLine = $this->recipientList[$templateName]['subject'];
+               } // END - if
+
+               // Return it
+               return $subjectLine;
+       }
+
+       /**
+        * Use subject line provided by the (XML) template otherwise a subject line must be set
+        *
+        * @return      void
+        */
+       public function useSubjectFromTemplate () {
+               // Set the subject line
+               $this->setSubjectLine("{?subject?}");
+       }
+
+       /**
+        * Getter for recipient list array
+        *
+        * @return      $recipientList  Array with reciepients
+        */
+       public final function getRecipientList () {
+               return $this->recipientList;
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/main/mailer/debug/.htaccess b/inc/classes/main/mailer/debug/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/inc/classes/main/mailer/debug/class_DebugMailer.php b/inc/classes/main/mailer/debug/class_DebugMailer.php
new file mode 100644 (file)
index 0000000..14bdd41
--- /dev/null
@@ -0,0 +1,175 @@
+<?php
+/**
+ * A mailer class for debugging purposes only. This class will print the
+ * prepared mail out and will not send it to the recipient.
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class DebugMailer extends BaseMailer implements DeliverableMail {
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+       }
+
+       /**
+        * Creates an instance of this mailer class
+        *
+        * @param       $templateInstance       A template instance
+        * @param       $appInstance            An application helper class
+        * @param       $templateName           Name of email template to set
+        * @return      $mailerInstance         An instance of this mailer class
+        */
+       public final static function createDebugMailer (CompileableTemplate $templateInstance, ManageableApplication $appInstance, $templateName) {
+               // Get a new instance
+               $mailerInstance = new DebugMailer();
+
+               // Set template instance
+               $mailerInstance->setTemplateInstance($templateInstance);
+
+               // Set application instance
+               $mailerInstance->setApplicationInstance($appInstance);
+
+               // Set template name
+               $mailerInstance->setTemplateName('resend_link');
+
+               // Return the instance
+               return $mailerInstance;
+       }
+
+       /**
+        * Deliver email to the recipient(s)
+        *
+        * @return      void
+        * @throws      InvalidInterfaceException       If the recipient instance does not implement ManageableMember
+        */
+       public function deliverEmail () {
+               // Get template instance
+               $templateInstance = $this->getTemplateInstance();
+
+               // "Deliver" all emails
+               foreach ($this->getRecipientList() as $templateName => $recipientList) {
+                       // Walk through all recipients and "sent", or better print, it out
+                       foreach ($recipientList['recipients'] as $recipientInstance) {
+                               // The recipient should be a user instance, right?
+                               if (!$recipientInstance instanceof ManageableMember) {
+                                       // Invalid entry found!
+                                       throw new InvalidInterfaceException(array($this, 'ManageableMember'), self::EXCEPTION_REQUIRED_INTERFACE_MISSING);
+                               }
+
+                               // User class found, so entry is valid, first load the template
+                               $this->loadTemplate($templateName);
+
+                               // Set subject line
+                               $templateInstance->assignVariable('subject', $this->getSubjectLine());
+
+                               // Walk through all variables, first config to assign them
+                               foreach ($recipientList['config_vars'] as $variable => $dummy) {
+                                       // Load the config value and set it
+                                       $templateInstance->assignConfigVariable($variable);
+                               } // END - if
+
+                               // Now do the same with the values but ask the "value instance" instead!
+                               foreach ($recipientList['value_vars'] as $variable => $dummy) {
+                                       // Is the value instance there?
+                                       if (!isset($recipientList['values'][$variable])) {
+                                               // Throw exception
+                                               throw new NullPointerException ($this, self::EXCEPTION_IS_NULL_POINTER);
+                                       } // END - if
+
+                                       // Get the field from the value instance
+                                       $fieldValue = $recipientList['values'][$variable]->getField($variable);
+
+                                       // Set it in template engine
+                                       $templateInstance->assignVariable($variable, $fieldValue);
+                               }
+
+                               // Render the content
+                               $templateInstance->renderXmlContent();
+
+                               // Get responce instance
+                               $responseInstance = $this->getApplicationInstance()->getResponseInstance();
+
+                               // Transfer the data to the response
+                               $this->getTemplateInstance()->transferToResponse($responseInstance);
+                       } // END - foreach
+               } // END - foreach
+       }
+
+       /**
+        * Send notification to the admin
+        *
+        * @return      void
+        * @todo        0% done
+        */
+       public function sendAdminNotification () {
+               // Unfinished work
+       }
+
+       /**
+        * Invokes the mail delivery process which will prepare the output of the message in a code template
+        *
+        * @return      void
+        */
+       public function invokeMailDelivery () {
+               // Get template instance
+               $templateInstance = $this->getTemplateInstance();
+
+               // Get the compiled message and set it as new template variable
+               $message = $templateInstance->getCompiledData();
+               $templateInstance->assignVariable('message', $message);
+
+               // Load the code template
+               $templateInstance->loadCodeTemplate('mail_debug');
+
+               // Compile the template
+               $templateInstance->compileTemplate();
+
+               // Assign this template with variable
+               $templateInstance->assignTemplateWithVariable('mail_debug', 'content');
+
+               // 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');
+
+               // Load the master template
+               $templateInstance->loadCodeTemplate($this->getApplicationInstance()->getMasterTemplate());
+
+               // Then compile it again
+               $templateInstance->compileVariables();
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/main/output/.htaccess b/inc/classes/main/output/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/inc/classes/main/output/class_ConsoleOutput.php b/inc/classes/main/output/class_ConsoleOutput.php
new file mode 100644 (file)
index 0000000..51f5dca
--- /dev/null
@@ -0,0 +1,115 @@
+<?php
+/**
+ * This class simply puts text without any HTML code out. This class is suiable
+ * for console output
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class ConsoleOutput extends BaseFrameworkSystem implements OutputStreamer {
+       /**
+        * The instance for the singleton design pattern
+        */
+       private static $consoleInstance = null;
+
+       /**
+        * Assigned variables
+        */
+       private $vars = array();
+
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+       }
+
+       /**
+        * Create a new web output system and set the content type
+        *
+        * @param       $contentType    A valid content-type
+        * @return      $debugInstance  An instance of this middleware class
+        */
+       public final static function createConsoleOutput ($contentType) {
+               // Cast the content-type to string
+               $contentType = (string) $contentType;
+               $contentType = trim($contentType);
+
+               // Get instance
+               self::$consoleInstance = new ConsoleOutput();
+
+               // Set the content type
+               if (!empty($contentType)) {
+                       @header(sprintf("Content-type: %s",
+                               $contentType
+                       ));
+               }
+
+               // Return instance
+               return self::$consoleInstance;
+       }
+
+       /**
+        * Getter for an instance of this class
+        *
+        * @return      $consoleInstance        An instance of this class
+        */
+       public final static function getInstance() {
+               if (is_null(self::$consoleInstance)) {
+                       $contentType = FrameworkConfiguration::getInstance()->readConfig('web_content_type');
+                       self::$consoleInstance = ConsoleOutput::createConsoleOutput($contentType);
+               }
+               return self::$consoleInstance;
+       }
+
+       /**
+        * Output the code
+        *
+        * @param       $outStream      Something we shall sent to the console
+        * @return      void
+        */
+       public final function output ($outStream=false) {
+               if ($outStream === false) {
+                       // Output something here...
+                       foreach ($this->vars as $var => $value) {
+                               $this->output("var=".$var.", value=".$value."");
+                       }
+               } else {
+                       // Output it to the console
+                       printf("%s\n", trim(html_entity_decode(strip_tags(stripslashes($outStream)))));
+               }
+       }
+
+       /**
+        * Assigns a variable for output
+        *
+        * @param       $var    The variable we shall assign
+        * @param       $value  The value to store in the variable
+        * @return      void
+        */
+       public function assignVariable ($var, $value) {
+               $this->vars[$var] = $value;
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/main/output/class_WebOutput.php b/inc/classes/main/output/class_WebOutput.php
new file mode 100644 (file)
index 0000000..e82c0b7
--- /dev/null
@@ -0,0 +1,92 @@
+<?php
+/**
+ * This class simply puts HTML code / JavaScript code or CSS code out to the
+ * browser
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class WebOutput extends BaseFrameworkSystem implements OutputStreamer, Registerable {
+       /**
+        * The instance for the singleton design pattern
+        */
+       private static $webInstance = null;
+
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+       }
+
+       /**
+        * Create a new web output system and set the content type
+        *
+        * @param               $contentType            A valid content-type
+        * @return      $debugInstance          An instance of this middleware class
+        */
+       public final static function createWebOutput ($contentType) {
+               // Is there no instance?
+               if (is_null(self::$webInstance)) {
+                       // Cast the content-type to string and trim it
+                       $contentType = (string) $contentType;
+                       $contentType = trim($contentType);
+
+                       // Set the content type
+                       if (!empty($contentType)) {
+                               @header(sprintf("Content-type: %s",
+                                       $contentType
+                               ));
+                       }
+
+                       // Get a new instance and set it
+                       self::$webInstance = new WebOutput();
+               }
+
+               // Return instance
+               return self::$webInstance;
+       }
+
+       /**
+        * Assigns a variable for output
+        *
+        * @param               $var            The variable we shall assign
+        * @param               $value  The value to store in the variable
+        * @return      void
+        */
+       public function assignVariable($var, $value) {
+               // Stub message because we don't have it here
+               trigger_error(__METHOD__.": Stub!");
+       }
+
+       /**
+        * Output the code
+        *
+        * @return      void
+        */
+       public final function output ($outStream=false) {
+               print(stripslashes($outStream));
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/main/points/.htaccess b/inc/classes/main/points/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/inc/classes/main/points/class_UserPoints.php b/inc/classes/main/points/class_UserPoints.php
new file mode 100644 (file)
index 0000000..e7b636f
--- /dev/null
@@ -0,0 +1,93 @@
+<?php
+/**
+ * A class for handling user points which can be real or Internet currency
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class UserPoints extends BaseFrameworkSystem implements Registerable {
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+
+               // Clean up a little
+               $this->removeNumberFormaters();
+               $this->removeSystemArray();
+       }
+
+       /**
+        * Creates an instance of this points class
+        *
+        * @param       $userInstance           An instance of a user class
+        * @return      $pointsInstance         An instance of this class
+        */
+       public final static function createUserPoints (ManageableAccount $userInstance) {
+               // Get a new instance
+               $pointsInstance = new UserPoints();
+
+               // Set user instance
+               $pointsInstance->setUserInstance($userInstance);
+
+               // Return instance
+               return $pointsInstance;
+       }
+
+       /**
+        * Checks wether the user has the required amount of points left for the specified action
+        *
+        * @param       $action                 The action or configuration entry plus prefix the user wants to perform
+        * @return      $hasRequired    Wether the user has the required points
+        * @todo        Finish loading part of points
+        */
+       public function ifUserHasRequiredPoints ($action) {
+               // Default is that everyone is poor... ;-)
+               $hasRequired = false;
+
+               // Get the required points entry
+               $requiredPoints = $this->getConfigInstance()->readConfig($action . '_action_points');
+
+               // Get a wrapper instance
+               $wrapperInstance = ObjectFactory::createObjectByConfiguredName('user_points_db_wrapper_class');
+
+               // Now get a search criteria and set the user's name as criteria
+               $criteriaInstance = ObjectFactory::createObjectByConfiguredName('search_criteria_class');
+               $criteriaInstance->addCriteria("points_uid", $this->getUserInstance()->getUserName());
+               $criteriaInstance->setLimit(1);
+
+               // Get result back
+               $resultInstance = $wrapperInstance->doSelectByCriteria($criteriaInstance);
+
+               // Do we have an entry?
+               if ($resultInstance->next()) {
+                       // @TODO Load points here
+                       $this->partialStub("Load points here for comparison.");
+               } // END - if
+
+               // Return the result
+               return $hasRequired;
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/main/reader/.htaccess b/inc/classes/main/reader/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/inc/classes/main/reader/class_DefaultNewsReader.php b/inc/classes/main/reader/class_DefaultNewsReader.php
new file mode 100644 (file)
index 0000000..b0dbac6
--- /dev/null
@@ -0,0 +1,87 @@
+<?php
+/**
+ * A default news reader class reads news from database layer
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class DefaultNewsReader extends BaseFrameworkSystem implements ReadableNews, Registerable {
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+
+               // 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 () {
+               // Get "page" for saving some calls
+               $page = $this->getRequestInstance()->getRequestElement('page');
+
+               // First get a wrapper instance
+               $wrapperInstance = ObjectFactory::createObjectByConfiguredName('news_db_wrapper_class');
+
+               // Next create a searchable criteria instance
+               $criteriaInstance = ObjectFactory::createObjectByConfiguredName('search_criteria_class');
+
+               // Add the page as criteria to it at lease
+               $criteriaInstance->addCriteria("page", $page);
+
+               // Add limitation from config
+               $criteriaInstance->setLimit($this->getConfigInstance()->readConfig("news_{$page}_limit"));
+
+               // Get a resultInstance back from the database
+               $resultInstance = $wrapperInstance->doSelectByCriteria($criteriaInstance);
+
+               // Save that resultInstance in this class
+               $this->setResultInstance($resultInstance);
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/main/registration/.htaccess b/inc/classes/main/registration/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/inc/classes/main/registration/class_BaseRegistration.php b/inc/classes/main/registration/class_BaseRegistration.php
new file mode 100644 (file)
index 0000000..1ebf7e5
--- /dev/null
@@ -0,0 +1,105 @@
+<?php
+/**
+ * A general registration class.
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class BaseRegistration extends BaseFrameworkSystem {
+       /**
+        * Pre-registration filter chain
+        */
+       private $preRegistrationFilter = null;
+
+       /**
+        * Pre-registration filter chain
+        */
+       private $postRegistrationFilter = null;
+
+       /**
+        * Protected constructor
+        *
+        * @param       $className      Name of the class
+        * @return      void
+        */
+       protected function __construct ($className) {
+               // Call parent constructor
+               parent::__construct($className);
+
+               // Clean up a little
+               $this->removeNumberFormaters();
+               $this->removeSystemArray();
+       }
+
+       /**
+        * Initialize filters. This must be done before you can use them
+        *
+        * @return      void
+        */
+       protected function initFilterChains () {
+               // Pre/post-registration filters
+               $this->preRegistrationFilter = ObjectFactory::createObjectByConfiguredName('filter_chain_class');
+               $this->postRegistrationFilter = ObjectFactory::createObjectByConfiguredName('filter_chain_class');
+       }
+
+       /**
+        * Adds a filter to the pre filter chain
+        *
+        * @param       $filterInstance         An instance of a filter
+        * @return      void
+        */
+       public function addPreFilter (Filterable $filterInstance) {
+               // Add the pre filter
+               $this->preRegistrationFilter->addFilter($filterInstance);
+       }
+
+       /**
+        * Adds a filter to the post filter chain
+        *
+        * @param       $filterInstance         An instance of a filter
+        * @return      void
+        */
+       public function addPostFilter (Filterable $filterInstance) {
+               // Add the post filter
+               $this->postRegistrationFilter->addFilter($filterInstance);
+       }
+
+       /**
+        * Executes all pre filters
+        *
+        * @return      void
+        */
+       protected function executePreFilters () {
+               // Execute all pre filters
+               $this->preRegistrationFilter->processFilters($this->getRequestInstance(), $this->getResponseInstance());
+       }
+
+       /**
+        * Executes all post filters
+        *
+        * @return      void
+        */
+       protected function executePostFilters () {
+               // Execute all post filters
+               $this->postRegistrationFilter->processFilters($this->getRequestInstance(), $this->getResponseInstance());
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/main/registry/.htaccess b/inc/classes/main/registry/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/inc/classes/main/registry/class_Registry.php b/inc/classes/main/registry/class_Registry.php
new file mode 100644 (file)
index 0000000..9a8b648
--- /dev/null
@@ -0,0 +1,132 @@
+<?php
+/**
+ * A registry for several data types
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class Registry extends BaseFrameworkSystem implements Register {
+       /**
+        * Instance of this class
+        */
+       private static $selfInstance = null;
+
+       /**
+        * Wether the registry is initialized
+        */
+       private static $initialized = false;
+
+       /**
+        * Instance registry
+        */
+       private $instanceRegistry = array();
+
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+
+               // Clean up a little
+               $this->removeNumberFormaters();
+               $this->removeSystemArray();
+       }
+
+       /**
+        * Singleton getter for self instance
+        *
+        * @return      $selfInstance   Instance of this class
+        */
+       public final static function getRegistry () {
+               // Is an instance there?
+               if (is_null(self::$selfInstance)) {
+                       // Not yet, so create one
+                       self::$selfInstance = new Registry();
+               }
+
+               // Return the instance
+               return self::$selfInstance;
+       }
+
+       /**
+        * Checks or sets wether the registry has been initialized. This had only be done once
+        *
+        * @param       $initialized    Wether the registry is initialized
+        * @return      $initialized    Wether the registry is initialized
+        */
+       public final static function isInitialized ($initialized = null) {
+               if (is_null($initialized)) {
+                       // Get status if initialized
+                       return self::$initialized;
+               } elseif (!is_null($initialized)) {
+                       // Registry is initialized!
+                       self::$initialized = true;
+               }
+       }
+
+       /**
+        * Checks wether an instance key was found
+        *
+        * @param       $instanceKey    The key holding an instance in registry
+        * @return      $exists                 Wether the key exists in registry
+        */
+       public function instanceExists ($instanceKey) {
+               // Does this key exists?
+               $exists = (isset($this->instanceRegistry[$instanceKey]));
+
+               // Return the result
+               return $exists;
+       }
+
+       /**
+        * Adds/overwrites a new instance to the registry at the given key
+        *
+        * @param       $instanceKey            The key to identify the instance
+        * @param       $objectInstance         An instance we shall store
+        * @return      void
+        */
+       public function addInstance ($instanceKey, Registerable $objectInstance) {
+               $this->instanceRegistry[$instanceKey] = $objectInstance;
+       }
+
+       /**
+        * Gets a registered instance or null if not found
+        *
+        * @param       $instanceKey            The key to identify the instance
+        * @return      $objectInstance         An instance we shall store
+        */
+       public function getInstance ($instanceKey) {
+               // By default the instance is not in registry
+               $objectInstance = null;
+
+               // Is the instance there?
+               if ($this->instanceExists($instanceKey)) {
+                       $objectInstance = $this->instanceRegistry[$instanceKey];
+               }
+
+               // Return the result
+               return $objectInstance;
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/main/request/.htaccess b/inc/classes/main/request/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/inc/classes/main/request/class_HttpRequest.php b/inc/classes/main/request/class_HttpRequest.php
new file mode 100644 (file)
index 0000000..0538512
--- /dev/null
@@ -0,0 +1,208 @@
+<?php
+/**
+ * A concrete and secured HTTP request class to make HTTP requests more abstract
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class HttpRequest extends BaseFrameworkSystem implements Requestable {
+       /**
+        * Array for the request data
+        */
+       private $requestData = array();
+
+       /**
+        * Wether this request is valid and can be further processed. The default is
+        * valid so make sure your intercepting filters sets this attribute to false
+        * when they need to intercept the data flow.
+        */
+       private $requestIsValid = true;
+
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+
+               // Clean up a little
+               $this->removeNumberFormaters();
+               $this->removeSystemArray();
+       }
+
+       /**
+        * Creates an instance of this class and prepares it a little
+        *
+        * @return      $httpInstance   An instance of this class
+        */
+       public final static function createHttpRequest () {
+               // Create an instance
+               $httpInstance = new HttpRequest();
+
+               // Prepare the HTTP request data for usage
+               $httpInstance->prepareRequestData();
+
+               // Return the prepared instance
+               return $httpInstance;
+       }
+
+       /**
+        * Prepares the HTTP request data for usage by currently copying
+        * $_REQUEST into a private attribute. Later on we can add more
+        * things for initialization here.
+        *
+        * @return      void
+        */
+       public function prepareRequestData () {
+               // Copy GET then POST data
+               $this->requestData = array_merge($_GET, $_POST);
+       }
+
+       /**
+        * Checks wether a request element is set
+        * @param       $element        Name of the request element we want to check
+        * @return      $isSet          Wether the request element is set
+        */
+       public function isRequestElementSet ($element) {
+               // Is this element found?
+               $isSet = isset($this->requestData[$element]);
+
+               // Return result
+               return $isSet;
+       }
+
+       /**
+        * Getter for request element or 'null' if element was not found
+        *
+        * @param       $element        Name of the request element we want to check
+        * @return      $value          Value of the found request element or 'null' if the
+        *                                              element was not found
+        */
+       public function getRequestElement ($element) {
+               // Initialize value
+               $value = null;
+
+               // Is the element set?
+               if ($this->isRequestElementSet($element)) {
+                       // Get the bare value
+                       $value = $this->requestData[$element];
+
+                       // Secure it against attacks
+                       $value = htmlentities(strip_tags($value), ENT_QUOTES);
+               } // END - if
+
+               // Return the element's value
+               return $value;
+       }
+
+       /**
+        * Setter for request elements
+        *
+        * @param       $element        Request element to se
+        * @param       $value          Value to set
+        * @return      void
+        */
+       public function setRequestElement ($element, $value) {
+               $this->requestData[$element] = $value;
+       }
+
+       /**
+        * Wrapper method for array_key() function for the request data array
+        *
+        * @return      $array  An array containing all array keys to return
+        */
+       public function getParameterNames () {
+               return array_keys($this->requestData);
+       }
+
+       /**
+        * Getter for a header element or 'null' if header was not found
+        *
+        * @param       $headerName             Name of the header
+        * @return      $headerValue    Value of the header or 'null' if not found
+        */
+       public function getHeader ($headerName) {
+               // Default return value on error
+               $headerValue = null;
+
+               // Construct the name
+               $name = 'HTTP_' . strtolower(str_replace('-', '_', $headerName));
+
+               // Does this header exist?
+               if (isset($_SERVER[$name])) {
+                       $headerValue = $_SERVER[$name];
+               } // END - if
+
+               // Return the value
+               return $headerValue;
+       }
+
+       /**
+        * Getter for request method. This getter might be useful for security filters
+        *
+        * @return      $requestMethod  Used request method
+        */
+       public final function getRequestMethod () {
+               return $_SERVER['REQUEST_METHOD'];
+       }
+
+       /**
+        * Sets wether the request was valid (default: true)
+        *
+        * @param       $isValid        Wether the request is valid
+        * @return      void
+        */
+       public final function requestIsValid ($isValid = true) {
+               $this->requestIsValid = (bool) $isValid;
+       }
+
+       /**
+        * Returns wether this request is valid
+        *
+        * @return      $requestIsValid         Wether this request is valid
+        */
+       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/.htaccess b/inc/classes/main/resolver/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/inc/classes/main/resolver/action/.htaccess b/inc/classes/main/resolver/action/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/inc/classes/main/resolver/action/class_BaseActionResolver.php b/inc/classes/main/resolver/action/class_BaseActionResolver.php
new file mode 100644 (file)
index 0000000..7e462cc
--- /dev/null
@@ -0,0 +1,134 @@
+<?php
+/**
+ * A generic action resolver class
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class BaseActionResolver extends BaseResolver {
+       /**
+        * Prefix for local, remote or other resolver
+        */
+       private $actionPrefix = "";
+
+       /**
+        * Validated action name
+        */
+       private $actionName = "";
+
+       /**
+        * Protected constructor
+        *
+        * @param       $className      Name of the class
+        * @return      void
+        */
+       protected function __construct ($className) {
+               // Call parent constructor
+               parent::__construct($className);
+       }
+
+       /**
+        * Setter for action prefix
+        *
+        * @param       $actionPrefix   Last validated actionPrefix
+        * @return      void
+        */
+       protected final function setActionPrefix ($actionPrefix) {
+               $this->actionPrefix = $actionPrefix;
+       }
+
+       /**
+        * Setter for action name
+        *
+        * @param       $actionName     Last validated action name
+        * @return      void
+        */
+       protected final function setActionName ($actionName) {
+               $this->actionName = (string) $actionName;
+       }
+
+       /**
+        * Getter for action name
+        *
+        * @return      $actionName     Last validated action name
+        */
+       public final function getActionName () {
+               return $this->actionName;
+       }
+
+       /**
+        * Checks wether the given action is valid
+        *
+        * @param       $actionName     The default action we shall execute
+        * @return      $isValid                Wether the given action is valid
+        * @throws      EmptyVariableException  Thrown if given action is not set
+        */
+       public function isActionValid ($actionName) {
+               // By default nothing shall be valid
+               $isValid = false;
+
+               // Is a action set?
+               if (empty($actionName)) {
+                       // Then thrown an exception here
+                       throw new EmptyVariableException(array($this, 'actionName'), self::EXCEPTION_UNEXPECTED_EMPTY_STRING);
+               } // END - if
+
+               // Now, let us create the full name of the action class
+               $this->setClassName(sprintf("%s%sAction",
+                       $this->actionPrefix,
+                       $this->convertToClassName($actionName)
+               ));
+
+               // Is this class already loaded?
+               if (class_exists($this->getClassName())) {
+                       // This class does exist. :-)
+                       $isValid = true;
+               } // END - if
+
+               // Set action name
+               $this->setActionName($actionName);
+
+               // Return the result
+               return $isValid;
+       }
+
+       /**
+        * "Loads" current action and instances it if not yet cached
+        *
+        * @return      $actionInstance                 A loaded action instance
+        */
+       protected function loadAction () {
+               // Init action instance
+               $actionInstance = null;
+
+               // Create action class name
+               $this->setClassName(sprintf("Web%sAction",
+                       $this->convertToClassName($this->getActionName())
+               ));
+
+               // Initiate the action
+               $actionInstance = ObjectFactory::createObjectByName($this->getClassName(), array($this));
+
+               // Return the result
+               return $actionInstance;
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/main/resolver/action/web/.htaccess b/inc/classes/main/resolver/action/web/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/inc/classes/main/resolver/action/web/class_WebActionResolver.php b/inc/classes/main/resolver/action/web/class_WebActionResolver.php
new file mode 100644 (file)
index 0000000..6276b11
--- /dev/null
@@ -0,0 +1,147 @@
+<?php
+/**
+ * A action resolver for local (non-hubbed) actions
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class WebActionResolver extends BaseActionResolver implements ActionResolver {
+       /**
+        * Last successfull resolved action
+        */
+       private $lastActionInstance = "";
+
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+
+               // Set prefix to "Web"
+               $this->setActionPrefix("Web");
+       }
+
+       /**
+        * Creates an instance of a Web action resolver with a given default action
+        *
+        * @param       $actionName                             The default action we shall execute
+        * @param       $appInstance                    An instance of a manageable application helper class
+        * @return      $resolverInstance               The prepared action resolver instance
+        * @throws      EmptyVariableException  Thrown if default action is not set
+        * @throws      InvalidActionException  Thrown if default action is invalid
+        */
+       public final static function createWebActionResolver ($actionName, ManageableApplication $appInstance) {
+               // Create the new instance
+               $resolverInstance = new WebActionResolver();
+
+               // Is the variable $actionName set and the action is valid?
+               if (empty($actionName)) {
+                       // Then thrown an exception here
+                       throw new EmptyVariableException(array($resolverInstance, 'defaultAction'), self::EXCEPTION_UNEXPECTED_EMPTY_STRING);
+               } elseif ($resolverInstance->isActionValid($actionName) === false) {
+                       // Invalid action found
+                       throw new InvalidActionException(array($resolverInstance, $actionName), self::EXCEPTION_INVALID_ACTION);
+               }
+
+               // Set the application instance
+               $resolverInstance->setApplicationInstance($appInstance);
+
+               // Return the prepared instance
+               return $resolverInstance;
+       }
+
+       /**
+        * Returns an action instance for a given request class or null if
+        * it was not found
+        *
+        * @param       $requestInstance        An instance of a request class
+        * @return      $actionInstance An instance of the resolved action
+        * @throws      InvalidActionException                          Thrown if $actionName is
+        *                                                                                              invalid
+        * @throws      InvalidActionInstanceException          Thrown if $actionInstance
+        *                                                                                              is an invalid instance
+        */
+       public function resolveActionByRequest (Requestable $requestInstance) {
+               // Init variables
+               $actionName = "";
+               $actionInstance = null;
+
+               // This goes fine so let's resolv the action
+               $actionName = $requestInstance->getRequestElement('action');
+
+               // Is the action empty? Then fall back to default action
+               if (empty($actionName)) $actionName = $this->getConfigInstance()->readConfig('default_action');
+
+               // Check if action is valid
+               if ($this->isActionValid($actionName) === false) {
+                       // This action is invalid!
+                       throw new InvalidActionException(array($this, $actionName), self::EXCEPTION_INVALID_ACTION);
+               } // END - if
+
+               // Get the action
+               $actionInstance = $this->loadAction();
+
+               // And validate it
+               if ((!is_object($actionInstance)) || (!$actionInstance instanceof Actionable)) {
+                       // This action has an invalid instance!
+                       throw new InvalidActionInstanceException(array($this, $actionName), self::EXCEPTION_INVALID_ACTION);
+               } // END - if
+
+               // Set last action
+               $this->lastActionInstance = $actionInstance;
+
+               // Return the resolved action instance
+               return $actionInstance;
+       }
+
+       /**
+        * Resolves the action by its direct name and returns an instance of its class
+        *
+        * @return      $actionInstance         An instance of the action class
+        * @throws      InvalidActionException  Thrown if $actionName is invalid
+        */
+       public function resolveAction () {
+               // Initiate the instance variable
+               $actionInstance = null;
+
+               // Get action name
+               $actionName = $this->getActionName();
+
+               // Is the action empty? Then fall back to default action
+               if (empty($actionName)) $actionName = $this->getConfigInstance()->readConfig('default_action');
+
+               // Check if action is valid
+               if ($this->isActionValid($actionName) === false) {
+                       // This action is invalid!
+                       throw new InvalidActionException(array($this, $actionName), self::EXCEPTION_INVALID_ACTION);
+               }
+
+               // Get the action
+               $actionInstance = $this->loadAction();
+
+               // Return the instance
+               return $actionInstance;
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/main/resolver/class_BaseResolver.php b/inc/classes/main/resolver/class_BaseResolver.php
new file mode 100644 (file)
index 0000000..07e1966
--- /dev/null
@@ -0,0 +1,71 @@
+<?php
+/**
+ * A generic resolver class
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class BaseResolver extends BaseFrameworkSystem {
+       /**
+        * Class name
+        */
+       private $className = "";
+
+       // Exception constants
+       const EXCEPTION_INVALID_COMMAND    = 0x1d0;
+       const EXCEPTION_INVALID_CONTROLLER = 0x1d1;
+       const EXCEPTION_INVALID_ACTION     = 0x1d2;
+
+       /**
+        * Protected constructor
+        *
+        * @param       $className      Real name of the class
+        * @return      void
+        */
+       protected function __construct ($className) {
+               // Call parent constructor
+               parent::__construct($className);
+
+               // Clean up a little
+               $this->removeNumberFormaters();
+               $this->removeSystemArray();
+       }
+
+       /**
+        * Setter for class name
+        *
+        * @param       $className      Name of the class
+        * @return      void
+        */
+       protected final function setClassName ($className) {
+               $this->className = $className;
+       }
+
+       /**
+        * Getter for class name
+        *
+        * @return      $className      Name of the class
+        */
+       public final function getClassName () {
+               return $this->className;
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/main/resolver/command/.htaccess b/inc/classes/main/resolver/command/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/inc/classes/main/resolver/command/class_BaseCommandResolver.php b/inc/classes/main/resolver/command/class_BaseCommandResolver.php
new file mode 100644 (file)
index 0000000..4900c61
--- /dev/null
@@ -0,0 +1,113 @@
+<?php
+/**
+ * A generic command resolver class
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class BaseCommandResolver extends BaseResolver {
+       /**
+        * Prefix for local, remote or other resolver
+        */
+       private $commandPrefix = "";
+
+       /**
+        * Validated command name
+        */
+       private $commandName = "";
+
+       /**
+        * Protected constructor
+        *
+        * @param       $className      Name of the class
+        * @return      void
+        */
+       protected function __construct ($className) {
+               // Call parent constructor
+               parent::__construct($className);
+       }
+
+       /**
+        * Setter for command prefix
+        *
+        * @param       $commandPrefix  Last validated commandPrefix
+        * @return      void
+        */
+       protected final function setCommandPrefix ($commandPrefix) {
+               $this->commandPrefix = $commandPrefix;
+       }
+
+       /**
+        * Setter for command name
+        *
+        * @param       $commandName    Last validated command name
+        * @return      void
+        */
+       protected final function setCommandName ($commandName) {
+               $this->commandName = $commandName;
+       }
+
+       /**
+        * Getter for command name
+        *
+        * @return      $commandName    Last validated command name
+        */
+       protected final function getCommandName () {
+               return $this->commandName;
+       }
+
+       /**
+        * Checks wether the given command is valid
+        *
+        * @param       $commandName    The default command we shall execute
+        * @return      $isValid                Wether the given command is valid
+        * @throws      EmptyVariableException  Thrown if given command is not set
+        */
+       public function isCommandValid ($commandName) {
+               // By default nothing shall be valid
+               $isValid = false;
+
+               // Is a command set?
+               if (empty($commandName)) {
+                       // Then thrown an exception here
+                       throw new EmptyVariableException(array($this, 'commandName'), self::EXCEPTION_UNEXPECTED_EMPTY_STRING);
+               }
+
+               // Now, let us create the full name of the command class
+               $this->setClassName(sprintf("%s%sCommand",
+                       $this->commandPrefix,
+                       $this->convertToClassName($commandName)
+               ));
+
+               // Is this class already loaded?
+               if (class_exists($this->getClassName())) {
+                       // This class does exist. :-)
+                       $isValid = true;
+               } // END - if
+
+               // Set command name
+               $this->setCommandName($commandName);
+
+               // Return the result
+               return $isValid;
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/main/resolver/command/image/.htaccess b/inc/classes/main/resolver/command/image/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/inc/classes/main/resolver/command/image/class_ImageCommandResolver.php b/inc/classes/main/resolver/command/image/class_ImageCommandResolver.php
new file mode 100644 (file)
index 0000000..dc104e6
--- /dev/null
@@ -0,0 +1,178 @@
+<?php
+/**
+ * A command resolver for local (non-hubbed) image commands
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class ImageCommandResolver extends BaseCommandResolver implements CommandResolver {
+       /**
+        * Last successfull resolved command
+        */
+       private $lastCommandInstance = null;
+
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+
+               // Set prefix to "Image"
+               $this->setCommandPrefix("Image");
+       }
+
+       /**
+        * Creates an instance of a Image command resolver with a given default command
+        *
+        * @param       $commandName                            The default command we shall execute
+        * @param       $appInstance                            An instance of a manageable application helper class
+        * @return      $resolverInstance                       The prepared command resolver instance
+        * @throws      EmptyVariableException          Thrown if default command is not set
+        * @throws      InvalidCommandException         Thrown if default command is invalid
+        */
+       public final static function createImageCommandResolver ($commandName, ManageableApplication $appInstance) {
+               // Create the new instance
+               $resolverInstance = new ImageCommandResolver();
+
+               // Is the variable $commandName set and the command is valid?
+               if (empty($commandName)) {
+                       // Then thrown an exception here
+                       throw new EmptyVariableException(array($resolverInstance, 'commandName'), self::EXCEPTION_UNEXPECTED_EMPTY_STRING);
+               } elseif ($resolverInstance->isCommandValid($commandName) === false) {
+                       // Invalid command found
+                       throw new InvalidCommandException(array($resolverInstance, $commandName), self::EXCEPTION_INVALID_COMMAND);
+               }
+
+               // Set the application instance
+               $resolverInstance->setApplicationInstance($appInstance);
+
+               // Return the prepared instance
+               return $resolverInstance;
+       }
+
+       /**
+        * Returns an command instance for a given request class or null if
+        * it was not found
+        *
+        * @param       $requestInstance        An instance of a request class
+        * @return      $commandInstance        An instance of the resolved command
+        * @throws      InvalidCommandException                         Thrown if $commandName is
+        *                                                                                              invalid
+        * @throws      InvalidCommandInstanceException         Thrown if $commandInstance
+        *                                                                                              is an invalid instance
+        */
+       public function resolveCommandByRequest (Requestable $requestInstance) {
+               // Init variables
+               $commandName = "";
+               $commandInstance = null;
+
+               // This goes fine so let's resolv the command
+               $commandName = $requestInstance->getRequestElement('page');
+
+               // Is the command empty? Then fall back to default command
+               if (empty($commandName)) $commandName = $this->getConfigInstance()->readConfig('default_image_command');
+
+               // Check if command is valid
+               if ($this->isCommandValid($commandName) === false) {
+                       // This command is invalid!
+                       throw new InvalidCommandException(array($this, $commandName), self::EXCEPTION_INVALID_COMMAND);
+               } // END - if
+
+               // Get the command
+               $commandInstance = $this->loadCommand($commandName);
+
+               // And validate it
+               if ((!is_object($commandInstance)) || (!$commandInstance instanceof Commandable)) {
+                       // This command has an invalid instance!
+                       throw new InvalidCommandInstanceException(array($this, $commandName), self::EXCEPTION_INVALID_COMMAND);
+               } // END - if
+
+               // Set last command
+               $this->lastCommandInstance = $commandInstance;
+
+               // Return the resolved command instance
+               return $commandInstance;
+       }
+
+       /**
+        * Resolves the command by its direct name and returns an instance of its class
+        *
+        * @param       $commandName            The direct command name we shall resolve
+        * @return      $commandInstance        An instance of the command class
+        * @throws      InvalidCommandException         Thrown if $commandName is invalid
+        */
+       public function resolveCommand ($commandName) {
+               // Initiate the instance variable
+               $commandInstance = null;
+
+               // Is the command empty? Then fall back to default command
+               if (empty($commandName)) $commandName = $this->getConfigInstance()->readConfig('default_image_command');
+
+               // Check if command is valid
+               if ($this->isCommandValid($commandName) === false) {
+                       // This command is invalid!
+                       throw new InvalidCommandException(array($this, $commandName), self::EXCEPTION_INVALID_COMMAND);
+               }
+
+               // Get the command
+               $commandInstance = $this->loadCommand($commandName);
+
+               // Return the instance
+               return $commandInstance;
+       }
+
+       /**
+        * "Loads" a given command and instances it if not yet cached
+        *
+        * @param       $commandName                            A command name we shall look for
+        * @return      $commandInstance                        A loaded command instance
+        * @throws      InvalidCommandException         Thrown if even the default
+        *                                                                              command class is missing (bad!)
+        */
+       private function loadCommand ($commandName) {
+               // Cache default command
+               $defaultCommand = $this->getConfigInstance()->readConfig('default_image_command');
+
+               // Init command instance
+               $commandInstance = null;
+
+               // Create command class name
+               $this->setClassName(sprintf("Image%sCommand",
+                       $this->convertToClassName($commandName)
+               ));
+
+               // Is this class loaded?
+               if (!class_exists($this->getClassName())) {
+                       // Class not found, so throw an exception
+                       throw new InvalidCommandException(array($this, $defaultCommand), self::EXCEPTION_INVALID_COMMAND);
+               } // END - if
+
+               // Initiate the command
+               $commandInstance = ObjectFactory::createObjectByName($this->getClassName(), array($this));
+
+               // Return the result
+               return $commandInstance;
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/main/resolver/command/web/.htaccess b/inc/classes/main/resolver/command/web/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/inc/classes/main/resolver/command/web/class_ b/inc/classes/main/resolver/command/web/class_
new file mode 100644 (file)
index 0000000..4808086
--- /dev/null
@@ -0,0 +1,178 @@
+<?php
+/**
+ * A command resolver for local (non-hubbed) web commands
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class Web???CommandResolver extends BaseCommandResolver implements CommandResolver {
+       /**
+        * Last successfull resolved command
+        */
+       private $lastCommandInstance = null;
+
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+
+               // Set prefix to "Web"
+               $this->setCommandPrefix("Web");
+       }
+
+       /**
+        * Creates an instance of a Web command resolver with a given default command
+        *
+        * @param       $commandName                            The default command we shall execute
+        * @param       $appInstance                            An instance of a manageable application helper class
+        * @return      $resolverInstance                       The prepared command resolver instance
+        * @throws      EmptyVariableException          Thrown if the default command is not set
+        * @throws      InvalidCommandException         Thrown if the default command is invalid
+        */
+       public final static function createWeb???CommandResolver ($commandName, ManageableApplication $appInstance) {
+               // Create the new instance
+               $resolverInstance = new Web???CommandResolver();
+
+               // Is the variable $commandName set and the command is valid?
+               if (empty($commandName)) {
+                       // Then thrown an exception here
+                       throw new EmptyVariableException(array($resolverInstance, 'commandName'), self::EXCEPTION_UNEXPECTED_EMPTY_STRING);
+               } elseif ($resolverInstance->isCommandValid($commandName) === false) {
+                       // Invalid command found
+                       throw new InvalidCommandException(array($resolverInstance, $commandName), self::EXCEPTION_INVALID_COMMAND);
+               }
+
+               // Set the application instance
+               $resolverInstance->setApplicationInstance($appInstance);
+
+               // Return the prepared instance
+               return $resolverInstance;
+       }
+
+       /**
+        * Returns an command instance for a given request class or null if
+        * it was not found
+        *
+        * @param       $requestInstance        An instance of a request class
+        * @return      $commandInstance        An instance of the resolved command
+        * @throws      InvalidCommandException                         Thrown if $commandName is
+        *                                                                                              invalid
+        * @throws      InvalidCommandInstanceException         Thrown if $commandInstance
+        *                                                                                              is an invalid instance
+        */
+       public function resolveCommandByRequest (Requestable $requestInstance) {
+               // Init variables
+               $commandName = "";
+               $commandInstance = null;
+
+               // This goes fine so let's resolv the command
+               $commandName = $requestInstance->getRequestElement('page');
+
+               // Is the command empty? Then fall back to default command
+               if (empty($commandName)) $commandName = $this->getConfigInstance()->readConfig('default_web_command');
+
+               // Check if the command is valid
+               if ($this->isCommandValid($commandName) === false) {
+                       // This command is invalid!
+                       throw new InvalidCommandException(array($this, $commandName), self::EXCEPTION_INVALID_COMMAND);
+               } // END - if
+
+               // Get the command
+               $commandInstance = $this->loadCommand($commandName);
+
+               // And validate it
+               if ((!is_object($commandInstance)) || (!$commandInstance instanceof Commandable)) {
+                       // This command has an invalid instance!
+                       throw new InvalidCommandInstanceException(array($this, $commandName), self::EXCEPTION_INVALID_COMMAND);
+               } // END - if
+
+               // Set last command
+               $this->lastCommandInstance = $commandInstance;
+
+               // Return the resolved command instance
+               return $commandInstance;
+       }
+
+       /**
+        * Resolves the command by its direct name and returns an instance of its class
+        *
+        * @param       $commandName            The direct command name we shall resolve
+        * @return      $commandInstance        An instance of the command class
+        * @throws      InvalidCommandException         Thrown if $commandName is invalid
+        */
+       public function resolveCommand ($commandName) {
+               // Initiate the instance variable
+               $commandInstance = null;
+
+               // Is the command empty? Then fall back to default command
+               if (empty($commandName)) $commandName = $this->getConfigInstance()->readConfig('default_web_command');
+
+               // Check if the command is valid
+               if ($this->isCommandValid($commandName) === false) {
+                       // This command is invalid!
+                       throw new InvalidCommandException(array($this, $commandName), self::EXCEPTION_INVALID_COMMAND);
+               }
+
+               // Get the command
+               $commandInstance = $this->loadCommand($commandName);
+
+               // Return the instance
+               return $commandInstance;
+       }
+
+       /**
+        * "Loads" a given command and instances it if not yet cached
+        *
+        * @param       $commandName                            A command name we shall look for
+        * @return      $commandInstance                        A loaded command instance
+        * @throws      InvalidCommandException         Thrown if even the default
+        *                                                                              command class is missing (bad!)
+        */
+       private function loadCommand ($commandName) {
+               // Cache default command
+               $defaultCommand = $this->getConfigInstance()->readConfig('default_web_command');
+
+               // Init command instance
+               $commandInstance = null;
+
+               // Create command class name
+               $this->setClassName(sprintf("Web%sCommand",
+                       $this->convertToClassName($commandName)
+               ));
+
+               // Is this class loaded?
+               if (!class_exists($this->getClassName())) {
+                       // Class not found, so throw an exception
+                       throw new InvalidCommandException(array($this, $defaultCommand), self::EXCEPTION_INVALID_COMMAND);
+               } // END - if
+
+               // Initiate the command
+               $commandInstance = ObjectFactory::createObjectByName($this->getClassName(), array($this));
+
+               // Return the result
+               return $commandInstance;
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/main/resolver/command/web/class_WebCommandResolver.php b/inc/classes/main/resolver/command/web/class_WebCommandResolver.php
new file mode 100644 (file)
index 0000000..42ae37a
--- /dev/null
@@ -0,0 +1,178 @@
+<?php
+/**
+ * A command resolver for local (non-hubbed) web commands
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class WebCommandResolver extends BaseCommandResolver implements CommandResolver {
+       /**
+        * Last successfull resolved command
+        */
+       private $lastCommandInstance = null;
+
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+
+               // Set prefix to "Web"
+               $this->setCommandPrefix("Web");
+       }
+
+       /**
+        * Creates an instance of a Web command resolver with a given default command
+        *
+        * @param       $commandName                            The default command we shall execute
+        * @param       $appInstance                            An instance of a manageable application helper class
+        * @return      $resolverInstance                       The prepared command resolver instance
+        * @throws      EmptyVariableException          Thrown if default command is not set
+        * @throws      InvalidCommandException         Thrown if default command is invalid
+        */
+       public final static function createWebCommandResolver ($commandName, ManageableApplication $appInstance) {
+               // Create the new instance
+               $resolverInstance = new WebCommandResolver();
+
+               // Is the variable $commandName set and the command is valid?
+               if (empty($commandName)) {
+                       // Then thrown an exception here
+                       throw new EmptyVariableException(array($resolverInstance, 'commandName'), self::EXCEPTION_UNEXPECTED_EMPTY_STRING);
+               } elseif ($resolverInstance->isCommandValid($commandName) === false) {
+                       // Invalid command found
+                       throw new InvalidCommandException(array($resolverInstance, $commandName), self::EXCEPTION_INVALID_COMMAND);
+               }
+
+               // Set the application instance
+               $resolverInstance->setApplicationInstance($appInstance);
+
+               // Return the prepared instance
+               return $resolverInstance;
+       }
+
+       /**
+        * Returns an command instance for a given request class or null if
+        * it was not found
+        *
+        * @param       $requestInstance        An instance of a request class
+        * @return      $commandInstance        An instance of the resolved command
+        * @throws      InvalidCommandException                         Thrown if $commandName is
+        *                                                                                              invalid
+        * @throws      InvalidCommandInstanceException         Thrown if $commandInstance
+        *                                                                                              is an invalid instance
+        */
+       public function resolveCommandByRequest (Requestable $requestInstance) {
+               // Init variables
+               $commandName = "";
+               $commandInstance = null;
+
+               // This goes fine so let's resolv the command
+               $commandName = $requestInstance->getRequestElement('page');
+
+               // Is the command empty? Then fall back to default command
+               if (empty($commandName)) $commandName = $this->getConfigInstance()->readConfig('default_web_command');
+
+               // Check if command is valid
+               if ($this->isCommandValid($commandName) === false) {
+                       // This command is invalid!
+                       throw new InvalidCommandException(array($this, $commandName), self::EXCEPTION_INVALID_COMMAND);
+               } // END - if
+
+               // Get the command
+               $commandInstance = $this->loadCommand($commandName);
+
+               // And validate it
+               if ((!is_object($commandInstance)) || (!$commandInstance instanceof Commandable)) {
+                       // This command has an invalid instance!
+                       throw new InvalidCommandInstanceException(array($this, $commandName), self::EXCEPTION_INVALID_COMMAND);
+               } // END - if
+
+               // Set last command
+               $this->lastCommandInstance = $commandInstance;
+
+               // Return the resolved command instance
+               return $commandInstance;
+       }
+
+       /**
+        * Resolves the command by its direct name and returns an instance of its class
+        *
+        * @param       $commandName            The direct command name we shall resolve
+        * @return      $commandInstance        An instance of the command class
+        * @throws      InvalidCommandException         Thrown if $commandName is invalid
+        */
+       public function resolveCommand ($commandName) {
+               // Initiate the instance variable
+               $commandInstance = null;
+
+               // Is the command empty? Then fall back to default command
+               if (empty($commandName)) $commandName = $this->getConfigInstance()->readConfig('default_web_command');
+
+               // Check if command is valid
+               if ($this->isCommandValid($commandName) === false) {
+                       // This command is invalid!
+                       throw new InvalidCommandException(array($this, $commandName), self::EXCEPTION_INVALID_COMMAND);
+               }
+
+               // Get the command
+               $commandInstance = $this->loadCommand($commandName);
+
+               // Return the instance
+               return $commandInstance;
+       }
+
+       /**
+        * "Loads" a given command and instances it if not yet cached
+        *
+        * @param       $commandName                            A command name we shall look for
+        * @return      $commandInstance                        A loaded command instance
+        * @throws      InvalidCommandException         Thrown if even the default
+        *                                                                              command class is missing (bad!)
+        */
+       private function loadCommand ($commandName) {
+               // Cache default command
+               $defaultCommand = $this->getConfigInstance()->readConfig('default_web_command');
+
+               // Init command instance
+               $commandInstance = null;
+
+               // Create command class name
+               $this->setClassName(sprintf("Web%sCommand",
+                       $this->convertToClassName($commandName)
+               ));
+
+               // Is this class loaded?
+               if (!class_exists($this->getClassName())) {
+                       // Class not found, so throw an exception
+                       throw new InvalidCommandException(array($this, $defaultCommand), self::EXCEPTION_INVALID_COMMAND);
+               } // END - if
+
+               // Initiate the command
+               $commandInstance = ObjectFactory::createObjectByName($this->getClassName(), array($this));
+
+               // Return the result
+               return $commandInstance;
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/main/resolver/controller/.htaccess b/inc/classes/main/resolver/controller/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/inc/classes/main/resolver/controller/class_BaseControllerResolver.php b/inc/classes/main/resolver/controller/class_BaseControllerResolver.php
new file mode 100644 (file)
index 0000000..a667fe6
--- /dev/null
@@ -0,0 +1,126 @@
+<?php
+/**
+ * A generic controller resolver class
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class BaseControllerResolver extends BaseResolver {
+       /**
+        * Prefix for local, remote or other resolver
+        */
+       private $controllerPrefix = "";
+
+       /**
+        * Validated controller name
+        */
+       private $controllerName = "";
+
+       /**
+        * Protected constructor
+        *
+        * @param       $className      Name of the real class
+        * @return      void
+        */
+       protected function __construct ($className) {
+               // Call parent constructor
+               parent::__construct($className);
+       }
+
+       /**
+        * Setter for controller prefix
+        *
+        * @param       $controllerPrefix       Last validated controllerPrefix
+        * @return      void
+        */
+       protected final function setControllerPrefix ($controllerPrefix) {
+               $this->controllerPrefix = $controllerPrefix;
+       }
+
+       /**
+        * Setter for controller name
+        *
+        * @param       $controllerName         Last validated controller name
+        * @return      void
+        */
+       protected final function setControllerName ($controllerName) {
+               $this->controllerName = $controllerName;
+       }
+
+       /**
+        * Getter for controller name
+        *
+        * @return      $controllerName Last validated controller name
+        */
+       public final function getControllerName () {
+               return $this->controllerName;
+       }
+
+       /**
+        * Checks wether the given controller is valid
+        *
+        * @param       $controllerName         The default controller we shall execute
+        * @return      $isValid                        Wether the given controller is valid
+        * @throws      EmptyVariableException          Thrown if given controller is not set
+        * @throws      DefaultControllerException      Thrown if default controller was not found
+        */
+       public function isControllerValid ($controllerName) {
+               // By default nothing shall be valid
+               $isValid = false;
+
+               // Is a controller set?
+               if (empty($controllerName)) {
+                       // Then thrown an exception here
+                       throw new EmptyVariableException(array($this, 'controllerName'), self::EXCEPTION_UNEXPECTED_EMPTY_STRING);
+               } // END - if
+
+               // Now, let us create the full name of the controller class
+               $this->setClassName(sprintf("%s%sController",
+                       $this->controllerPrefix,
+                       $this->convertToClassName($controllerName)
+               ));
+
+               // Try it hard to get an controller
+               while ($isValid === false) {
+                       // Is this class already loaded?
+                       if (class_exists($this->getClassName())) {
+                               // This class does exist. :-)
+                               $isValid = true;
+                       } elseif (($this->getClassName() != $this->controllerPrefix.'DefaultController') && ($this->getClassName() != $this->controllerPrefix.'DefaultNewsController')) {
+                               // Do we have news?
+                               if ($this->getConfigInstance()->readConfig('page_with_news') == $this->getApplicationInstance()->getRequestInstance()->getRequestElement('page')) {
+                                       // Yes, display news in home then set default controller with news
+                                       $this->setClassName($this->controllerPrefix . 'DefaultNewsController');
+                               } else {
+                                       // No news at home page or non-news page
+                                       $this->setClassName($this->controllerPrefix . 'DefaultController');
+                               }
+                       } else {
+                               // All is tried, give it up here
+                               throw new DefaultControllerException($this, self::EXCEPTION_DEFAULT_CONTROLLER_GONE);
+                       }
+               } // END - while
+
+               // Return the result
+               return $isValid;
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/main/resolver/controller/image/.htaccess b/inc/classes/main/resolver/controller/image/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/inc/classes/main/resolver/controller/image/class_ImageControllerResolver.php b/inc/classes/main/resolver/controller/image/class_ImageControllerResolver.php
new file mode 100644 (file)
index 0000000..39d88d1
--- /dev/null
@@ -0,0 +1,161 @@
+<?php
+/**
+ * A resolver for resolving controllers locally
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class ImageControllerResolver extends BaseControllerResolver implements ControllerResolver {
+       /**
+        * Last successfull resolved controller (name)
+        */
+       private $lastControllerName = "";
+
+       /**
+        * Last successfull resolved controller (instance)
+        */
+       private $lastControllerInstance = null;
+
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+
+               // Set prefix to "Image"
+               $this->setControllerPrefix("Image");
+       }
+
+       /**
+        * Creates an instance of a resolver class with a given command
+        *
+        * @param       $controllerName                         The controller we shall resolve
+        * @param       $appInstance                            An instance of a manageable application helper class
+        * @return      $resolverInstance                       The prepared controller resolver instance
+        * @throws      EmptyVariableException          Thrown if default command is not set
+        * @throws      InvalidControllerException      Thrown if default controller is invalid
+        */
+       public final static function createImageControllerResolver ($controllerName, ManageableApplication $appInstance) {
+               // Create the new instance
+               $resolverInstance = new ImageControllerResolver();
+
+               // Is the variable $controllerName set and the command is valid?
+               if (empty($controllerName)) {
+                       // Then thrown an exception here
+                       throw new EmptyVariableException(array($resolverInstance, 'commandName'), self::EXCEPTION_UNEXPECTED_EMPTY_STRING);
+               } elseif ($resolverInstance->isControllerValid($controllerName) === false) {
+                       // Invalid command found
+                       throw new InvalidControllerException(array($resolverInstance, $controllerName), self::EXCEPTION_INVALID_CONTROLLER);
+               }
+
+               // Set the application instance
+               $resolverInstance->setApplicationInstance($appInstance);
+
+               // Set command name
+               $resolverInstance->setControllerName($controllerName);
+
+               // Return the prepared instance
+               return $resolverInstance;
+       }
+
+       /**
+        * Resolves the default controller of the given command
+        *
+        * @return      $controllerInstance             A controller instance for the default
+        *                                                                      command
+        * @throws      InvalidControllerInstanceException      Thrown if $controllerInstance
+        *                                                                                              is invalid
+        */
+       public function resolveController () {
+               // Init variables
+               $controllerName = "";
+               $controllerInstance = null;
+
+               // Get the command name 
+               $controllerName = $this->getControllerName();
+
+               // Get the command
+               $controllerInstance = $this->loadController($controllerName);
+
+               // And validate it
+               if ((!is_object($controllerInstance)) || (!$controllerInstance instanceof Controller)) {
+                       // This command has an invalid instance!
+                       throw new InvalidControllerInstanceException(array($this, $controllerName), self::EXCEPTION_INVALID_CONTROLLER);
+               } // END - if
+
+               // Set last controller
+               $this->lastControllerInstance = $controllerInstance;
+
+               // Return the maybe resolved instance
+               return $controllerInstance;
+       }
+
+       /**
+        * "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       $controllerName                 A controller name we shall look for
+        * @return      $controllerInstance             A loaded controller instance
+        * @throws      InvalidControllerException      Thrown if even the requested
+        *                                                                              controller class is missing (bad!)
+        */
+       private function loadController ($controllerName) {
+               // Cache default command
+               $defaultController = $this->getConfigInstance()->readConfig('default_image_command');
+
+               // Init controller instance
+               $controllerInstance = null;
+
+               // Default controller
+               $this->setClassName($defaultController);
+
+               // Generate the class name
+               //* DEBUG: */ echo __METHOD__.": Controller=".$controllerName;
+               if ($controllerName != $defaultController) {
+                       // Create controller class name
+                       $this->setClassName(sprintf("Image%sController",
+                               $this->convertToClassName($controllerName)
+                       ));
+               } // END - if
+               //* DEBUG: */ echo ", controller=".$this->getClassName()."<br />\n";
+
+               // Is this class loaded?
+               if (!class_exists($this->getClassName())) {
+                       // Class not found, so or throw an exception
+                       throw new InvalidControllerException(array($this, $controllerName), self::EXCEPTION_INVALID_CONTROLLER);
+               } // END - if
+
+               // Initiate the resolver and controller
+               $resolverInstance = ObjectFactory::createObjectByConfiguredName('image_cmd_resolver_class', array($controllerName, $this->getApplicationInstance()));
+               $controllerInstance = ObjectFactory::createObjectByName($this->getClassName(), array($resolverInstance));
+
+               // Remove resolver
+               unset($resolverInstance);
+
+               // Return the result
+               return $controllerInstance;
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/main/resolver/controller/web/.htaccess b/inc/classes/main/resolver/controller/web/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/inc/classes/main/resolver/controller/web/class_WebControllerResolver.php b/inc/classes/main/resolver/controller/web/class_WebControllerResolver.php
new file mode 100644 (file)
index 0000000..5378006
--- /dev/null
@@ -0,0 +1,182 @@
+<?php
+/**
+ * A resolver for resolving controllers locally
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class WebControllerResolver extends BaseControllerResolver implements ControllerResolver {
+       /**
+        * Last successfull resolved controller (name)
+        */
+       private $lastControllerName = "";
+
+       /**
+        * Last successfull resolved controller (instance)
+        */
+       private $lastControllerInstance = null;
+
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+
+               // Set prefix to "Web"
+               $this->setControllerPrefix("Web");
+       }
+
+       /**
+        * Creates an instance of a resolver class with a given command
+        *
+        * @param       $controllerName                         The controller we shall resolve
+        * @param       $appInstance                            An instance of a manageable application helper class
+        * @return      $resolverInstance                       The prepared controller resolver instance
+        * @throws      EmptyVariableException          Thrown if default command is not set
+        * @throws      InvalidControllerException      Thrown if default controller is invalid
+        */
+       public final static function createWebControllerResolver ($controllerName, ManageableApplication $appInstance) {
+               // Create the new instance
+               $resolverInstance = new WebControllerResolver();
+
+               // Is the variable $controllerName set and the command is valid?
+               if (empty($controllerName)) {
+                       // Then thrown an exception here
+                       throw new EmptyVariableException(array($resolverInstance, 'commandName'), self::EXCEPTION_UNEXPECTED_EMPTY_STRING);
+               } elseif ($resolverInstance->isControllerValid($controllerName) === false) {
+                       // Invalid command found
+                       throw new InvalidControllerException(array($resolverInstance, $controllerName), self::EXCEPTION_INVALID_CONTROLLER);
+               }
+
+               // Set the application instance
+               $resolverInstance->setApplicationInstance($appInstance);
+
+               // Set command name
+               $resolverInstance->setControllerName($controllerName);
+
+               // Return the prepared instance
+               return $resolverInstance;
+       }
+
+       /**
+        * Resolves the default controller of the given command
+        *
+        * @return      $controllerInstance             A controller instance for the default
+        *                                                                      command
+        * @throws      InvalidControllerInstanceException      Thrown if $controllerInstance
+        *                                                                                              is invalid
+        */
+       public function resolveController () {
+               // Init variables
+               $controllerName = "";
+               $controllerInstance = null;
+
+               // Get the command name 
+               $controllerName = $this->getControllerName();
+
+               // Get the command
+               $controllerInstance = $this->loadController($controllerName);
+
+               // And validate it
+               if ((!is_object($controllerInstance)) || (!$controllerInstance instanceof Controller)) {
+                       // This command has an invalid instance!
+                       throw new InvalidControllerInstanceException(array($this, $controllerName), self::EXCEPTION_INVALID_CONTROLLER);
+               } // END - if
+
+               // Set last controller
+               $this->lastControllerInstance = $controllerInstance;
+
+               // Return the maybe resolved instance
+               return $controllerInstance;
+       }
+
+       /**
+        * "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       $controllerName                 A controller name we shall look for
+        * @return      $controllerInstance             A loaded controller instance
+        * @throws      InvalidControllerException      Thrown if even the requested
+        *                                                                              controller class is missing (bad!)
+        */
+       private function loadController ($controllerName) {
+               // Cache default command
+               $defaultController = $this->getConfigInstance()->readConfig('default_web_command');
+
+               // Init controller instance
+               $controllerInstance = null;
+
+               // Default controller
+               $this->setClassName('WebDefaultController');
+
+               // Generate the class name
+               //* DEBUG: */ echo __METHOD__.": Controller=".$controllerName;
+               if ($controllerName != $defaultController) {
+                       // Create controller class name
+                       $this->setClassName(sprintf("Web%sController",
+                               $this->convertToClassName($controllerName)
+                       ));
+               } elseif ($this->getConfigInstance()->readConfig('page_with_news') == $this->getApplicationInstance()->getRequestInstance()->getRequestElement('page')) {
+                       // Yes, display news in home then set default controller with news
+                       $this->setClassName('WebDefaultNewsController');
+               } else {
+                       // No news at home page or non-news page
+                       $this->setClassName('WebDefaultController');
+               }
+               //* DEBUG: */ echo ", controller=".$this->getClassName()."<br />\n";
+
+               // Is this class loaded?
+               if (!class_exists($this->getClassName())) {
+                       // Throw an exception here
+                       throw new InvalidControllerException(array($this, $controllerName), self::EXCEPTION_INVALID_CONTROLLER);
+               } // END - if
+
+               // Set default resolver config name
+               $resolverConfigEntry = "";
+
+               // Try to read a config entry for our resolver including controller name... ;-)
+               try {
+                       // Create the resolver name
+                       $resolverConfigEntry = sprintf("web_cmd_%s_resolver_class", strtolower($controllerName));
+
+                       // Get the config, this will throw an exception if there is no special command resolver
+                       $resolverClass = $this->getConfigInstance()->readConfig($resolverConfigEntry);
+               } catch (ConfigEntryNotFoundException $e) {
+                       // Use default resolver entry
+                       $resolverConfigEntry = "web_cmd_resolver_class";
+               }
+
+               // Initiate the resolver and controller
+               $resolverInstance = ObjectFactory::createObjectByConfiguredName($resolverConfigEntry, array($controllerName, $this->getApplicationInstance()));
+               $controllerInstance = ObjectFactory::createObjectByName($this->getClassName(), array($resolverInstance));
+
+               // Remove resolver (we don't need it anymore)
+               unset($resolverInstance);
+
+               // Return the result
+               return $controllerInstance;
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/main/response/.htaccess b/inc/classes/main/response/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/inc/classes/main/response/class_BaseResponse.php b/inc/classes/main/response/class_BaseResponse.php
new file mode 100644 (file)
index 0000000..1bbf574
--- /dev/null
@@ -0,0 +1,211 @@
+<?php
+/**
+ * A generic request class
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * The extended headers are taken from phpMyAdmin setup tool, written by
+ * Michal Cihar <michal@cihar.com>, licensed under GNU GPL 2.0.
+ */
+class BaseResponse extends BaseFrameworkSystem {
+       /**
+        * Response status
+        */
+       private $responseStatus = "200 OK";
+
+       /**
+        * Array with all headers
+        */
+       private $responseHeaders = array();
+
+       /**
+        * Cookies we shall sent out
+        */
+       private $cookies = array();
+
+       /**
+        * Body of the response
+        */
+       private $responseBody = "";
+
+       /**
+        * Instance of the template engine
+        */
+       private $templateInstance = null;
+
+       /**
+        * Fatal resolved messages from filters and so on
+        */
+       private $fatalMessages = array();
+
+       /**
+        * Protected constructor
+        *
+        * @param       $className      Name of the concrete response
+        * @return      void
+        */
+       protected function __construct ($className) {
+               // Call parent constructor
+               parent::__construct($className);
+
+               // Clean up a little
+               $this->removeNumberFormaters();
+               $this->removeSystemArray();
+       }
+
+       /**
+        * Setter for status
+        *
+        * @param       $status         New response status
+        * @return      void
+        */
+       public final function setResponseStatus ($status) {
+               $this->responseStatus = (string) $status;
+       }
+
+       /**
+        * Add header element
+        *
+        * @param       $name   Name of header element
+        * @param       $value  Value of header element
+        * @return      void
+        */
+       public final function addHeader ($name, $value) {
+               $this->responseHeaders[$name] = $value;
+       }
+
+       /**
+        * Reset the header array
+        *
+        * @return      void
+        */
+       public final function resetResponseHeaders () {
+               $this->responseHeaders = array();
+       }
+
+       /**
+        * "Writes" data to the response body
+        *
+        * @param       $output         Output we shall sent in the HTTP response
+        * @return      void
+        */
+       public final function writeToBody ($output) {
+               $this->responseBody .= $output;
+       }
+
+       /**
+        * Sets the response body to something new
+        *
+        * @param       $output         Output we shall sent in the HTTP response
+        * @return      void
+        */
+       public final function setResponseBody ($output) {
+               $this->responseBody = $output;
+       }
+
+       /**
+        * Adds a fatal message id to the response. The added messages can then be
+        * processed and outputed to the world
+        *
+        * @param       $messageId      The message id we shall add
+        * @return      void
+        */
+       public final function addFatalMessage ($messageId) {
+               // Adds the resolved message id to the fatal message list
+               $this->fatalMessages[] = $this->getApplicationInstance()->getLanguageInstance()->getMessage($messageId);
+       }
+
+       /**
+        * Adds a plain fatal message id to the response
+        *
+        * @param       $message        The plain message we shall add
+        * @return      void
+        */
+       public final function addFatalMessagePlain ($message) {
+               // Adds the resolved message id to the fatal message list
+               $this->fatalMessages[] = $message;
+       }
+
+       /**
+        * Flushs the cached HTTP response to the outer world
+        *
+        * @param       $force  Wether we shall force the output or abort if headers are
+        *                                      already sent with an exception
+        * @return      void
+        * @throws      ResponseHeadersAlreadySentException             Thrown if headers are
+        *                                                                                                      already sent
+        */
+       public function flushBuffer ($force = false) {
+               if ((headers_sent()) && ($force === false)) {
+                       // Headers are already sent!
+                       throw new ResponseHeadersAlreadySentException($this, self::EXCEPTION_HEADERS_ALREADY_SENT);
+               } elseif (!headers_sent()) {
+                       // Send headers out
+                       header("HTTP/1.1 {$this->responseStatus}");
+
+                       // Used later
+                       $now = gmdate('D, d M Y H:i:s') . ' GMT';
+
+                       // 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
+
+                       // Define the charset to be used
+                       //$this->addHeader('Content-type:', sprintf("text/html; charset=%s", $this->getConfigInstance()->readConfig('header_charset')));
+
+                       // Send all headers
+                       foreach ($this->responseHeaders as $name => $value) {
+                               header("{$name}: {$value}");
+                               //* DEBUG: */ echo "{$name}: {$value}<br />\n";
+                       } // 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?
+               if (count($this->fatalMessages) == 0) {
+                       // Flush the output to the world
+                       $this->getWebOutputInstance()->output($this->responseBody);
+               } else {
+                       // Display all error messages
+                       $this->getApplicationInstance()->handleFatalMessages($this->fatalMessages);
+
+                       // Send the error messages out to the world
+                       $this->getWebOutputInstance()->output($this->responseBody);
+               }
+
+               // Clear response header and body
+               $this->setResponseBody("");
+               $this->resetResponseHeaders();
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/main/response/http/.htaccess b/inc/classes/main/response/http/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/inc/classes/main/response/http/class_HttpResponse.php b/inc/classes/main/response/http/class_HttpResponse.php
new file mode 100644 (file)
index 0000000..50bf2de
--- /dev/null
@@ -0,0 +1,211 @@
+<?php
+/**
+ * A class for an HTTP response on an HTTP request
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * The extended headers are taken from phpMyAdmin setup tool, written by
+ * Michal Cihar <michal@cihar.com>, licensed under GNU GPL 2.0.
+ */
+class HttpResponse extends BaseResponse implements Responseable {
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+       }
+
+       /**
+        * Creates an object of this class
+        *
+        * @param       $appInstance            An instance of a manageable application
+        * @return      $responseInstance       A prepared instance of this class
+        */
+       public final static function createHttpResponse (ManageableApplication $appInstance) {
+               // Get a new instance
+               $responseInstance = new HttpResponse();
+
+               // Set the application instance
+               $responseInstance->setApplicationInstance($appInstance);
+
+               // Initialize the template engine here
+               $responseInstance->initTemplateEngine($appInstance);
+
+               // Return the prepared instance
+               return $responseInstance;
+       }
+
+       /**
+        * Initializes the template engine instance
+        *
+        * @param       $appInstance    An instance of a manageable application
+        * @return      void
+        */
+       public final function initTemplateEngine (ManageableApplication $appInstance) {
+               $this->setTemplateInstance($this->prepareTemplateInstance($appInstance));
+       }
+
+       /**
+        * 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
+        * @todo        Encryption of cookie data not yet supported.
+        * @todo        Why are these parameters conflicting?
+        * @todo        If the return statement is removed and setcookie() commented out,
+        * @todo        this will send only one cookie out, the first one.
+        */
+       public function addCookie ($cookieName, $cookieValue, $encrypted = false, $expires = null) {
+               //* DEBUG: */ echo $cookieName."=".$cookieValue."<br />\n";
+               // Are headers already sent?
+               if (headers_sent()) {
+                       // Throw an exception here
+                       //* DEBUG: */ return;
+                       throw new ResponseHeadersAlreadySentException($this, self::EXCEPTION_HEADERS_ALREADY_SENT);
+               } // END - if
+
+               // Shall we encrypt the cookie?
+               if ($encrypted === true) {
+               } // 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);
+               //, $path, $domain, (isset($_SERVER['HTTPS']))
+               return;
+
+               // Now construct the full header
+               $cookieString = $cookieName . "=" . $cookieValue . "; ";
+               $cookieString .= "expires=" . date("D, d-F-Y H:i:s", $expires) . " GMT";
+               // $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
+
+               // Assign application data
+               $this->getTemplateInstance()->assignApplicationData($this->getApplicationInstance());
+
+               // Get the url from config
+               $url = $this->getConfigInstance()->readConfig($configEntry);
+
+               // Compile the URL
+               $url = $this->getTemplateInstance()->compileRawCode($url);
+
+               // 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
+       }
+
+       /**
+        * Refreshs a given cookie. This will make the cookie live longer
+        *
+        * @param       $cookieName             Cookie to refresh
+        * @return      void
+        */
+       public function refreshCookie ($cookieName) {
+               // Only update existing cookies
+               if (isset($_COOKIE[$cookieName])) {
+                       // Update the cookie
+                       $this->addCookie($cookieName, $_COOKIE[$cookieName], false);
+               } // END - if
+       }
+
+       /**
+        * Getter for default command
+        *
+        * @return      $defaultCommand         Default command for this response
+        */
+       public function getDefaultCommand () {
+               $defaultCommand = $this->getConfigInstance()->readConfig('default_web_command');
+               return $defaultCommand;
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/main/response/image/.htaccess b/inc/classes/main/response/image/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/inc/classes/main/response/image/class_ImageResponse.php b/inc/classes/main/response/image/class_ImageResponse.php
new file mode 100644 (file)
index 0000000..c03e6ea
--- /dev/null
@@ -0,0 +1,268 @@
+<?php
+/**
+ * A class for an image response on an HTTP request
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * The extended headers are taken from phpMyAdmin setup tool, written by
+ * Michal Cihar <michal@cihar.com>, licensed under GNU GPL 2.0.
+ */
+class ImageResponse extends BaseResponse implements Responseable {
+       /**
+        * Instance of the image
+        */
+       private $imageInstance = null;
+
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+       }
+
+       /**
+        * Creates an object of this class
+        *
+        * @param       $appInstance            An instance of a manageable application
+        * @return      $responseInstance       A prepared instance of this class
+        */
+       public final static function createImageResponse (ManageableApplication $appInstance) {
+               // Get a new instance
+               $responseInstance = new ImageResponse();
+
+               // Set the application instance
+               $responseInstance->setApplicationInstance($appInstance);
+
+               // Initialize the template engine here
+               $responseInstance->initTemplateEngine($appInstance);
+
+               // Return the prepared instance
+               return $responseInstance;
+       }
+
+       /**
+        * Initializes the template engine instance
+        *
+        * @param       $appInstance    An instance of a manageable application
+        * @return      void
+        */
+       public final function initTemplateEngine (ManageableApplication $appInstance) {
+               // Get config instance
+               $cfg = $this->getConfigInstance();
+
+               // Set new template engine
+               $cfg->setConfigEntry('template_class'         , $cfg->readConfig('image_template_class'));
+               $cfg->setConfigEntry('raw_template_extension' , ".img");
+               $cfg->setConfigEntry('code_template_extension', ".itp");
+               $cfg->setConfigEntry('tpl_base_path'          , "templates/images/");
+               $cfg->setConfigEntry('code_template_type'     , "image");
+
+               // Get a prepared instance
+               $this->setTemplateInstance($this->prepareTemplateInstance($appInstance));
+       }
+
+       /**
+        * 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
+        * @todo        Encryption of cookie data not yet supported.
+        * @todo        Why are these parameters conflicting?
+        * @todo        If the return statement is removed and setcookie() commented out,
+        * @todo        this will send only one cookie out, the first one.
+        */
+       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) {
+               } // 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);
+               //, $path, $domain, (isset($_SERVER['HTTPS']))
+               return;
+
+               // Now construct the full header
+               $cookieString = $cookieName . "=" . $cookieValue . "; ";
+               $cookieString .= "expires=" . date("D, d-F-Y H:i:s", $expires) . " GMT";
+               // $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
+
+               // Assign application data
+               $this->getTemplateInstance()->assignApplicationData($this->getApplicationInstance());
+
+               // Get the url from config
+               $url = $this->getConfigInstance()->readConfig($configEntry);
+
+               // Compile the URL
+               $url = $this->getTemplateInstance()->compileRawCode($url);
+
+               // 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();
+       }
+
+       /**
+        * Flushs the cached HTTP response to the outer world
+        *
+        * @param       $force  Wether we shall force the output or abort if headers are
+        *                                      already sent with an exception
+        * @return      void
+        */
+       public function flushBuffer ($force = false) {
+               // Finish the image
+               $this->getImageInstance()->finishImage();
+
+               // Get image content
+               $content = $this->getImageInstance()->getContent();
+
+               // Set it as response body
+               $this->setResponseBody($content);
+
+               // Set content type
+               $this->addHeader('Content-type', "image/".$this->getImageInstance()->getImageType());
+
+               // Call parent method
+               parent::flushBuffer($force);
+       }
+
+       /**
+        * 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
+       }
+
+       /**
+        * Refreshs a given cookie. This will make the cookie live longer
+        *
+        * @param       $cookieName             Cookie to refresh
+        * @return      void
+        */
+       public function refreshCookie ($cookieName) {
+               // Only update existing cookies
+               if (isset($_COOKIE[$cookieName])) {
+                       // Update the cookie
+                       $this->addCookie($cookieName, $_COOKIE[$cookieName], false);
+               } // END - if
+       }
+
+       /**
+        * Setter for image instanxe
+        *
+        * @param       $imageInstance  An instance of an image
+        * @return      void
+        */
+       public final function setImageInstance (BaseImage $imageInstance) {
+               $this->imageInstance = $imageInstance;
+       }
+
+       /**
+        * Getter for image instanxe
+        *
+        * @return      $imageInstance  An instance of an image
+        */
+       public final function getImageInstance () {
+               return $this->imageInstance;
+       }
+
+       /**
+        * Getter for default command
+        *
+        * @return      $defaultCommand         Default command for this response
+        */
+       public function getDefaultCommand () {
+               $defaultCommand = $this->getConfigInstance()->readConfig('default_image_command');
+               return $defaultCommand;
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/main/result/.htaccess b/inc/classes/main/result/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/inc/classes/main/result/class_DatabaseResult.php b/inc/classes/main/result/class_DatabaseResult.php
new file mode 100644 (file)
index 0000000..94fe3b5
--- /dev/null
@@ -0,0 +1,404 @@
+<?php
+/**
+ * A database result class
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class DatabaseResult extends BaseFrameworkSystem implements SearchableResult, UpdateableResult, SeekableIterator {
+       // Exception constants
+       const EXCEPTION_INVALID_DATABASE_RESULT = 0x1c0;
+       const EXCEPTION_RESULT_UPDATE_FAILED    = 0x1c1;
+
+       /**
+        * Current position in array
+        */
+       private $currentPos = -1;
+
+       /**
+        * Current row
+        */
+       private $currentRow = null;
+
+       /**
+        * Result array
+        */
+       private $resultArray = array();
+
+       /**
+        * Array of out-dated entries
+        */
+       private $outDated = array();
+
+       /**
+        * Affected rows
+        */
+       private $affectedRows = 0;
+
+       /**
+        * Found value
+        */
+       private $foundValue = "";
+
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+
+               // Clean up a little
+               $this->removeNumberFormaters();
+               $this->removeSystemArray();
+       }
+
+       /**
+        * Creates an instance of this result by a provided result array
+        *
+        * @param       $resultArray            The array holding the result from query
+        * @return      $resultInstance         An instance of this class
+        */
+       public final static function createDatabaseResult (array $resultArray) {
+               // Get a new instance
+               $resultInstance = new DatabaseResult();
+
+               // Set the result array
+               $resultInstance->setResultArray($resultArray);
+
+               // Return the instance
+               return $resultInstance;
+       }
+
+       /**
+        * Setter for result array
+        *
+        * @param       $resultArray    The array holding the result from query
+        * @return      void
+        */
+       protected final function setResultArray (array $resultArray) {
+               $this->resultArray = $resultArray;
+       }
+
+       /**
+        * Updates the current entry by given update criteria
+        *
+        * @param       $updateInstance         An instance of an Updateable criteria
+        * @return      void
+        */
+       private function updateCurrentEntryByCriteria (LocalUpdateCriteria $updateInstance) {
+               // Get the current entry key
+               $entryKey = $this->key();
+
+               // Now get the update criteria array and update all entries
+               foreach ($updateInstance->getUpdateCriteria() as $criteriaKey => $criteriaValue) {
+                       // Update data
+                       $this->resultArray['rows'][$entryKey][$criteriaKey] = $criteriaValue;
+
+                       // Mark it as out-dated
+                       $this->outDated[$criteriaKey] = 1;
+               } // END - foreach
+       }
+
+       /**
+        * "Iterator" method next() to advance to the next valid entry. This method
+        * does also check if result is invalid
+        *
+        * @return      $nextValid      Wether the next entry is valid
+        */
+       public function next () {
+               // Default is not valid
+               $nextValid = false;
+
+               // Is the result valid?
+               if ($this->valid()) {
+                       // Next entry found, so count one up and cache it
+                       $this->currentPos++;
+                       $this->currentRow = $this->resultArray['rows'][$this->currentPos];
+                       $nextValid = true;
+               } // END - if
+
+               // 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 (($this->ifStatusIsOkay()) && (isset($this->resultArray['rows'][($this->currentPos + 1)])) && (isset($this->resultArray['rows'][0]))) {
+                       // All fine!
+                       $isValid = true;
+               } // END - if
+
+               // Return the result
+               return $isValid;
+       }
+
+       /**
+        * Determines wether the status of the query was fine ("ok")
+        *
+        * @return      $ifStatusOkay   Wether the status of the query was okay
+        */
+       public function ifStatusIsOkay () {
+               return ((isset($this->resultArray['status'])) && ($this->resultArray['status'] === "ok"));
+       }
+
+       /**
+        * Gets the current key of iteration
+        *
+        * @return      $currentPos     Key from iterator
+        */
+       public function key () {
+               return $this->currentPos;
+       }
+
+       /**
+        * Rewind to the beginning and clear array $currentRow
+        *
+        * @return      void
+        */
+       public function rewind () {
+               $this->currentPos = -1;
+               $this->currentRow = array();
+       }
+
+       /**
+        * Searches for an entry in data result and returns it
+        *
+        * @param       $criteriaInstance       The criteria to look inside the data set
+        * @return      $result                         Found result entry
+        * @todo        0% done
+        */
+       public function searchEntry (LocalSearchCriteria $criteriaInstance) {
+               die(__METHOD__.": Unfinished!");
+       }
+
+       /**
+        * Adds an update request to the database result for writing it to the
+        * database layer
+        *
+        * @param       $criteriaInstance       An instance of a updateable criteria
+        * @return      void
+        * @throws      ResultUpdateException   If no result was updated
+        */
+       public function add2UpdateQueue (LocalUpdateCriteria $criteriaInstance) {
+               // Rewind the pointer
+               $this->rewind();
+
+               // Get search criteria
+               $searchInstance = $criteriaInstance->getSearchInstance();
+
+               // And start looking for the result
+               $foundEntries = 0;
+               while (($this->valid()) && ($foundEntries < $searchInstance->getLimit())) {
+                       // Get next entry
+                       $this->next();
+                       $currentEntry = $this->current();
+
+                       // Is this entry found?
+                       if ($searchInstance->ifEntryMatches($currentEntry)) {
+                               // Update this entry
+                               $this->updateCurrentEntryByCriteria($criteriaInstance);
+
+                               // Count one up
+                               $foundEntries++;
+                       } // END - if
+               } // END - while
+
+               // Set affected rows
+               $this->setAffectedRows($foundEntries);
+
+               // If no entry is found/updated throw an exception
+               if ($foundEntries == 0) {
+                       // Throw an exception here
+                       throw new ResultUpdateException($this, self::EXCEPTION_RESULT_UPDATE_FAILED);
+               } // END - if
+
+               // Set search instance
+               $this->setSearchInstance($searchInstance);
+       }
+
+       /**
+        * Setter for affected rows
+        *
+        * @param       $rows   Number of affected rows
+        * @return      void
+        */
+       public final function setAffectedRows ($rows) {
+               $this->affectedRows = $rows;
+       }
+
+       /**
+        * Getter for affected rows
+        *
+        * @return      $rows   Number of affected rows
+        */
+       public final function getAffectedRows () {
+               return $this->affectedRows;
+       }
+
+       /**
+        * Getter for found value of previous found() call
+        *
+        * @return      $foundValue             Found value of previous found() call
+        */
+       public final function getFoundValue () {
+               return $this->foundValue;
+       }
+
+       /**
+        * Checks wether we have out-dated entries or not
+        *
+        * @return      $needsUpdate    Wether we have out-dated entries
+        */
+       public function ifDataNeedsFlush () {
+               $needsUpdate = (count($this->outDated) > 0);
+               return $needsUpdate;
+       }
+
+       /**
+        * Adds registration elements to a given dataset instance
+        *
+        * @param       $criteriaInstance       An instance of a storeable criteria
+        * @return      void
+        */
+       public function addElementsToDataSet (StoreableCriteria $criteriaInstance) {
+               // Walk only through out-dated columns
+               foreach ($this->outDated as $key => $dummy) {
+                       // Does this key exist?
+                       //* DEBUG: */ echo "outDated: {$key}<br />\n";
+                       if ($this->find($key)) {
+                               // Then update it
+                               $criteriaInstance->addCriteria($key, $this->getFoundValue());
+                       } // END - if
+               } // END - foreach
+       }
+
+       /**
+        * Find a key inside the result array
+        *
+        * @param       $key    The key we shall find
+        * @return      $found  Wether the key was found or not
+        */
+       public function find ($key) {
+               // By default nothing is found
+               $found = false;
+
+               // Rewind the pointer
+               $this->rewind();
+
+               // Walk through all entries
+               while ($this->valid()) {
+                       // Advance to next entry
+                       $this->next();
+
+                       // Get the whole array
+                       $currentEntry = $this->current();
+
+                       // Is the element there?
+                       if (isset($currentEntry[$key])) {
+                               // Okay, found!
+                               $found = true;
+
+                               // So "cache" it
+                               $this->foundValue = $currentEntry[$key];
+
+                               // And stop searching
+                               break;
+                       } // END - if
+               } // END - while
+
+               // Return the result
+               return $found;
+       }
+
+       /**
+        * Solver for result index value with call-back method
+        *
+        * @param       $databaseColumn         Database column where the index might be found
+        * @param       $wrapperInstance        The wrapper instance to ask for array element
+        * @para        $callBack                       Call-back object for setting the index;
+        *                                                              0=object instance,1=method name
+        * @return      void
+4       * @todo        Find a caching way without modifying the result array
+        */
+       public function solveResultIndex ($databaseColumn, BaseDatabaseWrapper $wrapperInstance, array $callBack) {
+               // By default nothing is found
+               $indexValue = 0;
+
+               // Is the element in result itself found?
+               if ($this->find($databaseColumn)) {
+                       // Use this value
+                       $indexValue = $this->getFoundValue();
+               } elseif ($this->find($wrapperInstance->getIndexKey())) {
+                       // Use this value
+                       $indexValue = $this->getFoundValue();
+               }
+
+               // Set the index
+               call_user_func_array($callBack, array($indexValue));
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/main/rng/.htaccess b/inc/classes/main/rng/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/inc/classes/main/rng/class_RandomNumberGenerator.php b/inc/classes/main/rng/class_RandomNumberGenerator.php
new file mode 100644 (file)
index 0000000..93ba398
--- /dev/null
@@ -0,0 +1,180 @@
+<?php
+/**
+ * A standard random number generator
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class RandomNumberGenerator extends BaseFrameworkSystem {
+       /**
+        * Prime number for better pseudo random numbers
+        */
+       private $prime = 0;
+
+       /**
+        * Add this calculated number to the rng
+        */
+       private $extraNumber = 0;
+
+       /**
+        * Extra salt for secured hashing
+        */
+       private $extraSalt = "";
+
+       /**
+        * Fixed salt for secured hashing
+        */
+       private $fixedSalt = "";
+
+       /**
+        * Maximum length for random string
+        */
+       private $rndStrLen = 0;
+
+       /**
+        * Protected constructor
+        *
+        * @param       $className      Name of this class
+        * @return      void
+        */
+       protected function __construct ($className = __CLASS__) {
+               // Call parent constructor
+               parent::__construct($className);
+
+               // Clean up a little
+               $this->removeNumberFormaters();
+               $this->removeSystemArray();
+       }
+
+       /**
+        * Creates an instance of this class
+        *
+        * @param       $extraInstance  An extra instance for more salt (default: null)
+        * @return      $rngInstance    An instance of this random number generator
+        */
+       public final static function createRandomNumberGenerator (FrameworkInterface $extraInstance = null) {
+               // Get a new instance
+               $rngInstance = new RandomNumberGenerator();
+
+               // Initialize the RNG now
+               $rngInstance->initRng($extraInstance);
+
+               // Return the instance
+               return $rngInstance;
+       }
+
+       /**
+        * Initializes the random number generator
+        *
+        * @param       $extraInstance  An extra instance for more salt (default: null)
+        * @return      void
+        * @todo        Add site key for stronger salt!
+        */
+       protected function initRng ($extraInstance) {
+               // Get the prime number from config
+               $this->prime = $this->getConfigInstance()->readConfig('math_prime');
+
+               // Calculate the extra number which is always the same unless you give
+               // a better prime number
+               $this->extraNumber = ($this->prime * $this->prime / (pi() ^ 2));
+
+               // Seed mt_rand()
+               mt_srand((double) sqrt(microtime() * 100000000 * $this->extraNumber));
+
+               // Set the server IP to cluster
+               $serverIp = "cluster";
+
+               // Do we have a single server?
+               if ($this->getConfigInstance()->readConfig('is_single_server') === "Y") {
+                       // Then use that IP for extra security
+                       $serverIp = getenv('SERVER_ADDR');
+               } // END - if
+
+               // Yet-another fixed salt. This is not dependend on server software or date
+               if ($extraInstance instanceof FrameworkInterface) {
+                       // With extra instance information
+                       $this->fixedSalt = sha1($serverIp . ":" . $extraInstance->__toString() . ":" . serialize($this->getDatabaseInstance()->getConnectionData()));
+               } else {
+                       // Without extra information
+                       $this->fixedSalt = sha1($serverIp . ":" . serialize($this->getDatabaseInstance()->getConnectionData()));
+               }
+
+               // One-way data we need for "extra-salting" the random number
+               $this->extraSalt = sha1($this->fixedSalt . ":" . getenv('SERVER_SOFTWARE') . ":" . $this->getConfigInstance()->readConfig('date_key') . $this->getConfigInstance()->readConfig('base_url'));
+
+               // Get config entry for max salt length
+               $this->rndStrLen = $this->getConfigInstance()->readConfig('rnd_str_length');
+       }
+
+       /**
+        * Makes a pseudo-random string useable for salts
+        *
+        * @param       $length                 Length of the string, default: 128
+        * @return      $randomString   The pseudo-random string
+        */
+       public function randomString ($length = -1) {
+               // Is the number <1, then fix it to default length
+               if ($length < 1) $length = $this->rndStrLen;
+
+               // Initialize the string
+               $randomString = "";
+
+               // And generate it
+               for ($idx = 0; $idx < $length; $idx++) {
+                       // Add a random character and add it to our string
+                       $randomString .= chr($this->randomNumber(0, 255));
+               }
+
+               // Return the random string a little mixed up
+               return str_shuffle($randomString);
+       }
+
+       /**
+        * Generate a pseudo-random integer number in a given range
+        *
+        * @param       $min    Min value to generate
+        * @param       $max    Max value to generate
+        * @return      $num    Pseudo-random number
+        * @todo        I had a better random number generator here but now it is somewhere lost :(
+        */
+       public function randomNumber ($min, $max) {
+               return mt_rand($min, $max);
+       }
+
+       /**
+        * Getter for extra salt
+        *
+        * @return      $extraSalt
+        */
+       public final function getExtraSalt () {
+               return $this->extraSalt;
+       }
+
+       /**
+        * Getter for fixed salt
+        *
+        * @return      $fixedSalt
+        */
+       public final function getFixedSalt () {
+               return $this->fixedSalt;
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/main/template/.htaccess b/inc/classes/main/template/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/inc/classes/main/template/class_BaseTemplateEngine.php b/inc/classes/main/template/class_BaseTemplateEngine.php
new file mode 100644 (file)
index 0000000..8690db6
--- /dev/null
@@ -0,0 +1,1299 @@
+<?php
+/**
+ * A generic template engine
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class BaseTemplateEngine extends BaseFrameworkSystem {
+       /**
+        * The local path name where all templates and sub folders for special
+        * templates are stored. We will internally determine the language plus
+        * "html" for web templates or "emails" for email templates
+        */
+       private $basePath = "";
+
+       /**
+        * Template type
+        */
+       private $templateType = "html";
+
+       /**
+        * The extension for web and email templates (not compiled templates)
+        */
+       private $templateExtension = ".tpl";
+
+       /**
+        * The extension for code templates (not compiled templates)
+        */
+       private $codeExtension = ".ctp";
+
+       /**
+        * Path relative to $basePath and language code for compiled code-templates
+        */
+       private $compileOutputPath = "templates/_compiled";
+
+       /**
+        * The raw (maybe uncompiled) template
+        */
+       private $rawTemplateData = "";
+
+       /**
+        * Template data with compiled-in variables
+        */
+       private $compiledData = "";
+
+       /**
+        * The last loaded template's FQFN for debugging the engine
+        */
+       private $lastTemplate = "";
+
+       /**
+        * The variable stack for the templates
+        */
+       private $varStack = array();
+
+       /**
+        * Loaded templates for recursive protection and detection
+        */
+       private $loadedTemplates = array();
+
+       /**
+        * Compiled templates for recursive protection and detection
+        */
+       private $compiledTemplates = array();
+
+       /**
+        * Loaded raw template data
+        */
+       private $loadedRawData = null;
+
+       /**
+        * Raw templates which are linked in code templates
+        */
+       private $rawTemplates = null;
+
+       /**
+        * A regular expression for variable=value pairs
+        */
+       private $regExpVarValue = '/([\w_]+)(="([^"]*)"|=([\w_]+))?/';
+
+       /**
+        * A regular expression for filtering out code tags
+        *
+        * E.g.: {?template:variable=value;var2=value2;[...]?}
+        */
+       private $regExpCodeTags = '/\{\?([a-z_]+)(:("[^"]+"|[^?}]+)+)?\?\}/';
+
+       /**
+        * Loaded helpers
+        */
+       private $helpers = array();
+
+       /**
+        * Current variable group
+        */
+       private $currGroup = 'general';
+
+       /**
+        * All template groups except "general"
+        */
+       private $varGroups = array();
+
+       // Exception codes for the template engine
+       const EXCEPTION_TEMPLATE_TYPE_IS_UNEXPECTED   = 0x110;
+       const EXCEPTION_TEMPLATE_CONTAINS_INVALID_VAR = 0x111;
+       const EXCEPTION_INVALID_VIEW_HELPER           = 0x112;
+
+       /**
+        * Protected constructor
+        *
+        * @param       $className      Name of the class
+        * @return      void
+        */
+       protected function __construct ($className) {
+               // Call parent constructor
+               parent::__construct($className);
+
+               // Clean up a little
+               $this->removeNumberFormaters();
+               $this->removeSystemArray();
+       }
+
+       /**
+        * Search for a variable in the stack
+        *
+        * @param       $var    The variable we are looking for
+        * @return      $idx    FALSE means not found, >=0 means found on a specific index
+        */
+       private function isVariableAlreadySet ($var) {
+               // First everything is not found
+               $found = false;
+
+               // Is the group there?
+               if (isset($this->varStack[$this->currGroup])) {
+                       // Now search for it
+                       foreach ($this->varStack[$this->currGroup] as $idx => $currEntry) {
+                               //* DEBUG: */ echo __METHOD__.":currGroup={$this->currGroup},idx={$idx},currEntry={$currEntry['name']},var={$var}<br />\n";
+                               // Is the entry found?
+                               if ($currEntry['name'] == $var) {
+                                       // Found!
+                                       //* DEBUG: */ echo __METHOD__.":FOUND!<br />\n";
+                                       $found = $idx;
+                                       break;
+                               } // END - if
+                       } // END - foreach
+               } // END - if
+
+               // Return the current position
+               return $found;
+       }
+
+       /**
+        * Return a content of a variable or null if not found
+        *
+        * @param       $var            The variable we are looking for
+        * @return      $content        Content of the variable or null if not found
+        */
+       protected function readVariable ($var) {
+               // First everything is not found
+               $content = null;
+
+               // Get variable index
+               $found = $this->isVariableAlreadySet($var);
+
+               // Is the variable found?
+               if ($found !== false) {
+                       // Read it
+                       $found = $this->varStack[$this->currGroup][$found]['value'];
+               } // END - if
+
+               //* DEBUG: */ echo __METHOD__.": group=".$this->currGroup.",var=".$var.", found=".$found."<br />\n";
+
+               // Return the current position
+               return $found;
+       }
+
+       /**
+        * Add a variable to the stack
+        *
+        * @param       $var    The variable we are looking for
+        * @param       $value  The value we want to store in the variable
+        * @return      void
+        */
+       private function addVariable ($var, $value) {
+               // Set general variable group
+               $this->setVariableGroup('general');
+
+               // Add it to the stack
+               $this->addGroupVariable($var, $value);
+       }
+
+       /**
+        * Returns all variables of current group or empty array
+        *
+        * @return      $result         Wether array of found variables or empty array
+        */
+       private function readCurrentGroup () {
+               // Default is not found
+               $result = array();
+
+               // Is the group there?
+               if (isset($this->varStack[$this->currGroup])) {
+                       // Then use it
+                       $result = $this->varStack[$this->currGroup];
+               } // END - if
+
+               // Return result
+               return $result;
+       }
+
+       /**
+        * Settter for variable group
+        *
+        * @param       $groupName      Name of variable group
+        * @param       $add            Wether add this group
+        * @retur4n     void
+        */
+       public function setVariableGroup ($groupName, $add = true) {
+               // Set group name
+               //* DEBIG: */ echo __METHOD__.": currGroup=".$groupName."<br />\n";
+               $this->currGroup = $groupName;
+
+               // Skip group 'general'
+               if (($groupName != 'general') && ($add === true)) {
+                       $this->varGroups[$groupName] = 'OK';
+               } // END - if
+       }
+
+
+       /**
+        * Adds a variable to current group
+        *
+        * @param       $var    Variable to set
+        * @param       $value  Value to store in variable
+        * @return      void
+        */
+       public function addGroupVariable ($var, $value) {
+               //* DEBUG: */ echo __METHOD__.": group=".$this->currGroup.", var=".$var.", value=".$value."<br />\n";
+
+               // Get current variables in group
+               $currVars = $this->readCurrentGroup();
+
+               // Append our variable
+               $currVars[] = array(
+                       'name'  => $var,
+                       'value' => $value
+               );
+
+               // Add it to the stack
+               $this->varStack[$this->currGroup] = $currVars;
+       }
+
+       /**
+        * Modify an entry on the stack
+        *
+        * @param       $var    The variable we are looking for
+        * @param       $value  The value we want to store in the variable
+        * @return      void
+        */
+       private function modifyVariable ($var, $value) {
+               // Get index for variable
+               $idx = $this->isVariableAlreadySet($var);
+
+               // Is the variable set?
+               if ($idx !== false) {
+                       // Then modify it
+                       $this->varStack[$this->currGroup][$idx]['value'] = $value;
+               } // END - if
+       }
+
+       /**
+        * Setter for template type. Only "html", "emails" and "compiled" should
+        * be sent here
+        *
+        * @param       $templateType   The current template's type
+        * @return      void
+        */
+       private final function setTemplateType ($templateType) {
+               $this->templateType = (string) $templateType;
+       }
+
+       /**
+        * Setter for the last loaded template's FQFN
+        *
+        * @param       $template       The last loaded template
+        * @return      void
+        */
+       private final function setLastTemplate ($template) {
+               $this->lastTemplate = (string) $template;
+       }
+
+       /**
+        * Getter for the last loaded template's FQFN
+        *
+        * @return      $template       The last loaded template
+        */
+       private final function getLastTemplate () {
+               return $this->lastTemplate;
+       }
+
+       /**
+        * Setter for base path
+        *
+        * @param               $basePath               The local base path for all templates
+        * @return      void
+        */
+       public final function setBasePath ($basePath) {
+               // And set it
+               $this->basePath = (string) $basePath;
+       }
+
+       /**
+        * Getter for base path
+        *
+        * @return      $basePath               The local base path for all templates
+        */
+       public final function getBasePath () {
+               // And set it
+               return $this->basePath;
+       }
+
+       /**
+        * Setter for template extension
+        *
+        * @param               $templateExtension      The file extension for all uncompiled
+        *                                                      templates
+        * @return      void
+        */
+       public final function setRawTemplateExtension ($templateExtension) {
+               // And set it
+               $this->templateExtension = (string) $templateExtension;
+       }
+
+       /**
+        * Setter for code template extension
+        *
+        * @param               $codeExtension          The file extension for all uncompiled
+        *                                                      templates
+        * @return      void
+        */
+       public final function setCodeTemplateExtension ($codeExtension) {
+               // And set it
+               $this->codeExtension = (string) $codeExtension;
+       }
+
+       /**
+        * Getter for template extension
+        *
+        * @return      $templateExtension      The file extension for all uncompiled
+        *                                                      templates
+        */
+       public final function getRawTemplateExtension () {
+               // And set it
+               return $this->templateExtension;
+       }
+
+       /**
+        * Getter for code-template extension
+        *
+        * @return      $codeExtension          The file extension for all code-
+        *                                                      templates
+        */
+       public final function getCodeTemplateExtension () {
+               // And set it
+               return $this->codeExtension;
+       }
+
+       /**
+        * Setter for path of compiled templates
+        *
+        * @param       $compileOutputPath      The local base path for all compiled
+        *                                                              templates
+        * @return      void
+        */
+       public final function setCompileOutputPath ($compileOutputPath) {
+               // And set it
+               $this->compileOutputPath = (string) $compileOutputPath;
+       }
+
+       /**
+        * Getter for template type
+        *
+        * @return      $templateType   The current template's type
+        */
+       public final function getTemplateType () {
+               return $this->templateType;
+       }
+
+       /**
+        * Assign (add) a given variable with a value
+        *
+        * @param       $var    The variable we are looking for
+        * @param       $value  The value we want to store in the variable
+        * @return      void
+        * @throws      EmptyVariableException  If the variable name is left empty
+        */
+       public final function assignVariable ($var, $value) {
+               // Trim spaces of variable name
+               $var = trim($var);
+
+               // Empty variable found?
+               if (empty($var)) {
+                       // Throw an exception
+                       throw new EmptyVariableException(array($this, 'var'), self::EXCEPTION_UNEXPECTED_EMPTY_STRING);
+               } // END - if
+
+               // First search for the variable if it was already added
+               $idx = $this->isVariableAlreadySet($var);
+
+               // Was it found?
+               if ($idx === false) {
+                       // Add it to the stack
+                       //* DEBUG: */ echo "ADD: ".$var."<br />\n";
+                       $this->addVariable($var, $value);
+               } elseif (!empty($value)) {
+                       // Modify the stack entry
+                       //* DEBUG: */ echo "MOD: ".$var."<br />\n";
+                       $this->modifyVariable($var, $value);
+               }
+       }
+
+       /**
+        * Removes a given variable
+        *
+        * @param       $var    The variable we are looking for
+        * @return      void
+        */
+       public final function removeVariable ($var) {
+               // First search for the variable if it was already added
+               $idx = $this->isVariableAlreadySet($var);
+
+               // Was it found?
+               if ($idx !== false) {
+                       // Remove this variable
+                       $this->varStack->offsetUnset($idx);
+               }
+       }
+
+       /**
+        * Private setter for raw template data
+        *
+        * @param       $rawTemplateData        The raw data from the template
+        * @return      void
+        */
+       protected final function setRawTemplateData ($rawTemplateData) {
+               // And store it in this class
+               //* DEBUG: */ echo __METHOD__.":".$this->getUniqueId().": ".strlen($rawTemplateData)." Bytes set.<br />\n";
+               //* DEBUG: */ echo $this->currGroup." variables: ".count($this->varStack[$this->currGroup]).", groups=".count($this->varStack)."<br />\n";
+               $this->rawTemplateData = (string) $rawTemplateData;
+       }
+
+       /**
+        * Getter for raw template data
+        *
+        * @return      $rawTemplateData        The raw data from the template
+        */
+       public final function getRawTemplateData () {
+               //* DEBUG: */ echo __METHOD__.":".$this->getUniqueId().": ".strlen($this->rawTemplateData)." Bytes read.<br />\n";
+               return $this->rawTemplateData;
+       }
+
+       /**
+        * Private setter for compiled templates
+        *
+        * @return      void
+        */
+       private final function setCompiledData ($compiledData) {
+               // And store it in this class
+               //* DEBUG: */ echo __METHOD__.":".$this->getUniqueId().": ".strlen($compiledData)." Bytes set.<br />\n";
+               $this->compiledData = (string) $compiledData;
+       }
+
+       /**
+        * Getter for compiled templates
+        *
+        * @return      $compiledData   Compiled template data
+        */
+       public final function getCompiledData () {
+               //* DEBUG: */ echo __METHOD__.":".$this->getUniqueId().": ".strlen($this->compiledData)." Bytes read.<br />\n";
+               return $this->compiledData;
+       }
+
+       /**
+        * Private loader for all template types
+        *
+        * @param       $template       The template we shall load
+        * @return      void
+        */
+       private function loadTemplate ($template) {
+               // Get extension for the template
+               $ext = $this->getRawTemplateExtension();
+
+               // If we shall load a code-template we need to switch the file extension
+               if ($this->getTemplateType() == $this->getConfigInstance()->readConfig('code_template_type')) {
+                       // Switch over to the code-template extension
+                       $ext = $this->getCodeTemplateExtension();
+               } // END - if
+
+               // Construct the FQFN for the template by honoring the current language
+               $fqfn = sprintf("%s%s/%s/%s%s",
+                       $this->getBasePath(),
+                       $this->getLanguageInstance()->getLanguageCode(),
+                       $this->getTemplateType(),
+                       (string) $template,
+                       $ext
+               );
+
+               // Load the raw template data
+               $this->loadRawTemplateData($fqfn);
+       }
+
+       /**
+        * A private loader for raw template names
+        *
+        * @param       $fqfn   The full-qualified file name for a template
+        * @return      void
+        */
+       private function loadRawTemplateData ($fqfn) {
+               // Get a input/output instance from the middleware
+               $ioInstance = $this->getFileIoInstance();
+
+               // Some debug code to look on the file which is being loaded
+               //* DEBUG: */ echo __METHOD__.": FQFN=".$fqfn."<br />\n";
+
+               // Load the raw template
+               $rawTemplateData = $ioInstance->loadFileContents($fqfn);
+
+               // Store the template's contents into this class
+               $this->setRawTemplateData($rawTemplateData);
+
+               // Remember the template's FQFN
+               $this->setLastTemplate($fqfn);
+       }
+
+       /**
+        * Try to assign an extracted template variable as a "content" or 'config'
+        * variable.
+        *
+        * @param       $varName        The variable's name (shall be content orconfig) by
+        *                                              default
+        * @param       $var            The variable we want to assign
+        */
+       private function assignTemplateVariable ($varName, $var) {
+               // Is it not a config variable?
+               if ($varName != 'config') {
+                       // Regular template variables
+                       $this->assignVariable($var, "");
+               } else {
+                       // Configuration variables
+                       $this->assignConfigVariable($var);
+               }
+       }
+
+       /**
+        * Extract variables from a given raw data stream
+        *
+        * @param       $rawData        The raw template data we shall analyze
+        * @return      void
+        */
+       private function extractVariablesFromRawData ($rawData) {
+               // Cast to string
+               $rawData = (string) $rawData;
+
+               // Search for variables
+               @preg_match_all('/\$(\w+)(\[(\w+)\])?/', $rawData, $variableMatches);
+
+               // Did we find some variables?
+               if ((is_array($variableMatches)) && (count($variableMatches) == 4) && (count($variableMatches[0]) > 0)) {
+                       // Initialize all missing variables
+                       foreach ($variableMatches[3] as $key => $var) {
+                               // Variable name
+                               $varName = $variableMatches[1][$key];
+
+                               // Workarround: Do not assign empty variables
+                               if (!empty($var)) {
+                                       // Try to assign it, empty strings are being ignored
+                                       $this->assignTemplateVariable($varName, $var);
+                               } // END - if
+                       } // END - foreach
+               } // END - if
+       }
+
+       /**
+        * Main analysis of the loaded template
+        *
+        * @param       $templateMatches        Found template place-holders, see below
+        * @return      void
+        *
+        *---------------------------------
+        * Structure of $templateMatches:
+        *---------------------------------
+        * [0] => Array - An array with all full matches
+        * [1] => Array - An array with left part (before the ":") of a match
+        * [2] => Array - An array with right part of a match including ":"
+        * [3] => Array - An array with right part of a match excluding ":"
+        */
+       private function analyzeTemplate (array $templateMatches) {
+               // Backup raw template data
+               $backup = $this->getRawTemplateData();
+
+               // Initialize some arrays
+               if (is_null($this->loadedRawData)) { $this->loadedRawData = array(); $this->rawTemplates = array(); }
+
+               // Load all requested templates
+               foreach ($templateMatches[1] as $template) {
+
+                       // Load and compile only templates which we have not yet loaded
+                       // RECURSIVE PROTECTION! BE CAREFUL HERE!
+                       if ((!isset($this->loadedRawData[$template])) && (!in_array($template, $this->loadedTemplates))) {
+
+                               // Template not found, but maybe variable assigned?
+                               //* DEBUG: */ echo __METHOD__.":template={$template}<br />\n";
+                               if ($this->isVariableAlreadySet($template) !== false) {
+                                       // Use that content here
+                                       $this->loadedRawData[$template] = $this->readVariable($template);
+
+                                       // Recursive protection:
+                                       $this->loadedTemplates[] = $template;
+                               } elseif (isset($this->varStack['config'][$template])) {
+                                       // Use that content here
+                                       $this->loadedRawData[$template] = $this->varStack['config'][$template];
+
+                                       // Recursive protection:
+                                       $this->loadedTemplates[] = $template;
+                               } else {
+                                       // Then try to search for code-templates
+                                       try {
+                                               // Load the code template and remember it's contents
+                                               $this->loadCodeTemplate($template);
+                                               $this->loadedRawData[$template] = $this->getRawTemplateData();
+
+                                               // Remember this template for recursion detection
+                                               // RECURSIVE PROTECTION!
+                                               $this->loadedTemplates[] = $template;
+                                       } catch (FileNotFoundException $e) {
+                                               // Even this is not done... :/
+                                               $this->rawTemplates[] = $template;
+                                       } catch (FilePointerNotOpenedException $e) {
+                                               // Even this is not done... :/
+                                               $this->rawTemplates[] = $template;
+                                       }
+                               }
+                       } // END - if
+               } // END - foreach
+
+               // Restore the raw template data
+               $this->setRawTemplateData($backup);
+       }
+
+       /**
+        * Compile a given raw template code and remember it for later usage
+        *
+        * @param       $code           The raw template code
+        * @param       $template       The template's name
+        * @return      void
+        */
+       private function compileCode ($code, $template) {
+               // Is this template already compiled?
+               if (in_array($template, $this->compiledTemplates)) {
+                       // Abort here...
+                       return;
+               } // END - if
+
+               // Remember this template being compiled
+               $this->compiledTemplates[] = $template;
+
+               // Compile the loaded code in five steps:
+               //
+               // 1. Backup current template data
+               $backup = $this->getRawTemplateData();
+
+               // 2. Set the current template's raw data as the new content
+               $this->setRawTemplateData($code);
+
+               // 3. Compile the template data
+               $this->compileTemplate();
+
+               // 4. Remember it's contents
+               $this->loadedRawData[$template] = $this->getRawTemplateData();
+
+               // 5. Restore the previous raw content from backup variable
+               $this->setRawTemplateData($backup);
+       }
+
+       /**
+        * Insert all given and loaded templates by running through all loaded
+        * codes and searching for their place-holder in the main template
+        *
+        * @param       $templateMatches        See method analyzeTemplate()
+        * @return      void
+        */
+       private function insertAllTemplates (array $templateMatches) {
+               // Run through all loaded codes
+               foreach ($this->loadedRawData as $template => $code) {
+
+                       // Search for the template
+                       $foundIndex = array_search($template, $templateMatches[1]);
+
+                       // Lookup the matching template replacement
+                       if (($foundIndex !== false) && (isset($templateMatches[0][$foundIndex]))) {
+
+                               // Get the current raw template
+                               $rawData = $this->getRawTemplateData();
+
+                               // Replace the space holder with the template code
+                               $rawData = str_replace($templateMatches[0][$foundIndex], $code, $rawData);
+
+                               // Set the new raw data
+                               $this->setRawTemplateData($rawData);
+                       } // END - if
+               } // END - foreach
+       }
+
+       /**
+        * Load all extra raw templates
+        *
+        * @return      void
+        */
+       private function loadExtraRawTemplates () {
+               // Are there some raw templates we need to load?
+               if (count($this->rawTemplates) > 0) {
+                       // Try to load all raw templates
+                       foreach ($this->rawTemplates as $key => $template) {
+                               try {
+                                       // Load the template
+                                       $this->loadWebTemplate($template);
+
+                                       // Remember it's contents
+                                       $this->rawTemplates[$template] = $this->getRawTemplateData();
+
+                                       // Remove it from the loader list
+                                       unset($this->rawTemplates[$key]);
+
+                                       // Remember this template for recursion detection
+                                       // RECURSIVE PROTECTION!
+                                       $this->loadedTemplates[] = $template;
+                               } catch (FileNotFoundException $e) {
+                                       // This template was never found. We silently ignore it
+                                       unset($this->rawTemplates[$key]);
+                               } catch (FilePointerNotOpenedException $e) {
+                                       // This template was never found. We silently ignore it
+                                       unset($this->rawTemplates[$key]);
+                               }
+                       } // END - foreach
+               } // END - if
+       }
+
+       /**
+        * Assign all found template variables
+        *
+        * @param       $varMatches             An array full of variable/value pairs.
+        * @return      void
+        * @todo        Unfinished work or don't die here.
+        */
+       private function assignAllVariables (array $varMatches) {
+               // Search for all variables
+               foreach ($varMatches[1] as $key => $var) {
+
+                       // Detect leading equals
+                       if (substr($varMatches[2][$key], 0, 1) == "=") {
+                               // Remove and cast it
+                               $varMatches[2][$key] = (string) substr($varMatches[2][$key], 1);
+                       }
+
+                       // Do we have some quotes left and right side? Then it is free text
+                       if ((substr($varMatches[2][$key], 0, 1) == "\"") && (substr($varMatches[2][$key], -1, 1) == "\"")) {
+                               // Free string detected! Which we can assign directly
+                               $this->assignVariable($var, $varMatches[3][$key]);
+                       } elseif (!empty($varMatches[2][$key])) {
+                               // Non-string found so we need some deeper analysis...
+                               die("Deeper analysis not yet implemented!");
+                       }
+
+               } // for ($varMatches ...
+       }
+       /**
+        * Compiles all loaded raw templates
+        *
+        * @param               $templateMatches        See method analyzeTemplate() for details
+        * @return      void
+        */
+       private function compileRawTemplateData (array $templateMatches) {
+               // Are some code-templates found which we need to compile?
+               if (count($this->loadedRawData) > 0) {
+
+                       // Then compile all!
+                       foreach ($this->loadedRawData as $template => $code) {
+
+                               // Is this template already compiled?
+                               if (in_array($template, $this->compiledTemplates)) {
+                                       // Then skip it
+                                       continue;
+                               }
+
+                               // Search for the template
+                               $foundIndex = array_search($template, $templateMatches[1]);
+
+                               // Lookup the matching variable data
+                               if (($foundIndex !== false) && (isset($templateMatches[3][$foundIndex]))) {
+
+                                       // Split it up with another reg. exp. into variable=value pairs
+                                       preg_match_all($this->regExpVarValue, $templateMatches[3][$foundIndex], $varMatches);
+
+                                       // Assign all variables
+                                       $this->assignAllVariables($varMatches);
+
+                               } // END - if (isset($templateMatches ...
+
+                               // Compile the loaded template
+                               $this->compileCode($code, $template);
+
+                       } // END - foreach ($this->loadedRawData ...
+
+                       // Insert all templates
+                       $this->insertAllTemplates($templateMatches);
+
+               } // END - if (count($this->loadedRawData) ...
+       }
+
+       /**
+        * Inserts all raw templates into their respective variables
+        *
+        * @return      void
+        */
+       private function insertRawTemplates () {
+               // Load all templates
+               foreach ($this->rawTemplates as $template => $content) {
+                       // Set the template as a variable with the content
+                       $this->assignVariable($template, $content);
+               }
+       }
+
+       /**
+        * Finalizes the compilation of all template variables
+        *
+        * @return      void
+        */
+       private function finalizeVariableCompilation () {
+               // Get the content
+               $content = $this->getRawTemplateData();
+               //* DEBUG: */ echo __METHOD__.": content before=".strlen($content)." (".md5($content).")<br />\n";
+
+               // Walk through all variables
+               foreach ($this->varStack['general'] as $currEntry) {
+                       //* DEBUG: */ echo __METHOD__.": name=".$currEntry['name'].", value=<pre>".htmlentities($currEntry['value'])."</pre>\n";
+                       // Replace all [$var] or {?$var?} with the content
+                       // Old behaviour, will become obsolete!
+                       $content = str_replace("\$content[".$currEntry['name']."]", $currEntry['value'], $content);
+
+                       // Yet another old way
+                       $content = str_replace("[".$currEntry['name']."]", $currEntry['value'], $content);
+
+                       // The new behaviour
+                       $content = str_replace("{?".$currEntry['name']."?}", $currEntry['value'], $content);
+               } // END - for
+
+               //* DEBUG: */ echo __METHOD__.": content after=".strlen($content)." (".md5($content).")<br />\n";
+
+               // Set the content back
+               $this->setRawTemplateData($content);
+       }
+
+       /**
+        * Load a specified web template into the engine
+        *
+        * @param       $template       The web template we shall load which is located in
+        *                                              "html" by default
+        * @return      void
+        */
+       public function loadWebTemplate ($template) {
+               // Set template type
+               $this->setTemplateType($this->getConfigInstance()->readConfig('web_template_type'));
+
+               // Load the special template
+               $this->loadTemplate($template);
+       }
+
+       /**
+        * Assign a given congfiguration variable with a value
+        *
+        * @param       $var    The configuration variable we want to assign
+        * @return      void
+        */
+       public function assignConfigVariable ($var) {
+               // Sweet and simple...
+               //* DEBUG: */ echo __METHOD__.":var={$var}<br />\n";
+               $this->varStack['config'][$var] = $this->getConfigInstance()->readConfig($var);
+       }
+
+       /**
+        * Load a specified email template into the engine
+        *
+        * @param       $template       The email template we shall load which is located in
+        *                                              "emails" by default
+        * @return      void
+        */
+       public function loadEmailTemplate ($template) {
+               // Set template type
+               $this->setTemplateType($this->getConfigInstance()->readConfig('email_template_type'));
+
+               // Load the special template
+               $this->loadTemplate($template);
+       }
+
+       /**
+        * Load a specified code template into the engine
+        *
+        * @param       $template       The code template we shall load which is
+        *                                              located in "code" by default
+        * @return      void
+        */
+       public function loadCodeTemplate ($template) {
+               // Set template type
+               $this->setTemplateType($this->getConfigInstance()->readConfig('code_template_type'));
+
+               // Load the special template
+               $this->loadTemplate($template);
+       }
+
+       /**
+        * Compile all variables by inserting their respective values
+        *
+        * @return      void
+        * @todo        Make this code some nicer...
+        */
+       public final function compileVariables () {
+               // Initialize the $content array
+               $validVar = $this->getConfigInstance()->readConfig('tpl_valid_var');
+               $dummy = array();
+
+               // Iterate through all general variables
+               foreach ($this->varStack['general'] as $currVariable) {
+                       // Transfer it's name/value combination to the $content array
+                       //* DEBUG: */ echo $currVariable['name']."=<pre>".htmlentities($currVariable['value'])."</pre>\n";
+                       $dummy[$currVariable['name']] = $currVariable['value'];
+               }// END - if
+
+               // Set the new variable (don't remove the second dollar!)
+               $$validVar = $dummy;
+
+               // Prepare all configuration variables
+               $config = null;
+               if (isset($this->varStack['config'])) {
+                       $config = $this->varStack['config'];
+               } // END - if
+
+               // Remove some variables
+               unset($idx);
+               unset($currVariable);
+
+               // Run the compilation twice to get content from helper classes in
+               $cnt = 0;
+               while ($cnt < 3) {
+                       // Finalize the compilation of template variables
+                       $this->finalizeVariableCompilation();
+
+                       // Prepare the eval() command for comiling the template
+                       $eval = sprintf("\$result = \"%s\";",
+                               addslashes($this->getRawTemplateData())
+                       );
+
+                       // This loop does remove the backslashes (\) in PHP parameters
+                       while (strpos($eval, "<?php") !== false) {
+                               // Get left part before "<?"
+                               $evalLeft = substr($eval, 0, strpos($eval, "<?php"));
+
+                               // Get all from right of "<?"
+                               $evalRight = substr($eval, (strpos($eval, "<?php") + 5));
+
+                               // Cut middle part out and remove escapes
+                               $evalMiddle = trim(substr($evalRight, 0, strpos($evalRight, "?>")));
+                               $evalMiddle = stripslashes($evalMiddle);
+
+                               // Remove the middle part from right one
+                               $evalRight = substr($evalRight, (strpos($evalRight, "?>") + 2));
+
+                               // And put all together
+                               $eval = sprintf("%s<%%php %s %%>%s", $evalLeft, $evalMiddle, $evalRight);
+                       } // END - while
+
+                       // Prepare PHP code for eval() command
+                       $eval = str_replace(
+                               "<%php", "\";",
+                               str_replace(
+                                       "%>", "\n\$result .= \"", $eval
+                               )
+                       );
+
+                       // Run the constructed command. This will "compile" all variables in
+                       @eval($eval);
+
+                       // Goes something wrong?
+                       if (!isset($result)) {
+                               // Output eval command
+                               $this->debugOutput(sprintf("Failed eval() code: <pre>%s</pre>", $this->markupCode($eval, true)), true);
+
+                               // Output backtrace here
+                               $this->debugBackTrace();
+                       } // END - if
+
+                       // Set raw template data
+                       $this->setRawTemplateData($result);
+                       $cnt++;
+               } // END - while
+
+               // Final variable assignment
+               $this->finalizeVariableCompilation();
+
+               // Set the new content
+               $this->setCompiledData($this->getRawTemplateData());
+       }
+
+       /**
+        * Compile all required templates into the current loaded one
+        *
+        * @return      void
+        * @throws      UnexpectedTemplateTypeException If the template type is
+        *                                                                                      not "code"
+        * @throws      InvalidArrayCountException              If an unexpected array
+        *                                                                                      count has been found
+        */
+       public function compileTemplate () {
+               // We will only work with template type "code" from configuration
+               if ($this->getTemplateType() != $this->getConfigInstance()->readConfig('code_template_type')) {
+                       // Abort here
+                       throw new UnexpectedTemplateTypeException(array($this, $this->getTemplateType(), $this->getConfigInstance()->readConfig('code_template_type')), self::EXCEPTION_TEMPLATE_TYPE_IS_UNEXPECTED);
+               } // END - if
+
+               // Get the raw data.
+               $rawData = $this->getRawTemplateData();
+
+               // Remove double spaces and trim leading/trailing spaces
+               $rawData = trim(str_replace("  ", " ", $rawData));
+
+               // Search for raw variables
+               $this->extractVariablesFromRawData($rawData);
+
+               // Search for code-tags which are {? ?}
+               preg_match_all($this->regExpCodeTags, $rawData, $templateMatches);
+
+               // Analyze the matches array
+               if ((is_array($templateMatches)) && (count($templateMatches) == 4) && (count($templateMatches[0]) > 0)) {
+                       // Entries are found:
+                       //
+                       // The main analysis
+                       $this->analyzeTemplate($templateMatches);
+
+                       // Compile raw template data
+                       $this->compileRawTemplateData($templateMatches);
+
+                       // Are there some raw templates left for loading?
+                       $this->loadExtraRawTemplates();
+
+                       // Are some raw templates found and loaded?
+                       if (count($this->rawTemplates) > 0) {
+
+                               // Insert all raw templates
+                               $this->insertRawTemplates();
+
+                               // Remove the raw template content as well
+                               $this->setRawTemplateData("");
+
+                       } // END - if
+
+               } // END - if($templateMatches ...
+       }
+
+       /**
+        * A old deprecated method
+        *
+        * @return      void
+        * @deprecated
+        * @see         BaseTemplateEngine::transferToResponse
+        */
+       public function output () {
+               // Check which type of template we have
+               switch ($this->getTemplateType()) {
+               case "html": // Raw HTML templates can be send to the output buffer
+                       // Quick-N-Dirty:
+                       $this->getWebOutputInstance()->output($this->getCompiledData());
+                       break;
+
+               default: // Unknown type found
+                       // Construct message
+                       $msg = sprintf("[%s-&gt;%s] Unknown/unsupported template type <span class=\"data\">%s</span> detected.",
+                               $this->__toString(),
+                               __FUNCTION__,
+                               $this->getTemplateType()
+                       );
+
+                       // Write the problem to the world...
+                       $this->debugOutput($msg);
+                       break;
+               }
+       }
+
+       /**
+        * Loads a given view helper (by name)
+        *
+        * @param       $helperName             The helper's name
+        * @return      void
+        * @throws      ViewHelperNotFoundException     If the given view helper was not found
+        */
+       protected function loadViewHelper ($helperName) {
+               // Make first character upper case, rest low
+               $helperName = ucfirst($helperName);
+
+               // Is this view helper loaded?
+               if (!isset($this->helpers[$helperName])) {
+                       // Create a class name
+                       $className = "{$helperName}ViewHelper";
+
+                       // Does this class exists?
+                       if (!class_exists($className)) {
+                               // Abort here!
+                               throw new ViewHelperNotFoundException(array($this, $helperName), self::EXCEPTION_INVALID_VIEW_HELPER);
+                       } // END - if
+
+                       // Generate new instance
+                       $eval = sprintf("\$this->helpers[%s] = %s::create%s();",
+                               $helperName,
+                               $className,
+                               $className
+                       );
+
+                       // Run the code
+                       eval($eval);
+               } // END - if
+
+               // Return the requested instance
+               return $this->helpers[$helperName];
+       }
+
+       /**
+        * Assigns the last loaded raw template content with a given variable
+        *
+        * @param       $templateName   Name of the template we want to assign
+        * @param       $variableName   Name of the variable we want to assign
+        * @return      void
+        */
+       public function assignTemplateWithVariable ($templateName, $variableName) {
+               // Get the content from last loaded raw template
+               $content = $this->getRawTemplateData();
+
+               // Assign the variable
+               $this->assignVariable($variableName, $content);
+
+               // Purge raw content
+               $this->setRawTemplateData("");
+       }
+
+       /**
+        * Transfers the content of this template engine to a given response instance
+        *
+        * @param       $responseInstance       An instance of a response class
+        * @return      void
+        */
+       public function transferToResponse (Responseable $responseInstance) {
+               // Get the content and set it in response class
+               $responseInstance->writeToBody($this->getCompiledData());
+       }
+
+       /**
+        * Assigns all the application data with template variables
+        *
+        * @param       $appInstance    A manageable application instance
+        * @return      void
+        */
+       public function assignApplicationData (ManageableApplication $appInstance) {
+               // Get long name and assign it
+               $this->assignVariable('app_full_name' , $appInstance->getAppName());
+
+               // Get short name and assign it
+               $this->assignVariable('app_short_name', $appInstance->getAppShortName());
+
+               // Get version number and assign it
+               $this->assignVariable('app_version'   , $appInstance->getAppVersion());
+
+               // Assign extra application-depending data
+               $appInstance->assignExtraTemplateData($this);
+       }
+
+       /**
+        * "Compiles" a variable by replacing {?var?} with it's content
+        *
+        * @param       $rawCode        Raw code to compile
+        * @return      $rawCode        Compile code with inserted variable value
+        */
+       public function compileRawCode ($rawCode) {
+               // Find the variables
+               //* DEBUG: */ echo "rawCode=<pre>".htmlentities($rawCode)."</pre>\n";
+               preg_match_all($this->regExpVarValue, $rawCode, $varMatches);
+
+               // Compile all variables
+               //* DEBUG: */ echo "<pre>".print_r($varMatches, true)."</pre>";
+               foreach ($varMatches[0] as $match) {
+                       // Add variable tags around it
+                       $varCode = "{?".$match."?}";
+
+                       // Is the variable found in code? (safes some calls)
+                       if (strpos($rawCode, $varCode) !== false) {
+                               // Replace the variable with it's value, if found
+                               //* DEBUG: */ echo __METHOD__.": match=".$match."<br />\n";
+                               $rawCode = str_replace($varCode, $this->readVariable($match), $rawCode);
+                       } // END - if
+               } // END - foreach
+
+               // Return the compiled data
+               return $rawCode;
+       }
+
+       /**
+        * Getter for variable group array
+        *
+        * @return      $vargroups      All variable groups
+        */
+       public final function getVariableGroups () {
+               return $this->varGroups;
+       }
+
+       /**
+        * Renames a variable in code and in stack
+        *
+        * @param       $oldName        Old name of variable
+        * @param       $newName        New name of variable
+        * @return      void
+        */
+       public function renameVariable ($oldName, $newName) {
+               //* DEBUG: */ echo __METHOD__.": oldName={$oldName}, newName={$newName}<br />\n";
+               // Get raw template code
+               $rawData = $this->getRawTemplateData();
+
+               // Replace it
+               $rawData = str_replace($oldName, $newName, $rawData);
+
+               // Set the code back
+               $this->setRawTemplateData($rawData);
+       }
+
+       /**
+        * Renders the given XML content
+        *
+        * @param       $content        Valid XML content or if not set the current loaded raw content
+        * @return      void
+        * @throws      XmlParserException      If an XML error was found
+        */
+       public final function renderXmlContent ($content = null) {
+               // Is the content set?
+               if (is_null($content)) {
+                       // Get current content
+                       $content = $this->getRawTemplateData();
+               } // END - if
+
+               // Convert all to UTF8
+               $content = recode("html..utf8", $content);
+
+               // Get an XML parser
+               $xmlParser = xml_parser_create();
+
+               // Force case-folding to on
+               xml_parser_set_option($xmlParser, XML_OPTION_CASE_FOLDING, true);
+
+               // Set object
+               xml_set_object($xmlParser, $this);
+
+               // Set handler call-backs
+               xml_set_element_handler($xmlParser, 'startElement', 'endElement');
+               xml_set_character_data_handler($xmlParser, 'characterHandler');
+
+               // Now parse the XML tree
+               if (!xml_parse($xmlParser, $content)) {
+                       // Error found in XML!
+                       //die("<pre>".htmlentities($content)."</pre>");
+                       throw new XmlParserException(array($this, $xmlParser), BaseHelper::EXCEPTION_XML_PARSER_ERROR);
+               } // END - if
+
+               // Free the parser
+               xml_parser_free($xmlParser);
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/main/template/image/.htaccess b/inc/classes/main/template/image/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/inc/classes/main/template/image/class_ImageTemplateEngine.php b/inc/classes/main/template/image/class_ImageTemplateEngine.php
new file mode 100644 (file)
index 0000000..68d1cbe
--- /dev/null
@@ -0,0 +1,472 @@
+<?php
+/**
+ * The own template engine for loading caching and sending out images
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class ImageTemplateEngine extends BaseTemplateEngine implements CompileableTemplate {
+       /**
+        * Main nodes in the XML tree ('image' is ignored)
+        */
+       private $mainNodes = array("base", "type", "resolution", "background-color", "foreground-color", "image-string");
+
+       /**
+        * Sub nodes in the XML tree
+        */
+       private $subNodes = array("name", "string-name", "x", "y", "font-size", "width", "height", "red", "green", "blue", "text");
+
+       /**
+        * Image instance
+        */
+       private $imageInstance = null;
+
+       /**
+        * Current main node
+        */
+       private $currMainNode = "";
+
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+       }
+
+       /**
+        * Creates an instance of the class TemplateEngine and prepares it for usage
+        *
+        * @param       $basePath               The local base path for all templates
+        * @param       $langInstance   An instance of LanguageSystem (default)
+        * @param       $ioInstance             An instance of FileIoHandler (default, middleware!)
+        * @return      $tplInstance    An instance of TemplateEngine
+        * @throws      BasePathIsEmptyException                If the provided $basePath is empty
+        * @throws      InvalidBasePathStringException  If $basePath is no string
+        * @throws      BasePathIsNoDirectoryException  If $basePath is no
+        *                                                                                      directory or not found
+        * @throws      BasePathReadProtectedException  If $basePath is
+        *                                                                                      read-protected
+        */
+       public final static function createImageTemplateEngine ($basePath, ManageableLanguage  $langInstance, FileIoHandler $ioInstance) {
+               // Get a new instance
+               $tplInstance = new ImageTemplateEngine();
+
+               // Is the base path valid?
+               if (empty($basePath)) {
+                       // Base path is empty
+                       throw new BasePathIsEmptyException($tplInstance, self::EXCEPTION_UNEXPECTED_EMPTY_STRING);
+               } elseif (!is_string($basePath)) {
+                       // Is not a string
+                       throw new InvalidBasePathStringException(array($tplInstance, $basePath), self::EXCEPTION_INVALID_STRING);
+               } elseif (!is_dir($basePath)) {
+                       // Is not a path
+                       throw new BasePathIsNoDirectoryException(array($tplInstance, $basePath), self::EXCEPTION_INVALID_PATH_NAME);
+               } elseif (!is_readable($basePath)) {
+                       // Is not readable
+                       throw new BasePathReadProtectedException(array($tplInstance, $basePath), self::EXCEPTION_READ_PROTECED_PATH);
+               }
+
+               // Get configuration instance
+               $cfgInstance = FrameworkConfiguration::getInstance();
+
+               // Set the base path
+               $tplInstance->setBasePath($basePath);
+
+               // Set the language and IO instances
+               $tplInstance->setLanguageInstance($langInstance);
+               $tplInstance->setFileIoInstance($ioInstance);
+
+               // Set template extensions
+               $tplInstance->setRawTemplateExtension($cfgInstance->readConfig('raw_template_extension'));
+               $tplInstance->setCodeTemplateExtension($cfgInstance->readConfig('code_template_extension'));
+
+               // Absolute output path for compiled templates
+               $tplInstance->setCompileOutputPath($cfgInstance->readConfig('base_path') . $cfgInstance->readConfig('compile_output_path'));
+
+               // Return the prepared instance
+               return $tplInstance;
+       }
+
+       /**
+        * Getter for current main node
+        *
+        * @return      $currMainNode   Current main node
+        */
+       public final function getCurrMainNode () {
+               return $this->currMainNode;
+       }
+
+       /**
+        * Getter for main node array
+        *
+        * @return      $mainNodes      Array with valid main node names
+        */
+       public final function getMainNodes () {
+               return $this->mainNodes;
+       }
+
+       /**
+        * Getter for sub node array
+        *
+        * @return      $subNodes       Array with valid sub node names
+        */
+       public final function getSubNodes () {
+               return $this->subNodes;
+       }
+
+       /**
+        * Handles the start element of an XML resource
+        *
+        * @param       $resource               XML parser resource (currently ignored)
+        * @param       $element                The element we shall handle
+        * @param       $attributes             All attributes
+        * @return      void
+        * @throws      InvalidXmlNodeException         If an unknown/invalid XML node name was found
+        */
+       public function startElement ($resource, $element, array $attributes) {
+               // Initial method name which will never be called...
+               $methodName = 'initImage';
+
+               // Make the element name lower-case
+               $element = strtolower($element);
+
+               // Is the element a main node?
+               //* DEBUG: */ echo "START: &gt;".$element."&lt;<br />\n";
+               if (in_array($element, $this->mainNodes)) {
+                       // Okay, main node found!
+                       $methodName = 'setImage' . $this->convertToClassName($element);
+               } elseif (in_array($element, $this->subNodes)) {
+                       // Sub node found
+                       $methodName = 'setImageProperty' . $this->convertToClassName($element);
+               } elseif ($element != 'image') {
+                       // Invalid node name found
+                       throw new InvalidXmlNodeException(array($this, $element, $attributes), BaseHelper::EXCEPTION_XML_NODE_UNKNOWN);
+               }
+
+               // Call method
+               //* DEBUG: */ echo "call: ".$methodName."<br />\n";
+               call_user_func_array(array($this, $methodName), $attributes);
+       }
+
+       /**
+        * Ends the main or sub node by sending out the gathered data
+        *
+        * @param       $resource       An XML resource pointer (currently ignored)
+        * @param       $nodeName       Name of the node we want to finish
+        * @return      void
+        * @throws      XmlNodeMismatchException        If current main node mismatches the closing one
+        */
+       protected function endElement ($resource, $nodeName) {
+               // Make all lower-case
+               $nodeName = strtolower($nodeName);
+
+               // Does this match with current main node?
+               //* DEBUG: */ echo "END: &gt;".$nodeName."&lt;<br />\n";
+               if (($nodeName != $this->getCurrMainNode()) && (in_array($nodeName, $this->getMainNodes()))) {
+                       // Did not match!
+                       throw new XmlNodeMismatchException (array($this, $nodeName, $this->getCurrMainNode()), BaseHelper::EXCEPTION_XML_NODE_MISMATCH);
+               } elseif (in_array($nodeName, $this->getSubNodes())) {
+                       // Silently ignore sub nodes
+                       return;
+               }
+
+               // Construct method name
+               $methodName = 'finish' . $this->convertToClassName($nodeName);
+
+               // Call the corresponding method
+               call_user_func_array(array($this->imageInstance, $methodName), array());
+       }
+
+       /**
+        * Currently not used
+        *
+        * @param       $resource               XML parser resource (currently ignored)
+        * @param       $characters             Characters to handle
+        * @return      void
+        * @todo        Find something usefull with this!
+        */
+       protected function characterHandler ($resource, $characters) {
+               // Trim all spaces away
+               $characters = trim($characters);
+
+               // Is this string empty?
+               if (empty($characters)) {
+                       // Then skip it silently
+                       return false;
+               } // END - if
+
+               // Unfinished work!
+               $this->partialStub("Handling extra characters is not yet supported!");
+       }
+
+       /**
+        * Intializes the image
+        *
+        * @return      void
+        * @todo        Add cache creation here
+        */
+       private function initImage () {
+               // Unfinished work!
+       }
+
+       /**
+        * Set the image type
+        *
+        * @param       $imageType      Code fragment or direct value holding the image type
+        * @return      void
+        */
+       private function setImageType ($imageType) {
+               // Set group to general
+               $this->setVariableGroup('general');
+
+               // Try to compile it first to get the value from variable stack
+               $imageType = $this->compileRawCode($imageType);
+
+               // Now make a class name of it
+               $className = $this->convertToClassName($imageType.'_image');
+
+               // And try to initiate it
+               $this->imageInstance = ObjectFactory::createObjectByName($className, array($this));
+
+               // Set current main node to type
+               $this->currMainNode = 'type';
+       }
+
+       /**
+        * "Setter" for resolution, we first need to collect the resolution from the
+        * sub-nodes. So first, this method will prepare an array for it
+        *
+        * @return      void
+        */
+       private function setImageResolution () {
+               // Call the image class
+               $this->imageInstance->initResolution();
+
+               // Current main node is resolution
+               $this->currMainNode = 'resolution';
+       }
+
+       /**
+        * "Setter" for base information. For more details see above method!
+        *
+        * @return      void
+        * @see         ImageTemplateEngine::setImageResolution
+        */
+       private function setImageBase () {
+               // Call the image class
+               $this->imageInstance->initBase();
+
+               // Current main node is resolution
+               $this->currMainNode = 'base';
+       }
+
+       /**
+        * "Setter" for background-color. For more details see above method!
+        *
+        * @return      void
+        * @see         ImageTemplateEngine::setImageResolution
+        */
+       private function setImageBackgroundColor () {
+               // Call the image class
+               $this->imageInstance->initBackgroundColor();
+
+               // Current main node is background-color
+               $this->currMainNode = 'background-color';
+       }
+
+       /**
+        * "Setter" for foreground-color. For more details see above method!
+        *
+        * @return      void
+        * @see         ImageTemplateEngine::setImageResolution
+        */
+       private function setImageForegroundColor () {
+               // Call the image class
+               $this->imageInstance->initForegroundColor();
+
+               // Current main node is foreground-color
+               $this->currMainNode = 'foreground-color';
+       }
+
+       /**
+        * "Setter" for image-string. For more details see above method!
+        *
+        * @param       $groupable      Wether this image string is groupable
+        * @return      void
+        * @see         ImageTemplateEngine::setImageResolution
+        */
+       private function setImageImageString ($groupable = 'single') {
+               // Call the image class
+               $this->imageInstance->initImageString($groupable);
+
+               // Current main node is foreground-color
+               $this->currMainNode = 'image-string';
+       }
+
+       /**
+        * Setter for image name
+        *
+        * @param       $imageName      Name of the image
+        * @return      void
+        */
+       private function setImagePropertyName ($imageName) {
+               // Call the image class
+               $this->imageInstance->setImageName($imageName);
+       }
+
+       /**
+        * Setter for image width
+        *
+        * @param       $width  Width of the image or variable
+        * @return      void
+        */
+       private function setImagePropertyWidth ($width) {
+               // Call the image class
+               $this->imageInstance->setWidth($width);
+       }
+
+       /**
+        * Setter for image height
+        *
+        * @param       $height Height of the image or variable
+        * @return      void
+        */
+       private function setImagePropertyHeight ($height) {
+               // Call the image class
+               $this->imageInstance->setHeight($height);
+       }
+
+       /**
+        * Setter for image red color
+        *
+        * @param       $red    Red color value
+        * @return      void
+        */
+       private function setImagePropertyRed ($red) {
+               // Call the image class
+               $this->imageInstance->setRed($red);
+       }
+
+       /**
+        * Setter for image green color
+        *
+        * @param       $green  Green color value
+        * @return      void
+        */
+       private function setImagePropertyGreen ($green) {
+               // Call the image class
+               $this->imageInstance->setGreen($green);
+       }
+
+       /**
+        * Setter for image blue color
+        *
+        * @param       $blue   Blue color value
+        * @return      void
+        */
+       private function setImagePropertyBlue ($blue) {
+               // Call the image class
+               $this->imageInstance->setBlue($blue);
+       }
+
+       /**
+        * Setter for string name (identifier)
+        *
+        * @param       $stringName             String name (identifier)
+        * @return      void
+        */
+       private function setImagePropertyStringName ($stringName) {
+               // Call the image class
+               $this->imageInstance->setStringName($stringName);
+       }
+
+       /**
+        * Setter for font size
+        *
+        * @param       $fontSize       Size of the font
+        * @return      void
+        */
+       private function setImagePropertyFontSize ($fontSize) {
+               // Call the image class
+               $this->imageInstance->setFontSize($fontSize);
+       }
+
+       /**
+        * Setter for image string
+        *
+        * @param       $imageString    Image string to set
+        * @return      void
+        */
+       private function setImagePropertyText ($imageString) {
+               // Call the image class
+               $this->imageInstance->setString($imageString);
+       }
+
+       /**
+        * Setter for X coordinate
+        *
+        * @param       $x      X coordinate
+        * @return      void
+        */
+       private function setImagePropertyX ($x) {
+               // Call the image class
+               $this->imageInstance->setX($x);
+       }
+
+       /**
+        * Setter for Y coordinate
+        *
+        * @param       $y      Y coordinate
+        * @return      void
+        */
+       private function setImagePropertyY ($y) {
+               // Call the image class
+               $this->imageInstance->setY($y);
+       }
+
+       /**
+        * Getter for image cache file (FQFN)
+        *
+        * @return      $fqfn   Full-qualified file name of the image cache
+        */
+       public function getImageCacheFqfn () {
+               // Get the FQFN ready
+               $fqfn = $this->getBasePath().'_cache/' . md5($this->imageInstance->getImageName().":".$this->__toString().":".$this->imageInstance->__toString()) . "." . $this->imageInstance->getImageType();
+
+               // Return it
+               return $fqfn;
+       }
+
+       /**
+        * Outputs the image to the world
+        *
+        * @param       $responseInstance       An instance of a Responseable class
+        * @return      void
+        */
+       public function transferToResponse (Responseable $responseInstance) {
+               // Set the image instance
+               $responseInstance->setImageInstance($this->imageInstance);
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/main/template/mail/.htaccess b/inc/classes/main/template/mail/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/inc/classes/main/template/mail/class_MailTemplateEngine.php b/inc/classes/main/template/mail/class_MailTemplateEngine.php
new file mode 100644 (file)
index 0000000..8fcd0f9
--- /dev/null
@@ -0,0 +1,357 @@
+<?php
+/**
+ * The own template engine for loading caching and sending out images
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class MailTemplateEngine extends BaseTemplateEngine implements CompileableTemplate {
+       /**
+        * Main nodes in the XML tree
+        */
+       private $mainNodes = array("mail-data");
+
+       /**
+        * Sub nodes in the XML tree
+        */
+       private $subNodes = array("subject-line", "sender-address", "recipient-address", "message");
+
+       /**
+        * Mailer instance
+        */
+       private $mailerInstance = null;
+
+       /**
+        * Current main node
+        */
+       private $currMainNode = "";
+
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+       }
+
+       /**
+        * Creates an instance of the class TemplateEngine and prepares it for usage
+        *
+        * @param       $basePath               The local base path for all templates
+        * @param       $langInstance   An instance of LanguageSystem (default)
+        * @param       $ioInstance             An instance of FileIoHandler (default, middleware!)
+        * @return      $tplInstance    An instance of TemplateEngine
+        * @throws      BasePathIsEmptyException                If the provided $basePath is empty
+        * @throws      InvalidBasePathStringException  If $basePath is no string
+        * @throws      BasePathIsNoDirectoryException  If $basePath is no
+        *                                                                                      directory or not found
+        * @throws      BasePathReadProtectedException  If $basePath is
+        *                                                                                      read-protected
+        */
+       public final static function createMailTemplateEngine ($basePath, ManageableLanguage  $langInstance, FileIoHandler $ioInstance) {
+               // Get a new instance
+               $tplInstance = new MailTemplateEngine();
+
+               // Is the base path valid?
+               if (empty($basePath)) {
+                       // Base path is empty
+                       throw new BasePathIsEmptyException($tplInstance, self::EXCEPTION_UNEXPECTED_EMPTY_STRING);
+               } elseif (!is_string($basePath)) {
+                       // Is not a string
+                       throw new InvalidBasePathStringException(array($tplInstance, $basePath), self::EXCEPTION_INVALID_STRING);
+               } elseif (!is_dir($basePath)) {
+                       // Is not a path
+                       throw new BasePathIsNoDirectoryException(array($tplInstance, $basePath), self::EXCEPTION_INVALID_PATH_NAME);
+               } elseif (!is_readable($basePath)) {
+                       // Is not readable
+                       throw new BasePathReadProtectedException(array($tplInstance, $basePath), self::EXCEPTION_READ_PROTECED_PATH);
+               }
+
+               // Get configuration instance
+               $cfgInstance = FrameworkConfiguration::getInstance();
+
+               // Set the base path
+               $tplInstance->setBasePath($basePath);
+
+               // Set the language and IO instances
+               $tplInstance->setLanguageInstance($langInstance);
+               $tplInstance->setFileIoInstance($ioInstance);
+
+               // Set template extensions
+               $tplInstance->setRawTemplateExtension($cfgInstance->readConfig('raw_template_extension'));
+               $tplInstance->setCodeTemplateExtension($cfgInstance->readConfig('code_template_extension'));
+
+               // Absolute output path for compiled templates
+               $tplInstance->setCompileOutputPath($cfgInstance->readConfig('base_path') . $cfgInstance->readConfig('compile_output_path'));
+
+               // Return the prepared instance
+               return $tplInstance;
+       }
+
+       /**
+        * Getter for current main node
+        *
+        * @return      $currMainNode   Current main node
+        */
+       public final function getCurrMainNode () {
+               return $this->currMainNode;
+       }
+
+       /**
+        * Getter for main node array
+        *
+        * @return      $mainNodes      Array with valid main node names
+        */
+       public final function getMainNodes () {
+               return $this->mainNodes;
+       }
+
+       /**
+        * Getter for sub node array
+        *
+        * @return      $subNodes       Array with valid sub node names
+        */
+       public final function getSubNodes () {
+               return $this->subNodes;
+       }
+
+       /**
+        * Handles the start element of an XML resource
+        *
+        * @param       $resource               XML parser resource (currently ignored)
+        * @param       $element                The element we shall handle
+        * @param       $attributes             All attributes
+        * @return      void
+        * @throws      InvalidXmlNodeException         If an unknown/invalid XML node name was found
+        */
+       protected function startElement ($resource, $element, array $attributes) {
+               // Initial method name which will never be called...
+               $methodName = 'initEmail';
+
+               // Make the element name lower-case
+               $element = strtolower($element);
+
+               // Is the element a main node?
+               //* DEBUG: */ echo "START: &gt;".$element."&lt;<br />\n";
+               if (in_array($element, $this->getMainNodes())) {
+                       // Okay, main node found!
+                       $methodName = 'setEmail' . $this->convertToClassName($element);
+               } elseif (in_array($element, $this->getSubNodes())) {
+                       // Sub node found
+                       $methodName = 'setEmailProperty' . $this->convertToClassName($element);
+               } elseif ($element != 'text-mail') {
+                       // Invalid node name found
+                       throw new InvalidXmlNodeException(array($this, $element, $attributes), BaseHelper::EXCEPTION_XML_NODE_UNKNOWN);
+               }
+
+               // Call method
+               //* DEBUG: */ echo "call: ".$methodName."<br />\n";
+               call_user_func_array(array($this, $methodName), $attributes);
+       }
+
+       /**
+        * Ends the main or sub node by sending out the gathered data
+        *
+        * @param       $resource       An XML resource pointer (currently ignored)
+        * @param       $nodeName       Name of the node we want to finish
+        * @return      void
+        * @throws      XmlNodeMismatchException        If current main node mismatches the closing one
+        */
+       protected function endElement ($resource, $nodeName) {
+               // Make all lower-case
+               $nodeName = strtolower($nodeName);
+
+               // Does this match with current main node?
+               //* DEBUG: */ echo "END: &gt;".$nodeName."&lt;<br />\n";
+               if (($nodeName != $this->getCurrMainNode()) && (in_array($nodeName, $this->getMainNodes()))) {
+                       // Did not match!
+                       throw new XmlNodeMismatchException (array($this, $nodeName, $this->getCurrMainNode()), BaseHelper::EXCEPTION_XML_NODE_MISMATCH);
+               } elseif (in_array($nodeName, $this->getSubNodes())) {
+                       // Silently ignore sub nodes
+                       return;
+               }
+
+               // Construct method name
+               $methodName = 'finish' . $this->convertToClassName($nodeName);
+
+               // Call the corresponding method
+               call_user_func_array(array($this, $methodName), array());
+       }
+
+       /**
+        * Adds the message text to the template engine
+        *
+        * @param       $resource               XML parser resource (currently ignored)
+        * @param       $characters             Characters to handle
+        * @return      void
+        */
+       protected function characterHandler ($resource, $characters) {
+               // Trim all spaces away
+               $characters = trim($characters);
+
+               // Is this string empty?
+               if (empty($characters)) {
+                       // Then skip it silently
+                       return false;
+               } // END - if
+
+               // Add the message now
+               $this->assignVariable('message', $characters);
+       }
+
+       /**
+        * Intializes the mail
+        *
+        * @return      void
+        * @todo        Add cache creation here
+        */
+       private function initEmail () {
+               // Unfinished work!
+       }
+
+       /**
+        * Setter for mail data node
+        *
+        * @return      void
+        * @todo        Should we call back the mailer class here?
+        */
+       private function setEmailMailData () {
+               // Set current main node
+               $this->currMainNode = 'mail-data';
+       }
+
+       /**
+        * Setter for sender address property
+        *
+        * @param       $senderAddress  Sender address to set in email
+        * @return      void
+        */
+       private function setEmailPropertySenderAddress ($senderAddress) {
+               // Set the template variable
+               $this->assignVariable('sender', $senderAddress);
+       }
+
+       /**
+        * Setter for recipient address property
+        *
+        * @param       $recipientAddress       Recipient address to set in email
+        * @return      void
+        */
+       private function setEmailPropertyRecipientAddress ($recipientAddress) {
+               // Set the template variable
+               $this->assignVariable('recipient', $recipientAddress);
+       }
+
+       /**
+        * Setter for subject line property
+        *
+        * @param       $subjectLine    Subject line to set in email
+        * @return      void
+        */
+       private function setEmailPropertySubjectLine ($subjectLine) {
+               // Set the template variable
+               $this->assignVariable('subject', $subjectLine);
+       }
+
+       /**
+        * Method stub to avoid output
+        *
+        * @return      void
+        */
+       private function setEmailPropertyMessage () {
+               // Empty for now
+       }
+
+       /**
+        * Gets the template variable "message", stores it back as raw template data
+        * and compiles all variables so the mail message got prepared for output
+        *
+        * @return      void
+        */
+       private function finishMailData () {
+               // Get the message and set it as new raw template data back
+               $message = $this->readVariable('message');
+               $this->setRawTemplateData($message);
+
+               // Get some variables to compile
+               //$sender = $this->compileRawCode($this->readVariable('sender'));
+               //$this->assignVariable('sender', $sender);
+
+               // Then compile all variables
+               $this->compileVariables();
+       }
+
+       /**
+        * Invokes the final mail process
+        *
+        * @return      void
+        */
+       private function finishTextMail () {
+               $this->getMailerInstance()->invokeMailDelivery();
+       }
+
+       /**
+        * Getter for image cache file (FQFN)
+        *
+        * @return      $fqfn   Full-qualified file name of the image cache
+        * @todo        0% done
+        */
+       public function getMailCacheFqfn () {
+               // Initialize FQFN
+               $fqfn = "";
+               $this->debugBackTrace();
+
+               // Return it
+               return $fqfn;
+       }
+
+       /**
+        * Setter for mailer instance
+        *
+        * @param       $mailerInstance         A mailer instance
+        * @return      void
+        */
+       public final function setMailerInstance (DeliverableMail $mailerInstance) {
+               $this->mailerInstance = $mailerInstance;
+       }
+
+       /**
+        * Getter for mailer instance
+        *
+        * @return      $mailerInstance         A mailer instance
+        */
+       protected final function getMailerInstance () {
+               return $this->mailerInstance;
+       }
+
+       /**
+        * Outputs the mail to the world. This should only the mailer debug class do!
+        *
+        * @param       $responseInstance       An instance of a Responseable class
+        * @return      void
+        */
+       public function transferToResponse (Responseable $responseInstance) {
+               $responseInstance->writeToBody($this->getCompiledData());
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/main/template/web/.htaccess b/inc/classes/main/template/web/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/inc/classes/main/template/web/class_WebTemplateEngine.php b/inc/classes/main/template/web/class_WebTemplateEngine.php
new file mode 100644 (file)
index 0000000..61a6bbb
--- /dev/null
@@ -0,0 +1,92 @@
+<?php
+/**
+ * The own template engine for loading caching and sending out the web pages
+ * and emails.
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class WebTemplateEngine extends BaseTemplateEngine implements CompileableTemplate {
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+       }
+
+       /**
+        * Creates an instance of the class TemplateEngine and prepares it for usage
+        *
+        * @param       $basePath               The local base path for all templates
+        * @param       $langInstance   An instance of LanguageSystem (default)
+        * @param       $ioInstance             An instance of FileIoHandler (default, middleware!)
+        * @return      $tplInstance    An instance of TemplateEngine
+        * @throws      BasePathIsEmptyException                If the provided $basePath is empty
+        * @throws      InvalidBasePathStringException  If $basePath is no string
+        * @throws      BasePathIsNoDirectoryException  If $basePath is no
+        *                                                                                      directory or not found
+        * @throws      BasePathReadProtectedException  If $basePath is
+        *                                                                                      read-protected
+        */
+       public final static function createWebTemplateEngine ($basePath, ManageableLanguage  $langInstance, FileIoHandler $ioInstance) {
+               // Get a new instance
+               $tplInstance = new WebTemplateEngine();
+
+               // Is the base path valid?
+               if (empty($basePath)) {
+                       // Base path is empty
+                       throw new BasePathIsEmptyException($tplInstance, self::EXCEPTION_UNEXPECTED_EMPTY_STRING);
+               } elseif (!is_string($basePath)) {
+                       // Is not a string
+                       throw new InvalidBasePathStringException(array($tplInstance, $basePath), self::EXCEPTION_INVALID_STRING);
+               } elseif (!is_dir($basePath)) {
+                       // Is not a path
+                       throw new BasePathIsNoDirectoryException(array($tplInstance, $basePath), self::EXCEPTION_INVALID_PATH_NAME);
+               } elseif (!is_readable($basePath)) {
+                       // Is not readable
+                       throw new BasePathReadProtectedException(array($tplInstance, $basePath), self::EXCEPTION_READ_PROTECED_PATH);
+               }
+
+               // Get configuration instance
+               $cfgInstance = FrameworkConfiguration::getInstance();
+
+               // Set the base path
+               $tplInstance->setBasePath($basePath);
+
+               // Set the language and IO instances
+               $tplInstance->setLanguageInstance($langInstance);
+               $tplInstance->setFileIoInstance($ioInstance);
+
+               // Set template extensions
+               $tplInstance->setRawTemplateExtension($cfgInstance->readConfig('raw_template_extension'));
+               $tplInstance->setCodeTemplateExtension($cfgInstance->readConfig('code_template_extension'));
+
+               // Absolute output path for compiled templates
+               $tplInstance->setCompileOutputPath($cfgInstance->readConfig('base_path') . $cfgInstance->readConfig('compile_output_path'));
+
+               // Return the prepared instance
+               return $tplInstance;
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/main/user/.htaccess b/inc/classes/main/user/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/inc/classes/main/user/class_BaseUser.php b/inc/classes/main/user/class_BaseUser.php
new file mode 100644 (file)
index 0000000..b00a073
--- /dev/null
@@ -0,0 +1,340 @@
+<?php
+/**
+ * A general user class 
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class BaseUser extends BaseFrameworkSystem {
+       // Exception constances
+       const EXCEPTION_USERNAME_NOT_FOUND   = 0x150;
+       const EXCEPTION_USER_EMAIL_NOT_FOUND = 0x151;
+       const EXCEPTION_USER_PASS_MISMATCH   = 0x152;
+
+       /**
+        * Username of current user
+        */
+       private $userName = "";
+
+       /**
+        * User id of current user
+        */
+       private $userId = 0;
+
+       /**
+        * Email of current user
+        */
+       private $email = "";
+
+       /**
+        * Protected constructor
+        *
+        * @param       $className      Name of the class
+        * @return      void
+        */
+       protected function __construct ($className) {
+               // Call parent constructor
+               parent::__construct($className);
+
+               // Clean up a little
+               $this->removeNumberFormaters();
+               $this->removeSystemArray();
+       }
+
+       /**
+        * Setter for username
+        *
+        * @param       $userName       The username to set
+        * @return      void
+        */
+       public final function setUserName ($userName) {
+               $this->userName = (string) $userName;
+       }
+
+       /**
+        * Getter for username
+        *
+        * @return      $userName       The username to get
+        */
+       public final function getUserName () {
+               return $this->userName;
+       }
+
+       /**
+        * Setter for user id
+        *
+        * @param       $userId         The user id to set
+        * @return      void
+        * @todo        Find a way of casting here. "(int)" might destroy the user id > 32766
+        */
+       public final function setUserId ($userId) {
+               $this->userId = $userId;
+       }
+
+       /**
+        * Getter for user id
+        *
+        * @return      $userId The user id to get
+        */
+       public final function getUserId () {
+               return $this->userId;
+       }
+
+       /**
+        * Setter for email
+        *
+        * @param       $email  The email to set
+        * @return      void
+        */
+       protected final function setEmail ($email) {
+               $this->email = (string) $email;
+       }
+
+       /**
+        * Getter for email
+        *
+        * @return      $email  The email to get
+        */
+       public final function getEmail () {
+               return $this->email;
+       }
+
+       /**
+        * Determines wether the username exists or not
+        *
+        * @return      $exists         Wether the username exists
+        */
+       public function ifUsernameExists () {
+               // By default the username does not exist
+               $exists = false;
+
+               // Is a previous result there?
+               if (is_null($this->getResultInstance())) {
+                       // Get a UserDatabaseWrapper instance
+                       $wrapperInstance = ObjectFactory::createObjectByConfiguredName('user_db_wrapper_class');
+
+                       // Create a search criteria
+                       $criteriaInstance = ObjectFactory::createObjectByConfiguredName('search_criteria_class');
+
+                       // Add the username as a criteria and set limit to one entry
+                       $criteriaInstance->addCriteria(UserDatabaseWrapper::DB_COLUMN_USERNAME, $this->getUserName());
+                       $criteriaInstance->setLimit(1);
+
+                       // Get a search result
+                       $resultInstance = $wrapperInstance->doSelectByCriteria($criteriaInstance);
+
+                       // Set the index "solver"
+                       $resultInstance->solveResultIndex(UserDatabaseWrapper::DB_COLUMN_USERID, $wrapperInstance, array($this, 'setUserId'));
+
+                       // And finally set it
+                       $this->setResultInstance($resultInstance);
+               } // END - if
+
+               // Rewind it
+               $this->getResultInstance()->rewind();
+
+               // Search for it
+               if ($this->getResultInstance()->next()) {
+                       // Entry found
+                       $exists = true;
+               } // END - if
+
+               // Return the status
+               return $exists;
+       }
+
+       /**
+        * Determines wether the email exists or not
+        *
+        * @return      $exists         Wether the email exists
+        */
+       public function ifEmailAddressExists () {
+               // By default the email does not exist
+               $exists = false;
+
+               // Is a previous result there?
+               if (is_null($this->getResultInstance())) {
+                       // Get a UserDatabaseWrapper instance
+                       $wrapperInstance = ObjectFactory::createObjectByConfiguredName('user_db_wrapper_class');
+
+                       // Create a search criteria
+                       $criteriaInstance = ObjectFactory::createObjectByConfiguredName('search_criteria_class');
+
+                       // Add the username as a criteria and set limit to one entry
+                       $criteriaInstance->addCriteria(UserDatabaseWrapper::DB_COLUMN_EMAIL, $this->getEmail());
+                       $criteriaInstance->setLimit(1);
+
+                       // Get a search result
+                       $resultInstance = $wrapperInstance->doSelectByCriteria($criteriaInstance);
+
+                       // Set the index "solver"
+                       $resultInstance->solveResultIndex(UserDatabaseWrapper::DB_COLUMN_USERID, $wrapperInstance, array($this, 'setUserId'));
+
+                       // And finally set it
+                       $this->setResultInstance($resultInstance);
+               } // END - if
+
+               // Rewind it
+               $this->getResultInstance()->rewind();
+
+               // Search for it
+               if ($this->getResultInstance()->next()) {
+                       // Entry found
+                       $exists = true;
+
+                       // Is the username set?
+                       if ($this->getUserName() == "") {
+                               // Get current entry
+                               $currEntry = $this->getResultInstance()->current();
+
+                               // Set the username
+                               $this->setUserName($currEntry['username']);
+                       } // END - if
+               } // END - if
+
+               // Return the status
+               return $exists;
+       }
+
+       /**
+        * Checks if supplied password hash in request matches with the stored in
+        * database.
+        *
+        * @param       $requestInstance        A requestable class instance
+        * @return      $matches                        Wether the supplied password hash matches
+        */
+       public function ifPasswordHashMatches (Requestable $requestInstance) {
+               // By default nothing matches... ;)
+               $matches = false;
+
+               // Is a previous result there?
+               if (is_null($this->getResultInstance())) {
+                       // Get a UserDatabaseWrapper instance
+                       $wrapperInstance = ObjectFactory::createObjectByConfiguredName('user_db_wrapper_class');
+
+                       // Create a search criteria
+                       $criteriaInstance = ObjectFactory::createObjectByConfiguredName('search_criteria_class');
+
+                       // Add the username as a criteria and set limit to one entry
+                       $criteriaInstance->addCriteria(UserDatabaseWrapper::DB_COLUMN_USERNAME, $this->getUserName());
+                       $criteriaInstance->setLimit(1);
+
+                       // Get a search result
+                       $resultInstance = $wrapperInstance->doSelectByCriteria($criteriaInstance);
+
+                       // Set the index "solver"
+                       $resultInstance->solveResultIndex(UserDatabaseWrapper::DB_COLUMN_USERID, $wrapperInstance, array($this, 'setUserId'));
+
+                       // And finally set it
+                       $this->setResultInstance($resultInstance);
+               } // END - if
+
+               // Rewind it
+               $this->getResultInstance()->rewind();
+
+               // Search for it
+               if ($this->getResultInstance()->find('pass_hash')) {
+                       // So does the hashes match?
+                       //* DEBUG: */ echo $requestInstance->getRequestElement('pass_hash')."/".$entry['pass_hash'];
+                       $matches = ($requestInstance->getRequestElement('pass_hash') === $this->getResultInstance()->getFoundValue());
+               } // END - if
+
+               // Return the status
+               return $matches;
+       }
+
+       /**
+        * "Getter" for user's password hash
+        *
+        * @return      $passHash       User's password hash from database result
+        */
+       public final function getPasswordHash () {
+               // Default is missing password hash
+               $passHash = null;
+
+               // Get a database entry
+               $entry = $this->getDatabaseEntry();
+
+               // Is the password hash there?
+               if (isset($entry['pass_hash'])) {
+                       // Get it
+                       $passHash = $entry['pass_hash'];
+               } // END - if
+
+               // And return the hash
+               return $passHash;
+       }
+
+       /**
+        * Getter for primary key value
+        *
+        * @return      $primaryValue   Value of the primary key based on database type
+        */
+       public final function getPrimaryKey () {
+               // Get a user database wrapper
+               $wrapperInstance = ObjectFactory::createObjectByConfiguredName('user_db_wrapper_class');
+
+               // Get the primary key back from the wrapper
+               $primaryKey = $wrapperInstance->getPrimaryKeyValue();
+
+               // Get that field
+               $primaryValue = $this->getField($primaryKey);
+
+               // Return the value
+               return $primaryValue;
+       }
+
+       /**
+        * Updates a given field with new value
+        *
+        * @param       $fieldName              Field to update
+        * @param       $fieldValue             New value to store
+        * @return      void
+        * @throws      DatabaseUpdateSupportException  If this class does not support database updates
+        */
+       public function updateDatabaseField ($fieldName, $fieldValue) {
+               // Is updating database fields allowed by interface?
+               if (!$this instanceof Updateable) {
+                       // Update not supported!
+                       throw new DatabaseUpdateSupportException($this, self::EXCEPTION_DATABASE_UPDATED_NOT_ALLOWED);
+               } // END - if
+
+               // Get a critieria instance
+               $searchInstance = ObjectFactory::createObjectByConfiguredName('search_criteria_class');
+
+               // Add search criteria
+               $searchInstance->addCriteria(UserDatabaseWrapper::DB_COLUMN_USERNAME, $this->getUserName());
+               $searchInstance->setLimit(1);
+
+               // Now get another criteria
+               $updateInstance = ObjectFactory::createObjectByConfiguredName('update_criteria_class');
+
+               // And add our both entries
+               $updateInstance->addCriteria($fieldName, $fieldValue);
+
+               // Add the search criteria for searching for the right entry
+               $updateInstance->setSearchInstance($searchInstance);
+
+               // Remember the update in database result
+               $this->getResultInstance()->add2UpdateQueue($updateInstance);
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/main/user/guest/.htaccess b/inc/classes/main/user/guest/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/inc/classes/main/user/guest/class_Guest.php b/inc/classes/main/user/guest/class_Guest.php
new file mode 100644 (file)
index 0000000..2362921
--- /dev/null
@@ -0,0 +1,107 @@
+<?php
+/**
+ * A generic class for handling guests
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class Guest extends BaseUser implements ManageableGuest, Registerable {
+       // Exceptions
+       const EXCEPTION_USERNAME_NOT_FOUND   = 0x170;
+       const EXCEPTION_USER_EMAIL_NOT_FOUND = 0x171;
+       const EXCEPTION_USER_PASS_MISMATCH   = 0x172;
+
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+       }
+
+       /**
+        * Creates an instance of this user class by a provided username. This
+        * factory method will check if username is already taken and if not so it
+        * will throw an exception.
+        *
+        * @param       $userName               Username we need a class instance for
+        * @return      $userInstance   An instance of this user class
+        * @throws      UsernameMissingException        If the username does not exist
+        */
+       public final static function createGuestByUsername ($userName) {
+               // Get a new instance
+               $userInstance = new Guest();
+
+               // Set the username
+               $userInstance->setUserName($userName);
+
+               // Check if username exists
+               if ($userInstance->ifUsernameExists() === false) {
+                       // Throw an exception here
+                       throw new UsernameMissingException(array($userInstance, $userName), self::EXCEPTION_USERNAME_NOT_FOUND);
+               } // END - if
+
+               // Return the instance
+               return $userInstance;
+       }
+
+       /**
+        * Creates an instance of this user class by a provided email address. This
+        * factory method will not check if email address is there.
+        *
+        * @param       $email                  Email address of the user
+        * @return      $userInstance   An instance of this user class
+        */
+       public final static function createGuestByEmail ($email) {
+               // Get a new instance
+               $userInstance = new Guest();
+
+               // Set the username
+               $userInstance->setEmail($email);
+
+               // Return the instance
+               return $userInstance;
+       }
+
+       /**
+        * Updates the last activity timestamp and last performed action in the
+        * database result. You should call flushPendingUpdates() to flush these updates
+        * to the database layer.
+        *
+        * @param       $requestInstance        A requestable class instance
+        * @return      void
+        */
+       public function updateLastActivity (Requestable $requestInstance) {
+               // No activity will be logged for guest accounts
+       }
+
+       /**
+        * Flushs all pending updates to the database layer
+        *
+        * @return      void
+        */
+       public function flushPendingUpdates () {
+               // No updates will be flushed to database!
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/main/user/member/.htaccess b/inc/classes/main/user/member/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/inc/classes/main/user/member/class_Member.php b/inc/classes/main/user/member/class_Member.php
new file mode 100644 (file)
index 0000000..b67ad88
--- /dev/null
@@ -0,0 +1,175 @@
+<?php
+/**
+ * A generic class for handling users
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class Member extends BaseUser implements ManageableMember, Registerable, Updateable {
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+       }
+
+       /**
+        * Destructor to always flush updates
+        *
+        * @return      void
+        */
+       public function __destruct () {
+               // Flush any updated entries to the database
+               $this->flushPendingUpdates();
+
+               // Call parent destructor
+               parent::__destruct();
+       }
+
+       /**
+        * Creates an instance of this user class by a provided username. This
+        * factory method will check if username is already taken and if not so it
+        * will throw an exception.
+        *
+        * @param       $userName               Username we need a class instance for
+        * @return      $userInstance   An instance of this user class
+        * @throws      UsernameMissingException        If the username does not exist
+        */
+       public final static function createMemberByUsername ($userName) {
+               // Get a new instance
+               $userInstance = new Member();
+
+               // Set the username
+               $userInstance->setUserName($userName);
+
+               // Check if username exists
+               if ($userInstance->ifUsernameExists() === false) {
+                       // Throw an exception here
+                       throw new UsernameMissingException(array($userInstance, $userName), self::EXCEPTION_USERNAME_NOT_FOUND);
+               } // END - if
+
+               // Return the instance
+               return $userInstance;
+       }
+
+       /**
+        * Creates an instance of this user class by a provided email address. This
+        * factory method will not check if email address is there.
+        *
+        * @param       $email                  Email address of the user
+        * @return      $userInstance   An instance of this user class
+        */
+       public final static function createMemberByEmail ($email) {
+               // Get a new instance
+               $userInstance = new Member();
+
+               // Set the username
+               $userInstance->setEmail($email);
+
+               // Return the instance
+               return $userInstance;
+       }
+
+       /**
+        * Creates a user by a given request instance
+        *
+        * @param       $requestInstance        An instance of a Requestable class
+        * @return      $userInstance           An instance of this user class
+        * @todo        Add more ways over creating user classes
+        */
+       public final static function createMemberByRequest (Requestable $requestInstance) {
+               // Determine if by email or username
+               if (!is_null($requestInstance->getRequestElement('username'))) {
+                       // Username supplied
+                       $userInstance = self::createMemberByUserName($requestInstance->getRequestElement('username'));
+               } elseif (!is_null($requestInstance->getRequestElement('email'))) {
+                       // Email supplied
+                       $userInstance = self::createMemberByEmail($requestInstance->getRequestElement('email'));
+               } else {
+                       // Unsupported mode
+                       $userInstance = new Member();
+                       $userInstance->partialStub("We need to add more ways of creating user classes here.");
+                       $userInstance->debugBackTrace();
+                       exit();
+               }
+
+               // Return the prepared instance
+               return $userInstance;
+       }
+
+       /**
+        * Updates the last activity timestamp and last performed action in the
+        * database result. You should call flushPendingUpdates() to flush these updates
+        * to the database layer.
+        *
+        * @param       $requestInstance        A requestable class instance
+        * @return      void
+        */
+       public function updateLastActivity (Requestable $requestInstance) {
+               // Set last action
+               $lastAction = $requestInstance->getRequestElement('action');
+
+               // If there is no action use the default on
+               if (is_null($lastAction)) {
+                       $lastAction = $this->getConfigInstance()->readConfig('login_default_action');
+               } // END - if
+
+               // Get a critieria instance
+               $searchInstance = ObjectFactory::createObjectByConfiguredName('search_criteria_class');
+
+               // Add search criteria
+               $searchInstance->addCriteria(UserDatabaseWrapper::DB_COLUMN_USERNAME, $this->getUserName());
+               $searchInstance->setLimit(1);
+
+               // Now get another criteria
+               $updateInstance = ObjectFactory::createObjectByConfiguredName('update_criteria_class');
+
+               // And add our both entries
+               $updateInstance->addCriteria("last_activity", date("Y-m-d H:i:s", time()));
+               $updateInstance->addCriteria("last_action", $lastAction);
+
+               // Add the search criteria for searching for the right entry
+               $updateInstance->setSearchInstance($searchInstance);
+
+               // Remember the update in database result
+               $this->getResultInstance()->add2UpdateQueue($updateInstance);
+       }
+
+       /**
+        * Flushs all pending updates to the database layer
+        *
+        * @return      void
+        */
+       public function flushPendingUpdates () {
+               // Do we have data to update?
+               if ($this->getResultInstance()->ifDataNeedsFlush()) {
+                       // Get a database wrapper
+                       $wrapperInstance = ObjectFactory::createObjectByConfiguredName('user_db_wrapper_class');
+
+                       // Yes, then send the whole result to the database layer
+                       $wrapperInstance->doUpdateByResult($this->getResultInstance());
+               } // END - if
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/middleware/.htaccess b/inc/classes/middleware/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/inc/classes/middleware/class_BaseMiddleware.php b/inc/classes/middleware/class_BaseMiddleware.php
new file mode 100644 (file)
index 0000000..48e7b1c
--- /dev/null
@@ -0,0 +1,42 @@
+<?php
+/**
+ * An abstract middleware class for all other middlware classes
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ * 
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class BaseMiddleware extends BaseFrameworkSystem {
+       /**
+        * Protected constructor
+        *
+        * @param       $className      Name of the 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/middleware/compressor/.htaccess b/inc/classes/middleware/compressor/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/inc/classes/middleware/compressor/class_CompressorChannel.php b/inc/classes/middleware/compressor/class_CompressorChannel.php
new file mode 100644 (file)
index 0000000..6d3ede2
--- /dev/null
@@ -0,0 +1,129 @@
+<?php
+/**
+ * Middleware class for selecting the right compressor channel
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class CompressorChannel extends BaseMiddleware implements Registerable {
+       /**
+        * Real compressor instance
+        */
+       private $compressor = null;
+
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor!
+               parent::__construct(__CLASS__);
+       }
+
+       /**
+        * Create a new compressor channel based a given base directory where
+        * we shall look for compressor classes
+        *
+        * @param       $baseDir        Directory which holds our compressor classes
+        * @return      $cInstance      A prepared instance of this class
+        */
+       public final static function createCompressorChannel ($baseDir) {
+               // Get new instance
+               $cInstance = new CompressorChannel();
+
+               // Is the compressor handler set?
+               if (
+                          (is_null($cInstance->getCompressor()))
+                       || (!is_object($cInstance->getCompressor()))
+                       || (!method_exists($cInstance->getCompressor(), 'compressStream'))
+                       || (!method_exists($cInstance->getCompressor(), 'decompressStream'))
+               ) {
+                       // Get a directory pointer
+                       $dirPointer = FrameworkDirectoryPointer::createFrameworkDirectoryPointer($baseDir);
+
+                       // Read all directories but no sub directories
+                       while ($dir = $dirPointer->readDirectoryExcept(array("..", ".", ".htaccess", ".svn"))) {
+                               // Is this a class file?
+                               if ((substr($dir, 0, 6) == "class_") && (substr($dir, -4, 4) == ".php")) {
+                                       // Get the compressor's name. That's why you must name
+                                       // your files like your classes and also that's why you
+                                       // must keep on class in one file.
+                                       $className = substr($dir, 6, -4);
+
+                                       // Get an instance from our object factory
+                                       $tempInstance = ObjectFactory::createObjectByName($className);
+
+                                       // Set the compressor
+                                       $cInstance->setCompressor($tempInstance);
+
+                                       // No more searches required because we have found a valid compressor stream
+                                       break;
+                               } // END - if
+                       } // END - while
+
+                       // Close the directory
+                       $dirPointer->closeDirectory();
+               } // END - if
+
+               // Check again if there is a compressor
+               if (
+                          (is_null($cInstance->getCompressor()))
+                       || (!is_object($cInstance->getCompressor()))
+                       || (!method_exists($cInstance->getCompressor(), 'compressStream'))
+                       || (!method_exists($cInstance->getCompressor(), 'decompressStream'))
+               ) {
+                       // Set the null compressor handler. This should not be configureable!
+                       $cInstance->setCompressor(ObjectFactory::createObjectByName('NullCompressor'));
+               } // END - if
+
+               // Return the compressor instance
+               return $cInstance;
+       }
+
+       /**
+        * Getter for compressor instance
+        *
+        * @return      $compressor     The compressor instance
+        */
+       public final function getCompressor () {
+               return $this->compressor;
+       }
+
+       /**
+        * Setter for compressor
+        *
+        * @param               $compressorInstance     The compressor instance we shall use
+        * @return      void
+        */
+       public final function setCompressor (Compressor $compressorInstance) {
+               $this->compressor = $compressorInstance;
+       }
+
+       /**
+        * Getter for the file extension of the current compressor
+        */
+       public final function getCompressorExtension () {
+               // Get compressor extension from current compressor
+               return $this->getCompressor()->getCompressorExtension();
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/middleware/database/.htaccess b/inc/classes/middleware/database/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/inc/classes/middleware/database/class_DatabaseConnection.php b/inc/classes/middleware/database/class_DatabaseConnection.php
new file mode 100644 (file)
index 0000000..6f0a4e1
--- /dev/null
@@ -0,0 +1,186 @@
+<?php
+/**
+ * Database selector class
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class DatabaseConnection extends BaseMiddleware implements DatabaseConnector, Registerable {
+       /**
+        * Array for connection data
+        */
+       private $connectData = array(
+               'login' => "",
+               'pass'  => "",
+               'dbase' => "",
+               'host'  => ""
+       );
+
+       // The real database layer
+       private $dbLayer = null;
+
+       // An instance of this class
+       private static $thisInstance = null;
+
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct() {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+       }
+
+       // Create new database connection layer
+       public final static function createDatabaseConnection (DebugMiddleware $debugInstance, DatabaseFrontendInterface $dbLayer) {
+               // Get instance
+               $dbInstance = new DatabaseConnection();
+
+               // Set debug output handler
+               $dbInstance->setDebugInstance($debugInstance);
+
+               // Set database layer
+               $dbInstance->setDatabaseLayer($dbLayer);
+
+               // Set db instance
+               self::$thisInstance = $dbInstance;
+
+               // Return instance
+               return $dbInstance;
+       }
+
+       // Get an instance of this class
+       public final static function getInstance () {
+               return self::$thisInstance;
+       }
+
+       // Public setter for database connection
+       public final function setConnectionData ($login, $pass, $dbase, $host="localhost") {
+               // Transfer connection data
+               $this->connectData['login'] = (string) $login;
+               $this->connectData['pass']  = (string) $pass;
+               $this->connectData['dbase'] = (string) $dbase;
+               $this->connectData['host']  = (string) $host;
+       }
+
+       /**
+        * Getter for connection data
+        *
+        * @return      $connectData    Connection data stored with this clas
+        */
+       public final function getConnectionData () {
+               return $this->connectData;
+       }
+
+       /**
+        * Setter for the real database layer
+        * @param       $dbLayer        An instance of the real database layer
+        * @return      void
+        */
+       public final function setDatabaseLayer (DatabaseFrontendInterface $dbLayer) {
+               $this->dbLayer = $dbLayer;
+       }
+
+       /**
+        * Getter for index key
+        *
+        * @return      $indexKey       Index key
+        */
+       public final function getIndexKey () {
+               return $this->dbLayer->getIndexKey();
+       }
+
+       /**
+        * Runs a "select" statement on the database layer with given table name
+        * and criteria. If this doesn't fail the result will be returned
+        *
+        * @param       $tableName                      Name of the "table" we shall query
+        * @param       $criteriaInstance       An instance of a Criteria class
+        * @return      $result                         The result as an array
+        */
+       public function doSelectByTableCriteria ($tableName, Criteria $criteriaInstance) {
+               // Connect to the database
+               $this->dbLayer->connectToDatabase();
+
+               // Get result from query
+               $result = $this->dbLayer->querySelect("array", $tableName, $criteriaInstance);
+
+               // Return the result
+               return $result;
+       }
+
+       /**
+        * Getter for last exception
+        *
+        * @return      $exceptionInstance      Last thrown exception
+        */
+       public final function getLastException () {
+               $exceptionInstance = $this->dbLayer->getLastException();
+               return $exceptionInstance;
+       }
+
+       /**
+        * "Inserts" a data set instance into a local file database folder
+        *
+        * @param       $dataSetInstance        A storeable data set
+        * @return      void
+        */
+       public function queryInsertDataSet (StoreableCriteria $dataSetInstance) {
+               // Connect to the database
+               $this->dbLayer->connectToDatabase();
+
+               // Ask the database layer
+               $this->dbLayer->queryInsertDataSet($dataSetInstance);
+       }
+
+       /**
+        * "Updates" a data set instance with a database layer
+        *
+        * @param       $dataSetInstance        A storeable data set
+        * @return      void
+        */
+       public function queryUpdateDataSet (StoreableCriteria $dataSetInstance) {
+               // Connect to the database
+               $this->dbLayer->connectToDatabase();
+
+               // Ask the database layer
+               $this->dbLayer->queryUpdateDataSet($dataSetInstance);
+       }
+
+       /**
+        * Getter for primary key column of specified table name
+        *
+        * @param       $tableName              Name of table we need the primary key column from
+        * @return      $primaryKey             Primary key column of requested table
+        */
+       public function getPrimaryKeyOfTable ($tableName) {
+               // Connect to the database
+               $this->dbLayer->connectToDatabase();
+
+               // Ask the database layer
+               $primaryKey = $this->dbLayer->getPrimaryKeyOfTable($tableName);
+
+               // Return the value
+               return $primaryKey;
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/middleware/debug/.htaccess b/inc/classes/middleware/debug/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/inc/classes/middleware/debug/class_DebugMiddleware.php b/inc/classes/middleware/debug/class_DebugMiddleware.php
new file mode 100644 (file)
index 0000000..8ee7e08
--- /dev/null
@@ -0,0 +1,119 @@
+<?php
+/**
+ * The middlware debug output system. A *real* or concrete output class shall
+ * become registered with this middleware because the back-fall class will
+ * become deprecated soon.
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class DebugMiddleware extends BaseMiddleware implements Registerable {
+       /**
+        * The concrete output instance
+        */
+       private $outputInstance = null;
+
+       /**
+        * An instance of this class
+        */
+       private static $thisInstance = null;
+
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+
+               // Set own instance
+               self::$thisInstance = $this;
+       }
+
+       /**
+        * Create a new debug output system.
+        * If no output is given this class is currently being used for back-fall.
+        * This fall-back mechanism will become deprecated very soon.
+        *
+        * @param       $debuggerClass  The class name which we shall use for
+        *                                                      registering the *real* debug output
+        * @return      $debugInstance  An instance of this middleware class
+        */
+       public final static function createDebugMiddleware ($debuggerClass) {
+               // Create an instance if this middleware
+               $debugInstance = new DebugMiddleware();
+
+               // Is there a valid output instance provided?
+               if ((!is_null($debuggerClass)) && (is_object($debuggerClass)) && ($debuggerClass instanceof OutputStreamer)) {
+                       // Use the given output instance
+                       $debugInstance->setOutputInstance($debuggerClass);
+               } elseif ((!is_null($debuggerClass)) && (is_string($debuggerClass)) && (class_exists($debuggerClass))) {
+                       // A name for a debug output class has been provided so we try to get it
+                       $debuggerInstance = ObjectFactory::createObjectByName($debuggerClass);
+
+                       // Set this as output class
+                       $debugInstance->setOutputInstance($debuggerInstance);
+               }
+
+               // Return instance
+               return $debugInstance;
+       }
+
+       /**
+        * Getter for an instance of this class
+        *
+        * @return      $thisInstance           An instance of this class
+        */
+       public final static function getInstance() {
+               return self::$thisInstance;
+       }
+
+       /**
+        * Setter for output instance
+        *
+        * @param       $outputInstance The debug output instance
+        * @return      void
+        */
+       public final function setOutputInstance (OutputStreamer $outputInstance) {
+               $this->outputInstance = $outputInstance;
+       }
+
+       /**
+        * This method shall send debug output which can be HTML code for the
+        * browser or debug lines for a log file, etc. to the registered debug
+        * output instance.
+        *
+        * @param       $outStream      Data we shall "stream" out to the world
+        * @return      void
+        */
+       public final function output ($outStream) {
+               // Is the output stream set
+               if (empty($outStream)) {
+                       // Initialization phase
+                       return;
+               } // END - if
+
+               // Use the output instance
+               $this->outputInstance->outputStream($outStream);
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/middleware/io/.htaccess b/inc/classes/middleware/io/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/inc/classes/middleware/io/class_FileIoHandler.php b/inc/classes/middleware/io/class_FileIoHandler.php
new file mode 100644 (file)
index 0000000..db57979
--- /dev/null
@@ -0,0 +1,150 @@
+<?php
+/**
+ * This is a file IO handler. It handles reading from and writing to files.
+ * Missing paths in writing process will be automatically created.
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class FileIoHandler extends BaseMiddleware {
+       /**
+        * The *real* file input class we shall use for reading data
+        */
+       private $inputStream = null;
+
+       /**
+        * The *real* file output class we shall use for reading data
+        */
+       private $outputStream = null;
+
+       /**
+        * An instance of this class
+        */
+       private static $thisInstance = null;
+
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+
+               // Set own instance
+               self::$thisInstance = $this;
+       }
+
+       /**
+        * Creates an instance of this class and prepares the IO system. This is
+        * being done by setting the default file IO class
+        *
+        * @return      $ioInstance             A prepared instance of FilIOHandler
+        */
+       public final static function createFileIoHandler () {
+               // Get instance
+               $ioHandler = new FileIoHandler();
+
+               // Set the *real* file IO instances (both the same)
+               $ioHandler->setInputStream(ObjectFactory::createObjectByConfiguredName('file_input_class'));
+               $ioHandler->setOutputStream(ObjectFactory::createObjectByConfiguredName('file_output_class'));
+
+               // Return instance
+               return $ioHandler;
+       }
+
+       /**
+        * Getter for an instance of this class
+        *
+        * @return      $thisInstance   An instance of this class
+        */
+       public final static function getInstance () {
+               return self::$thisInstance;
+       }
+
+       /**
+        * Setter for the *real* file input instance
+        *
+        * @param       $inputStream    The *real* file-input class
+        * @return      void
+        */
+       public final function setInputStream (FileInputStreamer $inputStream) {
+               $this->inputStream = $inputStream;
+       }
+
+       /**
+        * Getter for the *real* file input instance
+        *
+        * @return      $inputStream    The *real* file-input class
+        */
+       public final function getInputStream () {
+               return $this->inputStream;
+       }
+
+       /**
+        * Setter for the *real* file output instance
+        *
+        * @param       $outputStream   The *real* file-output class
+        * @return      void
+        */
+       public final function setOutputStream (FileOutputStreamer $outputStream) {
+               $this->outputStream = $outputStream;
+       }
+
+       /**
+        * Getter for the *real* file output instance
+        *
+        * @return      $outputStream   The *real* file-output class
+        */
+       public final function getOutputStream () {
+               return $this->outputStream;
+       }
+
+       /**
+        * Saves a file with data by using the current output stream
+        *
+        * @param       $fileName       Name of the file
+        * @param       $dataArray      Array with file contents
+        * @return      void
+        * @see         FileOutputStreamer
+        */
+       public function saveFile ($fileName, $dataArray) {
+               // Get output stream
+               $outInstance = $this->getOutputStream();
+
+               // Send the fileName and dataArray to the output handler
+               $outInstance->saveFile($fileName, $dataArray);
+       }
+
+       /** Loads data from a file over the input handler
+        *
+        * @return      $array  Array with the file contents
+        * @see         FileInputStreamer
+        */
+       public function loadFileContents ($fqfn) {
+               // Get output stream
+               $inInstance = $this->getInputStream();
+
+               // Read from the input handler
+               return $inInstance->loadFileContents($fqfn);
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/third_party/.htaccess b/inc/classes/third_party/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/inc/classes/third_party/akismet/.htaccess b/inc/classes/third_party/akismet/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/inc/classes/third_party/akismet/akismet.class.php b/inc/classes/third_party/akismet/akismet.class.php
new file mode 100644 (file)
index 0000000..021447e
--- /dev/null
@@ -0,0 +1,388 @@
+<?php
+/**
+ * 01.07.2008 22:32:28est
+ * 
+ * Akismet PHP4 class
+ * 
+ * <b>Usage</b>
+ * <code>
+ *    $comment = array(
+ *           'author'    => 'viagra-test-123',
+ *           'email'     => 'test@example.com',
+ *           'website'   => 'http://www.example.com/',
+ *           'body'      => 'This is a test comment',
+ *           'permalink' => 'http://yourdomain.com/yourblogpost.url',
+ *        );
+ *
+ *    $akismet = new Akismet('http://www.yourdomain.com/', 'YOUR_WORDPRESS_API_KEY', $comment);
+ *
+ *    if($akismet->errorsExist()) {
+ *        echo"Couldn't connected to Akismet server!";
+ *    } else {
+ *        if($akismet->isSpam()) {
+ *            echo"Spam detected";
+ *        } else {
+ *            echo"yay, no spam!";
+ *        }
+ *    }
+ * </code>
+ * 
+ * @author Bret Kuhns {@link www.miphp.net}
+ * @link http://www.miphp.net/blog/view/new_akismet_class/
+ * @version 0.3.4
+ * @license http://www.opensource.org/licenses/mit-license.php MIT License
+ */
+
+
+
+// Error constants
+define("AKISMET_SERVER_NOT_FOUND",     0);
+define("AKISMET_RESPONSE_FAILED",      1);
+define("AKISMET_INVALID_KEY",          2);
+
+
+
+// Base class to assist in error handling between Akismet classes
+class AkismetObject {
+       var $errors = array();
+       
+       
+       /**
+        * Add a new error to the errors array in the object
+        *
+        * @param       String  $name   A name (array key) for the error
+        * @param       String  $string The error message
+        * @return void
+        */ 
+       // Set an error in the object
+       function setError($name, $message) {
+               $this->errors[$name] = $message;
+       }
+       
+
+       /**
+        * Return a specific error message from the errors array
+        *
+        * @param       String  $name   The name of the error you want
+        * @return mixed        Returns a String if the error exists, a false boolean if it does not exist
+        */
+       function getError($name) {
+               if($this->isError($name)) {
+                       return $this->errors[$name];
+               } else {
+                       return false;
+               }
+       }
+       
+       
+       /**
+        * Return all errors in the object
+        *
+        * @return String[]
+        */ 
+       function getErrors() {
+               return (array)$this->errors;
+       }
+       
+       
+       /**
+        * Check if a certain error exists
+        *
+        * @param       String  $name   The name of the error you want
+        * @return boolean
+        */ 
+       function isError($name) {
+               return isset($this->errors[$name]);
+       }
+       
+       
+       /**
+        * Check if any errors exist
+        *
+        * @return boolean
+        */
+       function errorsExist() {
+               return (count($this->errors) > 0);
+       }
+       
+       
+}
+
+
+
+
+
+// Used by the Akismet class to communicate with the Akismet service
+class AkismetHttpClient extends AkismetObject {
+       var $akismetVersion = '1.1';
+       var $con;
+       var $host;
+       var $port;
+       var $apiKey;
+       var $blogUrl;
+       var $errors = array();
+       
+       
+       // Constructor
+       function AkismetHttpClient($host, $blogUrl, $apiKey, $port = 80) {
+               $this->host = $host;
+               $this->port = $port;
+               $this->blogUrl = $blogUrl;
+               $this->apiKey = $apiKey;
+       }
+       
+       
+       // Use the connection active in $con to get a response from the server and return that response
+       function getResponse($request, $path, $type = "post", $responseLength = 1160) {
+               $this->_connect();
+               
+               if($this->con && !$this->isError(AKISMET_SERVER_NOT_FOUND)) {
+                       $request  = 
+                                       strToUpper($type)." /{$this->akismetVersion}/$path HTTP/1.1\r\n" .
+                                       "Host: ".((!empty($this->apiKey)) ? $this->apiKey."." : null)."{$this->host}\r\n" .
+                                       "Content-Type: application/x-www-form-urlencoded; charset=utf-8\r\n" .
+                                       "Content-Length: ".strlen($request)."\r\n" .
+                                       "User-Agent: Akismet PHP4 Class\r\n" .
+                                       "\r\n" .
+                                       $request
+                               ;
+                       $response = "";
+
+                       @fwrite($this->con, $request);
+
+                       while(!feof($this->con)) {
+                               $response .= @fgets($this->con, $responseLength);
+                       }
+
+                       $response = explode("\r\n\r\n", $response, 2);
+                       return $response[1];
+               } else {
+                       $this->setError(AKISMET_RESPONSE_FAILED, "The response could not be retrieved.");
+               }
+               
+               $this->_disconnect();
+       }
+       
+       
+       // Connect to the Akismet server and store that connection in the instance variable $con
+       function _connect() {
+               if(!($this->con = @fsockopen($this->host, $this->port))) {
+                       $this->setError(AKISMET_SERVER_NOT_FOUND, "Could not connect to akismet server.");
+               }
+       }
+       
+       
+       // Close the connection to the Akismet server
+       function _disconnect() {
+               @fclose($this->con);
+       }
+       
+       
+}
+
+
+
+
+
+// The controlling class. This is the ONLY class the user should instantiate in
+// order to use the Akismet service!
+class Akismet extends AkismetObject {
+       var $apiPort = 80;
+       var $akismetServer = 'rest.akismet.com';
+       var $akismetVersion = '1.1';
+       var $http;
+       
+       var $ignore = array(
+                       'HTTP_COOKIE',
+                       'HTTP_X_FORWARDED_FOR',
+                       'HTTP_X_FORWARDED_HOST',
+                       'HTTP_MAX_FORWARDS',
+                       'HTTP_X_FORWARDED_SERVER',
+                       'REDIRECT_STATUS',
+                       'SERVER_PORT',
+                       'PATH',
+                       'DOCUMENT_ROOT',
+                       'SERVER_ADMIN',
+                       'QUERY_STRING',
+                       'PHP_SELF',
+                       'argv'
+               );
+       
+       var $blogUrl = "";
+       var $apiKey  = "";
+       var $comment = array();
+       
+       
+       /**
+        * Constructor
+        * 
+        * Set instance variables, connect to Akismet, and check API key
+        * 
+        * @param       String  $blogUrl        The URL to your own blog
+        * @param       String  $apiKey         Your wordpress API key
+        * @param       String[]        $comment        A formatted comment array to be examined by the Akismet service
+        * @return      Akismet
+        */
+       function Akismet($blogUrl, $apiKey, $comment = array()) {
+               $this->blogUrl = $blogUrl;
+               $this->apiKey  = $apiKey;
+               $this->setComment($comment);
+               
+               // Connect to the Akismet server and populate errors if they exist
+               $this->http = new AkismetHttpClient($this->akismetServer, $blogUrl, $apiKey);
+               if($this->http->errorsExist()) {
+                       $this->errors = array_merge($this->errors, $this->http->getErrors());
+               }
+               
+               // Check if the API key is valid
+               if(!$this->_isValidApiKey($apiKey)) {
+                       $this->setError(AKISMET_INVALID_KEY, "Your Akismet API key is not valid.");
+               }
+       }
+       
+       
+       /**
+        * Query the Akismet and determine if the comment is spam or not
+        * 
+        * @return      boolean
+        */
+       function isSpam() {
+               $response = $this->http->getResponse($this->_getQueryString(), 'comment-check');
+               
+               return ($response == "true");
+       }
+       
+       
+       /**
+        * Submit this comment as an unchecked spam to the Akismet server
+        * 
+        * @return      void
+        */
+       function submitSpam() {
+               $this->http->getResponse($this->_getQueryString(), 'submit-spam');
+       }
+       
+       
+       /**
+        * Submit a false-positive comment as "ham" to the Akismet server
+        *
+        * @return      void
+        */
+       function submitHam() {
+               $this->http->getResponse($this->_getQueryString(), 'submit-ham');
+       }
+       
+       
+       /**
+        * Manually set the comment value of the instantiated object.
+        *
+        * @param       Array   $comment
+        * @return      void
+        */
+       function setComment($comment) {
+               $this->comment = $comment;
+               if(!empty($comment)) {
+                       $this->_formatCommentArray();
+                       $this->_fillCommentValues();
+               }
+       }
+       
+       
+       /**
+        * Returns the current value of the object's comment array.
+        *
+        * @return      Array
+        */
+       function getComment() {
+               return $this->comment;
+       }
+       
+       
+       /**
+        * Check with the Akismet server to determine if the API key is valid
+        *
+        * @access      Protected
+        * @param       String  $key    The Wordpress API key passed from the constructor argument
+        * @return      boolean
+        */
+       function _isValidApiKey($key) {
+               $keyCheck = $this->http->getResponse("key=".$this->apiKey."&blog=".$this->blogUrl, 'verify-key');
+                       
+               return ($keyCheck == "valid");
+       }
+       
+       
+       /**
+        * Format the comment array in accordance to the Akismet API
+        *
+        * @access      Protected
+        * @return      void
+        */
+       function _formatCommentArray() {
+               $format = array(
+                               'type' => 'comment_type',
+                               'author' => 'comment_author',
+                               'email' => 'comment_author_email',
+                               'website' => 'comment_author_url',
+                               'body' => 'comment_content'
+                       );
+               
+               foreach($format as $short => $long) {
+                       if(isset($this->comment[$short])) {
+                               $this->comment[$long] = $this->comment[$short];
+                               unset($this->comment[$short]);
+                       }
+               }
+       }
+       
+       
+       /**
+        * Fill any values not provided by the developer with available values.
+        *
+        * @return      void
+        */
+       function _fillCommentValues() {
+               if(!isset($this->comment['user_ip'])) {
+                       $this->comment['user_ip'] = ($_SERVER['REMOTE_ADDR'] != getenv('SERVER_ADDR')) ? $_SERVER['REMOTE_ADDR'] : getenv('HTTP_X_FORWARDED_FOR');
+               }
+               if(!isset($this->comment['user_agent'])) {
+                       $this->comment['user_agent'] = $_SERVER['HTTP_USER_AGENT'];
+               }
+               if(!isset($this->comment['referrer'])) {
+                       $this->comment['referrer'] = $_SERVER['HTTP_REFERER'];
+               }
+               if(!isset($this->comment['blog'])) {
+                       $this->comment['blog'] = $this->blogUrl;
+               }
+       }
+       
+       
+       /**
+        * Build a query string for use with HTTP requests
+        *
+        * @access      Protected
+        * @return      String
+        */
+       function _getQueryString() {
+               foreach($_SERVER as $key => $value) {
+                       if(!in_array($key, $this->ignore)) {
+                               if($key == 'REMOTE_ADDR') {
+                                       $this->comment[$key] = $this->comment['user_ip'];
+                               } else {
+                                       $this->comment[$key] = $value;
+                               }
+                       }
+               }
+
+               $query_string = '';
+
+               foreach($this->comment as $key => $data) {
+                       $query_string .= $key . '=' . urlencode(stripslashes($data)) . '&';
+               }
+
+               return $query_string;
+       }
+       
+       
+}
+?>
\ No newline at end of file
diff --git a/inc/classes/third_party/api/.htaccess b/inc/classes/third_party/api/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/inc/classes/third_party/api/primusportal/.htaccess b/inc/classes/third_party/api/primusportal/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/inc/classes/third_party/api/primusportal/class_PrimeraApi.php b/inc/classes/third_party/api/primusportal/class_PrimeraApi.php
new file mode 100644 (file)
index 0000000..fba7463
--- /dev/null
@@ -0,0 +1,240 @@
+<?php
+/**
+ * PrimusInterface
+ * -------------------------------------------
+ * Mit dieser Klasse ist ein einfacher Primeratransfer von Ihrem Account
+ * zu dem Account eines bei Primusportal.de registrierten Mitglieds möglich.
+ *
+ *------------------ Aenderungen durch Roland Haeder 09.08.2008 ----------------
+ * Klasse umbenannt nach PrimeraApi, damit sie in das Framework besser passt.
+ * Zudem sind alle oeffentlichen Attribute nun privat, der Konstruktor hat den
+ * neuen "magischen" Namen __construct() und "normale" Konstanten sind nach
+ * Klassenkonstanten umbenannt. Unsinnige else-Bloecke sind noch umgewandelt.
+ * Methodennamen fangen nun immer mit einem kleinen Buchstaben an. Zudem sind
+ * die Methoden Pay,Query und Parse umbenannt.
+ *------------------ Aenderungen durch Roland Haeder 09.08.2008 ----------------
+ *
+ * Die Einbindung des Interfaces geschieht folgendermaßen:
+ *  1. Einbindung der Klasse in Ihr PHP-Auszahlungsskript:
+ *     CODE:
+ *       require_once( "PFAD/ZU/DER/KLASSE/PrimusInterface.class.php" );
+ *       $PPUsername = "username"; // Ihr Username bei Primusportal
+ *       $PPPassword = "passwort"; // Ihr Passwort bei Primusportal
+ *
+ *       $Interface = new PrimusInterface($PPUsername, $PPPassword);
+ *  2. Durchführen einer Auszahlung:
+ *     CODE:
+ *       $Status = $Interface->payPrimera($PayReceiver, $PayAmount, $PayDescription);
+ *
+ *     Wobei $PayReicer der Username des Empfängers bei
+ *     Primusportal.de ist. $PayAmount ist der gerundete( !! ) Betrag an Primera,
+ *     die der Empfänger erhalten soll. $PayDescription ist eine von Ihnen 
+ *     festgelegte kurze Beschreibung. Die Länge dieses Textes darf 100 Zeichen
+ *     nicht überschreiten. Beispiel:
+ *       $status = $Interface->payPrimera("garbage", 10000, "Auszahlung IhreSeite.de - ID: 12345");
+ *  3. Überprüfung des Status (Rückgabecode):
+ *     CODE:
+ *       if (!$status) {
+ *         // Ein Fehler ist aufgetreten
+ *     // Fehlerbehandlung hier einfügen...
+ *       }else {
+ *         // Auszahlung erfolgreich durchgeführt
+ *         // Führen Sie hier Ihre Datenbankabfragen durch, um die Auszahlung zu
+ *         // bestätigen...
+ *       }
+ *
+ *     Die komplette Rückgabe des Interfaces wird als assoziatives Array in der Klassen-
+ *     variable __data gespeichert:
+ *     __data => array("status" => Rückgabecode (PI_DONE, PI_SENDER_ERROR, ...),
+ *                     "statustext" => Status in Worten (z.B.: "Transaktion erfolgreich durchgeführt"),
+ *                     ")
+ *
+ *
+ * @author             Andreas Schmidt <xxgarbagexx@web.de>
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            1.0 - beta
+ * @copyright  (c) 2007 by Primusportal.de
+ * @copyright  (c) 2008 by Roland Haeder
+ */
+class PrimeraApi {
+       /**
+        * Fehler - Interfacebenutzer
+        */
+       const PI_ERROR = -1;
+
+       /**
+        * Statuscode für erfolgreich ausgeführte Transaktion
+        */
+       const PI_DONE = 200;
+
+       /**
+        * Fehler - User existiert nicht oder ist gesperrt
+        */
+       const PI_RECEIVER_ERROR = 301;
+
+       /**
+        * Sender-Account Fehler (User nicht existent, gesperrt, ...)
+        */
+       const PI_SENDER_ERROR = 401;
+
+       /**
+        * Betrag fehler
+        */
+       const PI_AMOUNT_ERROR = 501;
+
+       /**
+        * Zu wenig Primera
+        */
+       const PI_TOO_LESS_PRIMERA = 502;
+
+       /**
+        * User nicht aktiv oder existiert nicht
+        */
+       const PI_USER_CHECK_ERROR = 601;
+
+       /**
+        * User aktiv
+        */
+       const PI_USER_CHECK_OK = 602;
+
+       /**
+        * Primerastand erfolgreich geholt
+        */
+       const PI_GET_PRIMERA_DONE = 701;
+
+       /**
+        * URL für das Interface auf dem Primusserver:
+        */
+       private $host = "www.primusportal.de";
+       private $path = "/transfer.interface.2.0.php";
+
+       private $errno = 0;
+       private $err = "";
+
+       private $seperator = ":";
+
+       private $username = "";
+       private $password = "";
+
+       private $data = array();
+
+       /**
+        * Konstruktor
+        */
+       public function __construct ($PPUsername, $PPPassword) {
+               // Call parent constructor
+               parent::__construct();
+
+               // Clean up a little
+               $this->removeSystemArray();
+               $this->removeNumberFormaters();
+
+               // Set data (DEPRECATED!)
+               $this->username = $PPUsername;
+               $this->password = $PPPassword;
+       }
+
+       /**
+        * Anfrage senden und Rückgabecode in Variable speichern
+        */
+       function queryApi ( $data = array() ) {
+               $fp = fsockopen($this->host, 80, $this->errno, $this->_err);
+               if (!$fp) return false;
+
+               $data["PrimusInterface_Username"] = base64_encode($this->username);
+               $data["PrimusInterface_Password"] = base64_encode(md5($this->password));
+
+               // POST-Daten übermitteln:
+               $data = http_build_query($data, '', '&');
+
+               fputs($fp, "POST {$this->path}HTTP/1.1\r\n");
+               fputs($fp, "Host: {$this->host}\r\n");
+               fputs($fp, "Content-type: application/x-www-form-urlencoded\r\n");
+               fputs($fp, "Content-length: ". strlen($data) ."\r\n");
+               fputs($fp, "Connection: close\r\n\r\n");
+               fputs($fp, $data);
+
+               $return = "";
+               while (!feof($fp)) {
+                       $return.=fgets($fp,128);
+               }
+
+               $content = explode("<!-- return-start -->", $return);
+               return $content[1];
+       }
+
+       /**
+        * Funktion parst die Rückgabe vom Transferskript:
+        */
+       function parseContent ( $content ) {
+               $x = explode("\n", $content);
+               $return = array();
+               foreach($x as $currentLine) {
+                       $line_exploded = explode(":", $currentLine,2);
+                       if (count($line_exploded) > 1) {
+                               $return[$line_exploded[0]] = $line_exploded[1];
+                       }
+               }
+               return $return;
+       }
+
+       /**
+        * @param int/string $Receiver UserID / Username des Empfängers
+        * @param int$Amount Betrag in ganzzahligen Primera
+        * @param string $Description Beschreibung (Sichtbar in Einzelauflistung)
+        */
+       public function payPrimera ($Receiver, $Amount, $Description = "") {
+               $valid = false;
+               $PostData = array("PrimusInterface_Action" => "Pay",
+                       "PrimusInterface_Receiver" => base64_encode($Receiver),
+                       "PrimusInterface_Amount" => base64_encode($Amount),
+                       "PrimusInterface_Description" => base64_encode($Description) );
+
+               $PostReturn = $this->parseContent( $this->queryApi($PostData) );
+
+               $this->data = $PostReturn;
+               if ($PostReturn["status"] == "200") {
+                       $valid = true;
+               }
+               return $valid;
+       }
+
+       /**
+        * Überprüft den Status eines Primus-Users
+        * - existiert der User
+        * - ist er aktiv
+        * @param string/int $User Userid / Username
+        */
+       function CheckPrimusUser($User) {
+               $valid = false;
+               $PostData = array("PrimusInterface_Action"=> "CheckPrimusUser",
+                       "PrimusInterface_CheckPrimusUser" => $User);
+
+               $PostReturn = $this->parseContent( $this->queryApi($PostData) );
+
+               $this->data = $PostReturn;
+
+               if ($PostReturn["status"] == self::PI_USER_CHECK_OK) {
+                       $valid = true;
+               }
+               return $valid;
+       }
+
+       /**
+        * Die Funktion liefer den aktuellen Primerastand
+        */
+       function getPrimera() {
+               $primera = false;
+               $PostData = array( "PrimusInterface_Action" => "GetPrimera" );
+               $PostReturn = $this->parseContent( $this->queryApi($PostData) );
+
+               $this->data = $PostReturn;
+               if ($PostReturn["status"] == self::PI_GET_PRIMERA_DONE) {
+                       $primera = $PostReturn["primera"];
+               }
+               return $primera;
+       }
+}
+
+// [EOF]
+?>
\ No newline at end of file
diff --git a/inc/classes/third_party/api/wernisportal/.htaccess b/inc/classes/third_party/api/wernisportal/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/inc/classes/third_party/api/wernisportal/class_WernisApi.php b/inc/classes/third_party/api/wernisportal/class_WernisApi.php
new file mode 100644 (file)
index 0000000..cdda5d4
--- /dev/null
@@ -0,0 +1,416 @@
+<?php
+/**
+ * Class for connecting to the Wernis-Portal at http://www.wds66.com
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class WernisApi extends BaseFrameworkSystem {
+       /**
+        * Static base API URL
+        */
+       private static $apiUrl = "http://www.wds66.com/api/";
+
+       /**
+        * API Wernis amount
+        */
+       private $wernis_amount = 0;
+
+       /**
+        * API username
+        */
+       private $w_id = 0;
+
+       /**
+        * API Wernis password (not account password!)
+        */
+       private $w_md5 = "";
+
+       /**
+        * Nickname of the user
+        */
+       private $w_nick = "";
+
+       /**
+        * Wernis amount of the user
+        */
+       private $w_amount = 0;
+
+       /**
+        * Array with status informations
+        */
+       private $statusArray = array();
+
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+
+               // Clean up a little
+               $this->removeNumberFormaters();
+               $this->removeSystemArray();
+       }
+
+       /**
+        * Creates an instance of this API class
+        *
+        * @param       $cfg                    Configuration array
+        * @return      $apiInstance    An instance of this API class
+        */
+       public final static function createWernisApi (array $cfg) {
+               // Create a new instance
+               $apiInstance = new WernisApi();
+
+               // Fix missing
+               if (!isset($cfg['api_url'])) $cfg['api_url'] = self::$apiUrl;
+
+               // Konfiguration uebertragen
+               $apiInstance->setCoonfigArray($cfg);
+
+               // Return the instance
+               return $apiInstance;
+       }
+
+       /**
+        * Setter for gamer data
+        *
+        * @param       $w_id   Username (id) of the gamer
+        * @param       $w_pwd  Clear password of the gamer
+        * @return      void
+        */
+       public function setUser ($w_id, $w_pwd) {
+               // Set username (id)
+               $this->w_id = $w_id;
+
+               // Hash clear password and set it
+               $this->w_md5 = md5($w_pwd);
+       }
+
+       /************************************************
+        * The following methods are not yet rewritten! *
+        ************************************************/
+
+       public function einziehen ($amount) {
+               // amount auf Gueltigkeit pruefen
+               $amount = isset($amount) ? $amount+0 : 0;
+
+               if ($amount < $this->config['mineinsatz']) {
+                       $this->setStatusMessage('low_stakes', sprintf("Dein Einsatz muss mindestens %d Wernis betragen.", $this->config['mineinsatz']));
+                       return false;
+               }
+
+               // Abfrage senden
+               return $this->executeWithdraw($amount);
+       }
+
+       public function verschicken ($amount) {
+               // amount auf Gueltigkeit pruefen
+               $amount = isset($amount) ? $amount+0 : 0;
+
+               if ($amount < $this->config['mineinsatz']) {
+                       $this->setStatusMessage('low_stakes', sprintf("Dein Einsatz muss mindestens %d Wernis betragen.", $this->config['mineinsatz']));
+                       return false;
+               }
+
+               // Abfrage senden
+               return $this->executePayout($amount);
+       }
+
+       // Script abbrechen mit Zurueck-Buttom
+       public function ende () {
+               global $_CONFIG;
+               include "templates/zurueck.html";
+               include "templates/fuss.html";
+               die();
+       }
+
+       // Fehlermeldung ausgeben und beenden
+       public function error () {
+               print "<div class=\"fehler\">Fehler im Spiel: ".$this->getErrorMessage()."<div><br />\n";
+               $this->ende();
+       }
+
+       // Sets a status message and code
+       public function setStatusMessage ($msg, $status) {
+               $this->statusArray['message'] = $msg;
+               $this->statusArray['status'] = $status;
+       }
+
+       // Get the status message
+       public function getErrorMessage () {
+               if (isset($this->statusArray['message'])) {
+                       // Use raw message
+                       return $this->statusArray['message'];
+               } else {
+                       // Fall-back to status
+                       return sprintf("Fehler-Code <u>%s</u> ist keiner Nachricht zugewiesen.", $this->getErrorCode());
+               }
+       }
+
+       // Get the status code
+       public function getErrorCode () {
+               if (isset($this->statusArray['status'])) {
+                       // Use raw message
+                       return $this->statusArray['status'];
+               } else {
+                       // Something bad happend
+                       return 'unknown';
+               }
+       }
+
+       // Sends out a request to the API and returns it's result
+       private function sendRequest ($scriptName, array $requestData =  array()) {
+               // Is the requestData an array?
+               if (!is_array($requestData)) {
+                       // Then abort here!
+                       return array(
+                               'status'  => "failed_general",
+                               'message' => "API-Daten in <strong>config</strong> sind ung&uuml;ltig!"
+                       );
+               }
+
+               // Is the API id and MD5 hash there?
+               if ((empty($this->config['wernis_api_id'])) || (empty($this->config['wernis_api_key']))) {
+                       // Abort here...
+                       return array(
+                               'status'  => "failed_general",
+                               'message' => "API-Daten in config.php sind leer!"
+                       );
+               }
+
+               // Construct the request string
+               $requestString = $this->config['api_url'] . $scriptName."?api_id=".$this->config['wernis_api_id']."&api_key=".$this->config['wernis_api_key'];
+               foreach ($requestData as $key => $value) {
+                       $requestString .= "&".$key."=".$value;
+               }
+
+               // Get the raw response from the lower function
+               $response = $this->sendRawRequest($requestString);
+
+               // Check the response header if all is fine
+               if (strpos($response[0], "200") === false) {
+                       // Something bad happend... :(
+                       return array(
+                               'status'  => "request_error",
+                               'message' => sprintf("Servermeldung <u>%s</u> von WDS66-API erhalten.", $response[0])
+                       );
+               }
+
+               // All (maybe) fine so remove the response header from server
+               $response = $response[(count($response) - 1)];
+
+               // Prepare the returning result for higher functions
+               if (substr($response, 0, 1) == "&") {
+                       // Remove the leading & (which can be used in Flash)
+                       $response = substr($response, 1);
+               }
+
+               // Bring back the response
+               $data = explode("=", $response);
+
+               // Default return array (should not stay empty)
+               $return = array();
+
+               // We use only the first two entries (which shall be fine)
+               if ($data[0] === "error") {
+                       // The request has failed... :(
+                       switch ($data[1]) {
+                               case "404": // Invalid API ID
+                               case "AUTH": // Authorization has failed
+                                       $return = array(
+                                               'status'  => "auth_failed",
+                                               'message' => "API-Daten scheinen nicht zu stimmen! (Access Denied)"
+                                       );
+                                       break;
+
+                               case "LOCKED": // User account is locked!
+                               case "PASS":   // Bad passphrase entered
+                               case "USER":   // Missing account or invalid password
+                                       $return = array(
+                                               'status'  => "user_failed",
+                                               'message' => "Dein eingegebener WDS66-Username stimmt nicht, ist gesperrt oder du hast ein falsches Passwort eingegeben."
+                                       );
+                                       break;
+
+                               case "OWN": // Transfer to own account
+                                       $return = array(
+                                               'status'  => "own_failed",
+                                               'message' => "Du darfst dein eigenes Spiel leider nicht spielen."
+                                       );
+                                       break;
+
+                               case "AMOUNT": // Amount is depleted
+                                       $return = array(
+                                               'status'  => "amount_failed",
+                                               'message' => "Dein Guthaben reicht nicht aus, um das Spiel zu spielen."
+                                       );
+                                       break;
+
+                               case "AMOUNT-SEND": // API amount is depleted
+                                       $return = array(
+                                               'status'  => "api_amount_failed",
+                                               'message' => "Nicht gen&uuml;gend Guthaben auf dem API-Account."
+                                       );
+                                       break;
+
+                               default: // Unknown error (maybe new?)
+                                       $return = array(
+                                               'status'  => "request_failed",
+                                               'message' => sprintf("Unbekannter Fehler <u>%s</u> von API erhalten.", $data[1])
+                                       );
+                                       break;
+                       }
+               } else {
+                       // All fine here
+                       $return = array(
+                               'status'   => "OK",
+                               'response' => $response
+                       );
+               }
+
+               // Return the result
+               return $return;
+       }
+
+       // Widthdraw this amount
+       private function executeWithdraw ($amount) {
+               // First all fails...
+               $result = false;
+
+               // Prepare the purpose
+               $purpose = "\"Bube oder Dame\"-Einsatz gesetzt.";
+
+               // Prepare the request data
+               $requestData = array(
+                       'sub_request'   => "receive",
+                       't_uid'                 => $this->w_id,
+                       't_md5'                 => $this->w_md5,
+                       'r_uid'                 => (int)$this->config['wernis_refid'],
+                       'amount'                => (int)$amount,
+                       'purpose'               => urlencode(base64_encode($purpose))
+               );
+
+               // Return the result from the lower functions
+               $return = $this->sendRequest("book.php", $requestData);
+
+               if ($return['status'] == "OK") {
+                       // All fine!
+                       $result = true;
+               } else {
+                       // Status failture text
+                       $this->setStatusMessage($return['message'], $return['status']);
+               }
+
+               // Return result
+               return $result;
+       }
+
+       // Payout this amount
+       private function executePayout ($amount) {
+               // First all fails...
+               $result = false;
+
+               // Prepare the purpose
+               $purpose = "\"Bube oder Dame\"-Gewinn erhalten.";
+
+               // Prepare the request data
+               $requestData = array(
+                       'sub_request'   => "send",
+                       't_uid'                 => $this->w_id,
+                       't_md5'                 => $this->w_md5,
+                       'r_uid'                 => (int)$this->config['wernis_refid'],
+                       'amount'                => (int)$amount,
+                       'purpose'               => urlencode(base64_encode($purpose))
+               );
+
+               // Return the result from the lower functions
+               $return = $this->sendRequest("book.php", $requestData);
+
+               if ($return['status'] == "OK") {
+                       // All fine!
+                       $result = true;
+               } else {
+                       // Status failture text
+                       $this->setStatusMessage($return['message'], $return['status']);
+               }
+
+               // Return result
+               return $result;
+       }
+
+       // Send raw GET request
+       private function sendRawRequest ($script) {
+               // Use the hostname from script URL as new hostname
+               $url = substr($script, 7);
+               $extract = explode("/", $url);
+
+               // Done extracting the URL :)
+               $url = $extract[0];
+
+               // Extract host name
+               $host = str_replace("http://", "", $url);
+               if (ereg("/", $host)) $host = substr($host, 0, strpos($host, "/"));
+
+               // Generate relative URL
+               $script = substr($script, (strlen($url) + 7));
+               if (substr($script, 0, 1) == "/") $script = substr($script, 1);
+
+               // Open connection
+               $fp = @fsockopen($host, 80, $errno, $errdesc, 30);
+               if (!$fp) {
+                       // Failed!
+                       return array("", "", "");
+               }
+
+               // Generate request header
+               $request  = "GET /".trim($script)." HTTP/1.0\r\n";
+               $request .= "Host: ".$host."\r\n";
+               $request .= sprintf("User-Agent: Bube oder Dame / 1.0 by Quix0r [Spieler: %d]\r\n\r\n", $this->w_id);
+
+               // Initialize array
+               $response = array();
+
+               // Write request
+               fputs($fp, $request);
+
+               // Read response
+               while(!feof($fp)) {
+                       $response[] = trim(fgets($fp, 1024));
+               }
+
+               // Close socket
+               fclose($fp);
+
+               // Was the request successfull?
+               if ((!ereg("200 OK", $response[0])) && (empty($response[0]))) {
+                       // Not found / access forbidden
+                       $response = array("", "", "");
+               }
+
+               // Return response
+               return $response;
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/third_party/php_mailer/.htaccess b/inc/classes/third_party/php_mailer/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/inc/classes/third_party/php_mailer/ChangeLog.txt b/inc/classes/third_party/php_mailer/ChangeLog.txt
new file mode 100644 (file)
index 0000000..377ac5b
--- /dev/null
@@ -0,0 +1,307 @@
+/*******************************************************************\r
+* The http://phpmailer.codeworxtech.com/ website now carries a few *\r
+* advertisements through the Google Adsense network. Please visit  *\r
+* the advertiser sites and help us offset some of our costs.       *\r
+* Thanks ....                                                      *\r
+********************************************************************/\r
+\r
+ChangeLog\r
+\r
+NOTE: THIS VERSION OF PHPMAILER IS DESIGNED FOR PHP5. IT WILL NOT WORK WITH PHP4.\r
+\r
+Version 2.1 (Wed, June 04 2008)\r
+\r
+** NOTE: WE HAVE A NEW LANGUAGE VARIABLE FOR DIGITALLY SIGNED S/MIME EMAILS.\r
+   IF YOU CAN HELP WITH LANGUAGES OTHER THAN ENGLISH AND SPANISH, IT WOULD BE\r
+   APPRECIATED.\r
+\r
+* added S/MIME functionality (ability to digitally sign emails)\r
+  BIG THANKS TO "sergiocambra" for posting this patch back in November 2007.\r
+       The "Signed Emails" functionality adds the Sign method to pass the private key\r
+       filename and the password to read it, and then email will be sent with\r
+       content-type multipart/signed and with the digital signature attached.\r
+* fully compatible with E_STRICT error level\r
+  - Please note:\r
+    In about half the test environments this development version was subjected\r
+    to, an error was thrown for the date() functions used (line 1565 and 1569).\r
+    This is NOT a PHPMailer error, it is the result of an incorrectly configured\r
+    PHP5 installation. The fix is to modify your 'php.ini' file and include the\r
+    date.timezone = America/New York\r
+    directive, to your own server timezone\r
+  - If you do get this error, and are unable to access your php.ini file:\r
+    In your PHP script, add\r
+    date_default_timezone_set('America/Toronto');\r
+    - do not try to use\r
+    $myVar = date_default_timezone_get();\r
+    as a test, it will throw an error.\r
+* added ability to define path (mainly for embedded images)\r
+  function MsgHTML($message,$basedir='') ... where:\r
+  $basedir is the fully qualified path\r
+* fixed MsgHTML() function:\r
+  - Embedded Images where images are specified by <protocol>:// will not be altered or embedded\r
+* fixed the return value of SMTP exit code ( pclose )\r
+* addressed issue of multibyte characters in subject line and truncating\r
+* added ability to have user specified Message ID\r
+  (default is still that PHPMailer create a unique Message ID)\r
+* corrected unidentified message type to 'application/octet-stream'\r
+* fixed chunk_split() multibyte issue (thanks to Colin Brown, et al).\r
+* added check for added attachments\r
+* enhanced conversion of HTML to text in MsgHTML (thanks to "brunny")\r
+\r
+Version 2.1.0beta2 (Sun, Dec 02 2007)\r
+* implemented updated EncodeQP (thanks to coolbru, aka Marcus Bointon)\r
+* finished all testing, all known bugs corrected, enhancements tested\r
+- note: will NOT work with PHP4.\r
+\r
+please note, this is BETA software\r
+** DO NOT USE THIS IN PRODUCTION OR LIVE PROJECTS\r
+INTENDED STRICTLY FOR TESTING\r
+\r
+Version 2.1.0beta1\r
+please note, this is BETA software\r
+** DO NOT USE THIS IN PRODUCTION OR LIVE PROJECTS\r
+INTENDED STRICTLY FOR TESTING\r
+\r
+Version 2.0.0 rc2 (Fri, Nov 16 2007), interim release\r
+* implements new property to control VERP in class.smtp.php\r
+  example (requires instantiating class.smtp.php):\r
+  $mail->do_verp = true;\r
+* POP-before-SMTP functionality included, thanks to Richard Davey\r
+  (see class.pop3.php & pop3_before_smtp_test.php for examples)\r
+* included example showing how to use PHPMailer with GMAIL\r
+* fixed the missing Cc in SendMail() and Mail()\r
+\r
+******************\r
+A note on sending bulk emails:\r
+\r
+If the email you are sending is not personalized, consider using the\r
+"undisclosed-recipient:;" strategy. That is, put all of your recipients\r
+in the Bcc field and set the To field to "undisclosed-recipients:;".\r
+It's a lot faster (only one send) and saves quite a bit on resources.\r
+Contrary to some opinions, this will not get you listed in spam engines -\r
+it's a legitimate way for you to send emails.\r
+\r
+A partial example for use with PHPMailer:\r
+\r
+$mail->AddAddress("undisclosed-recipients:;");\r
+$mail->AddBCC("email1@anydomain.com,email2@anyotherdomain.com,email3@anyalternatedomain.com");\r
+\r
+Many email service providers restrict the number of emails that can be sent\r
+in any given time period. Often that is between 50 - 60 emails maximum\r
+per hour or per send session.\r
+\r
+If that's the case, then break up your Bcc lists into chunks that are one\r
+less than your limit, and put a pause in your script.\r
+*******************\r
+\r
+Version 2.0.0 rc1 (Thu, Nov 08 2007), interim release\r
+* dramatically simplified using inline graphics ... it's fully automated and requires no user input\r
+* added automatic document type detection for attachments and pictures\r
+* added MsgHTML() function to replace Body tag for HTML emails\r
+* fixed the SendMail security issues (input validation vulnerability)\r
+* enhanced the AddAddresses functionality so that the "Name" portion is used in the email address\r
+* removed the need to use the AltBody method (set from the HTML, or default text used)\r
+* set the PHP Mail() function as the default (still support SendMail, SMTP Mail)\r
+* removed the need to set the IsHTML property (set automatically)\r
+* added Estonian language file by Indrek P&auml;ri\r
+* added header injection patch\r
+* added "set" method to permit users to create their own pseudo-properties like 'X-Headers', etc.\r
+  example of use:\r
+  $mail->set('X-Priority', '3');\r
+  $mail->set('X-MSMail-Priority', 'Normal');\r
+* fixed warning message in SMTP get_lines method\r
+* added TLS/SSL SMTP support\r
+  example of use:\r
+  $mail = new PHPMailer();\r
+       $mail->Mailer = "smtp";\r
+       $mail->Host = "smtp.example.com";\r
+       $mail->SMTPSecure   = "tls"; // option\r
+       //$mail->SMTPSecure   = "ssl";  // option\r
+       ...\r
+  $mail->Send();\r
+* PHPMailer has been tested with PHP4 (4.4.7) and PHP5 (5.2.7)\r
+* Works with PHP installed as a module or as CGI-PHP\r
+- NOTE: will NOT work with PHP5 in E_STRICT error mode\r
+\r
+Version 1.73 (Sun, Jun 10 2005)\r
+* Fixed denial of service bug: http://www.cybsec.com/vuln/PHPMailer-DOS.pdf\r
+* Now has a total of 20 translations\r
+* Fixed alt attachments bug: http://tinyurl.com/98u9k\r
+\r
+Version 1.72 (Wed, May 25 2004)\r
+* Added Dutch, Swedish, Czech, Norwegian, and Turkish translations.\r
+* Received: Removed this method because spam filter programs like\r
+SpamAssassin reject this header.\r
+* Fixed error count bug.\r
+* SetLanguage default is now "language/".\r
+* Fixed magic_quotes_runtime bug.\r
+\r
+Version 1.71 (Tue, Jul 28 2003)\r
+* Made several speed enhancements\r
+* Added German and Italian translation files\r
+* Fixed HELO/AUTH bugs on keep-alive connects\r
+* Now provides an error message if language file does not load\r
+* Fixed attachment EOL bug\r
+* Updated some unclear documentation\r
+* Added additional tests and improved others\r
+\r
+Version 1.70 (Mon, Jun 20 2003)\r
+* Added SMTP keep-alive support\r
+* Added IsError method for error detection\r
+* Added error message translation support (SetLanguage)\r
+* Refactored many methods to increase library performance\r
+* Hello now sends the newer EHLO message before HELO as per RFC 2821\r
+* Removed the boundary class and replaced it with GetBoundary\r
+* Removed queue support methods\r
+* New $Hostname variable\r
+* New Message-ID header\r
+* Received header reformat\r
+* Helo variable default changed to $Hostname\r
+* Removed extra spaces in Content-Type definition (#667182)\r
+* Return-Path should be set to Sender when set\r
+* Adds Q or B encoding to headers when necessary\r
+* quoted-encoding should now encode NULs \000\r
+* Fixed encoding of body/AltBody (#553370)\r
+* Adds "To: undisclosed-recipients:;" when all recipients are hidden (BCC)\r
+* Multiple bug fixes\r
+\r
+Version 1.65 (Fri, Aug 09 2002)\r
+* Fixed non-visible attachment bug (#585097) for Outlook\r
+* SMTP connections are now closed after each transaction\r
+* Fixed SMTP::Expand return value\r
+* Converted SMTP class documentation to phpDocumentor format\r
+\r
+Version 1.62 (Wed, Jun 26 2002)\r
+* Fixed multi-attach bug\r
+* Set proper word wrapping\r
+* Reduced memory use with attachments\r
+* Added more debugging\r
+* Changed documentation to phpDocumentor format\r
+\r
+Version 1.60 (Sat, Mar 30 2002)\r
+* Sendmail pipe and address patch (Christian Holtje)\r
+* Added embedded image and read confirmation support (A. Ognio)\r
+* Added unit tests\r
+* Added SMTP timeout support (*nix only)\r
+* Added possibly temporary PluginDir variable for SMTP class\r
+* Added LE message line ending variable\r
+* Refactored boundary and attachment code\r
+* Eliminated SMTP class warnings\r
+* Added SendToQueue method for future queuing support\r
+\r
+Version 1.54 (Wed, Dec 19 2001)\r
+* Add some queuing support code\r
+* Fixed a pesky multi/alt bug\r
+* Messages are no longer forced to have "To" addresses\r
+\r
+Version 1.50 (Thu, Nov 08 2001)\r
+* Fix extra lines when not using SMTP mailer\r
+* Set WordWrap variable to int with a zero default\r
+\r
+Version 1.47 (Tue, Oct 16 2001)\r
+* Fixed Received header code format\r
+* Fixed AltBody order error\r
+* Fixed alternate port warning\r
+\r
+Version 1.45 (Tue, Sep 25 2001)\r
+* Added enhanced SMTP debug support\r
+* Added support for multiple ports on SMTP\r
+* Added Received header for tracing\r
+* Fixed AddStringAttachment encoding\r
+* Fixed possible header name quote bug\r
+* Fixed wordwrap() trim bug\r
+* Couple other small bug fixes\r
+\r
+Version 1.41 (Wed, Aug 22 2001)\r
+* Fixed AltBody bug w/o attachments\r
+* Fixed rfc_date() for certain mail servers\r
+\r
+Version 1.40 (Sun, Aug 12 2001)\r
+* Added multipart/alternative support (AltBody)\r
+* Documentation update\r
+* Fixed bug in Mercury MTA\r
+\r
+Version 1.29 (Fri, Aug 03 2001)\r
+* Added AddStringAttachment() method\r
+* Added SMTP authentication support\r
+\r
+Version 1.28 (Mon, Jul 30 2001)\r
+* Fixed a typo in SMTP class\r
+* Fixed header issue with Imail (win32) SMTP server\r
+* Made fopen() calls for attachments use "rb" to fix win32 error\r
+\r
+Version 1.25 (Mon, Jul 02 2001)\r
+* Added RFC 822 date fix (Patrice)\r
+* Added improved error handling by adding a $ErrorInfo variable\r
+* Removed MailerDebug variable (obsolete with new error handler)\r
+\r
+Version 1.20 (Mon, Jun 25 2001)\r
+* Added quoted-printable encoding (Patrice)\r
+* Set Version as public and removed PrintVersion()\r
+* Changed phpdoc to only display public variables and methods\r
+\r
+Version 1.19 (Thu, Jun 21 2001)\r
+* Fixed MS Mail header bug\r
+* Added fix for Bcc problem with mail(). *Does not work on Win32*\r
+  (See PHP bug report: http://www.php.net/bugs.php?id=11616)\r
+* mail() no longer passes a fifth parameter when not needed\r
+\r
+Version 1.15 (Fri, Jun 15 2001)\r
+[Note: these changes contributed by Patrice Fournier]\r
+* Changed all remaining \n to \r\n\r
+* Bcc: header no longer writen to message except\r
+when sent directly to sendmail\r
+* Added a small message to non-MIME compliant mail reader\r
+* Added Sender variable to change the Sender email\r
+used in -f for sendmail/mail and in 'MAIL FROM' for smtp mode\r
+* Changed boundary setting to a place it will be set only once\r
+* Removed transfer encoding for whole message when using multipart\r
+* Message body now uses Encoding in multipart messages\r
+* Can set encoding and type to attachments 7bit, 8bit\r
+and binary attachment are sent as is, base64 are encoded\r
+* Can set Encoding to base64 to send 8 bits body\r
+through 7 bits servers\r
+\r
+Version 1.10 (Tue, Jun 12 2001)\r
+* Fixed win32 mail header bug (printed out headers in message body)\r
+\r
+Version 1.09 (Fri, Jun 08 2001)\r
+* Changed date header to work with Netscape mail programs\r
+* Altered phpdoc documentation\r
+\r
+Version 1.08 (Tue, Jun 05 2001)\r
+* Added enhanced error-checking\r
+* Added phpdoc documentation to source\r
+\r
+Version 1.06 (Fri, Jun 01 2001)\r
+* Added optional name for file attachments\r
+\r
+Version 1.05 (Tue, May 29 2001)\r
+* Code cleanup\r
+* Eliminated sendmail header warning message\r
+* Fixed possible SMTP error\r
+\r
+Version 1.03 (Thu, May 24 2001)\r
+* Fixed problem where qmail sends out duplicate messages\r
+\r
+Version 1.02 (Wed, May 23 2001)\r
+* Added multiple recipient and attachment Clear* methods\r
+* Added Sendmail public variable\r
+* Fixed problem with loading SMTP library multiple times\r
+\r
+Version 0.98 (Tue, May 22 2001)\r
+* Fixed problem with redundant mail hosts sending out multiple messages\r
+* Added additional error handler code\r
+* Added AddCustomHeader() function\r
+* Added support for Microsoft mail client headers (affects priority)\r
+* Fixed small bug with Mailer variable\r
+* Added PrintVersion() function\r
+\r
+Version 0.92 (Tue, May 15 2001)\r
+* Changed file names to class.phpmailer.php and class.smtp.php to match\r
+  current PHP class trend.\r
+* Fixed problem where body not being printed when a message is attached\r
+* Several small bug fixes\r
+\r
+Version 0.90 (Tue, April 17 2001)\r
+* Intial public release\r
diff --git a/inc/classes/third_party/php_mailer/LICENSE b/inc/classes/third_party/php_mailer/LICENSE
new file mode 100644 (file)
index 0000000..03851a3
--- /dev/null
@@ -0,0 +1,504 @@
+                 GNU LESSER GENERAL PUBLIC LICENSE\r
+                      Version 2.1, February 1999\r
+\r
+ Copyright (C) 1991, 1999 Free Software Foundation, Inc.\r
+     59 Temple Place, Suite 330, Boston, MA  02111-1307  USA\r
+ Everyone is permitted to copy and distribute verbatim copies\r
+ of this license document, but changing it is not allowed.\r
+\r
+[This is the first released version of the Lesser GPL.  It also counts\r
+ as the successor of the GNU Library Public License, version 2, hence\r
+ the version number 2.1.]\r
+\r
+                           Preamble\r
+\r
+  The licenses for most software are designed to take away your\r
+freedom to share and change it.  By contrast, the GNU General Public\r
+Licenses are intended to guarantee your freedom to share and change\r
+free software--to make sure the software is free for all its users.\r
+\r
+  This license, the Lesser General Public License, applies to some\r
+specially designated software packages--typically libraries--of the\r
+Free Software Foundation and other authors who decide to use it.  You\r
+can use it too, but we suggest you first think carefully about whether\r
+this license or the ordinary General Public License is the better\r
+strategy to use in any particular case, based on the explanations below.\r
+\r
+  When we speak of free software, we are referring to freedom of use,\r
+not price.  Our General Public Licenses are designed to make sure that\r
+you have the freedom to distribute copies of free software (and charge\r
+for this service if you wish); that you receive source code or can get\r
+it if you want it; that you can change the software and use pieces of\r
+it in new free programs; and that you are informed that you can do\r
+these things.\r
+\r
+  To protect your rights, we need to make restrictions that forbid\r
+distributors to deny you these rights or to ask you to surrender these\r
+rights.  These restrictions translate to certain responsibilities for\r
+you if you distribute copies of the library or if you modify it.\r
+\r
+  For example, if you distribute copies of the library, whether gratis\r
+or for a fee, you must give the recipients all the rights that we gave\r
+you.  You must make sure that they, too, receive or can get the source\r
+code.  If you link other code with the library, you must provide\r
+complete object files to the recipients, so that they can relink them\r
+with the library after making changes to the library and recompiling\r
+it.  And you must show them these terms so they know their rights.\r
+\r
+  We protect your rights with a two-step method: (1) we copyright the\r
+library, and (2) we offer you this license, which gives you legal\r
+permission to copy, distribute and/or modify the library.\r
+\r
+  To protect each distributor, we want to make it very clear that\r
+there is no warranty for the free library.  Also, if the library is\r
+modified by someone else and passed on, the recipients should know\r
+that what they have is not the original version, so that the original\r
+author's reputation will not be affected by problems that might be\r
+introduced by others.\r
+\r
+  Finally, software patents pose a constant threat to the existence of\r
+any free program.  We wish to make sure that a company cannot\r
+effectively restrict the users of a free program by obtaining a\r
+restrictive license from a patent holder.  Therefore, we insist that\r
+any patent license obtained for a version of the library must be\r
+consistent with the full freedom of use specified in this license.\r
+\r
+  Most GNU software, including some libraries, is covered by the\r
+ordinary GNU General Public License.  This license, the GNU Lesser\r
+General Public License, applies to certain designated libraries, and\r
+is quite different from the ordinary General Public License.  We use\r
+this license for certain libraries in order to permit linking those\r
+libraries into non-free programs.\r
+\r
+  When a program is linked with a library, whether statically or using\r
+a shared library, the combination of the two is legally speaking a\r
+combined work, a derivative of the original library.  The ordinary\r
+General Public License therefore permits such linking only if the\r
+entire combination fits its criteria of freedom.  The Lesser General\r
+Public License permits more lax criteria for linking other code with\r
+the library.\r
+\r
+  We call this license the "Lesser" General Public License because it\r
+does Less to protect the user's freedom than the ordinary General\r
+Public License.  It also provides other free software developers Less\r
+of an advantage over competing non-free programs.  These disadvantages\r
+are the reason we use the ordinary General Public License for many\r
+libraries.  However, the Lesser license provides advantages in certain\r
+special circumstances.\r
+\r
+  For example, on rare occasions, there may be a special need to\r
+encourage the widest possible use of a certain library, so that it becomes\r
+a de-facto standard.  To achieve this, non-free programs must be\r
+allowed to use the library.  A more frequent case is that a free\r
+library does the same job as widely used non-free libraries.  In this\r
+case, there is little to gain by limiting the free library to free\r
+software only, so we use the Lesser General Public License.\r
+\r
+  In other cases, permission to use a particular library in non-free\r
+programs enables a greater number of people to use a large body of\r
+free software.  For example, permission to use the GNU C Library in\r
+non-free programs enables many more people to use the whole GNU\r
+operating system, as well as its variant, the GNU/Linux operating\r
+system.\r
+\r
+  Although the Lesser General Public License is Less protective of the\r
+users' freedom, it does ensure that the user of a program that is\r
+linked with the Library has the freedom and the wherewithal to run\r
+that program using a modified version of the Library.\r
+\r
+  The precise terms and conditions for copying, distribution and\r
+modification follow.  Pay close attention to the difference between a\r
+"work based on the library" and a "work that uses the library".  The\r
+former contains code derived from the library, whereas the latter must\r
+be combined with the library in order to run.\r
+\r
+                 GNU LESSER GENERAL PUBLIC LICENSE\r
+   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION\r
+\r
+  0. This License Agreement applies to any software library or other\r
+program which contains a notice placed by the copyright holder or\r
+other authorized party saying it may be distributed under the terms of\r
+this Lesser General Public License (also called "this License").\r
+Each licensee is addressed as "you".\r
+\r
+  A "library" means a collection of software functions and/or data\r
+prepared so as to be conveniently linked with application programs\r
+(which use some of those functions and data) to form executables.\r
+\r
+  The "Library", below, refers to any such software library or work\r
+which has been distributed under these terms.  A "work based on the\r
+Library" means either the Library or any derivative work under\r
+copyright law: that is to say, a work containing the Library or a\r
+portion of it, either verbatim or with modifications and/or translated\r
+straightforwardly into another language.  (Hereinafter, translation is\r
+included without limitation in the term "modification".)\r
+\r
+  "Source code" for a work means the preferred form of the work for\r
+making modifications to it.  For a library, complete source code means\r
+all the source code for all modules it contains, plus any associated\r
+interface definition files, plus the scripts used to control compilation\r
+and installation of the library.\r
+\r
+  Activities other than copying, distribution and modification are not\r
+covered by this License; they are outside its scope.  The act of\r
+running a program using the Library is not restricted, and output from\r
+such a program is covered only if its contents constitute a work based\r
+on the Library (independent of the use of the Library in a tool for\r
+writing it).  Whether that is true depends on what the Library does\r
+and what the program that uses the Library does.\r
+  \r
+  1. You may copy and distribute verbatim copies of the Library's\r
+complete source code as you receive it, in any medium, provided that\r
+you conspicuously and appropriately publish on each copy an\r
+appropriate copyright notice and disclaimer of warranty; keep intact\r
+all the notices that refer to this License and to the absence of any\r
+warranty; and distribute a copy of this License along with the\r
+Library.\r
+\r
+  You may charge a fee for the physical act of transferring a copy,\r
+and you may at your option offer warranty protection in exchange for a\r
+fee.\r
+\r
+  2. You may modify your copy or copies of the Library or any portion\r
+of it, thus forming a work based on the Library, and copy and\r
+distribute such modifications or work under the terms of Section 1\r
+above, provided that you also meet all of these conditions:\r
+\r
+    a) The modified work must itself be a software library.\r
+\r
+    b) You must cause the files modified to carry prominent notices\r
+    stating that you changed the files and the date of any change.\r
+\r
+    c) You must cause the whole of the work to be licensed at no\r
+    charge to all third parties under the terms of this License.\r
+\r
+    d) If a facility in the modified Library refers to a function or a\r
+    table of data to be supplied by an application program that uses\r
+    the facility, other than as an argument passed when the facility\r
+    is invoked, then you must make a good faith effort to ensure that,\r
+    in the event an application does not supply such function or\r
+    table, the facility still operates, and performs whatever part of\r
+    its purpose remains meaningful.\r
+\r
+    (For example, a function in a library to compute square roots has\r
+    a purpose that is entirely well-defined independent of the\r
+    application.  Therefore, Subsection 2d requires that any\r
+    application-supplied function or table used by this function must\r
+    be optional: if the application does not supply it, the square\r
+    root function must still compute square roots.)\r
+\r
+These requirements apply to the modified work as a whole.  If\r
+identifiable sections of that work are not derived from the Library,\r
+and can be reasonably considered independent and separate works in\r
+themselves, then this License, and its terms, do not apply to those\r
+sections when you distribute them as separate works.  But when you\r
+distribute the same sections as part of a whole which is a work based\r
+on the Library, the distribution of the whole must be on the terms of\r
+this License, whose permissions for other licensees extend to the\r
+entire whole, and thus to each and every part regardless of who wrote\r
+it.\r
+\r
+Thus, it is not the intent of this section to claim rights or contest\r
+your rights to work written entirely by you; rather, the intent is to\r
+exercise the right to control the distribution of derivative or\r
+collective works based on the Library.\r
+\r
+In addition, mere aggregation of another work not based on the Library\r
+with the Library (or with a work based on the Library) on a volume of\r
+a storage or distribution medium does not bring the other work under\r
+the scope of this License.\r
+\r
+  3. You may opt to apply the terms of the ordinary GNU General Public\r
+License instead of this License to a given copy of the Library.  To do\r
+this, you must alter all the notices that refer to this License, so\r
+that they refer to the ordinary GNU General Public License, version 2,\r
+instead of to this License.  (If a newer version than version 2 of the\r
+ordinary GNU General Public License has appeared, then you can specify\r
+that version instead if you wish.)  Do not make any other change in\r
+these notices.\r
+\r
+  Once this change is made in a given copy, it is irreversible for\r
+that copy, so the ordinary GNU General Public License applies to all\r
+subsequent copies and derivative works made from that copy.\r
+\r
+  This option is useful when you wish to copy part of the code of\r
+the Library into a program that is not a library.\r
+\r
+  4. You may copy and distribute the Library (or a portion or\r
+derivative of it, under Section 2) in object code or executable form\r
+under the terms of Sections 1 and 2 above provided that you accompany\r
+it with the complete corresponding machine-readable source code, which\r
+must be distributed under the terms of Sections 1 and 2 above on a\r
+medium customarily used for software interchange.\r
+\r
+  If distribution of object code is made by offering access to copy\r
+from a designated place, then offering equivalent access to copy the\r
+source code from the same place satisfies the requirement to\r
+distribute the source code, even though third parties are not\r
+compelled to copy the source along with the object code.\r
+\r
+  5. A program that contains no derivative of any portion of the\r
+Library, but is designed to work with the Library by being compiled or\r
+linked with it, is called a "work that uses the Library".  Such a\r
+work, in isolation, is not a derivative work of the Library, and\r
+therefore falls outside the scope of this License.\r
+\r
+  However, linking a "work that uses the Library" with the Library\r
+creates an executable that is a derivative of the Library (because it\r
+contains portions of the Library), rather than a "work that uses the\r
+library".  The executable is therefore covered by this License.\r
+Section 6 states terms for distribution of such executables.\r
+\r
+  When a "work that uses the Library" uses material from a header file\r
+that is part of the Library, the object code for the work may be a\r
+derivative work of the Library even though the source code is not.\r
+Whether this is true is especially significant if the work can be\r
+linked without the Library, or if the work is itself a library.  The\r
+threshold for this to be true is not precisely defined by law.\r
+\r
+  If such an object file uses only numerical parameters, data\r
+structure layouts and accessors, and small macros and small inline\r
+functions (ten lines or less in length), then the use of the object\r
+file is unrestricted, regardless of whether it is legally a derivative\r
+work.  (Executables containing this object code plus portions of the\r
+Library will still fall under Section 6.)\r
+\r
+  Otherwise, if the work is a derivative of the Library, you may\r
+distribute the object code for the work under the terms of Section 6.\r
+Any executables containing that work also fall under Section 6,\r
+whether or not they are linked directly with the Library itself.\r
+\r
+  6. As an exception to the Sections above, you may also combine or\r
+link a "work that uses the Library" with the Library to produce a\r
+work containing portions of the Library, and distribute that work\r
+under terms of your choice, provided that the terms permit\r
+modification of the work for the customer's own use and reverse\r
+engineering for debugging such modifications.\r
+\r
+  You must give prominent notice with each copy of the work that the\r
+Library is used in it and that the Library and its use are covered by\r
+this License.  You must supply a copy of this License.  If the work\r
+during execution displays copyright notices, you must include the\r
+copyright notice for the Library among them, as well as a reference\r
+directing the user to the copy of this License.  Also, you must do one\r
+of these things:\r
+\r
+    a) Accompany the work with the complete corresponding\r
+    machine-readable source code for the Library including whatever\r
+    changes were used in the work (which must be distributed under\r
+    Sections 1 and 2 above); and, if the work is an executable linked\r
+    with the Library, with the complete machine-readable "work that\r
+    uses the Library", as object code and/or source code, so that the\r
+    user can modify the Library and then relink to produce a modified\r
+    executable containing the modified Library.  (It is understood\r
+    that the user who changes the contents of definitions files in the\r
+    Library will not necessarily be able to recompile the application\r
+    to use the modified definitions.)\r
+\r
+    b) Use a suitable shared library mechanism for linking with the\r
+    Library.  A suitable mechanism is one that (1) uses at run time a\r
+    copy of the library already present on the user's computer system,\r
+    rather than copying library functions into the executable, and (2)\r
+    will operate properly with a modified version of the library, if\r
+    the user installs one, as long as the modified version is\r
+    interface-compatible with the version that the work was made with.\r
+\r
+    c) Accompany the work with a written offer, valid for at\r
+    least three years, to give the same user the materials\r
+    specified in Subsection 6a, above, for a charge no more\r
+    than the cost of performing this distribution.\r
+\r
+    d) If distribution of the work is made by offering access to copy\r
+    from a designated place, offer equivalent access to copy the above\r
+    specified materials from the same place.\r
+\r
+    e) Verify that the user has already received a copy of these\r
+    materials or that you have already sent this user a copy.\r
+\r
+  For an executable, the required form of the "work that uses the\r
+Library" must include any data and utility programs needed for\r
+reproducing the executable from it.  However, as a special exception,\r
+the materials to be distributed need not include anything that is\r
+normally distributed (in either source or binary form) with the major\r
+components (compiler, kernel, and so on) of the operating system on\r
+which the executable runs, unless that component itself accompanies\r
+the executable.\r
+\r
+  It may happen that this requirement contradicts the license\r
+restrictions of other proprietary libraries that do not normally\r
+accompany the operating system.  Such a contradiction means you cannot\r
+use both them and the Library together in an executable that you\r
+distribute.\r
+\r
+  7. You may place library facilities that are a work based on the\r
+Library side-by-side in a single library together with other library\r
+facilities not covered by this License, and distribute such a combined\r
+library, provided that the separate distribution of the work based on\r
+the Library and of the other library facilities is otherwise\r
+permitted, and provided that you do these two things:\r
+\r
+    a) Accompany the combined library with a copy of the same work\r
+    based on the Library, uncombined with any other library\r
+    facilities.  This must be distributed under the terms of the\r
+    Sections above.\r
+\r
+    b) Give prominent notice with the combined library of the fact\r
+    that part of it is a work based on the Library, and explaining\r
+    where to find the accompanying uncombined form of the same work.\r
+\r
+  8. You may not copy, modify, sublicense, link with, or distribute\r
+the Library except as expressly provided under this License.  Any\r
+attempt otherwise to copy, modify, sublicense, link with, or\r
+distribute the Library is void, and will automatically terminate your\r
+rights under this License.  However, parties who have received copies,\r
+or rights, from you under this License will not have their licenses\r
+terminated so long as such parties remain in full compliance.\r
+\r
+  9. You are not required to accept this License, since you have not\r
+signed it.  However, nothing else grants you permission to modify or\r
+distribute the Library or its derivative works.  These actions are\r
+prohibited by law if you do not accept this License.  Therefore, by\r
+modifying or distributing the Library (or any work based on the\r
+Library), you indicate your acceptance of this License to do so, and\r
+all its terms and conditions for copying, distributing or modifying\r
+the Library or works based on it.\r
+\r
+  10. Each time you redistribute the Library (or any work based on the\r
+Library), the recipient automatically receives a license from the\r
+original licensor to copy, distribute, link with or modify the Library\r
+subject to these terms and conditions.  You may not impose any further\r
+restrictions on the recipients' exercise of the rights granted herein.\r
+You are not responsible for enforcing compliance by third parties with\r
+this License.\r
+\r
+  11. If, as a consequence of a court judgment or allegation of patent\r
+infringement or for any other reason (not limited to patent issues),\r
+conditions are imposed on you (whether by court order, agreement or\r
+otherwise) that contradict the conditions of this License, they do not\r
+excuse you from the conditions of this License.  If you cannot\r
+distribute so as to satisfy simultaneously your obligations under this\r
+License and any other pertinent obligations, then as a consequence you\r
+may not distribute the Library at all.  For example, if a patent\r
+license would not permit royalty-free redistribution of the Library by\r
+all those who receive copies directly or indirectly through you, then\r
+the only way you could satisfy both it and this License would be to\r
+refrain entirely from distribution of the Library.\r
+\r
+If any portion of this section is held invalid or unenforceable under any\r
+particular circumstance, the balance of the section is intended to apply,\r
+and the section as a whole is intended to apply in other circumstances.\r
+\r
+It is not the purpose of this section to induce you to infringe any\r
+patents or other property right claims or to contest validity of any\r
+such claims; this section has the sole purpose of protecting the\r
+integrity of the free software distribution system which is\r
+implemented by public license practices.  Many people have made\r
+generous contributions to the wide range of software distributed\r
+through that system in reliance on consistent application of that\r
+system; it is up to the author/donor to decide if he or she is willing\r
+to distribute software through any other system and a licensee cannot\r
+impose that choice.\r
+\r
+This section is intended to make thoroughly clear what is believed to\r
+be a consequence of the rest of this License.\r
+\r
+  12. If the distribution and/or use of the Library is restricted in\r
+certain countries either by patents or by copyrighted interfaces, the\r
+original copyright holder who places the Library under this License may add\r
+an explicit geographical distribution limitation excluding those countries,\r
+so that distribution is permitted only in or among countries not thus\r
+excluded.  In such case, this License incorporates the limitation as if\r
+written in the body of this License.\r
+\r
+  13. The Free Software Foundation may publish revised and/or new\r
+versions of the Lesser General Public License from time to time.\r
+Such new versions will be similar in spirit to the present version,\r
+but may differ in detail to address new problems or concerns.\r
+\r
+Each version is given a distinguishing version number.  If the Library\r
+specifies a version number of this License which applies to it and\r
+"any later version", you have the option of following the terms and\r
+conditions either of that version or of any later version published by\r
+the Free Software Foundation.  If the Library does not specify a\r
+license version number, you may choose any version ever published by\r
+the Free Software Foundation.\r
+\r
+  14. If you wish to incorporate parts of the Library into other free\r
+programs whose distribution conditions are incompatible with these,\r
+write to the author to ask for permission.  For software which is\r
+copyrighted by the Free Software Foundation, write to the Free\r
+Software Foundation; we sometimes make exceptions for this.  Our\r
+decision will be guided by the two goals of preserving the free status\r
+of all derivatives of our free software and of promoting the sharing\r
+and reuse of software generally.\r
+\r
+                           NO WARRANTY\r
+\r
+  15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO\r
+WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.\r
+EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR\r
+OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY\r
+KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE\r
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\r
+PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE\r
+LIBRARY IS WITH YOU.  SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME\r
+THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.\r
+\r
+  16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN\r
+WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY\r
+AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU\r
+FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR\r
+CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE\r
+LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING\r
+RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A\r
+FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF\r
+SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH\r
+DAMAGES.\r
+\r
+                    END OF TERMS AND CONDITIONS\r
+\r
+           How to Apply These Terms to Your New Libraries\r
+\r
+  If you develop a new library, and you want it to be of the greatest\r
+possible use to the public, we recommend making it free software that\r
+everyone can redistribute and change.  You can do so by permitting\r
+redistribution under these terms (or, alternatively, under the terms of the\r
+ordinary General Public License).\r
+\r
+  To apply these terms, attach the following notices to the library.  It is\r
+safest to attach them to the start of each source file to most effectively\r
+convey the exclusion of warranty; and each file should have at least the\r
+"copyright" line and a pointer to where the full notice is found.\r
+\r
+    <one line to give the library's name and a brief idea of what it does.>\r
+    Copyright (C) <year>  <name of author>\r
+\r
+    This library is free software; you can redistribute it and/or\r
+    modify it under the terms of the GNU Lesser General Public\r
+    License as published by the Free Software Foundation; either\r
+    version 2.1 of the License, or (at your option) any later version.\r
+\r
+    This library is distributed in the hope that it will be useful,\r
+    but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r
+    Lesser General Public License for more details.\r
+\r
+    You should have received a copy of the GNU Lesser General Public\r
+    License along with this library; if not, write to the Free Software\r
+    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA\r
+\r
+Also add information on how to contact you by electronic and paper mail.\r
+\r
+You should also get your employer (if you work as a programmer) or your\r
+school, if any, to sign a "copyright disclaimer" for the library, if\r
+necessary.  Here is a sample; alter the names:\r
+\r
+  Yoyodyne, Inc., hereby disclaims all copyright interest in the\r
+  library `Frob' (a library for tweaking knobs) written by James Random Hacker.\r
+\r
+  <signature of Ty Coon>, 1 April 1990\r
+  Ty Coon, President of Vice\r
+\r
+That's all there is to it!\r
+\r
+\r
diff --git a/inc/classes/third_party/php_mailer/README b/inc/classes/third_party/php_mailer/README
new file mode 100644 (file)
index 0000000..3670fb6
--- /dev/null
@@ -0,0 +1,178 @@
+/*******************************************************************\r
+* The http://phpmailer.codeworxtech.com/ website now carries a few *\r
+* advertisements through the Google Adsense network. Please visit  *\r
+* the advertiser sites and help us offset some of our costs.       *\r
+* Thanks ....                                                      *\r
+********************************************************************/\r
+\r
+PHPMailer\r
+Full Featured Email Transfer Class for PHP\r
+==========================================\r
+\r
+Version 2.1 (June 04 2008)\r
+\r
+With this release, we are announcing that the development of PHPMailer for PHP5\r
+will be our focus from this date on. We have implemented all the enhancements\r
+and fixes from the latest release of PHPMailer for PHP4.\r
+\r
+Far more important, though, is that this release of PHPMailer (v2.1) is\r
+fully tested with E_STRICT error checking enabled.\r
+\r
+** NOTE: WE HAVE A NEW LANGUAGE VARIABLE FOR DIGITALLY SIGNED S/MIME EMAILS.\r
+   IF YOU CAN HELP WITH LANGUAGES OTHER THAN ENGLISH AND SPANISH, IT WOULD BE\r
+   APPRECIATED.\r
+\r
+We have now added S/MIME functionality (ability to digitally sign emails).\r
+BIG THANKS TO "sergiocambra" for posting this patch back in November 2007.\r
+The "Signed Emails" functionality adds the Sign method to pass the private key\r
+filename and the password to read it, and then email will be sent with\r
+content-type multipart/signed and with the digital signature attached.\r
+\r
+A quick note on E_STRICT:\r
+\r
+- In about half the test environments the development version was subjected\r
+       to, an error was thrown for the date() functions (used at line 1565 and 1569).\r
+       This is NOT a PHPMailer error, it is the result of an incorrectly configured\r
+       PHP5 installation. The fix is to modify your 'php.ini' file and include the\r
+       date.timezone = America/New York\r
+       directive, (for your own server timezone)\r
+- If you do get this error, and are unable to access your php.ini file, there is\r
+       a workaround. In your PHP script, add\r
+       date_default_timezone_set('America/Toronto');\r
+\r
+       * do NOT try to use\r
+       $myVar = date_default_timezone_get();\r
+       as a test, it will throw an error.\r
+\r
+We have also included more example files to show the use of "sendmail", "mail()",\r
+"smtp", and "gmail".\r
+\r
+We are also looking for more programmers to join the volunteer development team.\r
+If you have an interest in this, please let us know.\r
+\r
+Enjoy!\r
+\r
+\r
+Version 2.1.0beta1 & beta2\r
+\r
+please note, this is BETA software\r
+** DO NOT USE THIS IN PRODUCTION OR LIVE PROJECTS\r
+INTENDED STRICTLY FOR TESTING\r
+\r
+** NOTE:\r
+\r
+As of November 2007, PHPMailer has a new project team headed by industry\r
+veteran Andy Prevost (codeworxtech). The first release in more than two\r
+years will focus on fixes, adding ease-of-use enhancements, provide\r
+basic compatibility with PHP4 and PHP5 using PHP5 backwards compatibility\r
+features. A new release is planned before year-end 2007 that will provide\r
+full compatiblity with PHP4 and PHP5, as well as more bug fixes.\r
+\r
+We are looking for project developers to assist in restoring PHPMailer to\r
+its leadership position. Our goals are to simplify use of PHPMailer, provide\r
+good documentation and examples, and retain backward compatibility to level\r
+1.7.3 standards.\r
+\r
+If you are interested in helping out, visit http://sourceforge.net/phpmailer\r
+and indicate your interest.\r
+\r
+**\r
+\r
+http://phpmailer.sourceforge.net/\r
+\r
+This software is licenced under the LGPL.  Please read LICENSE for information on the\r
+software availability and distribution.\r
+\r
+Class Features:\r
+- Send emails with multiple TOs, CCs, BCCs and REPLY-TOs\r
+- Redundant SMTP servers\r
+- Multipart/alternative emails for mail clients that do not read HTML email\r
+- Support for 8bit, base64, binary, and quoted-printable encoding\r
+- Uses the same methods as the very popular AspEmail active server (COM) component\r
+- SMTP authentication\r
+- Native language support\r
+- Word wrap, and more!\r
+\r
+Why you might need it:\r
+\r
+Many PHP developers utilize email in their code.  The only PHP function\r
+that supports this is the mail() function.  However, it does not expose\r
+any of the popular features that many email clients use nowadays like\r
+HTML-based emails and attachments. There are two proprietary\r
+development tools out there that have all the functionality built into\r
+easy to use classes: AspEmail(tm) and AspMail.  Both of these\r
+programs are COM components only available on Windows.  They are also a\r
+little pricey for smaller projects.\r
+\r
+Since I do Linux development I\92ve missed these tools for my PHP coding.\r
+So I built a version myself that implements the same methods (object\r
+calls) that the Windows-based components do. It is open source and the\r
+LGPL license allows you to place the class in your proprietary PHP\r
+projects.\r
+\r
+\r
+Installation:\r
+\r
+Copy class.phpmailer.php into your php.ini include_path. If you are\r
+using the SMTP mailer then place class.smtp.php in your path as well.\r
+In the language directory you will find several files like\r
+phpmailer.lang-en.php.  If you look right before the .php extension\r
+that there are two letters.  These represent the language type of the\r
+translation file.  For instance "en" is the English file and "br" is\r
+the Portuguese file.  Chose the file that best fits with your language\r
+and place it in the PHP include path.  If your language is English\r
+then you have nothing more to do.  If it is a different language then\r
+you must point PHPMailer to the correct translation.  To do this, call\r
+the PHPMailer SetLanguage method like so:\r
+\r
+// To load the Portuguese version\r
+$mail->SetLanguage("br", "/optional/path/to/language/directory/");\r
+\r
+That's it.  You should now be ready to use PHPMailer!\r
+\r
+\r
+A Simple Example:\r
+\r
+<?php\r
+require("class.phpmailer.php");\r
+\r
+$mail = new PHPMailer();\r
+\r
+$mail->IsSMTP();                                      // set mailer to use SMTP\r
+$mail->Host = "smtp1.example.com;smtp2.example.com";  // specify main and backup server\r
+$mail->SMTPAuth = true;     // turn on SMTP authentication\r
+$mail->Username = "jswan";  // SMTP username\r
+$mail->Password = "secret"; // SMTP password\r
+\r
+$mail->From = "from@example.com";\r
+$mail->FromName = "Mailer";\r
+$mail->AddAddress("josh@example.net", "Josh Adams");\r
+$mail->AddAddress("ellen@example.com");                  // name is optional\r
+$mail->AddReplyTo("info@example.com", "Information");\r
+\r
+$mail->WordWrap = 50;                                 // set word wrap to 50 characters\r
+$mail->AddAttachment("/var/tmp/file.tar.gz");         // add attachments\r
+$mail->AddAttachment("/tmp/image.jpg", "new.jpg");    // optional name\r
+$mail->IsHTML(true);                                  // set email format to HTML\r
+\r
+$mail->Subject = "Here is the subject";\r
+$mail->Body    = "This is the HTML message body <b>in bold!</b>";\r
+$mail->AltBody = "This is the body in plain text for non-HTML mail clients";\r
+\r
+if(!$mail->Send())\r
+{\r
+   echo "Message could not be sent. <p>";\r
+   echo "Mailer Error: " . $mail->ErrorInfo;\r
+   exit;\r
+}\r
+\r
+echo "Message has been sent";\r
+?>\r
+\r
+CHANGELOG\r
+\r
+See ChangeLog.txt\r
+\r
+Download: http://sourceforge.net/project/showfiles.php?group_id=26031\r
+\r
+Andy Prevost\r
diff --git a/inc/classes/third_party/php_mailer/class.phpmailer.php b/inc/classes/third_party/php_mailer/class.phpmailer.php
new file mode 100644 (file)
index 0000000..856faaf
--- /dev/null
@@ -0,0 +1,1886 @@
+<?php
+/*~ class.phpmailer.php
+.---------------------------------------------------------------------------.
+|  Software: PHPMailer - PHP email class                                    |
+|   Version: 2.1                                                            |
+|   Contact: via sourceforge.net support pages (also www.codeworxtech.com)  |
+|      Info: http://phpmailer.sourceforge.net                               |
+|   Support: http://sourceforge.net/projects/phpmailer/                     |
+| ------------------------------------------------------------------------- |
+|    Author: Andy Prevost (project admininistrator)                         |
+|    Author: Brent R. Matzelle (original founder)                           |
+| Copyright (c) 2004-2007, Andy Prevost. All Rights Reserved.               |
+| Copyright (c) 2001-2003, Brent R. Matzelle                                |
+| ------------------------------------------------------------------------- |
+|   License: Distributed under the Lesser General Public License (LGPL)     |
+|            http://www.gnu.org/copyleft/lesser.html                        |
+| This program is distributed in the hope that it will be useful - WITHOUT  |
+| ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or     |
+| FITNESS FOR A PARTICULAR PURPOSE.                                         |
+| ------------------------------------------------------------------------- |
+| We offer a number of paid services (www.codeworxtech.com):                |
+| - Web Hosting on highly optimized fast and secure servers                 |
+| - Technology Consulting                                                   |
+| - Oursourcing (highly qualified programmers and graphic designers)        |
+'---------------------------------------------------------------------------'
+
+/**
+ * PHPMailer - PHP email transport class
+ * NOTE: Designed for use with PHP version 5 and up
+ * @package PHPMailer
+ * @author Andy Prevost
+ * @copyright 2004 - 2008 Andy Prevost
+ */
+
+class PHPMailer {
+
+  /////////////////////////////////////////////////
+  // PROPERTIES, PUBLIC
+  /////////////////////////////////////////////////
+
+  /**
+   * Email priority (1 = High, 3 = Normal, 5 = low).
+   * @var int
+   */
+  public $Priority          = 3;
+
+  /**
+   * Sets the CharSet of the message.
+   * @var string
+   */
+  public $CharSet           = 'iso-8859-1';
+
+  /**
+   * Sets the Content-type of the message.
+   * @var string
+   */
+  public $ContentType       = 'text/plain';
+
+  /**
+   * Sets the Encoding of the message. Options for this are "8bit",
+   * "7bit", "binary", "base64", and "quoted-printable".
+   * @var string
+   */
+  public $Encoding          = '8bit';
+
+  /**
+   * Holds the most recent mailer error message.
+   * @var string
+   */
+  public $ErrorInfo         = '';
+
+  /**
+   * Sets the From email address for the message.
+   * @var string
+   */
+  public $From              = 'root@localhost';
+
+  /**
+   * Sets the From name of the message.
+   * @var string
+   */
+  public $FromName          = 'Root User';
+
+  /**
+   * Sets the Sender email (Return-Path) of the message.  If not empty,
+   * will be sent via -f to sendmail or as 'MAIL FROM' in smtp mode.
+   * @var string
+   */
+  public $Sender            = '';
+
+  /**
+   * Sets the Subject of the message.
+   * @var string
+   */
+  public $Subject           = '';
+
+  /**
+   * Sets the Body of the message.  This can be either an HTML or text body.
+   * If HTML then run IsHTML(true).
+   * @var string
+   */
+  public $Body              = '';
+
+  /**
+   * Sets the text-only body of the message.  This automatically sets the
+   * email to multipart/alternative.  This body can be read by mail
+   * clients that do not have HTML email capability such as mutt. Clients
+   * that can read HTML will view the normal Body.
+   * @var string
+   */
+  public $AltBody           = '';
+
+  /**
+   * Sets word wrapping on the body of the message to a given number of
+   * characters.
+   * @var int
+   */
+  public $WordWrap          = 0;
+
+  /**
+   * Method to send mail: ("mail", "sendmail", or "smtp").
+   * @var string
+   */
+  public $Mailer            = 'mail';
+
+  /**
+   * Sets the path of the sendmail program.
+   * @var string
+   */
+  public $Sendmail          = '/usr/sbin/sendmail';
+
+  /**
+   * Path to PHPMailer plugins.  This is now only useful if the SMTP class
+   * is in a different directory than the PHP include path.
+   * @var string
+   */
+  public $PluginDir         = '';
+
+  /**
+   * Holds PHPMailer version.
+   * @var string
+   */
+  public $Version           = "2.1";
+
+  /**
+   * Sets the email address that a reading confirmation will be sent.
+   * @var string
+   */
+  public $ConfirmReadingTo  = '';
+
+  /**
+   * Sets the hostname to use in Message-Id and Received headers
+   * and as default HELO string. If empty, the value returned
+   * by SERVER_NAME is used or 'localhost.localdomain'.
+   * @var string
+   */
+  public $Hostname          = '';
+
+  /**
+   * Sets the message ID to be used in the Message-Id header.
+   * If empty, a unique id will be generated.
+   * @var string
+   */
+  public $MessageID      = '';
+
+  /////////////////////////////////////////////////
+  // PROPERTIES FOR SMTP
+  /////////////////////////////////////////////////
+
+  /**
+   * Sets the SMTP hosts.  All hosts must be separated by a
+   * semicolon.  You can also specify a different port
+   * for each host by using this format: [hostname:port]
+   * (e.g. "smtp1.example.com:25;smtp2.example.com").
+   * Hosts will be tried in order.
+   * @var string
+   */
+  public $Host        = 'localhost';
+
+  /**
+   * Sets the default SMTP server port.
+   * @var int
+   */
+  public $Port        = 25;
+
+  /**
+   * Sets the SMTP HELO of the message (Default is $Hostname).
+   * @var string
+   */
+  public $Helo        = '';
+
+  /**
+   * Sets connection prefix.
+   * Options are "", "ssl" or "tls"
+   * @var string
+   */
+  public $SMTPSecure = "";
+
+  /**
+   * Sets SMTP authentication. Utilizes the Username and Password variables.
+   * @var bool
+   */
+  public $SMTPAuth     = false;
+
+  /**
+   * Sets SMTP username.
+   * @var string
+   */
+  public $Username     = '';
+
+  /**
+   * Sets SMTP password.
+   * @var string
+   */
+  public $Password     = '';
+
+  /**
+   * Sets the SMTP server timeout in seconds. This function will not
+   * work with the win32 version.
+   * @var int
+   */
+  public $Timeout      = 10;
+
+  /**
+   * Sets SMTP class debugging on or off.
+   * @var bool
+   */
+  public $SMTPDebug    = false;
+
+  /**
+   * Prevents the SMTP connection from being closed after each mail
+   * sending.  If this is set to true then to close the connection
+   * requires an explicit call to SmtpClose().
+   * @var bool
+   */
+  public $SMTPKeepAlive = false;
+
+  /**
+   * Provides the ability to have the TO field process individual
+   * emails, instead of sending to entire TO addresses
+   * @var bool
+   */
+  public $SingleTo = false;
+
+  /////////////////////////////////////////////////
+  // PROPERTIES, PRIVATE
+  /////////////////////////////////////////////////
+
+  private $smtp            = NULL;
+  private $to              = array();
+  private $cc              = array();
+  private $bcc             = array();
+  private $ReplyTo         = array();
+  private $attachment      = array();
+  private $CustomHeader    = array();
+  private $message_type    = '';
+  private $boundary        = array();
+  private $language        = array();
+  private $error_count     = 0;
+  private $LE              = "\n";
+  private $sign_key_file   = "";
+  private $sign_key_pass   = "";
+
+  /////////////////////////////////////////////////
+  // METHODS, VARIABLES
+  /////////////////////////////////////////////////
+
+  /**
+   * Sets message type to HTML.
+   * @param bool $bool
+   * @return void
+   */
+  public function IsHTML($bool) {
+    if($bool == true) {
+      $this->ContentType = 'text/html';
+    } else {
+      $this->ContentType = 'text/plain';
+    }
+  }
+
+  /**
+   * Sets Mailer to send message using SMTP.
+   * @return void
+   */
+  public function IsSMTP() {
+    $this->Mailer = 'smtp';
+  }
+
+  /**
+   * Sets Mailer to send message using PHP mail() function.
+   * @return void
+   */
+  public function IsMail() {
+    $this->Mailer = 'mail';
+  }
+
+  /**
+   * Sets Mailer to send message using the $Sendmail program.
+   * @return void
+   */
+  public function IsSendmail() {
+    $this->Mailer = 'sendmail';
+  }
+
+  /**
+   * Sets Mailer to send message using the qmail MTA.
+   * @return void
+   */
+  public function IsQmail() {
+    $this->Sendmail = '/var/qmail/bin/sendmail';
+    $this->Mailer   = 'sendmail';
+  }
+
+  /////////////////////////////////////////////////
+  // METHODS, RECIPIENTS
+  /////////////////////////////////////////////////
+
+  /**
+   * Adds a "To" address.
+   * @param string $address
+   * @param string $name
+   * @return void
+   */
+  public function AddAddress($address, $name = '') {
+    $cur = count($this->to);
+    $this->to[$cur][0] = trim($address);
+    $this->to[$cur][1] = $name;
+  }
+
+  /**
+   * Adds a "Cc" address. Note: this function works
+   * with the SMTP mailer on win32, not with the "mail"
+   * mailer.
+   * @param string $address
+   * @param string $name
+   * @return void
+   */
+  public function AddCC($address, $name = '') {
+    $cur = count($this->cc);
+    $this->cc[$cur][0] = trim($address);
+    $this->cc[$cur][1] = $name;
+  }
+
+  /**
+   * Adds a "Bcc" address. Note: this function works
+   * with the SMTP mailer on win32, not with the "mail"
+   * mailer.
+   * @param string $address
+   * @param string $name
+   * @return void
+   */
+  public function AddBCC($address, $name = '') {
+    $cur = count($this->bcc);
+    $this->bcc[$cur][0] = trim($address);
+    $this->bcc[$cur][1] = $name;
+  }
+
+  /**
+   * Adds a "Reply-to" address.
+   * @param string $address
+   * @param string $name
+   * @return void
+   */
+  public function AddReplyTo($address, $name = '') {
+    $cur = count($this->ReplyTo);
+    $this->ReplyTo[$cur][0] = trim($address);
+    $this->ReplyTo[$cur][1] = $name;
+  }
+
+  /////////////////////////////////////////////////
+  // METHODS, MAIL SENDING
+  /////////////////////////////////////////////////
+
+  /**
+   * Creates message and assigns Mailer. If the message is
+   * not sent successfully then it returns false.  Use the ErrorInfo
+   * variable to view description of the error.
+   * @return bool
+   */
+  public function Send() {
+    $header = '';
+    $body = '';
+    $result = true;
+
+    if((count($this->to) + count($this->cc) + count($this->bcc)) < 1) {
+      $this->SetError($this->Lang('provide_address'));
+      return false;
+    }
+
+    /* Set whether the message is multipart/alternative */
+    if(!empty($this->AltBody)) {
+      $this->ContentType = 'multipart/alternative';
+    }
+
+    $this->error_count = 0; // reset errors
+    $this->SetMessageType();
+    $header .= $this->CreateHeader();
+    $body = $this->CreateBody();
+
+    if($body == '') {
+      return false;
+    }
+
+    /* Choose the mailer */
+    switch($this->Mailer) {
+      case 'sendmail':
+        $result = $this->SendmailSend($header, $body);
+        break;
+      case 'smtp':
+        $result = $this->SmtpSend($header, $body);
+        break;
+      case 'mail':
+        $result = $this->MailSend($header, $body);
+        break;
+      default:
+        $result = $this->MailSend($header, $body);
+        break;
+        //$this->SetError($this->Mailer . $this->Lang('mailer_not_supported'));
+        //$result = false;
+        //break;
+    }
+
+    return $result;
+  }
+
+  /**
+   * Sends mail using the $Sendmail program.
+   * @access public
+   * @return bool
+   */
+  public function SendmailSend($header, $body) {
+    if ($this->Sender != '') {
+      $sendmail = sprintf("%s -oi -f %s -t", escapeshellcmd($this->Sendmail), escapeshellarg($this->Sender));
+    } else {
+      $sendmail = sprintf("%s -oi -t", escapeshellcmd($this->Sendmail));
+    }
+
+    if(!@$mail = popen($sendmail, 'w')) {
+      $this->SetError($this->Lang('execute') . $this->Sendmail);
+      return false;
+    }
+
+    fputs($mail, $header);
+    fputs($mail, $body);
+
+    $result = pclose($mail);
+    if (version_compare(phpversion(), '4.2.3') == -1) {
+      $result = $result >> 8 & 0xFF;
+    }
+    if($result != 0) {
+      $this->SetError($this->Lang('execute') . $this->Sendmail);
+      return false;
+    }
+
+    return true;
+  }
+
+  /**
+   * Sends mail using the PHP mail() function.
+   * @access public
+   * @return bool
+   */
+  public function MailSend($header, $body) {
+
+    $to = '';
+    for($i = 0; $i < count($this->to); $i++) {
+      if($i != 0) { $to .= ', '; }
+      $to .= $this->AddrFormat($this->to[$i]);
+    }
+
+    $toArr = split(',', $to);
+
+    $params = sprintf("-oi -f %s", $this->Sender);
+    if ($this->Sender != '' && strlen(ini_get('safe_mode'))< 1) {
+      $old_from = ini_get('sendmail_from');
+      ini_set('sendmail_from', $this->Sender);
+      if ($this->SingleTo === true && count($toArr) > 1) {
+        foreach ($toArr as $key => $val) {
+          $rt = @mail($val, $this->EncodeHeader($this->SecureHeader($this->Subject)), $body, $header, $params);
+        }
+      } else {
+        $rt = @mail($to, $this->EncodeHeader($this->SecureHeader($this->Subject)), $body, $header, $params);
+      }
+    } else {
+      if ($this->SingleTo === true && count($toArr) > 1) {
+        foreach ($toArr as $key => $val) {
+          $rt = @mail($val, $this->EncodeHeader($this->SecureHeader($this->Subject)), $body, $header, $params);
+        }
+      } else {
+        $rt = @mail($to, $this->EncodeHeader($this->SecureHeader($this->Subject)), $body, $header);
+      }
+    }
+
+    if (isset($old_from)) {
+      ini_set('sendmail_from', $old_from);
+    }
+
+    if(!$rt) {
+      $this->SetError($this->Lang('instantiate'));
+      return false;
+    }
+
+    return true;
+  }
+
+  /**
+   * Sends mail via SMTP using PhpSMTP (Author:
+   * Chris Ryan).  Returns bool.  Returns false if there is a
+   * bad MAIL FROM, RCPT, or DATA input.
+   * @access public
+   * @return bool
+   */
+  public function SmtpSend($header, $body) {
+    include_once($this->PluginDir . 'class.smtp.php');
+    $error = '';
+    $bad_rcpt = array();
+
+    if(!$this->SmtpConnect()) {
+      return false;
+    }
+
+    $smtp_from = ($this->Sender == '') ? $this->From : $this->Sender;
+    if(!$this->smtp->Mail($smtp_from)) {
+      $error = $this->Lang('from_failed') . $smtp_from;
+      $this->SetError($error);
+      $this->smtp->Reset();
+      return false;
+    }
+
+    /* Attempt to send attach all recipients */
+    for($i = 0; $i < count($this->to); $i++) {
+      if(!$this->smtp->Recipient($this->to[$i][0])) {
+        $bad_rcpt[] = $this->to[$i][0];
+      }
+    }
+    for($i = 0; $i < count($this->cc); $i++) {
+      if(!$this->smtp->Recipient($this->cc[$i][0])) {
+        $bad_rcpt[] = $this->cc[$i][0];
+      }
+    }
+    for($i = 0; $i < count($this->bcc); $i++) {
+      if(!$this->smtp->Recipient($this->bcc[$i][0])) {
+        $bad_rcpt[] = $this->bcc[$i][0];
+      }
+    }
+
+    if(count($bad_rcpt) > 0) { // Create error message
+      for($i = 0; $i < count($bad_rcpt); $i++) {
+        if($i != 0) {
+          $error .= ', ';
+        }
+        $error .= $bad_rcpt[$i];
+      }
+      $error = $this->Lang('recipients_failed') . $error;
+      $this->SetError($error);
+      $this->smtp->Reset();
+      return false;
+    }
+
+    if(!$this->smtp->Data($header . $body)) {
+      $this->SetError($this->Lang('data_not_accepted'));
+      $this->smtp->Reset();
+      return false;
+    }
+    if($this->SMTPKeepAlive == true) {
+      $this->smtp->Reset();
+    } else {
+      $this->SmtpClose();
+    }
+
+    return true;
+  }
+
+  /**
+   * Initiates a connection to an SMTP server.  Returns false if the
+   * operation failed.
+   * @access public
+   * @return bool
+   */
+  public function SmtpConnect() {
+    if($this->smtp == NULL) {
+      $this->smtp = new SMTP();
+    }
+
+    $this->smtp->do_debug = $this->SMTPDebug;
+    $hosts = explode(';', $this->Host);
+    $index = 0;
+    $connection = ($this->smtp->Connected());
+
+    /* Retry while there is no connection */
+    while($index < count($hosts) && $connection == false) {
+      $hostinfo = array();
+      if(eregi('^(.+):([0-9]+)$', $hosts[$index], $hostinfo)) {
+        $host = $hostinfo[1];
+        $port = $hostinfo[2];
+      } else {
+        $host = $hosts[$index];
+        $port = $this->Port;
+      }
+
+      $tls = ($this->SMTPSecure == 'tls');
+      $ssl = ($this->SMTPSecure == 'ssl');
+
+      if($this->smtp->Connect(($ssl ? 'ssl://':'').$host, $port, $this->Timeout)) {
+
+        $hello = ($this->Helo != '' ? $this->Hello : $this->ServerHostname());
+        $this->smtp->Hello($hello);
+
+        if($tls) {
+          if(!$this->smtp->StartTLS()) {
+            $this->SetError($this->Lang("tls"));
+            $this->smtp->Reset();
+            $connection = false;
+          }
+
+          //We must resend HELLO after tls negociation
+          $this->smtp->Hello($hello);
+        }
+
+        $connection = true;
+        if($this->SMTPAuth) {
+          if(!$this->smtp->Authenticate($this->Username, $this->Password)) {
+            $this->SetError($this->Lang('authenticate'));
+            $this->smtp->Reset();
+            $connection = false;
+          }
+        }
+      }
+      $index++;
+    }
+    if(!$connection) {
+      $this->SetError($this->Lang('connect_host'));
+    }
+
+    return $connection;
+  }
+
+  /**
+   * Closes the active SMTP session if one exists.
+   * @return void
+   */
+  public function SmtpClose() {
+    if($this->smtp != NULL) {
+      if($this->smtp->Connected()) {
+        $this->smtp->Quit();
+        $this->smtp->Close();
+      }
+    }
+  }
+
+  /**
+   * Sets the language for all class error messages.  Returns false
+   * if it cannot load the language file.  The default language type
+   * is English.
+   * @param string $lang_type Type of language (e.g. Portuguese: "br")
+   * @param string $lang_path Path to the language file directory
+   * @access public
+   * @return bool
+   */
+  function SetLanguage($lang_type = 'en', $lang_path = 'language/') {
+    if( !(@include $lang_path.'phpmailer.lang-'.$lang_type.'.php') ) {
+      $this->SetError('Could not load language file');
+      return false;
+    }
+    $this->language = $PHPMAILER_LANG;
+    return true;
+  }
+
+  /////////////////////////////////////////////////
+  // METHODS, MESSAGE CREATION
+  /////////////////////////////////////////////////
+
+  /**
+   * Creates recipient headers.
+   * @access public
+   * @return string
+   */
+  public function AddrAppend($type, $addr) {
+    $addr_str = $type . ': ';
+    $addr_str .= $this->AddrFormat($addr[0]);
+    if(count($addr) > 1) {
+      for($i = 1; $i < count($addr); $i++) {
+        $addr_str .= ', ' . $this->AddrFormat($addr[$i]);
+      }
+    }
+    $addr_str .= $this->LE;
+
+    return $addr_str;
+  }
+
+  /**
+   * Formats an address correctly.
+   * @access public
+   * @return string
+   */
+  public function AddrFormat($addr) {
+    if(empty($addr[1])) {
+      $formatted = $this->SecureHeader($addr[0]);
+    } else {
+      $formatted = $this->EncodeHeader($this->SecureHeader($addr[1]), 'phrase') . " <" . $this->SecureHeader($addr[0]) . ">";
+    }
+
+    return $formatted;
+  }
+
+  /**
+   * Wraps message for use with mailers that do not
+   * automatically perform wrapping and for quoted-printable.
+   * Original written by philippe.
+   * @access public
+   * @return string
+   */
+  public function WrapText($message, $length, $qp_mode = false) {
+    $soft_break = ($qp_mode) ? sprintf(" =%s", $this->LE) : $this->LE;
+    // If utf-8 encoding is used, we will need to make sure we don't
+    // split multibyte characters when we wrap
+    $is_utf8 = (strtolower($this->CharSet) == "utf-8");
+
+    $message = $this->FixEOL($message);
+    if (substr($message, -1) == $this->LE) {
+      $message = substr($message, 0, -1);
+    }
+
+    $line = explode($this->LE, $message);
+    $message = '';
+    for ($i=0 ;$i < count($line); $i++) {
+      $line_part = explode(' ', $line[$i]);
+      $buf = '';
+      for ($e = 0; $e<count($line_part); $e++) {
+        $word = $line_part[$e];
+        if ($qp_mode and (strlen($word) > $length)) {
+          $space_left = $length - strlen($buf) - 1;
+          if ($e != 0) {
+            if ($space_left > 20) {
+              $len = $space_left;
+              if ($is_utf8) {
+                $len = $this->UTF8CharBoundary($word, $len);
+              } elseif (substr($word, $len - 1, 1) == "=") {
+                $len--;
+              } elseif (substr($word, $len - 2, 1) == "=") {
+                $len -= 2;
+              }
+              $part = substr($word, 0, $len);
+              $word = substr($word, $len);
+              $buf .= ' ' . $part;
+              $message .= $buf . sprintf("=%s", $this->LE);
+            } else {
+              $message .= $buf . $soft_break;
+            }
+            $buf = '';
+          }
+          while (strlen($word) > 0) {
+            $len = $length;
+            if ($is_utf8) {
+              $len = $this->UTF8CharBoundary($word, $len);
+            } elseif (substr($word, $len - 1, 1) == "=") {
+              $len--;
+            } elseif (substr($word, $len - 2, 1) == "=") {
+              $len -= 2;
+            }
+            $part = substr($word, 0, $len);
+            $word = substr($word, $len);
+
+            if (strlen($word) > 0) {
+              $message .= $part . sprintf("=%s", $this->LE);
+            } else {
+              $buf = $part;
+            }
+          }
+        } else {
+          $buf_o = $buf;
+          $buf .= ($e == 0) ? $word : (' ' . $word);
+
+          if (strlen($buf) > $length and $buf_o != '') {
+            $message .= $buf_o . $soft_break;
+            $buf = $word;
+          }
+        }
+      }
+      $message .= $buf . $this->LE;
+    }
+
+    return $message;
+  }
+
+  /**
+   * Finds last character boundary prior to maxLength in a utf-8
+   * quoted (printable) encoded string.
+   * Original written by Colin Brown.
+   * @access public
+   * @param string $encodedText utf-8 QP text
+   * @param int    $maxLength   find last character boundary prior to this length
+   * @return int
+   */
+  public function UTF8CharBoundary($encodedText, $maxLength) {
+    $foundSplitPos = false;
+    $lookBack = 3;
+    while (!$foundSplitPos) {
+      $lastChunk = substr($encodedText, $maxLength - $lookBack, $lookBack);
+      $encodedCharPos = strpos($lastChunk, "=");
+      if ($encodedCharPos !== false) {
+        // Found start of encoded character byte within $lookBack block.
+        // Check the encoded byte value (the 2 chars after the '=')
+        $hex = substr($encodedText, $maxLength - $lookBack + $encodedCharPos + 1, 2);
+        $dec = hexdec($hex);
+        if ($dec < 128) { // Single byte character.
+          // If the encoded char was found at pos 0, it will fit
+          // otherwise reduce maxLength to start of the encoded char
+          $maxLength = ($encodedCharPos == 0) ? $maxLength :
+          $maxLength - ($lookBack - $encodedCharPos);
+          $foundSplitPos = true;
+        } elseif ($dec >= 192) { // First byte of a multi byte character
+          // Reduce maxLength to split at start of character
+          $maxLength = $maxLength - ($lookBack - $encodedCharPos);
+          $foundSplitPos = true;
+        } elseif ($dec < 192) { // Middle byte of a multi byte character, look further back
+          $lookBack += 3;
+        }
+      } else {
+        // No encoded character found
+        $foundSplitPos = true;
+      }
+    }
+    return $maxLength;
+  }
+
+
+  /**
+   * Set the body wrapping.
+   * @access public
+   * @return void
+   */
+  public function SetWordWrap() {
+    if($this->WordWrap < 1) {
+      return;
+    }
+
+    switch($this->message_type) {
+      case 'alt':
+        /* fall through */
+      case 'alt_attachments':
+        $this->AltBody = $this->WrapText($this->AltBody, $this->WordWrap);
+        break;
+      default:
+        $this->Body = $this->WrapText($this->Body, $this->WordWrap);
+        break;
+    }
+  }
+
+  /**
+   * Assembles message header.
+   * @access public
+   * @return string
+   */
+  public function CreateHeader() {
+    $result = '';
+
+    /* Set the boundaries */
+    $uniq_id = md5(uniqid(time()));
+    $this->boundary[1] = 'b1_' . $uniq_id;
+    $this->boundary[2] = 'b2_' . $uniq_id;
+
+    $result .= $this->HeaderLine('Date', $this->RFCDate());
+    if($this->Sender == '') {
+      $result .= $this->HeaderLine('Return-Path', trim($this->From));
+    } else {
+      $result .= $this->HeaderLine('Return-Path', trim($this->Sender));
+    }
+
+    /* To be created automatically by mail() */
+    if($this->Mailer != 'mail') {
+      if(count($this->to) > 0) {
+        $result .= $this->AddrAppend('To', $this->to);
+      } elseif (count($this->cc) == 0) {
+        $result .= $this->HeaderLine('To', 'undisclosed-recipients:;');
+      }
+      if(count($this->cc) > 0) {
+        $result .= $this->AddrAppend('Cc', $this->cc);
+      }
+    }
+
+    $from = array();
+    $from[0][0] = trim($this->From);
+    $from[0][1] = $this->FromName;
+    $result .= $this->AddrAppend('From', $from);
+
+    /* sendmail and mail() extract Cc from the header before sending */
+    if((($this->Mailer == 'sendmail') || ($this->Mailer == 'mail')) && (count($this->cc) > 0)) {
+      $result .= $this->AddrAppend('Cc', $this->cc);
+    }
+
+    /* sendmail and mail() extract Bcc from the header before sending */
+    if((($this->Mailer == 'sendmail') || ($this->Mailer == 'mail')) && (count($this->bcc) > 0)) {
+      $result .= $this->AddrAppend('Bcc', $this->bcc);
+    }
+
+    if(count($this->ReplyTo) > 0) {
+      $result .= $this->AddrAppend('Reply-to', $this->ReplyTo);
+    }
+
+    /* mail() sets the subject itself */
+    if($this->Mailer != 'mail') {
+      $result .= $this->HeaderLine('Subject', $this->EncodeHeader($this->SecureHeader($this->Subject)));
+    }
+
+    if($this->MessageID != '') {
+      $result .= $this->HeaderLine('Message-ID',$this->MessageID);
+    } else {
+      $result .= sprintf("Message-ID: <%s@%s>%s", $uniq_id, $this->ServerHostname(), $this->LE);
+    }
+    $result .= $this->HeaderLine('X-Priority', $this->Priority);
+    $result .= $this->HeaderLine('X-Mailer', 'PHPMailer (phpmailer.codeworxtech.com) [version ' . $this->Version . ']');
+
+    if($this->ConfirmReadingTo != '') {
+      $result .= $this->HeaderLine('Disposition-Notification-To', '<' . trim($this->ConfirmReadingTo) . '>');
+    }
+
+    // Add custom headers
+    for($index = 0; $index < count($this->CustomHeader); $index++) {
+      $result .= $this->HeaderLine(trim($this->CustomHeader[$index][0]), $this->EncodeHeader(trim($this->CustomHeader[$index][1])));
+    }
+    //$result .= $this->HeaderLine('MIME-Version', '1.0');
+    if (!$this->sign_key_file) {
+      $result .= $this->HeaderLine('MIME-Version', '1.0');
+      $result .= $this->GetMailMIME();
+    }
+
+    return $result;
+  }
+
+  /**
+   * Returns the message MIME.
+   * @access public
+   * @return string
+   */
+  public function GetMailMIME() {
+    $result = '';
+    switch($this->message_type) {
+      case 'plain':
+        $result .= $this->HeaderLine('Content-Transfer-Encoding', $this->Encoding);
+        $result .= sprintf("Content-Type: %s; charset=\"%s\"", $this->ContentType, $this->CharSet);
+        break;
+      case 'attachments':
+        /* fall through */
+      case 'alt_attachments':
+        if($this->InlineImageExists()){
+          $result .= sprintf("Content-Type: %s;%s\ttype=\"text/html\";%s\tboundary=\"%s\"%s", 'multipart/related', $this->LE, $this->LE, $this->boundary[1], $this->LE);
+        } else {
+          $result .= $this->HeaderLine('Content-Type', 'multipart/mixed;');
+          $result .= $this->TextLine("\tboundary=\"" . $this->boundary[1] . '"');
+        }
+        break;
+      case 'alt':
+        $result .= $this->HeaderLine('Content-Type', 'multipart/alternative;');
+        $result .= $this->TextLine("\tboundary=\"" . $this->boundary[1] . '"');
+        break;
+    }
+
+    if($this->Mailer != 'mail') {
+      $result .= $this->LE.$this->LE;
+    }
+
+    return $result;
+  }
+
+  /**
+   * Assembles the message body.  Returns an empty string on failure.
+   * @access public
+   * @return string
+   */
+  public function CreateBody() {
+    $result = '';
+
+    if ($this->sign_key_file) {
+      $result .= $this->GetMailMIME();
+    }
+
+    $this->SetWordWrap();
+
+    switch($this->message_type) {
+      case 'alt':
+        $result .= $this->GetBoundary($this->boundary[1], '', 'text/plain', '');
+        $result .= $this->EncodeString($this->AltBody, $this->Encoding);
+        $result .= $this->LE.$this->LE;
+        $result .= $this->GetBoundary($this->boundary[1], '', 'text/html', '');
+        $result .= $this->EncodeString($this->Body, $this->Encoding);
+        $result .= $this->LE.$this->LE;
+        $result .= $this->EndBoundary($this->boundary[1]);
+        break;
+      case 'plain':
+        $result .= $this->EncodeString($this->Body, $this->Encoding);
+        break;
+      case 'attachments':
+        $result .= $this->GetBoundary($this->boundary[1], '', '', '');
+        $result .= $this->EncodeString($this->Body, $this->Encoding);
+        $result .= $this->LE;
+        $result .= $this->AttachAll();
+        break;
+      case 'alt_attachments':
+        $result .= sprintf("--%s%s", $this->boundary[1], $this->LE);
+        $result .= sprintf("Content-Type: %s;%s" . "\tboundary=\"%s\"%s", 'multipart/alternative', $this->LE, $this->boundary[2], $this->LE.$this->LE);
+        $result .= $this->GetBoundary($this->boundary[2], '', 'text/plain', '') . $this->LE; // Create text body
+        $result .= $this->EncodeString($this->AltBody, $this->Encoding);
+        $result .= $this->LE.$this->LE;
+        $result .= $this->GetBoundary($this->boundary[2], '', 'text/html', '') . $this->LE; // Create the HTML body
+        $result .= $this->EncodeString($this->Body, $this->Encoding);
+        $result .= $this->LE.$this->LE;
+        $result .= $this->EndBoundary($this->boundary[2]);
+        $result .= $this->AttachAll();
+        break;
+    }
+
+    if($this->IsError()) {
+      $result = '';
+    } else if ($this->sign_key_file) {
+      $file = tempnam("", "mail");
+      $fp = fopen($file, "w");
+      fwrite($fp, $result);
+      fclose($fp);
+      $signed = tempnam("", "signed");
+
+      if (@openssl_pkcs7_sign($file, $signed, "file://".$this->sign_key_file, array("file://".$this->sign_key_file, $this->sign_key_pass), null)) {
+        $fp = fopen($signed, "r");
+        $result = fread($fp, filesize($this->sign_key_file));
+        fclose($fp);
+      } else {
+        $this->SetError($this->Lang("signing").openssl_error_string());
+        $result = '';
+      }
+
+      unlink($file);
+      unlink($signed);
+    }
+
+    return $result;
+  }
+
+  /**
+   * Returns the start of a message boundary.
+   * @access public
+   */
+  public function GetBoundary($boundary, $charSet, $contentType, $encoding) {
+    $result = '';
+    if($charSet == '') {
+      $charSet = $this->CharSet;
+    }
+    if($contentType == '') {
+      $contentType = $this->ContentType;
+    }
+    if($encoding == '') {
+      $encoding = $this->Encoding;
+    }
+    $result .= $this->TextLine('--' . $boundary);
+    $result .= sprintf("Content-Type: %s; charset = \"%s\"", $contentType, $charSet);
+    $result .= $this->LE;
+    $result .= $this->HeaderLine('Content-Transfer-Encoding', $encoding);
+    $result .= $this->LE;
+
+    return $result;
+  }
+
+  /**
+   * Returns the end of a message boundary.
+   * @access public
+   */
+  public function EndBoundary($boundary) {
+    return $this->LE . '--' . $boundary . '--' . $this->LE;
+  }
+
+  /**
+   * Sets the message type.
+   * @access public
+   * @return void
+   */
+  public function SetMessageType() {
+    if(count($this->attachment) < 1 && strlen($this->AltBody) < 1) {
+      $this->message_type = 'plain';
+    } else {
+      if(count($this->attachment) > 0) {
+        $this->message_type = 'attachments';
+      }
+      if(strlen($this->AltBody) > 0 && count($this->attachment) < 1) {
+        $this->message_type = 'alt';
+      }
+      if(strlen($this->AltBody) > 0 && count($this->attachment) > 0) {
+        $this->message_type = 'alt_attachments';
+      }
+    }
+  }
+
+  /* Returns a formatted header line.
+   * @access public
+   * @return string
+   */
+  public function HeaderLine($name, $value) {
+    return $name . ': ' . $value . $this->LE;
+  }
+
+  /**
+   * Returns a formatted mail line.
+   * @access public
+   * @return string
+   */
+  public function TextLine($value) {
+    return $value . $this->LE;
+  }
+
+  /////////////////////////////////////////////////
+  // CLASS METHODS, ATTACHMENTS
+  /////////////////////////////////////////////////
+
+  /**
+   * Adds an attachment from a path on the filesystem.
+   * Returns false if the file could not be found
+   * or accessed.
+   * @param string $path Path to the attachment.
+   * @param string $name Overrides the attachment name.
+   * @param string $encoding File encoding (see $Encoding).
+   * @param string $type File extension (MIME) type.
+   * @return bool
+   */
+  public function AddAttachment($path, $name = '', $encoding = 'base64', $type = 'application/octet-stream') {
+    if(!@is_file($path)) {
+      $this->SetError($this->Lang('file_access') . $path);
+      return false;
+    }
+
+    $filename = basename($path);
+    if($name == '') {
+      $name = $filename;
+    }
+
+    $cur = count($this->attachment);
+    $this->attachment[$cur][0] = $path;
+    $this->attachment[$cur][1] = $filename;
+    $this->attachment[$cur][2] = $name;
+    $this->attachment[$cur][3] = $encoding;
+    $this->attachment[$cur][4] = $type;
+    $this->attachment[$cur][5] = false; // isStringAttachment
+    $this->attachment[$cur][6] = 'attachment';
+    $this->attachment[$cur][7] = 0;
+
+    return true;
+  }
+
+  /**
+   * Attaches all fs, string, and binary attachments to the message.
+   * Returns an empty string on failure.
+   * @access public
+   * @return string
+   */
+  public function AttachAll() {
+    /* Return text of body */
+    $mime = array();
+
+    /* Add all attachments */
+    for($i = 0; $i < count($this->attachment); $i++) {
+      /* Check for string attachment */
+      $bString = $this->attachment[$i][5];
+      if ($bString) {
+        $string = $this->attachment[$i][0];
+      } else {
+        $path = $this->attachment[$i][0];
+      }
+
+      $filename    = $this->attachment[$i][1];
+      $name        = $this->attachment[$i][2];
+      $encoding    = $this->attachment[$i][3];
+      $type        = $this->attachment[$i][4];
+      $disposition = $this->attachment[$i][6];
+      $cid         = $this->attachment[$i][7];
+
+      $mime[] = sprintf("--%s%s", $this->boundary[1], $this->LE);
+      $mime[] = sprintf("Content-Type: %s; name=\"%s\"%s", $type, $name, $this->LE);
+      $mime[] = sprintf("Content-Transfer-Encoding: %s%s", $encoding, $this->LE);
+
+      if($disposition == 'inline') {
+        $mime[] = sprintf("Content-ID: <%s>%s", $cid, $this->LE);
+      }
+
+      $mime[] = sprintf("Content-Disposition: %s; filename=\"%s\"%s", $disposition, $name, $this->LE.$this->LE);
+
+      /* Encode as string attachment */
+      if($bString) {
+        $mime[] = $this->EncodeString($string, $encoding);
+        if($this->IsError()) {
+          return '';
+        }
+        $mime[] = $this->LE.$this->LE;
+      } else {
+        $mime[] = $this->EncodeFile($path, $encoding);
+        if($this->IsError()) {
+          return '';
+        }
+        $mime[] = $this->LE.$this->LE;
+      }
+    }
+
+    $mime[] = sprintf("--%s--%s", $this->boundary[1], $this->LE);
+
+    return join('', $mime);
+  }
+
+  /**
+   * Encodes attachment in requested format.  Returns an
+   * empty string on failure.
+   * @access public
+   * @return string
+   */
+  public function EncodeFile ($path, $encoding = 'base64') {
+    if(!@$fd = fopen($path, 'rb')) {
+      $this->SetError($this->Lang('file_open') . $path);
+      return '';
+    }
+    $magic_quotes = get_magic_quotes_runtime();
+    set_magic_quotes_runtime(0);
+    $file_buffer = file_get_contents($path);
+    $file_buffer = $this->EncodeString($file_buffer, $encoding);
+    fclose($fd);
+    set_magic_quotes_runtime($magic_quotes);
+
+    return $file_buffer;
+  }
+
+  /**
+   * Encodes string to requested format. Returns an
+   * empty string on failure.
+   * @access public
+   * @return string
+   */
+  public function EncodeString ($str, $encoding = 'base64') {
+    $encoded = '';
+    switch(strtolower($encoding)) {
+      case 'base64':
+        $encoded = chunk_split(base64_encode($str), 76, $this->LE);
+        break;
+      case '7bit':
+      case '8bit':
+        $encoded = $this->FixEOL($str);
+        if (substr($encoded, -(strlen($this->LE))) != $this->LE)
+          $encoded .= $this->LE;
+        break;
+      case 'binary':
+        $encoded = $str;
+        break;
+      case 'quoted-printable':
+        $encoded = $this->EncodeQP($str);
+        break;
+      default:
+        $this->SetError($this->Lang('encoding') . $encoding);
+        break;
+    }
+    return $encoded;
+  }
+
+  /**
+   * Encode a header string to best of Q, B, quoted or none.
+   * @access public
+   * @return string
+   */
+  public function EncodeHeader ($str, $position = 'text') {
+    $x = 0;
+
+    switch (strtolower($position)) {
+      case 'phrase':
+        if (!preg_match('/[\200-\377]/', $str)) {
+          /* Can't use addslashes as we don't know what value has magic_quotes_sybase. */
+          $encoded = addcslashes($str, "\0..\37\177\\\"");
+          if (($str == $encoded) && !preg_match('/[^A-Za-z0-9!#$%&\'*+\/=?^_`{|}~ -]/', $str)) {
+            return ($encoded);
+          } else {
+            return ("\"$encoded\"");
+          }
+        }
+        $x = preg_match_all('/[^\040\041\043-\133\135-\176]/', $str, $matches);
+        break;
+      case 'comment':
+        $x = preg_match_all('/[()"]/', $str, $matches);
+        /* Fall-through */
+      case 'text':
+      default:
+        $x += preg_match_all('/[\000-\010\013\014\016-\037\177-\377]/', $str, $matches);
+        break;
+    }
+
+    if ($x == 0) {
+      return ($str);
+    }
+
+    $maxlen = 75 - 7 - strlen($this->CharSet);
+    /* Try to select the encoding which should produce the shortest output */
+    if (strlen($str)/3 < $x) {
+      $encoding = 'B';
+      if (function_exists('mb_strlen') && $this->HasMultiBytes($str)) {
+     // Use a custom function which correctly encodes and wraps long
+     // multibyte strings without breaking lines within a character
+        $encoded = $this->Base64EncodeWrapMB($str);
+      } else {
+        $encoded = base64_encode($str);
+        $maxlen -= $maxlen % 4;
+        $encoded = trim(chunk_split($encoded, $maxlen, "\n"));
+      }
+    } else {
+      $encoding = 'Q';
+      $encoded = $this->EncodeQ($str, $position);
+      $encoded = $this->WrapText($encoded, $maxlen, true);
+      $encoded = str_replace('='.$this->LE, "\n", trim($encoded));
+    }
+
+    $encoded = preg_replace('/^(.*)$/m', " =?".$this->CharSet."?$encoding?\\1?=", $encoded);
+    $encoded = trim(str_replace("\n", $this->LE, $encoded));
+
+    return $encoded;
+  }
+
+  /**
+   * Checks if a string contains multibyte characters.
+   * @access public
+   * @param string $str multi-byte text to wrap encode
+   * @return bool
+   */
+  public function HasMultiBytes($str) {
+    if (function_exists('mb_strlen')) {
+      return (strlen($str) > mb_strlen($str, $this->CharSet));
+    } else { // Assume no multibytes (we can't handle without mbstring functions anyway)
+      return False;
+    }
+  }
+
+  /**
+   * Correctly encodes and wraps long multibyte strings for mail headers
+   * without breaking lines within a character.
+   * Adapted from a function by paravoid at http://uk.php.net/manual/en/function.mb-encode-mimeheader.php
+   * @access public
+   * @param string $str multi-byte text to wrap encode
+   * @return string
+   */
+  public function Base64EncodeWrapMB($str) {
+    $start = "=?".$this->CharSet."?B?";
+    $end = "?=";
+    $encoded = "";
+
+    $mb_length = mb_strlen($str, $this->CharSet);
+    // Each line must have length <= 75, including $start and $end
+    $length = 75 - strlen($start) - strlen($end);
+    // Average multi-byte ratio
+    $ratio = $mb_length / strlen($str);
+    // Base64 has a 4:3 ratio
+    $offset = $avgLength = floor($length * $ratio * .75);
+
+    for ($i = 0; $i < $mb_length; $i += $offset) {
+      $lookBack = 0;
+
+      do {
+        $offset = $avgLength - $lookBack;
+        $chunk = mb_substr($str, $i, $offset, $this->CharSet);
+        $chunk = base64_encode($chunk);
+        $lookBack++;
+      }
+      while (strlen($chunk) > $length);
+
+      $encoded .= $chunk . $this->LE;
+    }
+
+    // Chomp the last linefeed
+    $encoded = substr($encoded, 0, -strlen($this->LE));
+    return $encoded;
+  }
+
+  /**
+  * Encode string to quoted-printable.
+  * @access public
+  * @param string $string the text to encode
+  * @param integer $line_max Number of chars allowed on a line before wrapping
+  * @return string
+  */
+  public function EncodeQP( $input = '', $line_max = 76, $space_conv = false ) {
+    $hex = array('0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F');
+    $lines = preg_split('/(?:\r\n|\r|\n)/', $input);
+    $eol = "\r\n";
+    $escape = '=';
+    $output = '';
+    while( list(, $line) = each($lines) ) {
+      $linlen = strlen($line);
+      $newline = '';
+      for($i = 0; $i < $linlen; $i++) {
+        $c = substr( $line, $i, 1 );
+        $dec = ord( $c );
+        if ( ( $i == 0 ) && ( $dec == 46 ) ) { // convert first point in the line into =2E
+          $c = '=2E';
+        }
+        if ( $dec == 32 ) {
+          if ( $i == ( $linlen - 1 ) ) { // convert space at eol only
+            $c = '=20';
+          } else if ( $space_conv ) {
+            $c = '=20';
+          }
+        } elseif ( ($dec == 61) || ($dec < 32 ) || ($dec > 126) ) { // always encode "\t", which is *not* required
+          $h2 = floor($dec/16);
+          $h1 = floor($dec%16);
+          $c = $escape.$hex[$h2].$hex[$h1];
+        }
+        if ( (strlen($newline) + strlen($c)) >= $line_max ) { // CRLF is not counted
+          $output .= $newline.$escape.$eol; //  soft line break; " =\r\n" is okay
+          $newline = '';
+          // check if newline first character will be point or not
+          if ( $dec == 46 ) {
+            $c = '=2E';
+          }
+        }
+        $newline .= $c;
+      } // end of for
+      $output .= $newline.$eol;
+    } // end of while
+    return trim($output);
+  }
+
+  /**
+   * Encode string to q encoding.
+   * @access public
+   * @return string
+   */
+  public function EncodeQ ($str, $position = 'text') {
+    /* There should not be any EOL in the string */
+    $encoded = preg_replace("[\r\n]", '', $str);
+
+    switch (strtolower($position)) {
+      case 'phrase':
+        $encoded = preg_replace("/([^A-Za-z0-9!*+\/ -])/e", "'='.sprintf('%02X', ord('\\1'))", $encoded);
+        break;
+      case 'comment':
+        $encoded = preg_replace("/([\(\)\"])/e", "'='.sprintf('%02X', ord('\\1'))", $encoded);
+      case 'text':
+      default:
+        /* Replace every high ascii, control =, ? and _ characters */
+        $encoded = preg_replace('/([\000-\011\013\014\016-\037\075\077\137\177-\377])/e',
+              "'='.sprintf('%02X', ord('\\1'))", $encoded);
+        break;
+    }
+
+    /* Replace every spaces to _ (more readable than =20) */
+    $encoded = str_replace(' ', '_', $encoded);
+
+    return $encoded;
+  }
+
+  /**
+   * Adds a string or binary attachment (non-filesystem) to the list.
+   * This method can be used to attach ascii or binary data,
+   * such as a BLOB record from a database.
+   * @param string $string String attachment data.
+   * @param string $filename Name of the attachment.
+   * @param string $encoding File encoding (see $Encoding).
+   * @param string $type File extension (MIME) type.
+   * @return void
+   */
+  public function AddStringAttachment($string, $filename, $encoding = 'base64', $type = 'application/octet-stream') {
+    /* Append to $attachment array */
+    $cur = count($this->attachment);
+    $this->attachment[$cur][0] = $string;
+    $this->attachment[$cur][1] = $filename;
+    $this->attachment[$cur][2] = $filename;
+    $this->attachment[$cur][3] = $encoding;
+    $this->attachment[$cur][4] = $type;
+    $this->attachment[$cur][5] = true; // isString
+    $this->attachment[$cur][6] = 'attachment';
+    $this->attachment[$cur][7] = 0;
+  }
+
+  /**
+   * Adds an embedded attachment.  This can include images, sounds, and
+   * just about any other document.  Make sure to set the $type to an
+   * image type.  For JPEG images use "image/jpeg" and for GIF images
+   * use "image/gif".
+   * @param string $path Path to the attachment.
+   * @param string $cid Content ID of the attachment.  Use this to identify
+   *        the Id for accessing the image in an HTML form.
+   * @param string $name Overrides the attachment name.
+   * @param string $encoding File encoding (see $Encoding).
+   * @param string $type File extension (MIME) type.
+   * @return bool
+   */
+  public function AddEmbeddedImage($path, $cid, $name = '', $encoding = 'base64', $type = 'application/octet-stream') {
+
+    if(!@is_file($path)) {
+      $this->SetError($this->Lang('file_access') . $path);
+      return false;
+    }
+
+    $filename = basename($path);
+    if($name == '') {
+      $name = $filename;
+    }
+
+    /* Append to $attachment array */
+    $cur = count($this->attachment);
+    $this->attachment[$cur][0] = $path;
+    $this->attachment[$cur][1] = $filename;
+    $this->attachment[$cur][2] = $name;
+    $this->attachment[$cur][3] = $encoding;
+    $this->attachment[$cur][4] = $type;
+    $this->attachment[$cur][5] = false;
+    $this->attachment[$cur][6] = 'inline';
+    $this->attachment[$cur][7] = $cid;
+
+    return true;
+  }
+
+  /**
+   * Returns true if an inline attachment is present.
+   * @access public
+   * @return bool
+   */
+  public function InlineImageExists() {
+    $result = false;
+    for($i = 0; $i < count($this->attachment); $i++) {
+      if($this->attachment[$i][6] == 'inline') {
+        $result = true;
+        break;
+      }
+    }
+
+    return $result;
+  }
+
+  /////////////////////////////////////////////////
+  // CLASS METHODS, MESSAGE RESET
+  /////////////////////////////////////////////////
+
+  /**
+   * Clears all recipients assigned in the TO array.  Returns void.
+   * @return void
+   */
+  public function ClearAddresses() {
+    $this->to = array();
+  }
+
+  /**
+   * Clears all recipients assigned in the CC array.  Returns void.
+   * @return void
+   */
+  public function ClearCCs() {
+    $this->cc = array();
+  }
+
+  /**
+   * Clears all recipients assigned in the BCC array.  Returns void.
+   * @return void
+   */
+  public function ClearBCCs() {
+    $this->bcc = array();
+  }
+
+  /**
+   * Clears all recipients assigned in the ReplyTo array.  Returns void.
+   * @return void
+   */
+  public function ClearReplyTos() {
+    $this->ReplyTo = array();
+  }
+
+  /**
+   * Clears all recipients assigned in the TO, CC and BCC
+   * array.  Returns void.
+   * @return void
+   */
+  public function ClearAllRecipients() {
+    $this->to = array();
+    $this->cc = array();
+    $this->bcc = array();
+  }
+
+  /**
+   * Clears all previously set filesystem, string, and binary
+   * attachments.  Returns void.
+   * @return void
+   */
+  public function ClearAttachments() {
+    $this->attachment = array();
+  }
+
+  /**
+   * Clears all custom headers.  Returns void.
+   * @return void
+   */
+  public function ClearCustomHeaders() {
+    $this->CustomHeader = array();
+  }
+
+  /////////////////////////////////////////////////
+  // CLASS METHODS, MISCELLANEOUS
+  /////////////////////////////////////////////////
+
+  /**
+   * Adds the error message to the error container.
+   * Returns void.
+   * @access private
+   * @return void
+   */
+  private function SetError($msg) {
+    $this->error_count++;
+    $this->ErrorInfo = $msg;
+  }
+
+  /**
+   * Returns the proper RFC 822 formatted date.
+   * @access private
+   * @return string
+   */
+  private static function RFCDate() {
+    $tz = date('Z');
+    $tzs = ($tz < 0) ? '-' : '+';
+    $tz = abs($tz);
+    $tz = (int)($tz/3600)*100 + ($tz%3600)/60;
+    $result = sprintf("%s %s%04d", date('D, j M Y H:i:s'), $tzs, $tz);
+
+    return $result;
+  }
+
+  /**
+   * Returns the server hostname or 'localhost.localdomain' if unknown.
+   * @access private
+   * @return string
+   */
+  private function ServerHostname() {
+    if (!empty($this->Hostname)) {
+      $result = $this->Hostname;
+    } elseif (isset($_SERVER['SERVER_NAME'])) {
+      $result = $_SERVER['SERVER_NAME'];
+    } else {
+      $result = "localhost.localdomain";
+    }
+
+    return $result;
+  }
+
+  /**
+   * Returns a message in the appropriate language.
+   * @access private
+   * @return string
+   */
+  private function Lang($key) {
+    if(count($this->language) < 1) {
+      $this->SetLanguage('en'); // set the default language
+    }
+
+    if(isset($this->language[$key])) {
+      return $this->language[$key];
+    } else {
+      return 'Language string failed to load: ' . $key;
+    }
+  }
+
+  /**
+   * Returns true if an error occurred.
+   * @access public
+   * @return bool
+   */
+  public function IsError() {
+    return ($this->error_count > 0);
+  }
+
+  /**
+   * Changes every end of line from CR or LF to CRLF.
+   * @access private
+   * @return string
+   */
+  private function FixEOL($str) {
+    $str = str_replace("\r\n", "\n", $str);
+    $str = str_replace("\r", "\n", $str);
+    $str = str_replace("\n", $this->LE, $str);
+    return $str;
+  }
+
+  /**
+   * Adds a custom header.
+   * @access public
+   * @return void
+   */
+  public function AddCustomHeader($custom_header) {
+    $this->CustomHeader[] = explode(':', $custom_header, 2);
+  }
+
+  /**
+   * Evaluates the message and returns modifications for inline images and backgrounds
+   * @access public
+   * @return $message
+   */
+  public function MsgHTML($message,$basedir='') {
+    preg_match_all("/(src|background)=\"(.*)\"/Ui", $message, $images);
+    if(isset($images[2])) {
+      foreach($images[2] as $i => $url) {
+        // do not change urls for absolute images (thanks to corvuscorax)
+        if (!preg_match('/^[A-z][A-z]*:\/\//',$url)) {
+          $filename = basename($url);
+          $directory = dirname($url);
+          ($directory == '.')?$directory='':'';
+          $cid = 'cid:' . md5($filename);
+          $fileParts = split("\.", $filename);
+          $ext = $fileParts[1];
+          $mimeType = $this->_mime_types($ext);
+          if ( strlen($basedir) > 1 && substr($basedir,-1) != '/') { $basedir .= '/'; }
+          if ( strlen($directory) > 1 && substr($basedir,-1) != '/') { $directory .= '/'; }
+          $this->AddEmbeddedImage($basedir.$directory.$filename, md5($filename), $filename, 'base64', $mimeType);
+          if ( $this->AddEmbeddedImage($basedir.$directory.$filename, md5($filename), $filename, 'base64',$mimeType) ) {
+            $message = preg_replace("/".$images[1][$i]."=\"".preg_quote($url, '/')."\"/Ui", $images[1][$i]."=\"".$cid."\"", $message);
+          }
+        }
+      }
+    }
+    $this->IsHTML(true);
+    $this->Body = $message;
+    $textMsg = trim(strip_tags(preg_replace('/<(head|title|style|script)[^>]*>.*?<\/\\1>/s','',$message)));
+    if ( !empty($textMsg) && empty($this->AltBody) ) {
+      $this->AltBody = $textMsg;
+    }
+    if ( empty($this->AltBody) ) {
+      $this->AltBody = 'To view this email message, open the email in with HTML compatibility!' . "\n\n";
+    }
+  }
+
+  /**
+   * Gets the mime type of the embedded or inline image
+   * @access public
+   * @return mime type of ext
+   */
+  public function _mime_types($ext = '') {
+    $mimes = array(
+      'hqx'   =>  'application/mac-binhex40',
+      'cpt'   =>  'application/mac-compactpro',
+      'doc'   =>  'application/msword',
+      'bin'   =>  'application/macbinary',
+      'dms'   =>  'application/octet-stream',
+      'lha'   =>  'application/octet-stream',
+      'lzh'   =>  'application/octet-stream',
+      'exe'   =>  'application/octet-stream',
+      'class' =>  'application/octet-stream',
+      'psd'   =>  'application/octet-stream',
+      'so'    =>  'application/octet-stream',
+      'sea'   =>  'application/octet-stream',
+      'dll'   =>  'application/octet-stream',
+      'oda'   =>  'application/oda',
+      'pdf'   =>  'application/pdf',
+      'ai'    =>  'application/postscript',
+      'eps'   =>  'application/postscript',
+      'ps'    =>  'application/postscript',
+      'smi'   =>  'application/smil',
+      'smil'  =>  'application/smil',
+      'mif'   =>  'application/vnd.mif',
+      'xls'   =>  'application/vnd.ms-excel',
+      'ppt'   =>  'application/vnd.ms-powerpoint',
+      'wbxml' =>  'application/vnd.wap.wbxml',
+      'wmlc'  =>  'application/vnd.wap.wmlc',
+      'dcr'   =>  'application/x-director',
+      'dir'   =>  'application/x-director',
+      'dxr'   =>  'application/x-director',
+      'dvi'   =>  'application/x-dvi',
+      'gtar'  =>  'application/x-gtar',
+      'php'   =>  'application/x-httpd-php',
+      'php4'  =>  'application/x-httpd-php',
+      'php3'  =>  'application/x-httpd-php',
+      'phtml' =>  'application/x-httpd-php',
+      'phps'  =>  'application/x-httpd-php-source',
+      'js'    =>  'application/x-javascript',
+      'swf'   =>  'application/x-shockwave-flash',
+      'sit'   =>  'application/x-stuffit',
+      'tar'   =>  'application/x-tar',
+      'tgz'   =>  'application/x-tar',
+      'xhtml' =>  'application/xhtml+xml',
+      'xht'   =>  'application/xhtml+xml',
+      'zip'   =>  'application/zip',
+      'mid'   =>  'audio/midi',
+      'midi'  =>  'audio/midi',
+      'mpga'  =>  'audio/mpeg',
+      'mp2'   =>  'audio/mpeg',
+      'mp3'   =>  'audio/mpeg',
+      'aif'   =>  'audio/x-aiff',
+      'aiff'  =>  'audio/x-aiff',
+      'aifc'  =>  'audio/x-aiff',
+      'ram'   =>  'audio/x-pn-realaudio',
+      'rm'    =>  'audio/x-pn-realaudio',
+      'rpm'   =>  'audio/x-pn-realaudio-plugin',
+      'ra'    =>  'audio/x-realaudio',
+      'rv'    =>  'video/vnd.rn-realvideo',
+      'wav'   =>  'audio/x-wav',
+      'bmp'   =>  'image/bmp',
+      'gif'   =>  'image/gif',
+      'jpeg'  =>  'image/jpeg',
+      'jpg'   =>  'image/jpeg',
+      'jpe'   =>  'image/jpeg',
+      'png'   =>  'image/png',
+      'tiff'  =>  'image/tiff',
+      'tif'   =>  'image/tiff',
+      'css'   =>  'text/css',
+      'html'  =>  'text/html',
+      'htm'   =>  'text/html',
+      'shtml' =>  'text/html',
+      'txt'   =>  'text/plain',
+      'text'  =>  'text/plain',
+      'log'   =>  'text/plain',
+      'rtx'   =>  'text/richtext',
+      'rtf'   =>  'text/rtf',
+      'xml'   =>  'text/xml',
+      'xsl'   =>  'text/xml',
+      'mpeg'  =>  'video/mpeg',
+      'mpg'   =>  'video/mpeg',
+      'mpe'   =>  'video/mpeg',
+      'qt'    =>  'video/quicktime',
+      'mov'   =>  'video/quicktime',
+      'avi'   =>  'video/x-msvideo',
+      'movie' =>  'video/x-sgi-movie',
+      'doc'   =>  'application/msword',
+      'word'  =>  'application/msword',
+      'xl'    =>  'application/excel',
+      'eml'   =>  'message/rfc822'
+    );
+    return ( ! isset($mimes[strtolower($ext)])) ? 'application/octet-stream' : $mimes[strtolower($ext)];
+  }
+
+  /**
+   * Set (or reset) Class Objects (variables)
+   *
+   * Usage Example:
+   * $page->set('X-Priority', '3');
+   *
+   * @access public
+   * @param string $name Parameter Name
+   * @param mixed $value Parameter Value
+   * NOTE: will not work with arrays, there are no arrays to set/reset
+   */
+  public function set ( $name, $value = '' ) {
+    if ( isset($this->$name) ) {
+      $this->$name = $value;
+    } else {
+      $this->SetError('Cannot set or reset variable ' . $name);
+      return false;
+    }
+  }
+
+  /**
+   * Read a file from a supplied filename and return it.
+   *
+   * @access public
+   * @param string $filename Parameter File Name
+   */
+  public function getFile($filename) {
+    $return = '';
+    if ($fp = fopen($filename, 'rb')) {
+      while (!feof($fp)) {
+        $return .= fread($fp, 1024);
+      }
+      fclose($fp);
+      return $return;
+    } else {
+      return false;
+    }
+  }
+
+  /**
+   * Strips newlines to prevent header injection.
+   * @access public
+   * @param string $str String
+   * @return string
+   */
+  public function SecureHeader($str) {
+    $str = trim($str);
+    $str = str_replace("\r", "", $str);
+    $str = str_replace("\n", "", $str);
+    return $str;
+  }
+
+  /**
+   * Set the private key file and password to sign the message.
+   *
+   * @access public
+   * @param string $key_filename Parameter File Name
+   * @param string $key_pass Password for private key
+   */
+  public function Sign($key_filename, $key_pass) {
+    $this->sign_key_file = $key_filename;
+    $this->sign_key_pass = $key_pass;
+  }
+
+}
+
+?>
diff --git a/inc/classes/third_party/php_mailer/class.pop3.php b/inc/classes/third_party/php_mailer/class.pop3.php
new file mode 100644 (file)
index 0000000..cac5dfe
--- /dev/null
@@ -0,0 +1,393 @@
+<?php
+/*~ class.pop3.php
+.---------------------------------------------------------------------------.
+|  Software: PHPMailer - PHP email class                                    |
+|   Version: 2.1                                                            |
+|   Contact: via sourceforge.net support pages (also www.codeworxtech.com)  |
+|      Info: http://phpmailer.sourceforge.net                               |
+|   Support: http://sourceforge.net/projects/phpmailer/                     |
+| ------------------------------------------------------------------------- |
+|    Author: Andy Prevost (project admininistrator)                         |
+|    Author: Brent R. Matzelle (original founder)                           |
+| Copyright (c) 2004-2007, Andy Prevost. All Rights Reserved.               |
+| Copyright (c) 2001-2003, Brent R. Matzelle                                |
+| ------------------------------------------------------------------------- |
+|   License: Distributed under the Lesser General Public License (LGPL)     |
+|            http://www.gnu.org/copyleft/lesser.html                        |
+| This program is distributed in the hope that it will be useful - WITHOUT  |
+| ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or     |
+| FITNESS FOR A PARTICULAR PURPOSE.                                         |
+| ------------------------------------------------------------------------- |
+| We offer a number of paid services (www.codeworxtech.com):                |
+| - Web Hosting on highly optimized fast and secure servers                 |
+| - Technology Consulting                                                   |
+| - Oursourcing (highly qualified programmers and graphic designers)        |
+'---------------------------------------------------------------------------'
+
+/**
+ * POP Before SMTP Authentication Class
+ * Version 2.1
+ *
+ * Author: Richard Davey (rich@corephp.co.uk)
+ * Modifications: Andy Prevost
+ * License: LGPL, see PHPMailer License
+ *
+ * Specifically for PHPMailer to allow POP before SMTP authentication.
+ * Does not yet work with APOP - if you have an APOP account, contact me
+ * and we can test changes to this script.
+ *
+ * This class is based on the structure of the SMTP class by Chris Ryan
+ *
+ * This class is rfc 1939 compliant and implements all the commands
+ * required for POP3 connection, authentication and disconnection.
+ *
+ * @package PHPMailer
+ * @author Richard Davey
+ */
+
+class POP3 {
+  /**
+   * Default POP3 port
+   * @var int
+   */
+  public $POP3_PORT = 110;
+
+  /**
+   * Default Timeout
+   * @var int
+   */
+  public $POP3_TIMEOUT = 30;
+
+  /**
+   * POP3 Carriage Return + Line Feed
+   * @var string
+   */
+  public $CRLF = "\r\n";
+
+  /**
+   * Displaying Debug warnings? (0 = now, 1+ = yes)
+   * @var int
+   */
+  public $do_debug = 2;
+
+  /**
+   * POP3 Mail Server
+   * @var string
+   */
+  public $host;
+
+  /**
+   * POP3 Port
+   * @var int
+   */
+  public $port;
+
+  /**
+   * POP3 Timeout Value
+   * @var int
+   */
+  public $tval;
+
+  /**
+   * POP3 Username
+   * @var string
+   */
+  public $username;
+
+  /**
+   * POP3 Password
+   * @var string
+   */
+  public $password;
+
+  /**#@+
+   * @access private
+   */
+  private $pop_conn;
+  private $connected;
+  private $error;     //  Error log array
+  /**#@-*/
+
+  /**
+   * Constructor, sets the initial values
+   * @access public
+   * @return POP3
+   */
+  public function __construct() {
+    $this->pop_conn  = 0;
+    $this->connected = false;
+    $this->error     = null;
+  }
+
+  /**
+   * Combination of public events - connect, login, disconnect
+   * @access public
+   * @param string $host
+   * @param integer $port
+   * @param integer $tval
+   * @param string $username
+   * @param string $password
+   */
+  public function Authorise ($host, $port = false, $tval = false, $username, $password, $debug_level = 0) {
+    $this->host = $host;
+
+    //  If no port value is passed, retrieve it
+    if ($port == false) {
+      $this->port = $this->POP3_PORT;
+    } else {
+      $this->port = $port;
+    }
+
+    //  If no port value is passed, retrieve it
+    if ($tval == false) {
+      $this->tval = $this->POP3_TIMEOUT;
+    } else {
+      $this->tval = $tval;
+    }
+
+    $this->do_debug = $debug_level;
+    $this->username = $username;
+    $this->password = $password;
+
+    //  Refresh the error log
+    $this->error = null;
+
+    //  Connect
+    $result = $this->Connect($this->host, $this->port, $this->tval);
+
+    if ($result) {
+      $login_result = $this->Login($this->username, $this->password);
+
+      if ($login_result) {
+        $this->Disconnect();
+
+        return true;
+      }
+
+    }
+
+    //  We need to disconnect regardless if the login succeeded
+    $this->Disconnect();
+
+    return false;
+  }
+
+  /**
+   * Connect to the POP3 server
+   * @access public
+   * @param string $host
+   * @param integer $port
+   * @param integer $tval
+   * @return boolean
+   */
+  public function Connect ($host, $port = false, $tval = 30) {
+    //  Are we already connected?
+    if ($this->connected) {
+      return true;
+    }
+
+    /*
+    On Windows this will raise a PHP Warning error if the hostname doesn't exist.
+    Rather than supress it with @fsockopen, let's capture it cleanly instead
+    */
+
+    set_error_handler(array(&$this, 'catchWarning'));
+
+    //  Connect to the POP3 server
+    $this->pop_conn = fsockopen($host,    //  POP3 Host
+                  $port,    //  Port #
+                  $errno,   //  Error Number
+                  $errstr,  //  Error Message
+                  $tval);   //  Timeout (seconds)
+
+    //  Restore the error handler
+    restore_error_handler();
+
+    //  Does the Error Log now contain anything?
+    if ($this->error && $this->do_debug >= 1) {
+      $this->displayErrors();
+    }
+
+    //  Did we connect?
+    if ($this->pop_conn == false) {
+      //  It would appear not...
+      $this->error = array(
+        'error' => "Failed to connect to server $host on port $port",
+        'errno' => $errno,
+        'errstr' => $errstr
+      );
+
+      if ($this->do_debug >= 1) {
+        $this->displayErrors();
+      }
+
+      return false;
+    }
+
+    //  Increase the stream time-out
+
+    //  Check for PHP 4.3.0 or later
+    if (version_compare(phpversion(), '4.3.0', 'ge')) {
+      stream_set_timeout($this->pop_conn, $tval, 0);
+    } else {
+      //  Does not work on Windows
+      if (substr(PHP_OS, 0, 3) !== 'WIN') {
+        socket_set_timeout($this->pop_conn, $tval, 0);
+      }
+    }
+
+    //  Get the POP3 server response
+    $pop3_response = $this->getResponse();
+
+    //  Check for the +OK
+    if ($this->checkResponse($pop3_response)) {
+    //  The connection is established and the POP3 server is talking
+    $this->connected = true;
+      return true;
+    }
+
+  }
+
+  /**
+   * Login to the POP3 server (does not support APOP yet)
+   * @access public
+   * @param string $username
+   * @param string $password
+   * @return boolean
+   */
+  public function Login ($username = '', $password = '') {
+    if ($this->connected == false) {
+      $this->error = 'Not connected to POP3 server';
+
+      if ($this->do_debug >= 1) {
+        $this->displayErrors();
+      }
+    }
+
+    if (empty($username)) {
+      $username = $this->username;
+    }
+
+    if (empty($password)) {
+      $password = $this->password;
+    }
+
+    $pop_username = "USER $username" . $this->CRLF;
+    $pop_password = "PASS $password" . $this->CRLF;
+
+    //  Send the Username
+    $this->sendString($pop_username);
+    $pop3_response = $this->getResponse();
+
+    if ($this->checkResponse($pop3_response)) {
+      //  Send the Password
+      $this->sendString($pop_password);
+      $pop3_response = $this->getResponse();
+
+      if ($this->checkResponse($pop3_response)) {
+        return true;
+      } else {
+        return false;
+      }
+    } else {
+      return false;
+    }
+  }
+
+  /**
+   * Disconnect from the POP3 server
+   * @access public
+   */
+  public function Disconnect () {
+    $this->sendString('QUIT');
+
+    fclose($this->pop_conn);
+  }
+
+  /////////////////////////////////////////////////
+  //  Private Methods
+  /////////////////////////////////////////////////
+
+  /**
+   * Get the socket response back.
+   * $size is the maximum number of bytes to retrieve
+   * @access private
+   * @param integer $size
+   * @return string
+   */
+  private public function getResponse ($size = 128) {
+    $pop3_response = fgets($this->pop_conn, $size);
+
+    return $pop3_response;
+  }
+
+  /**
+   * Send a string down the open socket connection to the POP3 server
+   * @access private
+   * @param string $string
+   * @return integer
+   */
+  private function sendString ($string) {
+    $bytes_sent = fwrite($this->pop_conn, $string, strlen($string));
+
+    return $bytes_sent;
+  }
+
+  /**
+   * Checks the POP3 server response for +OK or -ERR
+   * @access private
+   * @param string $string
+   * @return boolean
+   */
+  private function checkResponse ($string) {
+    if (substr($string, 0, 3) !== '+OK') {
+      $this->error = array(
+        'error' => "Server reported an error: $string",
+        'errno' => 0,
+        'errstr' => ''
+      );
+
+      if ($this->do_debug >= 1) {
+        $this->displayErrors();
+      }
+
+      return false;
+    } else {
+      return true;
+    }
+
+  }
+
+  /**
+   * If debug is enabled, display the error message array
+   * @access private
+   */
+  private function displayErrors () {
+    echo '<pre>';
+
+    foreach ($this->error as $single_error) {
+      print_r($single_error);
+    }
+
+    echo '</pre>';
+  }
+
+  /**
+   * Takes over from PHP for the socket warning handler
+   * @access private
+   * @param integer $errno
+   * @param string $errstr
+   * @param string $errfile
+   * @param integer $errline
+   */
+  private function catchWarning ($errno, $errstr, $errfile, $errline) {
+    $this->error[] = array(
+      'error' => "Connecting to the POP3 server raised a PHP warning: ",
+      'errno' => $errno,
+      'errstr' => $errstr
+    );
+  }
+
+  //  End of class
+}
+?>
diff --git a/inc/classes/third_party/php_mailer/class.smtp.php b/inc/classes/third_party/php_mailer/class.smtp.php
new file mode 100644 (file)
index 0000000..b2f0f3c
--- /dev/null
@@ -0,0 +1,1113 @@
+<?php
+/*~ class.smtp.php
+.---------------------------------------------------------------------------.
+|  Software: PHPMailer - PHP email class                                    |
+|   Version: 2.1                                                            |
+|   Contact: via sourceforge.net support pages (also www.codeworxtech.com)  |
+|      Info: http://phpmailer.sourceforge.net                               |
+|   Support: http://sourceforge.net/projects/phpmailer/                     |
+| ------------------------------------------------------------------------- |
+|    Author: Andy Prevost (project admininistrator)                         |
+|    Author: Brent R. Matzelle (original founder)                           |
+| Copyright (c) 2004-2007, Andy Prevost. All Rights Reserved.               |
+| Copyright (c) 2001-2003, Brent R. Matzelle                                |
+| ------------------------------------------------------------------------- |
+|   License: Distributed under the Lesser General Public License (LGPL)     |
+|            http://www.gnu.org/copyleft/lesser.html                        |
+| This program is distributed in the hope that it will be useful - WITHOUT  |
+| ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or     |
+| FITNESS FOR A PARTICULAR PURPOSE.                                         |
+| ------------------------------------------------------------------------- |
+| We offer a number of paid services (www.codeworxtech.com):                |
+| - Web Hosting on highly optimized fast and secure servers                 |
+| - Technology Consulting                                                   |
+| - Oursourcing (highly qualified programmers and graphic designers)        |
+'---------------------------------------------------------------------------'
+
+/**
+ * SMTP is rfc 821 compliant and implements all the rfc 821 SMTP
+ * commands except TURN which will always return a not implemented
+ * error. SMTP also provides some utility methods for sending mail
+ * to an SMTP server.
+ * @package PHPMailer
+ * @author Chris Ryan
+ */
+
+class SMTP {
+  /**
+   *  SMTP server port
+   *  @var int
+   */
+  public $SMTP_PORT = 25;
+
+  /**
+   *  SMTP reply line ending
+   *  @var string
+   */
+  public $CRLF = "\r\n";
+
+  /**
+   *  Sets whether debugging is turned on
+   *  @var bool
+   */
+  public $do_debug;       // the level of debug to perform
+
+  /**
+   *  Sets VERP use on/off (default is off)
+   *  @var bool
+   */
+  public $do_verp = false;
+
+  /**#@+
+   * @access private
+   */
+  private $smtp_conn;      // the socket to the server
+  private $error;          // error if any on the last call
+  private $helo_rply;      // the reply the server sent to us for HELO
+  /**#@-*/
+
+  /**
+   * Initialize the class so that the data is in a known state.
+   * @access public
+   * @return void
+   */
+  public function __construct() {
+    $this->smtp_conn = 0;
+    $this->error = null;
+    $this->helo_rply = null;
+
+    $this->do_debug = 0;
+  }
+
+  /*************************************************************
+   *                    CONNECTION FUNCTIONS                  *
+   ***********************************************************/
+
+  /**
+   * Connect to the server specified on the port specified.
+   * If the port is not specified use the default SMTP_PORT.
+   * If tval is specified then a connection will try and be
+   * established with the server for that number of seconds.
+   * If tval is not specified the default is 30 seconds to
+   * try on the connection.
+   *
+   * SMTP CODE SUCCESS: 220
+   * SMTP CODE FAILURE: 421
+   * @access public
+   * @return bool
+   */
+  public function Connect($host,$port=0,$tval=30) {
+    /* set the error val to null so there is no confusion */
+    $this->error = null;
+
+    /* make sure we are __not__ connected */
+    if($this->connected()) {
+      /* ok we are connected! what should we do?
+       * for now we will just give an error saying we
+       * are already connected
+       */
+      $this->error = array("error" => "Already connected to a server");
+      return false;
+    }
+
+    if(empty($port)) {
+      $port = $this->SMTP_PORT;
+    }
+
+    /* connect to the smtp server */
+    $this->smtp_conn = fsockopen($host,    // the host of the server
+                                 $port,    // the port to use
+                                 $errno,   // error number if any
+                                 $errstr,  // error message if any
+                                 $tval);   // give up after ? secs
+    /* verify we connected properly */
+    if(empty($this->smtp_conn)) {
+      $this->error = array("error" => "Failed to connect to server",
+                           "errno" => $errno,
+                           "errstr" => $errstr);
+      if($this->do_debug >= 1) {
+        echo "SMTP -> ERROR: " . $this->error["error"] .
+                 ": $errstr ($errno)" . $this->CRLF;
+      }
+      return false;
+    }
+
+    /* sometimes the SMTP server takes a little longer to respond
+     * so we will give it a longer timeout for the first read
+     * - Windows still does not have support for this timeout function
+     */
+    if(substr(PHP_OS, 0, 3) != "WIN")
+     socket_set_timeout($this->smtp_conn, $tval, 0);
+
+    /* get any announcement stuff */
+    $announce = $this->get_lines();
+
+    /* set the timeout  of any socket functions at 1/10 of a second */
+    //if(function_exists("socket_set_timeout"))
+    //   socket_set_timeout($this->smtp_conn, 0, 100000);
+
+    if($this->do_debug >= 2) {
+      echo "SMTP -> FROM SERVER:" . $this->CRLF . $announce;
+    }
+
+    return true;
+  }
+
+  /**
+   * Initiate a TSL communication with the server.
+   *
+   * SMTP CODE 220 Ready to start TLS
+   * SMTP CODE 501 Syntax error (no parameters allowed)
+   * SMTP CODE 454 TLS not available due to temporary reason
+   * @access public
+   * @return bool success
+   */
+  public function StartTLS() {
+    $this->error = null; # to avoid confusion
+
+    if(!$this->connected()) {
+      $this->error = array("error" => "Called StartTLS() without being connected");
+      return false;
+    }
+
+    fputs($this->smtp_conn,"STARTTLS" . $extra . $this->CRLF);
+
+    $rply = $this->get_lines();
+    $code = substr($rply,0,3);
+
+    if($this->do_debug >= 2) {
+      echo "SMTP -> FROM SERVER:" . $this->CRLF . $rply;
+    }
+
+    if($code != 220) {
+      $this->error =
+         array("error"     => "STARTTLS not accepted from server",
+               "smtp_code" => $code,
+               "smtp_msg"  => substr($rply,4));
+      if($this->do_debug >= 1) {
+        echo "SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF;
+      }
+      return false;
+    }
+
+    //Begin encrypted connection
+    if(!stream_socket_enable_crypto($this->smtp_conn, true, STREAM_CRYPTO_METHOD_TLS_CLIENT)) {
+      return false;
+    }
+
+    return true;
+  }
+
+  /**
+   * Performs SMTP authentication.  Must be run after running the
+   * Hello() method.  Returns true if successfully authenticated.
+   * @access public
+   * @return bool
+   */
+  public function Authenticate($username, $password) {
+    // Start authentication
+    fputs($this->smtp_conn,"AUTH LOGIN" . $this->CRLF);
+
+    $rply = $this->get_lines();
+    $code = substr($rply,0,3);
+
+    if($code != 334) {
+      $this->error =
+        array("error" => "AUTH not accepted from server",
+              "smtp_code" => $code,
+              "smtp_msg" => substr($rply,4));
+      if($this->do_debug >= 1) {
+        echo "SMTP -> ERROR: " . $this->error["error"] .
+                 ": " . $rply . $this->CRLF;
+      }
+      return false;
+    }
+
+    // Send encoded username
+    fputs($this->smtp_conn, base64_encode($username) . $this->CRLF);
+
+    $rply = $this->get_lines();
+    $code = substr($rply,0,3);
+
+    if($code != 334) {
+      $this->error =
+        array("error" => "Username not accepted from server",
+              "smtp_code" => $code,
+              "smtp_msg" => substr($rply,4));
+      if($this->do_debug >= 1) {
+        echo "SMTP -> ERROR: " . $this->error["error"] .
+                 ": " . $rply . $this->CRLF;
+      }
+      return false;
+    }
+
+    // Send encoded password
+    fputs($this->smtp_conn, base64_encode($password) . $this->CRLF);
+
+    $rply = $this->get_lines();
+    $code = substr($rply,0,3);
+
+    if($code != 235) {
+      $this->error =
+        array("error" => "Password not accepted from server",
+              "smtp_code" => $code,
+              "smtp_msg" => substr($rply,4));
+      if($this->do_debug >= 1) {
+        echo "SMTP -> ERROR: " . $this->error["error"] .
+                 ": " . $rply . $this->CRLF;
+      }
+      return false;
+    }
+
+    return true;
+  }
+
+  /**
+   * Returns true if connected to a server otherwise false
+   * @access public
+   * @return bool
+   */
+  public function Connected() {
+    if(!empty($this->smtp_conn)) {
+      $sock_status = socket_get_status($this->smtp_conn);
+      if($sock_status["eof"]) {
+        // hmm this is an odd situation... the socket is
+        // valid but we are not connected anymore
+        if($this->do_debug >= 1) {
+            echo "SMTP -> NOTICE:" . $this->CRLF .
+                 "EOF caught while checking if connected";
+        }
+        $this->Close();
+        return false;
+      }
+      return true; // everything looks good
+    }
+    return false;
+  }
+
+  /**
+   * Closes the socket and cleans up the state of the class.
+   * It is not considered good to use this function without
+   * first trying to use QUIT.
+   * @access public
+   * @return void
+   */
+  public function Close() {
+    $this->error = null; // so there is no confusion
+    $this->helo_rply = null;
+    if(!empty($this->smtp_conn)) {
+      // close the connection and cleanup
+      fclose($this->smtp_conn);
+      $this->smtp_conn = 0;
+    }
+  }
+
+  /***************************************************************
+   *                        SMTP COMMANDS                       *
+   *************************************************************/
+
+  /**
+   * Issues a data command and sends the msg_data to the server
+   * finializing the mail transaction. $msg_data is the message
+   * that is to be send with the headers. Each header needs to be
+   * on a single line followed by a <CRLF> with the message headers
+   * and the message body being seperated by and additional <CRLF>.
+   *
+   * Implements rfc 821: DATA <CRLF>
+   *
+   * SMTP CODE INTERMEDIATE: 354
+   *     [data]
+   *     <CRLF>.<CRLF>
+   *     SMTP CODE SUCCESS: 250
+   *     SMTP CODE FAILURE: 552,554,451,452
+   * SMTP CODE FAILURE: 451,554
+   * SMTP CODE ERROR  : 500,501,503,421
+   * @access public
+   * @return bool
+   */
+  public function Data($msg_data) {
+    $this->error = null; // so no confusion is caused
+
+    if(!$this->connected()) {
+      $this->error = array(
+              "error" => "Called Data() without being connected");
+      return false;
+    }
+
+    fputs($this->smtp_conn,"DATA" . $this->CRLF);
+
+    $rply = $this->get_lines();
+    $code = substr($rply,0,3);
+
+    if($this->do_debug >= 2) {
+      echo "SMTP -> FROM SERVER:" . $this->CRLF . $rply;
+    }
+
+    if($code != 354) {
+      $this->error =
+        array("error" => "DATA command not accepted from server",
+              "smtp_code" => $code,
+              "smtp_msg" => substr($rply,4));
+      if($this->do_debug >= 1) {
+        echo "SMTP -> ERROR: " . $this->error["error"] .
+                 ": " . $rply . $this->CRLF;
+      }
+      return false;
+    }
+
+    /* the server is ready to accept data!
+     * according to rfc 821 we should not send more than 1000
+     * including the CRLF
+     * characters on a single line so we will break the data up
+     * into lines by \r and/or \n then if needed we will break
+     * each of those into smaller lines to fit within the limit.
+     * in addition we will be looking for lines that start with
+     * a period '.' and append and additional period '.' to that
+     * line. NOTE: this does not count towards are limit.
+     */
+
+    // normalize the line breaks so we know the explode works
+    $msg_data = str_replace("\r\n","\n",$msg_data);
+    $msg_data = str_replace("\r","\n",$msg_data);
+    $lines = explode("\n",$msg_data);
+
+    /* we need to find a good way to determine is headers are
+     * in the msg_data or if it is a straight msg body
+     * currently I am assuming rfc 822 definitions of msg headers
+     * and if the first field of the first line (':' sperated)
+     * does not contain a space then it _should_ be a header
+     * and we can process all lines before a blank "" line as
+     * headers.
+     */
+    $field = substr($lines[0],0,strpos($lines[0],":"));
+    $in_headers = false;
+    if(!empty($field) && !strstr($field," ")) {
+      $in_headers = true;
+    }
+
+    $max_line_length = 998; // used below; set here for ease in change
+
+    while(list(,$line) = @each($lines)) {
+      $lines_out = null;
+      if($line == "" && $in_headers) {
+        $in_headers = false;
+      }
+      // ok we need to break this line up into several smaller lines
+      while(strlen($line) > $max_line_length) {
+        $pos = strrpos(substr($line,0,$max_line_length)," ");
+
+        // Patch to fix DOS attack
+        if(!$pos) {
+          $pos = $max_line_length - 1;
+          $lines_out[] = substr($line,0,$pos);
+          $line = substr($line,$pos);
+        } else {
+          $lines_out[] = substr($line,0,$pos);
+          $line = substr($line,$pos + 1);
+        }
+
+        /* if we are processing headers we need to
+         * add a LWSP-char to the front of the new line
+         * rfc 822 on long msg headers
+         */
+        if($in_headers) {
+          $line = "\t" . $line;
+        }
+      }
+      $lines_out[] = $line;
+
+      // now send the lines to the server
+      while(list(,$line_out) = @each($lines_out)) {
+        if(strlen($line_out) > 0)
+        {
+          if(substr($line_out, 0, 1) == ".") {
+            $line_out = "." . $line_out;
+          }
+        }
+        fputs($this->smtp_conn,$line_out . $this->CRLF);
+      }
+    }
+
+    // ok all the message data has been sent so lets get this
+    // over with aleady
+    fputs($this->smtp_conn, $this->CRLF . "." . $this->CRLF);
+
+    $rply = $this->get_lines();
+    $code = substr($rply,0,3);
+
+    if($this->do_debug >= 2) {
+      echo "SMTP -> FROM SERVER:" . $this->CRLF . $rply;
+    }
+
+    if($code != 250) {
+      $this->error =
+        array("error" => "DATA not accepted from server",
+              "smtp_code" => $code,
+              "smtp_msg" => substr($rply,4));
+      if($this->do_debug >= 1) {
+        echo "SMTP -> ERROR: " . $this->error["error"] .
+                 ": " . $rply . $this->CRLF;
+      }
+      return false;
+    }
+    return true;
+  }
+
+  /**
+   * Expand takes the name and asks the server to list all the
+   * people who are members of the _list_. Expand will return
+   * back and array of the result or false if an error occurs.
+   * Each value in the array returned has the format of:
+   *     [ <full-name> <sp> ] <path>
+   * The definition of <path> is defined in rfc 821
+   *
+   * Implements rfc 821: EXPN <SP> <string> <CRLF>
+   *
+   * SMTP CODE SUCCESS: 250
+   * SMTP CODE FAILURE: 550
+   * SMTP CODE ERROR  : 500,501,502,504,421
+   * @access public
+   * @return string array
+   */
+  public function Expand($name) {
+    $this->error = null; // so no confusion is caused
+
+    if(!$this->connected()) {
+      $this->error = array(
+            "error" => "Called Expand() without being connected");
+      return false;
+    }
+
+    fputs($this->smtp_conn,"EXPN " . $name . $this->CRLF);
+
+    $rply = $this->get_lines();
+    $code = substr($rply,0,3);
+
+    if($this->do_debug >= 2) {
+      echo "SMTP -> FROM SERVER:" . $this->CRLF . $rply;
+    }
+
+    if($code != 250) {
+      $this->error =
+        array("error" => "EXPN not accepted from server",
+              "smtp_code" => $code,
+              "smtp_msg" => substr($rply,4));
+      if($this->do_debug >= 1) {
+        echo "SMTP -> ERROR: " . $this->error["error"] .
+                 ": " . $rply . $this->CRLF;
+      }
+      return false;
+    }
+
+    // parse the reply and place in our array to return to user
+    $entries = explode($this->CRLF,$rply);
+    while(list(,$l) = @each($entries)) {
+      $list[] = substr($l,4);
+    }
+
+    return $list;
+  }
+
+  /**
+   * Sends the HELO command to the smtp server.
+   * This makes sure that we and the server are in
+   * the same known state.
+   *
+   * Implements from rfc 821: HELO <SP> <domain> <CRLF>
+   *
+   * SMTP CODE SUCCESS: 250
+   * SMTP CODE ERROR  : 500, 501, 504, 421
+   * @access public
+   * @return bool
+   */
+  public function Hello($host="") {
+    $this->error = null; // so no confusion is caused
+
+    if(!$this->connected()) {
+      $this->error = array(
+            "error" => "Called Hello() without being connected");
+      return false;
+    }
+
+    // if a hostname for the HELO was not specified determine
+    //a suitable one to send
+    if(empty($host)) {
+      // we need to determine some sort of appopiate default
+      // to send to the server
+      $host = "localhost";
+    }
+
+    // Send extended hello first (RFC 2821)
+    if(!$this->SendHello("EHLO", $host))
+    {
+      if(!$this->SendHello("HELO", $host))
+          return false;
+    }
+
+    return true;
+  }
+
+  /**
+   * Sends a HELO/EHLO command.
+   * @access private
+   * @return bool
+   */
+  private function SendHello($hello, $host) {
+    fputs($this->smtp_conn, $hello . " " . $host . $this->CRLF);
+
+    $rply = $this->get_lines();
+    $code = substr($rply,0,3);
+
+    if($this->do_debug >= 2) {
+      echo "SMTP -> FROM SERVER: " . $this->CRLF . $rply;
+    }
+
+    if($code != 250) {
+      $this->error =
+        array("error" => $hello . " not accepted from server",
+              "smtp_code" => $code,
+              "smtp_msg" => substr($rply,4));
+      if($this->do_debug >= 1) {
+        echo "SMTP -> ERROR: " . $this->error["error"] .
+                 ": " . $rply . $this->CRLF;
+      }
+      return false;
+    }
+
+    $this->helo_rply = $rply;
+
+    return true;
+  }
+
+  /**
+   * Gets help information on the keyword specified. If the keyword
+   * is not specified then returns generic help, ussually contianing
+   * A list of keywords that help is available on. This function
+   * returns the results back to the user. It is up to the user to
+   * handle the returned data. If an error occurs then false is
+   * returned with $this->error set appropiately.
+   *
+   * Implements rfc 821: HELP [ <SP> <string> ] <CRLF>
+   *
+   * SMTP CODE SUCCESS: 211,214
+   * SMTP CODE ERROR  : 500,501,502,504,421
+   * @access public
+   * @return string
+   */
+  public function Help($keyword="") {
+    $this->error = null; // to avoid confusion
+
+    if(!$this->connected()) {
+      $this->error = array(
+              "error" => "Called Help() without being connected");
+      return false;
+    }
+
+    $extra = "";
+    if(!empty($keyword)) {
+      $extra = " " . $keyword;
+    }
+
+    fputs($this->smtp_conn,"HELP" . $extra . $this->CRLF);
+
+    $rply = $this->get_lines();
+    $code = substr($rply,0,3);
+
+    if($this->do_debug >= 2) {
+      echo "SMTP -> FROM SERVER:" . $this->CRLF . $rply;
+    }
+
+    if($code != 211 && $code != 214) {
+      $this->error =
+        array("error" => "HELP not accepted from server",
+              "smtp_code" => $code,
+              "smtp_msg" => substr($rply,4));
+      if($this->do_debug >= 1) {
+        echo "SMTP -> ERROR: " . $this->error["error"] .
+                 ": " . $rply . $this->CRLF;
+      }
+      return false;
+    }
+
+    return $rply;
+  }
+
+  /**
+   * Starts a mail transaction from the email address specified in
+   * $from. Returns true if successful or false otherwise. If True
+   * the mail transaction is started and then one or more Recipient
+   * commands may be called followed by a Data command.
+   *
+   * Implements rfc 821: MAIL <SP> FROM:<reverse-path> <CRLF>
+   *
+   * SMTP CODE SUCCESS: 250
+   * SMTP CODE SUCCESS: 552,451,452
+   * SMTP CODE SUCCESS: 500,501,421
+   * @access public
+   * @return bool
+   */
+  public function Mail($from) {
+    $this->error = null; // so no confusion is caused
+
+    if(!$this->connected()) {
+      $this->error = array(
+              "error" => "Called Mail() without being connected");
+      return false;
+    }
+
+    $useVerp = ($this->do_verp ? "XVERP" : "");
+    fputs($this->smtp_conn,"MAIL FROM:<" . $from . ">" . $useVerp . $this->CRLF);
+
+    $rply = $this->get_lines();
+    $code = substr($rply,0,3);
+
+    if($this->do_debug >= 2) {
+      echo "SMTP -> FROM SERVER:" . $this->CRLF . $rply;
+    }
+
+    if($code != 250) {
+      $this->error =
+        array("error" => "MAIL not accepted from server",
+              "smtp_code" => $code,
+              "smtp_msg" => substr($rply,4));
+      if($this->do_debug >= 1) {
+        echo "SMTP -> ERROR: " . $this->error["error"] .
+                 ": " . $rply . $this->CRLF;
+      }
+      return false;
+    }
+    return true;
+  }
+
+  /**
+   * Sends the command NOOP to the SMTP server.
+   *
+   * Implements from rfc 821: NOOP <CRLF>
+   *
+   * SMTP CODE SUCCESS: 250
+   * SMTP CODE ERROR  : 500, 421
+   * @access public
+   * @return bool
+   */
+  public function Noop() {
+    $this->error = null; // so no confusion is caused
+
+    if(!$this->connected()) {
+      $this->error = array(
+              "error" => "Called Noop() without being connected");
+      return false;
+    }
+
+    fputs($this->smtp_conn,"NOOP" . $this->CRLF);
+
+    $rply = $this->get_lines();
+    $code = substr($rply,0,3);
+
+    if($this->do_debug >= 2) {
+      echo "SMTP -> FROM SERVER:" . $this->CRLF . $rply;
+    }
+
+    if($code != 250) {
+      $this->error =
+        array("error" => "NOOP not accepted from server",
+              "smtp_code" => $code,
+              "smtp_msg" => substr($rply,4));
+      if($this->do_debug >= 1) {
+        echo "SMTP -> ERROR: " . $this->error["error"] .
+                 ": " . $rply . $this->CRLF;
+      }
+      return false;
+    }
+    return true;
+  }
+
+  /**
+   * Sends the quit command to the server and then closes the socket
+   * if there is no error or the $close_on_error argument is true.
+   *
+   * Implements from rfc 821: QUIT <CRLF>
+   *
+   * SMTP CODE SUCCESS: 221
+   * SMTP CODE ERROR  : 500
+   * @access public
+   * @return bool
+   */
+  public function Quit($close_on_error=true) {
+    $this->error = null; // so there is no confusion
+
+    if(!$this->connected()) {
+      $this->error = array(
+              "error" => "Called Quit() without being connected");
+      return false;
+    }
+
+    // send the quit command to the server
+    fputs($this->smtp_conn,"quit" . $this->CRLF);
+
+    // get any good-bye messages
+    $byemsg = $this->get_lines();
+
+    if($this->do_debug >= 2) {
+      echo "SMTP -> FROM SERVER:" . $this->CRLF . $byemsg;
+    }
+
+    $rval = true;
+    $e = null;
+
+    $code = substr($byemsg,0,3);
+    if($code != 221) {
+      // use e as a tmp var cause Close will overwrite $this->error
+      $e = array("error" => "SMTP server rejected quit command",
+                 "smtp_code" => $code,
+                 "smtp_rply" => substr($byemsg,4));
+      $rval = false;
+      if($this->do_debug >= 1) {
+        echo "SMTP -> ERROR: " . $e["error"] . ": " .
+                 $byemsg . $this->CRLF;
+      }
+    }
+
+    if(empty($e) || $close_on_error) {
+      $this->Close();
+    }
+
+    return $rval;
+  }
+
+  /**
+   * Sends the command RCPT to the SMTP server with the TO: argument of $to.
+   * Returns true if the recipient was accepted false if it was rejected.
+   *
+   * Implements from rfc 821: RCPT <SP> TO:<forward-path> <CRLF>
+   *
+   * SMTP CODE SUCCESS: 250,251
+   * SMTP CODE FAILURE: 550,551,552,553,450,451,452
+   * SMTP CODE ERROR  : 500,501,503,421
+   * @access public
+   * @return bool
+   */
+  public function Recipient($to) {
+    $this->error = null; // so no confusion is caused
+
+    if(!$this->connected()) {
+      $this->error = array(
+              "error" => "Called Recipient() without being connected");
+      return false;
+    }
+
+    fputs($this->smtp_conn,"RCPT TO:<" . $to . ">" . $this->CRLF);
+
+    $rply = $this->get_lines();
+    $code = substr($rply,0,3);
+
+    if($this->do_debug >= 2) {
+      echo "SMTP -> FROM SERVER:" . $this->CRLF . $rply;
+    }
+
+    if($code != 250 && $code != 251) {
+      $this->error =
+        array("error" => "RCPT not accepted from server",
+              "smtp_code" => $code,
+              "smtp_msg" => substr($rply,4));
+      if($this->do_debug >= 1) {
+        echo "SMTP -> ERROR: " . $this->error["error"] .
+                 ": " . $rply . $this->CRLF;
+      }
+      return false;
+    }
+    return true;
+  }
+
+  /**
+   * Sends the RSET command to abort and transaction that is
+   * currently in progress. Returns true if successful false
+   * otherwise.
+   *
+   * Implements rfc 821: RSET <CRLF>
+   *
+   * SMTP CODE SUCCESS: 250
+   * SMTP CODE ERROR  : 500,501,504,421
+   * @access public
+   * @return bool
+   */
+  public function Reset() {
+    $this->error = null; // so no confusion is caused
+
+    if(!$this->connected()) {
+      $this->error = array(
+              "error" => "Called Reset() without being connected");
+      return false;
+    }
+
+    fputs($this->smtp_conn,"RSET" . $this->CRLF);
+
+    $rply = $this->get_lines();
+    $code = substr($rply,0,3);
+
+    if($this->do_debug >= 2) {
+      echo "SMTP -> FROM SERVER:" . $this->CRLF . $rply;
+    }
+
+    if($code != 250) {
+      $this->error =
+        array("error" => "RSET failed",
+              "smtp_code" => $code,
+              "smtp_msg" => substr($rply,4));
+      if($this->do_debug >= 1) {
+        echo "SMTP -> ERROR: " . $this->error["error"] .
+                 ": " . $rply . $this->CRLF;
+      }
+      return false;
+    }
+
+    return true;
+  }
+
+  /**
+   * Starts a mail transaction from the email address specified in
+   * $from. Returns true if successful or false otherwise. If True
+   * the mail transaction is started and then one or more Recipient
+   * commands may be called followed by a Data command. This command
+   * will send the message to the users terminal if they are logged
+   * in.
+   *
+   * Implements rfc 821: SEND <SP> FROM:<reverse-path> <CRLF>
+   *
+   * SMTP CODE SUCCESS: 250
+   * SMTP CODE SUCCESS: 552,451,452
+   * SMTP CODE SUCCESS: 500,501,502,421
+   * @access public
+   * @return bool
+   */
+  public function Send($from) {
+    $this->error = null; // so no confusion is caused
+
+    if(!$this->connected()) {
+      $this->error = array(
+              "error" => "Called Send() without being connected");
+      return false;
+    }
+
+    fputs($this->smtp_conn,"SEND FROM:" . $from . $this->CRLF);
+
+    $rply = $this->get_lines();
+    $code = substr($rply,0,3);
+
+    if($this->do_debug >= 2) {
+      echo "SMTP -> FROM SERVER:" . $this->CRLF . $rply;
+    }
+
+    if($code != 250) {
+      $this->error =
+        array("error" => "SEND not accepted from server",
+              "smtp_code" => $code,
+              "smtp_msg" => substr($rply,4));
+      if($this->do_debug >= 1) {
+        echo "SMTP -> ERROR: " . $this->error["error"] .
+                 ": " . $rply . $this->CRLF;
+      }
+      return false;
+    }
+    return true;
+  }
+
+  /**
+   * Starts a mail transaction from the email address specified in
+   * $from. Returns true if successful or false otherwise. If True
+   * the mail transaction is started and then one or more Recipient
+   * commands may be called followed by a Data command. This command
+   * will send the message to the users terminal if they are logged
+   * in and send them an email.
+   *
+   * Implements rfc 821: SAML <SP> FROM:<reverse-path> <CRLF>
+   *
+   * SMTP CODE SUCCESS: 250
+   * SMTP CODE SUCCESS: 552,451,452
+   * SMTP CODE SUCCESS: 500,501,502,421
+   * @access public
+   * @return bool
+   */
+  public function SendAndMail($from) {
+    $this->error = null; // so no confusion is caused
+
+    if(!$this->connected()) {
+      $this->error = array(
+          "error" => "Called SendAndMail() without being connected");
+      return false;
+    }
+
+    fputs($this->smtp_conn,"SAML FROM:" . $from . $this->CRLF);
+
+    $rply = $this->get_lines();
+    $code = substr($rply,0,3);
+
+    if($this->do_debug >= 2) {
+      echo "SMTP -> FROM SERVER:" . $this->CRLF . $rply;
+    }
+
+    if($code != 250) {
+      $this->error =
+        array("error" => "SAML not accepted from server",
+              "smtp_code" => $code,
+              "smtp_msg" => substr($rply,4));
+      if($this->do_debug >= 1) {
+        echo "SMTP -> ERROR: " . $this->error["error"] .
+                 ": " . $rply . $this->CRLF;
+      }
+      return false;
+    }
+    return true;
+  }
+
+  /**
+   * Starts a mail transaction from the email address specified in
+   * $from. Returns true if successful or false otherwise. If True
+   * the mail transaction is started and then one or more Recipient
+   * commands may be called followed by a Data command. This command
+   * will send the message to the users terminal if they are logged
+   * in or mail it to them if they are not.
+   *
+   * Implements rfc 821: SOML <SP> FROM:<reverse-path> <CRLF>
+   *
+   * SMTP CODE SUCCESS: 250
+   * SMTP CODE SUCCESS: 552,451,452
+   * SMTP CODE SUCCESS: 500,501,502,421
+   * @access public
+   * @return bool
+   */
+  public function SendOrMail($from) {
+    $this->error = null; // so no confusion is caused
+
+    if(!$this->connected()) {
+      $this->error = array(
+          "error" => "Called SendOrMail() without being connected");
+      return false;
+    }
+
+    fputs($this->smtp_conn,"SOML FROM:" . $from . $this->CRLF);
+
+    $rply = $this->get_lines();
+    $code = substr($rply,0,3);
+
+    if($this->do_debug >= 2) {
+      echo "SMTP -> FROM SERVER:" . $this->CRLF . $rply;
+    }
+
+    if($code != 250) {
+      $this->error =
+        array("error" => "SOML not accepted from server",
+              "smtp_code" => $code,
+              "smtp_msg" => substr($rply,4));
+      if($this->do_debug >= 1) {
+        echo "SMTP -> ERROR: " . $this->error["error"] .
+                 ": " . $rply . $this->CRLF;
+      }
+      return false;
+    }
+    return true;
+  }
+
+  /**
+   * This is an optional command for SMTP that this class does not
+   * support. This method is here to make the RFC821 Definition
+   * complete for this class and __may__ be implimented in the future
+   *
+   * Implements from rfc 821: TURN <CRLF>
+   *
+   * SMTP CODE SUCCESS: 250
+   * SMTP CODE FAILURE: 502
+   * SMTP CODE ERROR  : 500, 503
+   * @access public
+   * @return bool
+   */
+  public function Turn() {
+    $this->error = array("error" => "This method, TURN, of the SMTP ".
+                                    "is not implemented");
+    if($this->do_debug >= 1) {
+      echo "SMTP -> NOTICE: " . $this->error["error"] . $this->CRLF;
+    }
+    return false;
+  }
+
+  /**
+   * Verifies that the name is recognized by the server.
+   * Returns false if the name could not be verified otherwise
+   * the response from the server is returned.
+   *
+   * Implements rfc 821: VRFY <SP> <string> <CRLF>
+   *
+   * SMTP CODE SUCCESS: 250,251
+   * SMTP CODE FAILURE: 550,551,553
+   * SMTP CODE ERROR  : 500,501,502,421
+   * @access public
+   * @return int
+   */
+  public function Verify($name) {
+    $this->error = null; // so no confusion is caused
+
+    if(!$this->connected()) {
+      $this->error = array(
+              "error" => "Called Verify() without being connected");
+      return false;
+    }
+
+    fputs($this->smtp_conn,"VRFY " . $name . $this->CRLF);
+
+    $rply = $this->get_lines();
+    $code = substr($rply,0,3);
+
+    if($this->do_debug >= 2) {
+      echo "SMTP -> FROM SERVER:" . $this->CRLF . $rply;
+    }
+
+    if($code != 250 && $code != 251) {
+      $this->error =
+        array("error" => "VRFY failed on name '$name'",
+              "smtp_code" => $code,
+              "smtp_msg" => substr($rply,4));
+      if($this->do_debug >= 1) {
+        echo "SMTP -> ERROR: " . $this->error["error"] .
+                 ": " . $rply . $this->CRLF;
+      }
+      return false;
+    }
+    return $rply;
+  }
+
+  /*******************************************************************
+   *                       INTERNAL FUNCTIONS                       *
+   ******************************************************************/
+
+  /**
+   * Read in as many lines as possible
+   * either before eof or socket timeout occurs on the operation.
+   * With SMTP we can tell if we have more lines to read if the
+   * 4th character is '-' symbol. If it is a space then we don't
+   * need to read anything else.
+   * @access private
+   * @return string
+   */
+  private function get_lines() {
+    $data = "";
+    while($str = @fgets($this->smtp_conn,515)) {
+      if($this->do_debug >= 4) {
+        echo "SMTP -> get_lines(): \$data was \"$data\"" .
+                 $this->CRLF;
+        echo "SMTP -> get_lines(): \$str is \"$str\"" .
+                 $this->CRLF;
+      }
+      $data .= $str;
+      if($this->do_debug >= 4) {
+        echo "SMTP -> get_lines(): \$data is \"$data\"" . $this->CRLF;
+      }
+      // if the 4th character is a space then we are done reading
+      // so just break the loop
+      if(substr($str,3,1) == " ") { break; }
+    }
+    return $data;
+  }
+
+}
+
+
+ ?>
diff --git a/inc/classes/third_party/php_mailer/docs/extending.html b/inc/classes/third_party/php_mailer/docs/extending.html
new file mode 100644 (file)
index 0000000..f7c3200
--- /dev/null
@@ -0,0 +1,148 @@
+<html>\r
+<head>\r
+<title>Examples using phpmailer</title>\r
+</head>\r
+\r
+<body bgcolor="#FFFFFF">\r
+\r
+<h2>Examples using phpmailer</h2>\r
+\r
+<h3>1. Advanced Example</h3>\r
+<p>\r
+\r
+This demonstrates sending out multiple email messages with binary attachments\r
+from a MySQL database with multipart/alternative support.<p>\r
+<table cellpadding="4" border="1" width="80%">\r
+<tr>\r
+<td bgcolor="#CCCCCC">\r
+<pre>\r
+require("class.phpmailer.php");\r
+\r
+$mail = new phpmailer();\r
+\r
+$mail->From     = "list@example.com";\r
+$mail->FromName = "List manager";\r
+$mail->Host     = "smtp1.example.com;smtp2.example.com";\r
+$mail->Mailer   = "smtp";\r
+\r
+@MYSQL_CONNECT("localhost","root","password");\r
+@mysql_select_db("my_company");\r
+$query  = "SELECT full_name, email, photo FROM employee WHERE id=$id";\r
+$result = @MYSQL_QUERY($query);\r
+\r
+while ($row = mysql_fetch_array ($result))\r
+{\r
+    // HTML body\r
+    $body  = "Hello &lt;font size=\"4\"&gt;" . $row["full_name"] . "&lt;/font&gt;, &lt;p&gt;";\r
+    $body .= "&lt;i&gt;Your&lt;/i&gt; personal photograph to this message.&lt;p&gt;";\r
+    $body .= "Sincerely, &lt;br&gt;";\r
+    $body .= "phpmailer List manager";\r
+\r
+    // Plain text body (for mail clients that cannot read HTML)\r
+    $text_body  = "Hello " . $row["full_name"] . ", \n\n";\r
+    $text_body .= "Your personal photograph to this message.\n\n";\r
+    $text_body .= "Sincerely, \n";\r
+    $text_body .= "phpmailer List manager";\r
+\r
+    $mail->Body    = $body;\r
+    $mail->AltBody = $text_body;\r
+    $mail->AddAddress($row["email"], $row["full_name"]);\r
+    $mail->AddStringAttachment($row["photo"], "YourPhoto.jpg");\r
+\r
+    if(!$mail->Send())\r
+        echo "There has been a mail error sending to " . $row["email"] . "&lt;br&gt;";\r
+\r
+    // Clear all addresses and attachments for next loop\r
+    $mail->ClearAddresses();\r
+    $mail->ClearAttachments();\r
+}\r
+</pre>\r
+</td>\r
+</tr>\r
+</table>\r
+<p>\r
+\r
+<h3>2. Extending phpmailer</h3>\r
+<p>\r
+\r
+Extending classes with inheritance is one of the most\r
+powerful features of object-oriented\r
+programming.  It allows you to make changes to the\r
+original class for your\r
+own personal use without hacking the original\r
+classes.  Plus, it is very\r
+easy to do. I've provided an example:\r
+\r
+<p>\r
+Here's a class that extends the phpmailer class and sets the defaults\r
+for the particular site:<br>\r
+PHP include file: <b>mail.inc.php</b>\r
+<p>\r
+\r
+<table cellpadding="4" border="1" width="80%">\r
+<tr>\r
+<td bgcolor="#CCCCCC">\r
+<pre>\r
+require("class.phpmailer.php");\r
+\r
+class my_phpmailer extends phpmailer {\r
+    // Set default variables for all new objects\r
+    var $From     = "from@example.com";\r
+    var $FromName = "Mailer";\r
+    var $Host     = "smtp1.example.com;smtp2.example.com";\r
+    var $Mailer   = "smtp";                         // Alternative to IsSMTP()\r
+    var $WordWrap = 75;\r
+\r
+    // Replace the default error_handler\r
+    function error_handler($msg) {\r
+        print("My Site Error");\r
+        print("Description:");\r
+        printf("%s", $msg);\r
+        exit;\r
+    }\r
+\r
+    // Create an additional function\r
+    function do_something($something) {\r
+        // Place your new code here\r
+    }\r
+}\r
+</td>\r
+</tr>\r
+</table>\r
+<br>\r
+\r
+Now here's a normal PHP page in the site, which will have all the defaults set\r
+above:<br>\r
+Normal PHP file: <b>mail_test.php</b>\r
+<p>\r
+\r
+<table cellpadding="4" border="1" width="80%">\r
+<tr>\r
+<td bgcolor="#CCCCCC">\r
+<pre>\r
+require("mail.inc.php");\r
+\r
+// Instantiate your new class\r
+$mail = new my_phpmailer;\r
+\r
+// Now you only need to add the necessary stuff\r
+$mail->AddAddress("josh@example.com", "Josh Adams");\r
+$mail->Subject = "Here is the subject";\r
+$mail->Body    = "This is the message body";\r
+$mail->AddAttachment("c:/temp/11-10-00.zip", "new_name.zip");  // optional name\r
+\r
+if(!$mail->Send())\r
+{\r
+   echo "There was an error sending the message";\r
+   exit;\r
+}\r
+\r
+echo "Message was sent successfully";\r
+</pre>\r
+</td>\r
+</tr>\r
+</table>\r
+</p>\r
+\r
+</body>\r
+</html>\r
diff --git a/inc/classes/third_party/php_mailer/docs/faq.html b/inc/classes/third_party/php_mailer/docs/faq.html
new file mode 100644 (file)
index 0000000..54ac183
--- /dev/null
@@ -0,0 +1,67 @@
+<html>\r
+<head>\r
+<title>PHPMailer FAQ</title>\r
+<style>\r
+body, p {\r
+  font-family: Arial, Helvetica, sans-serif;\r
+  font-size: 12px;\r
+}\r
+div.width {\r
+  width: 500px;\r
+  text-align: left;\r
+}\r
+</style>\r
+</head>\r
+<body bgcolor="#FFFFFF">\r
+<center>\r
+<div class="width">\r
+<h2>PHPMailer FAQ</h2>\r
+<ul>\r
+\r
+  <li><b style="background-color: #FFFF00">Q:</b> <b>I&#039;m using the SMTP mailer and I keep on getting a timeout message\r
+  well before the X seconds I set it for.  What gives?</b><br />\r
+  <b style="background-color: #FFFF00">A:</b> PHP versions 4.0.4pl1 and earlier have a bug in which sockets timeout\r
+  early.  You can fix this by re-compiling PHP 4.0.4pl1 with this fix:\r
+  <a href="timeoutfix.diff">timeoutfix.diff</a>. Otherwise you can wait for the new PHP release.<br /><br /></li>\r
+\r
+  <li><b style="background-color: #FFFF00">Q:</b> <b>I am concerned that using include files will take up too much\r
+  processing time on my computer.  How can I make it run faster?</b><br />\r
+  <b style="background-color: #FFFF00">A:</b>  PHP by itself is very fast.  Much faster than ASP or JSP running on\r
+  the same type of server.  This is because it has very little overhead compared\r
+  to its competitors and it pre-compiles all of\r
+  its code before it runs each script (in PHP4).  However, all of\r
+  this compiling and re-compiling can take up a lot of valuable\r
+  computer resources.  However, there are programs out there that compile\r
+  PHP code and store it in memory (or on mmaped files) to reduce the\r
+  processing immensely.  Two of these: <a href="http://apc.communityconnect.com">APC\r
+  (Alternative PHP Cache)</a> and <a href="http://bwcache.bware.it/index.htm">Afterburner</a>\r
+  (<a href="http://www.mm4.de/php4win/mod_php4_win32/">Win32 download</a>)\r
+  are excellent free tools that do just this.  If you have the money\r
+  you might also try <a href="http://www.zend.com">Zend Cache</a>, it is\r
+  even faster than the open source varieties.  All of these tools make your\r
+  scripts run faster while also reducing the load on your server. I have tried\r
+  them myself and they are quite stable too.<br /><br /></li>\r
+\r
+  <li><b style="background-color: #FFFF00">Q:</b> <b>What mailer gives me the best performance?</b><br />\r
+  <b style="background-color: #FFFF00">A:</b> On a single machine the <b>sendmail (or Qmail)</b> is fastest overall.\r
+  Next fastest is mail() to give you the best performance. Both do not have the overhead of SMTP.\r
+  If you have you have your mail server on a another machine then\r
+  SMTP is your only option, but you do get the benefit of redundant mail servers.<br />\r
+  If you are running a mailing list with thousands of names, the fastest mailers in order are: SMTP, sendmail (or Qmail), mail().<br /><br /></li>\r
+\r
+  <li><b style="background-color: #FFFF00">Q:</b> <b>When I try to attach a file with on my server I get a\r
+  "Could not find {file} on filesystem error".  Why is this?</b><br />\r
+  <b style="background-color: #FFFF00">A:</b> If you are using a Unix machine this is probably because the user\r
+  running your web server does not have read access to the directory in question.  If you are using Windows,\r
+  then the problem probably is that you have used single backslashes to denote directories (\).\r
+  A single backslash has a special meaning to PHP so these are not\r
+  valid.  Instead use double backslashes ("\\") or a single forward\r
+  slash ("/").<br /><br /></li>\r
+\r
+</ul>\r
+\r
+</div>\r
+</center>\r
+\r
+</body>\r
+</html>\r
diff --git a/inc/classes/third_party/php_mailer/docs/pop3_article.txt b/inc/classes/third_party/php_mailer/docs/pop3_article.txt
new file mode 100644 (file)
index 0000000..379c44e
--- /dev/null
@@ -0,0 +1,39 @@
+This is built for PHP Mailer 1.72 and was not tested with any previous version. It was developed under PHP 4.3.11 (E_ALL). It works under PHP 5 and 5.1 with E_ALL, but not in Strict mode due to var deprecation (but then neither does PHP Mailer either!). It follows the RFC 1939 standard explicitly and is fully commented.\r
+\r
+With that noted, here is how to implement it:\r
+Install the class file\r
+\r
+I didn't want to modify the PHP Mailer classes at all, so you will have to include/require this class along with the base one. It can sit quite happily in the phpmailer-1.72 directory:\r
+[geshi lang=php] require 'phpmailer-1.72/class.phpmailer.php'; require 'phpmailer-1.72/class.pop3.php'; [/geshi]\r
+When you need it, create your POP3 object\r
+\r
+Right before I invoke PHP Mailer I activate the POP3 authorisation. POP3 before SMTP is a process whereby you login to your web hosts POP3 mail server BEFORE sending out any emails via SMTP. The POP3 logon 'verifies' your ability to send email by SMTP, which typically otherwise blocks you. On my web host (Pair Networks) a single POP3 logon is enough to 'verify' you for 90 minutes. Here is some sample PHP code that activates the POP3 logon and then sends an email via PHP Mailer:\r
+[geshi lang=php] Authorise('pop3.example.com', 110, 30, 'mailer', 'password', 1); $mail = new PHPMailer(); $mail->SMTPDebug = 2; $mail->IsSMTP(); $mail->IsHTML(false); $mail->Host = 'relay.example.com'; $mail->From = 'mailer@example.com'; $mail->FromName = 'Example Mailer'; $mail->Subject = 'My subject'; $mail->Body = 'Hello world'; $mail->AddAddress('rich@corephp.co.uk', 'Richard Davey'); if (!$mail->Send()) { echo $mail->ErrorInfo; } ?> [/geshi]\r
+\r
+The PHP Mailer parts of this code should be obvious to anyone who has used PHP Mailer before. One thing to note - you almost certainly will not need to use SMTP Authentication *and* POP3 before SMTP together. The Authorisation method is a proxy method to all of the others within that class. There are Connect, Logon and Disconnect methods available, but I wrapped them in the single Authorisation one to make things easier.\r
+The Parameters\r
+\r
+The Authorise parameters are as follows:\r
+[geshi lang=php]$pop->Authorise('pop3.example.com', 110, 30, 'mailer', 'password', 1);[/geshi]\r
+\r
+   1. pop3.example.com - The POP3 Mail Server Name (hostname or IP address)\r
+   2. 110 - The POP3 Port on which to connect (default is usually 110, but check with your host)\r
+   3. 30 - A connection time-out value (in seconds)\r
+   4. mailer - The POP3 Username required to logon\r
+   5. password - The POP3 Password required to logon\r
+   6. 1 - The class debug level (0 = off, 1+ = debug output is echoed to the browser)\r
+\r
+Final Comments + the Download\r
+\r
+1) This class does not support APOP connections. This is only because I did not have an APOP server to test with, but if you'd like to see that added just contact me.\r
+\r
+2) Opening and closing lots of POP3 connections can be quite a resource/network drain. If you need to send a whole batch of emails then just perform the authentication once at the start, and then loop through your mail sending script. Providing this process doesn't take longer than the verification period lasts on your POP3 server, you should be fine. With my host that period is 90 minutes, i.e. plenty of time.\r
+\r
+3) If you have heavy requirements for this script (i.e. send a LOT of email on a frequent basis) then I would advise seeking out an alternative sending method (direct SMTP ideally). If this isn't possible then you could modify this class so the 'last authorised' date is recorded somewhere (MySQL, Flat file, etc) meaning you only open a new connection if the old one has expired, saving you precious overhead.\r
+\r
+4) There are lots of other POP3 classes for PHP available. However most of them implement the full POP3 command set, where-as this one is purely for authentication, and much lighter as a result. However using any of the other POP3 classes to just logon to your server would have the same net result. At the end of the day, use whatever method you feel most comfortable with.\r
+Download\r
+\r
+Here is the full class file plus my test script: POP_before_SMTP_PHPMailer.zip (4 KB) - Please note that it does not include PHPMailer itself.\r
+\r
+My thanks to Chris Ryan for the inspiration (even if indirectly, via his SMTP class)\r
diff --git a/inc/classes/third_party/php_mailer/docs/use_gmail.txt b/inc/classes/third_party/php_mailer/docs/use_gmail.txt
new file mode 100644 (file)
index 0000000..3669f5d
--- /dev/null
@@ -0,0 +1,45 @@
+<?php\r
+\r
+// example on using PHPMailer with GMAIL\r
+\r
+include("class.phpmailer.php");\r
+include("class.smtp.php"); // note, this is optional - gets called from main class if not already loaded\r
+\r
+$mail             = new PHPMailer();\r
+\r
+$body             = $mail->getFile('contents.html');\r
+$body             = eregi_replace("[\]",'',$body);\r
+\r
+$mail->IsSMTP();\r
+$mail->SMTPAuth   = true;                  // enable SMTP authentication\r
+$mail->SMTPSecure = "ssl";                 // sets the prefix to the servier\r
+$mail->Host       = "smtp.gmail.com";      // sets GMAIL as the SMTP server\r
+$mail->Port       = 465;                   // set the SMTP port\r
+\r
+$mail->Username   = "yourname@gmail.com";  // GMAIL username\r
+$mail->Password   = "password";            // GMAIL password\r
+\r
+$mail->From       = "replyto@yourdomain.com";\r
+$mail->FromName   = "Webmaster";\r
+$mail->Subject    = "This is the subject";\r
+$mail->AltBody    = "This is the body when user views in plain text format"; //Text Body\r
+$mail->WordWrap   = 50; // set word wrap\r
+\r
+$mail->MsgHTML($body);\r
+\r
+$mail->AddReplyTo("replyto@yourdomain.com","Webmaster");\r
+\r
+$mail->AddAttachment("/path/to/file.zip");             // attachment\r
+$mail->AddAttachment("/path/to/image.jpg", "new.jpg"); // attachment\r
+\r
+$mail->AddAddress("username@domain.com","First Last");\r
+\r
+$mail->IsHTML(true); // send as HTML\r
+\r
+if(!$mail->Send()) {\r
+  echo "Mailer Error: " . $mail->ErrorInfo;\r
+} else {\r
+  echo "Message has been sent";\r
+}\r
+\r
+?>\r
diff --git a/inc/classes/third_party/php_mailer/examples/contents.html b/inc/classes/third_party/php_mailer/examples/contents.html
new file mode 100644 (file)
index 0000000..70c7e30
--- /dev/null
@@ -0,0 +1,12 @@
+<body background="images/bkgrnd.gif" style="margin: 0px;">\r
+<div style="width: 640px; font-family: Arial, Helvetica, sans-serif; font-size: 11px;">\r
+<div align="center"><img src="images/phpmailer.gif" style="height: 90px; width: 340px"></div><br>\r
+<br>\r
+&nbsp;This is a test of PHPMailer v2.0.0 rc1.<br>\r
+<br>\r
+This particular example uses <strong>HTML</strong>, with a &lt;div&gt; tag and inline<br>\r
+styles.<br>\r
+<br>\r
+Also note the use of the PHPMailer at the top with no specific code to handle\r
+including it in the body of the email.</div>\r
+</body>\r
diff --git a/inc/classes/third_party/php_mailer/examples/images/bkgrnd.gif b/inc/classes/third_party/php_mailer/examples/images/bkgrnd.gif
new file mode 100644 (file)
index 0000000..bc89624
Binary files /dev/null and b/inc/classes/third_party/php_mailer/examples/images/bkgrnd.gif differ
diff --git a/inc/classes/third_party/php_mailer/examples/images/phpmailer.gif b/inc/classes/third_party/php_mailer/examples/images/phpmailer.gif
new file mode 100644 (file)
index 0000000..5e26971
Binary files /dev/null and b/inc/classes/third_party/php_mailer/examples/images/phpmailer.gif differ
diff --git a/inc/classes/third_party/php_mailer/examples/images/phpmailer.png b/inc/classes/third_party/php_mailer/examples/images/phpmailer.png
new file mode 100644 (file)
index 0000000..abe0101
Binary files /dev/null and b/inc/classes/third_party/php_mailer/examples/images/phpmailer.png differ
diff --git a/inc/classes/third_party/php_mailer/examples/images/phpmailer_mini.gif b/inc/classes/third_party/php_mailer/examples/images/phpmailer_mini.gif
new file mode 100644 (file)
index 0000000..dc7d782
Binary files /dev/null and b/inc/classes/third_party/php_mailer/examples/images/phpmailer_mini.gif differ
diff --git a/inc/classes/third_party/php_mailer/examples/index.html b/inc/classes/third_party/php_mailer/examples/index.html
new file mode 100644 (file)
index 0000000..d0a8b9d
--- /dev/null
@@ -0,0 +1,73 @@
+<p>The example file &quot;test_mail.php&quot; contents include:</p>\r
+<div style="width: 600px; background-color: #CCCCCC;">\r
+<code>\r
+&lt;?php<br>\r
+<br>\r
+include_once('../class.phpmailer.php');<br>\r
+<br>\r
+$mail    = new PHPMailer();<br>\r
+<br>\r
+$body    = $mail->getFile('contents.html');<br>\r
+<br>\r
+$body    = eregi_replace("[\]",'',$body);<br>\r
+$subject = eregi_replace("[\]",'',$subject);<br>\r
+<br>\r
+$mail->From     = "name@yourdomain.com";<br>\r
+$mail->FromName = "First Last";<br>\r
+<br>\r
+$mail->Subject = "PHPMailer Test Subject";<br>\r
+<br>\r
+$mail->AltBody = "To view the message, please use an HTML compatible email viewer!"; // optional, comment out and test<br>\r
+<br>\r
+$mail->MsgHTML($body);<br>\r
+<br>\r
+$mail->AddAddress("whoto@otherdomain.com", "John Doe");<br>\r
+<br>\r
+if(!$mail->Send()) {<br>\r
+  echo 'Failed to send mail';<br>\r
+} else {<br>\r
+  echo 'Mail sent';<br>\r
+}<br>\r
+<br>\r
+?&gt;\r
+</code>\r
+</div>\r
+<br>\r
+Although you could use full compabitility with PHPMailer 1.7.3, this example\r
+shows how to use the new features. If you view 'contents.html', you will note\r
+that there is a background image used in the &lt;body tag as well as an image used\r
+with a regular &lt;img tag. Here&#39;s what the HTML file looks like:<br>\r
+<br>\r
+<div style="width: 600px; background-color: #CCCCCC;">\r
+<code>\r
+&lt;body background="images/bkgrnd.gif" style="margin: 0px;"&gt;<br>\r
+&lt;div style="width: 640px; font-family: Arial, Helvetica, sans-serif; font-size: 11px;"&gt;<br>\r
+&lt;div align="center"&gt;&lt;img src="images/phpmailer.gif" style="height: 90px; width: 340px"&gt;&lt;/div&gt;&lt;br&gt;<br>\r
+&lt;br&gt;<br>\r
+&nbsp;This is a test of PHPMailer v2.0.0 rc1.&lt;br&gt;<br>\r
+&lt;br&gt;<br>\r
+This particular example uses &lt;strong&gt;HTML&lt;/strong&gt;, with a &lt;div&gt; tag and inline&lt;br&gt;<br>\r
+styles.&lt;br&gt;<br>\r
+&lt;br&gt;<br>\r
+Also note the use of the PHPMailer at the top with no specific code to handle<br>\r
+including it in the body of the email.&lt;/div&gt;<br>\r
+&lt;/body&gt;<br>\r
+</code>\r
+</div>\r
+<br>\r
+A few things to notice in the PHP script that generates the email:\r
+<ul>\r
+  <li>the use of $mail-&gt;AltBody is completely optional. If not used, PHPMailer\r
+  will use the HTML text with htmlentities().</li>\r
+  <li>the background= and &lt;img src= images were processed without any directives\r
+  or methods from the PHP script</li>\r
+  <li>there is no specific code to define the image type ... that is handled\r
+  automatically by PHPMailer when it parses the images</li>\r
+  <li>we are using a new class method '$mail->MsgHTML($body)' ... that is what will handle the parsing of the images and creating the AltBody text</li>\r
+</ul>\r
+<p>Of course, you can still use PHPMailer the same way you have in the past.\r
+That provides full compatibility with all existing scripts, while new scripts\r
+can take advantage of the new features.</p>\r
+<p>Modify test_mail.php now with your own email address and try it out.</p>\r
+To see what the email SHOULD look like in your HTML compatible email viewer: <a href="contents.html">click here</a><br>\r
+\r
diff --git a/inc/classes/third_party/php_mailer/examples/pop3_before_smtp_test.php b/inc/classes/third_party/php_mailer/examples/pop3_before_smtp_test.php
new file mode 100644 (file)
index 0000000..794b2a2
--- /dev/null
@@ -0,0 +1,39 @@
+<html>\r
+<head>\r
+<title>POP before SMTP Test</title>\r
+</head>\r
+\r
+<body>\r
+\r
+<pre>\r
+<?php\r
+  require 'class.phpmailer.php';\r
+  require 'class.pop3.php';\r
+\r
+  $pop = new POP3();\r
+  $pop->Authorise('pop3.example.com', 110, 30, 'mailer', 'password', 1);\r
+\r
+  $mail = new PHPMailer();\r
+\r
+  $mail->IsSMTP();\r
+  $mail->SMTPDebug = 2;\r
+  $mail->IsHTML(false);\r
+\r
+  $mail->Host     = 'relay.example.com';\r
+\r
+  $mail->From     = 'mailer@example.com';\r
+  $mail->FromName = 'Example Mailer';\r
+\r
+  $mail->Subject  =  'My subject';\r
+  $mail->Body     =  'Hello world';\r
+  $mail->AddAddress('name@anydomain.com', 'First Last');\r
+\r
+  if (!$mail->Send())\r
+  {\r
+    echo $mail->ErrorInfo;\r
+  }\r
+?>\r
+</pre>\r
+\r
+</body>\r
+</html>\r
diff --git a/inc/classes/third_party/php_mailer/examples/test_gmail.php b/inc/classes/third_party/php_mailer/examples/test_gmail.php
new file mode 100644 (file)
index 0000000..4592efc
--- /dev/null
@@ -0,0 +1,50 @@
+<?php\r
+\r
+//error_reporting(E_ALL);\r
+error_reporting(E_STRICT);\r
+\r
+date_default_timezone_set('America/Toronto');\r
+\r
+include("class.phpmailer.php");\r
+//include("class.smtp.php"); // optional, gets called from within class.phpmailer.php if not already loaded\r
+\r
+$mail             = new PHPMailer();\r
+\r
+$body             = $mail->getFile('contents.html');\r
+$body             = eregi_replace("[\]",'',$body);\r
+\r
+$mail->IsSMTP();\r
+$mail->SMTPAuth   = true;                  // enable SMTP authentication\r
+$mail->SMTPSecure = "ssl";                 // sets the prefix to the servier\r
+$mail->Host       = "smtp.gmail.com";      // sets GMAIL as the SMTP server\r
+$mail->Port       = 465;                   // set the SMTP port for the GMAIL server\r
+\r
+$mail->Username   = "yourusername@gmail.com";  // GMAIL username\r
+$mail->Password   = "yourpassword";            // GMAIL password\r
+\r
+$mail->AddReplyTo("yourusername@gmail.com","First Last");\r
+\r
+$mail->From       = "name@yourdomain.com";\r
+$mail->FromName   = "First Last";\r
+\r
+$mail->Subject    = "PHPMailer Test Subject via gmail";\r
+\r
+//$mail->Body       = "Hi,<br>This is the HTML BODY<br>";                      //HTML Body\r
+$mail->AltBody    = "To view the message, please use an HTML compatible email viewer!"; // optional, comment out and test\r
+$mail->WordWrap   = 50; // set word wrap\r
+\r
+$mail->MsgHTML($body);\r
+\r
+$mail->AddAddress("whoto@otherdomain.com", "John Doe");\r
+\r
+$mail->AddAttachment("images/phpmailer.gif");             // attachment\r
+\r
+$mail->IsHTML(true); // send as HTML\r
+\r
+if(!$mail->Send()) {\r
+  echo "Mailer Error: " . $mail->ErrorInfo;\r
+} else {\r
+  echo "Message sent!";\r
+}\r
+\r
+?>\r
diff --git a/inc/classes/third_party/php_mailer/examples/test_mail.php b/inc/classes/third_party/php_mailer/examples/test_mail.php
new file mode 100644 (file)
index 0000000..e87056e
--- /dev/null
@@ -0,0 +1,29 @@
+<?php\r
+\r
+include_once('../class.phpmailer.php');\r
+\r
+$mail             = new PHPMailer(); // defaults to using php "mail()"\r
+\r
+$body             = $mail->getFile('contents.html');\r
+$body             = eregi_replace("[\]",'',$body);\r
+\r
+$mail->From       = "name@yourdomain.com";\r
+$mail->FromName   = "First Last";\r
+\r
+$mail->Subject    = "PHPMailer Test Subject via mail()";\r
+\r
+$mail->AltBody    = "To view the message, please use an HTML compatible email viewer!"; // optional, comment out and test\r
+\r
+$mail->MsgHTML($body);\r
+\r
+$mail->AddAddress("whoto@otherdomain.com", "John Doe");\r
+\r
+$mail->AddAttachment("images/phpmailer.gif");             // attachment\r
+\r
+if(!$mail->Send()) {\r
+  echo "Mailer Error: " . $mail->ErrorInfo;\r
+} else {\r
+  echo "Message sent!";\r
+}\r
+\r
+?>\r
diff --git a/inc/classes/third_party/php_mailer/examples/test_sendmail.php b/inc/classes/third_party/php_mailer/examples/test_sendmail.php
new file mode 100644 (file)
index 0000000..38eb78d
--- /dev/null
@@ -0,0 +1,37 @@
+<?php\r
+\r
+//error_reporting(E_ALL);\r
+error_reporting(E_STRICT);\r
+\r
+\r
+date_default_timezone_set('America/Toronto');\r
+//date_default_timezone_set(date_default_timezone_get());\r
+\r
+include_once('class.phpmailer.php');\r
+\r
+$mail             = new PHPMailer();\r
+$body             = $mail->getFile('contents.html');\r
+$body             = eregi_replace("[\]",'',$body);\r
+\r
+$mail->IsSendmail(); // telling the class to use SendMail transport\r
+\r
+$mail->From       = "name@yourdomain.com";\r
+$mail->FromName   = "First Last";\r
+\r
+$mail->Subject    = "PHPMailer Test Subject via smtp";\r
+\r
+$mail->AltBody    = "To view the message, please use an HTML compatible email viewer!"; // optional, comment out and test\r
+\r
+$mail->MsgHTML($body);\r
+\r
+$mail->AddAddress("whoto@otherdomain.com", "John Doe");\r
+\r
+$mail->AddAttachment("images/phpmailer.gif");             // attachment\r
+\r
+if(!$mail->Send()) {\r
+  echo "Mailer Error: " . $mail->ErrorInfo;\r
+} else {\r
+  echo "Message sent!";\r
+}\r
+\r
+?>\r
diff --git a/inc/classes/third_party/php_mailer/examples/test_smtp.php b/inc/classes/third_party/php_mailer/examples/test_smtp.php
new file mode 100644 (file)
index 0000000..bc46c67
--- /dev/null
@@ -0,0 +1,39 @@
+<?php\r
+\r
+//error_reporting(E_ALL);\r
+error_reporting(E_STRICT);\r
+\r
+date_default_timezone_set('America/Toronto');\r
+//date_default_timezone_set(date_default_timezone_get());\r
+\r
+include_once('class.phpmailer.php');\r
+//include("class.smtp.php"); // optional, gets called from within class.phpmailer.php if not already loaded\r
+\r
+$mail             = new PHPMailer();\r
+\r
+$body             = $mail->getFile('contents.html');\r
+$body             = eregi_replace("[\]",'',$body);\r
+\r
+$mail->IsSMTP(); // telling the class to use SMTP\r
+$mail->Host       = "mail.worxteam.com"; // SMTP server\r
+\r
+$mail->From       = "name@yourdomain.com";\r
+$mail->FromName   = "First Last";\r
+\r
+$mail->Subject    = "PHPMailer Test Subject via smtp";\r
+\r
+$mail->AltBody    = "To view the message, please use an HTML compatible email viewer!"; // optional, comment out and test\r
+\r
+$mail->MsgHTML($body);\r
+\r
+$mail->AddAddress("whoto@otherdomain.com", "John Doe");\r
+\r
+$mail->AddAttachment("images/phpmailer.gif");             // attachment\r
+\r
+if(!$mail->Send()) {\r
+  echo "Mailer Error: " . $mail->ErrorInfo;\r
+} else {\r
+  echo "Message sent!";\r
+}\r
+\r
+?>\r
diff --git a/inc/classes/third_party/php_mailer/language/.htaccess b/inc/classes/third_party/php_mailer/language/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/inc/classes/third_party/php_mailer/language/phpmailer.lang-br.php b/inc/classes/third_party/php_mailer/language/phpmailer.lang-br.php
new file mode 100644 (file)
index 0000000..601d3b8
--- /dev/null
@@ -0,0 +1,24 @@
+<?php
+/**
+ * PHPMailer language file.
+ * Portuguese Version
+ * By Paulo Henrique Garcia - paulo@controllerweb.com.br
+ */
+
+$PHPMAILER_LANG = array();
+$PHPMAILER_LANG["provide_address"]      = 'Você deve fornecer pelo menos um endereço de destinatário de email.';
+$PHPMAILER_LANG["mailer_not_supported"] = ' mailer não suportado.';
+$PHPMAILER_LANG["execute"]              = 'Não foi possível executar: ';
+$PHPMAILER_LANG["instantiate"]          = 'Não foi possível instanciar a função mail.';
+$PHPMAILER_LANG["authenticate"]         = 'Erro de SMTP: Não foi possível autenticar.';
+$PHPMAILER_LANG["from_failed"]          = 'Os endereços de rementente a seguir falharam: ';
+$PHPMAILER_LANG["recipients_failed"]    = 'Erro de SMTP: Os endereços de destinatário a seguir falharam: ';
+$PHPMAILER_LANG["data_not_accepted"]    = 'Erro de SMTP: Dados não aceitos.';
+$PHPMAILER_LANG["connect_host"]         = 'Erro de SMTP: Não foi possível conectar com o servidor SMTP.';
+$PHPMAILER_LANG["file_access"]          = 'Não foi possível acessar o arquivo: ';
+$PHPMAILER_LANG["file_open"]            = 'Erro de Arquivo: Não foi possível abrir o arquivo: ';
+$PHPMAILER_LANG["encoding"]             = 'Codificação desconhecida: ';
+$PHPMAILER_LANG["signing"]              = 'Signing Error: ';
+
+?>
+
diff --git a/inc/classes/third_party/php_mailer/language/phpmailer.lang-ca.php b/inc/classes/third_party/php_mailer/language/phpmailer.lang-ca.php
new file mode 100644 (file)
index 0000000..dbb2298
--- /dev/null
@@ -0,0 +1,24 @@
+<?php
+/**
+ * PHPMailer language file.
+ * Catalan Version
+ * By Ivan: web AT microstudi DOT com
+ */
+
+$PHPMAILER_LANG = array();
+
+$PHPMAILER_LANG["provide_address"]      = 'S\'ha de proveir almenys una adreça d\'email com a destinatari.';
+$PHPMAILER_LANG["mailer_not_supported"] = ' mailer no està suportat';
+$PHPMAILER_LANG["execute"]              = 'No es pot executar: ';
+$PHPMAILER_LANG["instantiate"]          = 'No s\'ha pogut crear una instància de la funció Mail.';
+$PHPMAILER_LANG["authenticate"]         = 'Error SMTP: No s\'hapogut autenticar.';
+$PHPMAILER_LANG["from_failed"]          = 'La(s) següent(s) adreces de remitent han fallat: ';
+$PHPMAILER_LANG["recipients_failed"]    = 'Error SMTP: Els següents destinataris han fallat: ';
+$PHPMAILER_LANG["data_not_accepted"]    = 'Error SMTP: Dades no acceptades.';
+$PHPMAILER_LANG["connect_host"]         = 'Error SMTP: No es pot connectar al servidor SMTP.';
+$PHPMAILER_LANG["file_access"]          = 'No es pot accedir a l\'arxiu: ';
+$PHPMAILER_LANG["file_open"]            = 'Error d\'Arxiu: No es pot obrir l\'arxiu: ';
+$PHPMAILER_LANG["encoding"]             = 'Codificació desconeguda: ';
+$PHPMAILER_LANG["signing"]              = 'Signing Error: ';
+
+?>
diff --git a/inc/classes/third_party/php_mailer/language/phpmailer.lang-cz.php b/inc/classes/third_party/php_mailer/language/phpmailer.lang-cz.php
new file mode 100644 (file)
index 0000000..ae82d2d
--- /dev/null
@@ -0,0 +1,26 @@
+<?php
+/**
+ * PHPMailer language file.
+ * Czech Version
+ */
+
+$PHPMAILER_LANG = array();
+
+$PHPMAILER_LANG["provide_address"]      = 'Musíte zadat alespoò jednu ' .
+                                          'emailovou adresu pøíjemce.';
+$PHPMAILER_LANG["mailer_not_supported"] = ' mailový klient není podporován.';
+$PHPMAILER_LANG["execute"]              = 'Nelze provést: ';
+$PHPMAILER_LANG["instantiate"]          = 'Nelze vytvoøit instanci emailové funkce.';
+$PHPMAILER_LANG["authenticate"]         = 'SMTP Error: Chyba autentikace.';
+$PHPMAILER_LANG["from_failed"]          = 'Následující adresa From je nesprávná: ';
+$PHPMAILER_LANG["recipients_failed"]    = 'SMTP Error: Adresy pøíjemcù ' .
+                                          'nejsou správné ' .
+$PHPMAILER_LANG["data_not_accepted"]    = 'SMTP Error: Data nebyla pøijata';
+$PHPMAILER_LANG["connect_host"]         = 'SMTP Error: Nelze navázat spojení se ' .
+                                          ' SMTP serverem.';
+$PHPMAILER_LANG["file_access"]          = 'Soubor nenalezen: ';
+$PHPMAILER_LANG["file_open"]            = 'File Error: Nelze otevøít soubor pro ètení: ';
+$PHPMAILER_LANG["encoding"]             = 'Neznámé kódování: ';
+$PHPMAILER_LANG["signing"]              = 'Signing Error: ';
+
+?>
diff --git a/inc/classes/third_party/php_mailer/language/phpmailer.lang-de.php b/inc/classes/third_party/php_mailer/language/phpmailer.lang-de.php
new file mode 100644 (file)
index 0000000..53c20e1
--- /dev/null
@@ -0,0 +1,26 @@
+<?php
+/**
+ * PHPMailer language file.
+ * German Version
+ */
+
+$PHPMAILER_LANG = array();
+
+$PHPMAILER_LANG["provide_address"]      = 'Bitte geben Sie mindestens eine ' .
+                                          'Empf&auml;nger Emailadresse an.';
+$PHPMAILER_LANG["mailer_not_supported"] = ' mailer wird nicht unterst&uuml;tzt.';
+$PHPMAILER_LANG["execute"]              = 'Konnte folgenden Befehl nicht ausf&uuml;hren: ';
+$PHPMAILER_LANG["instantiate"]          = 'Mail Funktion konnte nicht initialisiert werden.';
+$PHPMAILER_LANG["authenticate"]         = 'SMTP Fehler: Authentifizierung fehlgeschlagen.';
+$PHPMAILER_LANG["from_failed"]          = 'Die folgende Absenderadresse ist nicht korrekt: ';
+$PHPMAILER_LANG["recipients_failed"]    = 'SMTP Fehler: Die folgenden ' .
+                                          'Empf&auml;nger sind nicht korrekt: ';
+$PHPMAILER_LANG["data_not_accepted"]    = 'SMTP Fehler: Daten werden nicht akzeptiert.';
+$PHPMAILER_LANG["connect_host"]         = 'SMTP Fehler: Konnte keine Verbindung zum SMTP-Host herstellen.';
+$PHPMAILER_LANG["file_access"]          = 'Zugriff auf folgende Datei fehlgeschlagen: ';
+$PHPMAILER_LANG["file_open"]            = 'Datei Fehler: konnte folgende Datei nicht &ouml;ffnen: ';
+$PHPMAILER_LANG["encoding"]             = 'Unbekanntes Encoding-Format: ';
+$PHPMAILER_LANG["signing"]              = 'Signing Error: ';
+
+?>
+
diff --git a/inc/classes/third_party/php_mailer/language/phpmailer.lang-dk.php b/inc/classes/third_party/php_mailer/language/phpmailer.lang-dk.php
new file mode 100644 (file)
index 0000000..fe60f31
--- /dev/null
@@ -0,0 +1,26 @@
+<?php
+/**
+ * PHPMailer language file.
+ * Danish Version
+ * Author: Mikael Stokkebro <info@stokkebro.dk>
+ */
+
+$PHPMAILER_LANG = array();
+
+$PHPMAILER_LANG["provide_address"]      = 'Du skal indtaste mindst en ' .
+                                          'modtagers emailadresse.';
+$PHPMAILER_LANG["mailer_not_supported"] = ' mailer understøttes ikke.';
+$PHPMAILER_LANG["execute"]              = 'Kunne ikke køre: ';
+$PHPMAILER_LANG["instantiate"]          = 'Kunne ikke initialisere email funktionen.';
+$PHPMAILER_LANG["authenticate"]         = 'SMTP fejl: Kunne ikke logge på.';
+$PHPMAILER_LANG["from_failed"]          = 'Følgende afsenderadresse er forkert: ';
+$PHPMAILER_LANG["recipients_failed"]    = 'SMTP fejl: Følgende' .
+                                          'modtagere er forkerte: ';
+$PHPMAILER_LANG["data_not_accepted"]    = 'SMTP fejl: Data kunne ikke accepteres.';
+$PHPMAILER_LANG["connect_host"]         = 'SMTP fejl: Kunne ikke tilslutte SMTP serveren.';
+$PHPMAILER_LANG["file_access"]          = 'Ingen adgang til fil: ';
+$PHPMAILER_LANG["file_open"]            = 'Fil fejl: Kunne ikke åbne filen: ';
+$PHPMAILER_LANG["encoding"]             = 'Ukendt encode-format: ';
+$PHPMAILER_LANG["signing"]              = 'Signing Error: ';
+
+?>
diff --git a/inc/classes/third_party/php_mailer/language/phpmailer.lang-en.php b/inc/classes/third_party/php_mailer/language/phpmailer.lang-en.php
new file mode 100644 (file)
index 0000000..f7d4286
--- /dev/null
@@ -0,0 +1,25 @@
+<?php
+/**
+ * PHPMailer language file.
+ * English Version
+ */
+
+$PHPMAILER_LANG = array();
+
+$PHPMAILER_LANG["provide_address"]      = 'You must provide at least one ' .
+                                          'recipient email address.';
+$PHPMAILER_LANG["mailer_not_supported"] = ' mailer is not supported.';
+$PHPMAILER_LANG["execute"]              = 'Could not execute: ';
+$PHPMAILER_LANG["instantiate"]          = 'Could not instantiate mail function.';
+$PHPMAILER_LANG["authenticate"]         = 'SMTP Error: Could not authenticate.';
+$PHPMAILER_LANG["from_failed"]          = 'The following From address failed: ';
+$PHPMAILER_LANG["recipients_failed"]    = 'SMTP Error: The following ' .
+                                          'recipients failed: ';
+$PHPMAILER_LANG["data_not_accepted"]    = 'SMTP Error: Data not accepted.';
+$PHPMAILER_LANG["connect_host"]         = 'SMTP Error: Could not connect to SMTP host.';
+$PHPMAILER_LANG["file_access"]          = 'Could not access file: ';
+$PHPMAILER_LANG["file_open"]            = 'File Error: Could not open file: ';
+$PHPMAILER_LANG["encoding"]             = 'Unknown encoding: ';
+$PHPMAILER_LANG["signing"]              = 'Signing Error: ';
+
+?>
diff --git a/inc/classes/third_party/php_mailer/language/phpmailer.lang-es.php b/inc/classes/third_party/php_mailer/language/phpmailer.lang-es.php
new file mode 100644 (file)
index 0000000..bebf632
--- /dev/null
@@ -0,0 +1,25 @@
+<?php
+/**
+ * PHPMailer language file.
+ * Versión en español
+ */
+
+$PHPMAILER_LANG = array();
+
+$PHPMAILER_LANG["provide_address"]      = 'Debe proveer al menos una ' .
+                                          'dirección de email como destinatario.';
+$PHPMAILER_LANG["mailer_not_supported"] = ' mailer no está soportado.';
+$PHPMAILER_LANG["execute"]              = 'No puedo ejecutar: ';
+$PHPMAILER_LANG["instantiate"]          = 'No pude crear una instancia de la función Mail.';
+$PHPMAILER_LANG["authenticate"]         = 'Error SMTP: No se pudo autentificar.';
+$PHPMAILER_LANG["from_failed"]          = 'La(s) siguiente(s) direcciones de remitente fallaron: ';
+$PHPMAILER_LANG["recipients_failed"]    = 'Error SMTP: Los siguientes ' .
+                                          'destinatarios fallaron: ';
+$PHPMAILER_LANG["data_not_accepted"]    = 'Error SMTP: Datos no aceptados.';
+$PHPMAILER_LANG["connect_host"]         = 'Error SMTP: No puedo conectar al servidor SMTP.';
+$PHPMAILER_LANG["file_access"]          = 'No puedo acceder al archivo: ';
+$PHPMAILER_LANG["file_open"]            = 'Error de Archivo: No puede abrir el archivo: ';
+$PHPMAILER_LANG["encoding"]             = 'Codificación desconocida: ';
+$PHPMAILER_LANG["signing"]              = 'Error al firmar: ';
+
+?>
diff --git a/inc/classes/third_party/php_mailer/language/phpmailer.lang-et.php b/inc/classes/third_party/php_mailer/language/phpmailer.lang-et.php
new file mode 100644 (file)
index 0000000..3fd5595
--- /dev/null
@@ -0,0 +1,24 @@
+<?php
+/**
+ * PHPMailer language file.
+ * Estonian Version
+ * By Indrek P&auml;ri
+ */
+
+$PHPMAILER_LANG = array();
+
+$PHPMAILER_LANG["provide_address"]      = 'Te peate m&auml;&auml;rama v&auml;hemalt &uuml;he saaja e-posti aadressi.';
+$PHPMAILER_LANG["mailer_not_supported"] = ' maileri tugi puudub.';
+$PHPMAILER_LANG["execute"]              = 'Tegevus eba&otilde;nnestus: ';
+$PHPMAILER_LANG["instantiate"]          = 'mail funktiooni k&auml;ivitamine eba&otilde;nnestus.';
+$PHPMAILER_LANG["authenticate"]         = 'SMTP Viga: Autoriseerimise viga.';
+$PHPMAILER_LANG["from_failed"]          = 'J&auml;rgnev saatja e-posti aadress on vigane: ';
+$PHPMAILER_LANG["recipients_failed"]    = 'SMTP Viga: J&auml;rgnevate saajate e-posti aadressid on vigased: ';
+$PHPMAILER_LANG["data_not_accepted"]    = 'SMTP Viga: Vigased andmed.';
+$PHPMAILER_LANG["connect_host"]         = 'SMTP Viga: Ei &otilde;nnestunud luua &uuml;hendust SMTP serveriga.';
+$PHPMAILER_LANG["file_access"]          = 'Pole piisavalt &otilde;iguseid j&auml;rgneva faili avamiseks: ';
+$PHPMAILER_LANG["file_open"]            = 'Faili Viga: Faili avamine eba&otilde;nnestus: ';
+$PHPMAILER_LANG["encoding"]             = 'Tundmatu Unknown kodeering: ';
+$PHPMAILER_LANG["signing"]              = 'Signing Error: ';
+
+?>
diff --git a/inc/classes/third_party/php_mailer/language/phpmailer.lang-fi.php b/inc/classes/third_party/php_mailer/language/phpmailer.lang-fi.php
new file mode 100644 (file)
index 0000000..e2bb497
--- /dev/null
@@ -0,0 +1,25 @@
+<?php
+/**
+ * PHPMailer language file.
+ * Finnish Version
+ * By Jyry Kuukanen
+ */
+
+$PHPMAILER_LANG = array();
+
+$PHPMAILER_LANG["provide_address"]      = 'Aseta v&auml;hint&auml;&auml;n yksi vastaanottajan ' .
+                                          's&auml;hk&ouml;postiosoite.';
+$PHPMAILER_LANG["mailer_not_supported"] = 'postiv&auml;litintyyppi&auml; ei tueta.';
+$PHPMAILER_LANG["execute"]              = 'Suoritus ep&auml;onnistui: ';
+$PHPMAILER_LANG["instantiate"]          = 'mail-funktion luonti ep&auml;onnistui.';
+$PHPMAILER_LANG["authenticate"]         = 'SMTP-virhe: k&auml;ytt&auml;j&auml;tunnistus ep&auml;onnistui.';
+$PHPMAILER_LANG["from_failed"]          = 'Seuraava l&auml;hett&auml;j&auml;n osoite on virheellinen: ';
+$PHPMAILER_LANG["recipients_failed"]    = 'SMTP-virhe: seuraava vastaanottaja osoite on virheellinen.';
+$PHPMAILER_LANG["data_not_accepted"]    = 'SMTP-virhe: data on virheellinen.';
+$PHPMAILER_LANG["connect_host"]         = 'SMTP-virhe: yhteys palvelimeen ei onnistu.';
+$PHPMAILER_LANG["file_access"]          = 'Seuraavaan tiedostoon ei ole oikeuksia: ';
+$PHPMAILER_LANG["file_open"]            = 'Tiedostovirhe: Ei voida avata tiedostoa: ';
+$PHPMAILER_LANG["encoding"]             = 'Tuntematon koodaustyyppi: ';
+$PHPMAILER_LANG["signing"]              = 'Signing Error: ';
+
+?>
diff --git a/inc/classes/third_party/php_mailer/language/phpmailer.lang-fo.php b/inc/classes/third_party/php_mailer/language/phpmailer.lang-fo.php
new file mode 100644 (file)
index 0000000..13b136f
--- /dev/null
@@ -0,0 +1,27 @@
+<?php
+/**
+ * PHPMailer language file.
+ * Faroese Version [language of the Faroe Islands, a Danish dominion]
+ * This file created: 11-06-2004
+ * Supplied by Dávur Sørensen [www.profo-webdesign.dk]
+ */
+
+$PHPMAILER_LANG = array();
+
+$PHPMAILER_LANG["provide_address"]      = 'Tú skal uppgeva minst ' .
+                                          'móttakara-emailadressu(r).';
+$PHPMAILER_LANG["mailer_not_supported"] = ' er ikki supporterað.';
+$PHPMAILER_LANG["execute"]              = 'Kundi ikki útføra: ';
+$PHPMAILER_LANG["instantiate"]          = 'Kuni ikki instantiera mail funktión.';
+$PHPMAILER_LANG["authenticate"]         = 'SMTP feilur: Kundi ikki góðkenna.';
+$PHPMAILER_LANG["from_failed"]          = 'fylgjandi Frá/From adressa miseydnaðist: ';
+$PHPMAILER_LANG["recipients_failed"]    = 'SMTP Feilur: Fylgjandi ' .
+                                          'móttakarar miseydnaðust: ';
+$PHPMAILER_LANG["data_not_accepted"]    = 'SMTP feilur: Data ikki góðkent.';
+$PHPMAILER_LANG["connect_host"]         = 'SMTP feilur: Kundi ikki knýta samband við SMTP vert.';
+$PHPMAILER_LANG["file_access"]          = 'Kundi ikki tilganga fílu: ';
+$PHPMAILER_LANG["file_open"]            = 'Fílu feilur: Kundi ikki opna fílu: ';
+$PHPMAILER_LANG["encoding"]             = 'Ókend encoding: ';
+$PHPMAILER_LANG["signing"]              = 'Signing Error: ';
+
+?>
diff --git a/inc/classes/third_party/php_mailer/language/phpmailer.lang-fr.php b/inc/classes/third_party/php_mailer/language/phpmailer.lang-fr.php
new file mode 100644 (file)
index 0000000..8ef292a
--- /dev/null
@@ -0,0 +1,26 @@
+<?php
+/**
+ * PHPMailer language file.
+ * French Version
+ */
+
+$PHPMAILER_LANG = array();
+
+$PHPMAILER_LANG["provide_address"]      = 'Vous devez fournir au moins une ' .
+                                          'adresse de destinataire.';
+$PHPMAILER_LANG["mailer_not_supported"] = ' client de messagerie non supporté.';
+$PHPMAILER_LANG["execute"]              = 'Impossible de lancer l\'exécution : ';
+$PHPMAILER_LANG["instantiate"]          = 'Impossible d\'instancier la fonction mail.';
+$PHPMAILER_LANG["authenticate"]         = 'Erreur SMTP : Echec de l\'authentification.';
+$PHPMAILER_LANG["from_failed"]          = 'L\'adresse d\'expéditeur suivante a échouée : ';
+$PHPMAILER_LANG["recipients_failed"]    = 'Erreur SMTP : Les destinataires ' .
+                                          'suivants sont en erreur : ';
+$PHPMAILER_LANG["data_not_accepted"]    = 'Erreur SMTP : Données incorrects.';
+$PHPMAILER_LANG["connect_host"]         = 'Erreur SMTP : Impossible de se connecter au serveur SMTP.';
+$PHPMAILER_LANG["file_access"]          = 'Impossible d\'accéder au fichier : ';
+$PHPMAILER_LANG["file_open"]            = 'Erreur Fichier : ouverture impossible : ';
+$PHPMAILER_LANG["encoding"]             = 'Encodage inconnu : ';
+$PHPMAILER_LANG["signing"]              = 'Signing Error: ';
+
+?>
+
diff --git a/inc/classes/third_party/php_mailer/language/phpmailer.lang-hu.php b/inc/classes/third_party/php_mailer/language/phpmailer.lang-hu.php
new file mode 100644 (file)
index 0000000..8eafba7
--- /dev/null
@@ -0,0 +1,25 @@
+<?php
+/**
+ * PHPMailer language file.
+ * Hungarian Version
+ */
+
+$PHPMAILER_LANG = array();
+
+$PHPMAILER_LANG["provide_address"]      = 'Meg kell adnod legalább egy ' .
+                                          'címzett email címet.';
+$PHPMAILER_LANG["mailer_not_supported"] = ' levelezõ nem támogatott.';
+$PHPMAILER_LANG["execute"]              = 'Nem tudtam végrehajtani: ';
+$PHPMAILER_LANG["instantiate"]          = 'Nem sikerült példányosítani a mail funkciót.';
+$PHPMAILER_LANG["authenticate"]         = 'SMTP Hiba: Sikertelen autentikáció.';
+$PHPMAILER_LANG["from_failed"]          = 'Az alábbi Feladó cím hibás: ';
+$PHPMAILER_LANG["recipients_failed"]    = 'SMTP Hiba: Az alábbi ' .
+                                          'címzettek hibásak: ';
+$PHPMAILER_LANG["data_not_accepted"]    = 'SMTP Hiba: Nem elfogadható adat.';
+$PHPMAILER_LANG["connect_host"]         = 'SMTP Hiba: Nem tudtam csatlakozni az SMTP host-hoz.';
+$PHPMAILER_LANG["file_access"]          = 'Nem sikerült elérni a következõ fájlt: ';
+$PHPMAILER_LANG["file_open"]            = 'Fájl Hiba: Nem sikerült megnyitni a következõ fájlt: ';
+$PHPMAILER_LANG["encoding"]             = 'Ismeretlen kódolás: ';
+$PHPMAILER_LANG["signing"]              = 'Signing Error: ';
+
+?>
diff --git a/inc/classes/third_party/php_mailer/language/phpmailer.lang-it.php b/inc/classes/third_party/php_mailer/language/phpmailer.lang-it.php
new file mode 100644 (file)
index 0000000..2fb6a5d
--- /dev/null
@@ -0,0 +1,30 @@
+<?php
+/**
+* PHPMailer language file.
+* Italian version
+* @package PHPMailer
+* @author Ilias Bartolini <brain79@inwind.it>
+*/
+
+$PHPMAILER_LANG = array();
+
+$PHPMAILER_LANG["provide_address"]      = 'Deve essere fornito almeno un'.
+                                          ' indirizzo ricevente';
+$PHPMAILER_LANG["mailer_not_supported"] = 'Mailer non supportato';
+$PHPMAILER_LANG["execute"]              = "Impossibile eseguire l'operazione: ";
+$PHPMAILER_LANG["instantiate"]          = 'Impossibile istanziare la funzione mail';
+$PHPMAILER_LANG["authenticate"]         = 'SMTP Error: Impossibile autenticarsi.';
+$PHPMAILER_LANG["from_failed"]          = 'I seguenti indirizzi mittenti hanno'.
+                                          ' generato errore: ';
+$PHPMAILER_LANG["recipients_failed"]    = 'SMTP Error: I seguenti indirizzi'.
+                                          'destinatari hanno generato errore: ';
+$PHPMAILER_LANG["data_not_accepted"]    = 'SMTP Error: Data non accettati dal'.
+                                          'server.';
+$PHPMAILER_LANG["connect_host"]         = 'SMTP Error: Impossibile connettersi'.
+                                          ' all\'host SMTP.';
+$PHPMAILER_LANG["file_access"]          = 'Impossibile accedere al file: ';
+$PHPMAILER_LANG["file_open"]            = 'File Error: Impossibile aprire il file: ';
+$PHPMAILER_LANG["encoding"]             = 'Encoding set dei caratteri sconosciuto: ';
+$PHPMAILER_LANG["signing"]              = 'Signing Error: ';
+
+?>
diff --git a/inc/classes/third_party/php_mailer/language/phpmailer.lang-ja.php b/inc/classes/third_party/php_mailer/language/phpmailer.lang-ja.php
new file mode 100644 (file)
index 0000000..2e188eb
Binary files /dev/null and b/inc/classes/third_party/php_mailer/language/phpmailer.lang-ja.php differ
diff --git a/inc/classes/third_party/php_mailer/language/phpmailer.lang-nl.php b/inc/classes/third_party/php_mailer/language/phpmailer.lang-nl.php
new file mode 100644 (file)
index 0000000..262b543
--- /dev/null
@@ -0,0 +1,25 @@
+<?php
+/**
+ * PHPMailer language file.
+ * Dutch Version
+ */
+
+$PHPMAILER_LANG = array();
+
+$PHPMAILER_LANG["provide_address"]      = 'Er moet tenmiste &eacute;&eacute;n ' .
+                                          'ontvanger emailadres opgegeven worden.';
+$PHPMAILER_LANG["mailer_not_supported"] = ' mailer wordt niet ondersteund.';
+$PHPMAILER_LANG["execute"]              = 'Kon niet uitvoeren: ';
+$PHPMAILER_LANG["instantiate"]          = 'Kon mail functie niet initialiseren.';
+$PHPMAILER_LANG["authenticate"]         = 'SMTP Fout: authenticatie mislukt.';
+$PHPMAILER_LANG["from_failed"]          = 'De volgende afzender adressen zijn mislukt: ';
+$PHPMAILER_LANG["recipients_failed"]    = 'SMTP Fout: De volgende ' .
+                                          'ontvangers zijn mislukt: ';
+$PHPMAILER_LANG["data_not_accepted"]    = 'SMTP Fout: Data niet geaccepteerd.';
+$PHPMAILER_LANG["connect_host"]         = 'SMTP Fout: Kon niet verbinden met SMTP host.';
+$PHPMAILER_LANG["file_access"]          = 'Kreeg geen toegang tot bestand: ';
+$PHPMAILER_LANG["file_open"]            = 'Bestandsfout: Kon bestand niet openen: ';
+$PHPMAILER_LANG["encoding"]             = 'Onbekende codering: ';
+$PHPMAILER_LANG["signing"]              = 'Signing Error: ';
+
+?>
diff --git a/inc/classes/third_party/php_mailer/language/phpmailer.lang-no.php b/inc/classes/third_party/php_mailer/language/phpmailer.lang-no.php
new file mode 100644 (file)
index 0000000..9a25341
--- /dev/null
@@ -0,0 +1,25 @@
+<?php
+/**
+ * PHPMailer language file.
+ * Norwegian Version
+ */
+
+$PHPMAILER_LANG = array();
+
+$PHPMAILER_LANG["provide_address"]      = 'Du må ha med minst en' .
+                                          'mottager adresse.';
+$PHPMAILER_LANG["mailer_not_supported"] = ' mailer er ikke supportert.';
+$PHPMAILER_LANG["execute"]              = 'Kunne ikke utføre: ';
+$PHPMAILER_LANG["instantiate"]          = 'Kunne ikke instantiate mail funksjonen.';
+$PHPMAILER_LANG["authenticate"]         = 'SMTP Feil: Kunne ikke authentisere.';
+$PHPMAILER_LANG["from_failed"]          = 'Følgende Fra feilet: ';
+$PHPMAILER_LANG["recipients_failed"]    = 'SMTP Feil: Følgende' .
+                                          'mottagere feilet: ';
+$PHPMAILER_LANG["data_not_accepted"]    = 'SMTP Feil: Data ble ikke akseptert.';
+$PHPMAILER_LANG["connect_host"]         = 'SMTP Feil: Kunne ikke koble til SMTP host.';
+$PHPMAILER_LANG["file_access"]          = 'Kunne ikke få tilgang til filen: ';
+$PHPMAILER_LANG["file_open"]            = 'Fil feil: Kunne ikke åpne filen: ';
+$PHPMAILER_LANG["encoding"]             = 'Ukjent encoding: ';
+$PHPMAILER_LANG["signing"]              = 'Signing Error: ';
+
+?>
diff --git a/inc/classes/third_party/php_mailer/language/phpmailer.lang-pl.php b/inc/classes/third_party/php_mailer/language/phpmailer.lang-pl.php
new file mode 100644 (file)
index 0000000..e2f86ff
--- /dev/null
@@ -0,0 +1,25 @@
+<?php
+/**
+ * PHPMailer language file.
+ * Polish Version, encoding: windows-1250
+ * translated from english lang file ver. 1.72
+ */
+
+$PHPMAILER_LANG = array();
+
+$PHPMAILER_LANG["provide_address"]      = 'Nale¿y podaæ prawid³owy adres email Odbiorcy.';
+$PHPMAILER_LANG["mailer_not_supported"] = 'Wybrana metoda wysy³ki wiadomoœci nie jest obs³ugiwana.';
+$PHPMAILER_LANG["execute"]              = 'Nie mo¿na uruchomiæ: ';
+$PHPMAILER_LANG["instantiate"]          = 'Nie mo¿na wywo³aæ funkcji mail(). SprawdŸ konfiguracjê serwera.';
+$PHPMAILER_LANG["authenticate"]         = 'B³¹d SMTP: Nie mo¿na przeprowadziæ autentykacji.';
+$PHPMAILER_LANG["from_failed"]          = 'Nastêpuj¹cy adres Nadawcy jest jest nieprawid³owy: ';
+$PHPMAILER_LANG["recipients_failed"]    = 'B³¹d SMTP: Nastêpuj¹cy ' .
+                                          'odbiorcy s¹ nieprawid³owi: ';
+$PHPMAILER_LANG["data_not_accepted"]    = 'B³¹d SMTP: Dane nie zosta³y przyjête.';
+$PHPMAILER_LANG["connect_host"]         = 'B³¹d SMTP: Nie mo¿na po³¹czyæ siê z wybranym hostem.';
+$PHPMAILER_LANG["file_access"]          = 'Brak dostêpu do pliku: ';
+$PHPMAILER_LANG["file_open"]            = 'Nie mo¿na otworzyæ pliku: ';
+$PHPMAILER_LANG["encoding"]             = 'Nieznany sposób kodowania znaków: ';
+$PHPMAILER_LANG["signing"]              = 'Signing Error: ';
+
+?>
diff --git a/inc/classes/third_party/php_mailer/language/phpmailer.lang-ro.php b/inc/classes/third_party/php_mailer/language/phpmailer.lang-ro.php
new file mode 100644 (file)
index 0000000..3350217
--- /dev/null
@@ -0,0 +1,25 @@
+<?php
+/**
+ * PHPMailer language file.
+ * Romanian Version
+ * @package PHPMailer
+ * @author Catalin Constantin <catalin@dazoot.ro>
+ */
+
+$PHPMAILER_LANG = array();
+
+$PHPMAILER_LANG["provide_address"]      = 'Trebuie sa adaugati cel putin un recipient (adresa de mail).';
+$PHPMAILER_LANG["mailer_not_supported"] = ' mailer nu este suportat.';
+$PHPMAILER_LANG["execute"]              = 'Nu pot executa:  ';
+$PHPMAILER_LANG["instantiate"]          = 'Nu am putut instantia functia mail.';
+$PHPMAILER_LANG["authenticate"]         = 'Eroare SMTP: Nu a functionat autentificarea.';
+$PHPMAILER_LANG["from_failed"]          = 'Urmatoarele adrese From au dat eroare: ';
+$PHPMAILER_LANG["recipients_failed"]    = 'Eroare SMTP: Urmatoarele adrese de mail au dat eroare: ';
+$PHPMAILER_LANG["data_not_accepted"]    = 'Eroare SMTP: Continutul mailului nu a fost acceptat.';
+$PHPMAILER_LANG["connect_host"]         = 'Eroare SMTP: Nu m-am putut conecta la adresa SMTP.';
+$PHPMAILER_LANG["file_access"]          = 'Nu pot accesa fisierul: ';
+$PHPMAILER_LANG["file_open"]            = 'Eroare de fisier: Nu pot deschide fisierul: ';
+$PHPMAILER_LANG["encoding"]             = 'Encodare necunoscuta: ';
+$PHPMAILER_LANG["signing"]              = 'Signing Error: ';
+
+?>
diff --git a/inc/classes/third_party/php_mailer/language/phpmailer.lang-ru.php b/inc/classes/third_party/php_mailer/language/phpmailer.lang-ru.php
new file mode 100644 (file)
index 0000000..2e1b148
--- /dev/null
@@ -0,0 +1,26 @@
+<?php
+/**
+ * PHPMailer language file.
+ * Russian Version by Alexey Chumakov <alex@chumakov.ru>
+ */
+
+$PHPMAILER_LANG = array();
+
+$PHPMAILER_LANG["provide_address"]      = 'Ïîæàëóéñòà, ââåäèòå õîòÿ áû îäèí àäðåñ e-mail ' .
+                                          'ïîëó÷àòåëÿ.';
+$PHPMAILER_LANG["mailer_not_supported"] = ' - ïî÷òîâûé ñåðâåð íå ïîääåðæèâàåòñÿ.';
+$PHPMAILER_LANG["execute"]              = 'Íåâîçìîæíî âûïîëíèòü êîìàíäó: ';
+$PHPMAILER_LANG["instantiate"]          = 'Íåâîçìîæíî çàïóñòèòü ôóíêöèþ mail.';
+$PHPMAILER_LANG["authenticate"]         = 'Îøèáêà SMTP: îøèáêà àâòîðèçàöèè.';
+$PHPMAILER_LANG["from_failed"]          = 'Íåâåðíûé àäðåñ îòïðàâèòåëÿ: ';
+$PHPMAILER_LANG["recipients_failed"]    = 'Îøèáêà SMTP: îòïðàâêà ïî ñëåäóþùèì ' .
+                                          'àäðåñàì ïîëó÷àòåëåé íå óäàëàñü: ';
+$PHPMAILER_LANG["data_not_accepted"]    = 'Îøèáêà SMTP: äàííûå íå ïðèíÿòû.';
+$PHPMAILER_LANG["connect_host"]         = 'Îøèáêà SMTP: íå óäàåòñÿ ïîäêëþ÷èòüñÿ ê ñåðâåðó SMTP.';
+$PHPMAILER_LANG["file_access"]          = 'Íåò äîñòóïà ê ôàéëó: ';
+$PHPMAILER_LANG["file_open"]            = 'Ôàéëîâàÿ îøèáêà: íå óäàåòñÿ îòêðûòü ôàéë: ';
+$PHPMAILER_LANG["encoding"]             = 'Íåèçâåñòíûé âèä êîäèðîâêè: ';
+$PHPMAILER_LANG["signing"]              = 'Signing Error: ';
+
+?>
+
diff --git a/inc/classes/third_party/php_mailer/language/phpmailer.lang-se.php b/inc/classes/third_party/php_mailer/language/phpmailer.lang-se.php
new file mode 100644 (file)
index 0000000..e61bbb1
--- /dev/null
@@ -0,0 +1,26 @@
+<?php
+/**
+ * PHPMailer language file.
+ * Swedish Version
+ * Author: Johan Linnér <johan@linner.biz>
+ */
+
+$PHPMAILER_LANG = array();
+
+$PHPMAILER_LANG["provide_address"]      = 'Du måste ange minst en ' .
+                                          'mottagares e-postadress.';
+$PHPMAILER_LANG["mailer_not_supported"] = ' mailer stöds inte.';
+$PHPMAILER_LANG["execute"]              = 'Kunde inte köra: ';
+$PHPMAILER_LANG["instantiate"]          = 'Kunde inte initiera e-postfunktion.';
+$PHPMAILER_LANG["authenticate"]         = 'SMTP fel: Kunde inte autentisera.';
+$PHPMAILER_LANG["from_failed"]          = 'Följande avsändaradress är felaktig: ';
+$PHPMAILER_LANG["recipients_failed"]    = 'SMTP fel: Följande ' .
+                                          'mottagare är felaktig: ';
+$PHPMAILER_LANG["data_not_accepted"]    = 'SMTP fel: Data accepterades inte.';
+$PHPMAILER_LANG["connect_host"]         = 'SMTP fel: Kunde inte ansluta till SMTP-server.';
+$PHPMAILER_LANG["file_access"]          = 'Ingen åtkomst till fil: ';
+$PHPMAILER_LANG["file_open"]            = 'Fil fel: Kunde inte öppna fil: ';
+$PHPMAILER_LANG["encoding"]             = 'Okänt encode-format: ';
+$PHPMAILER_LANG["signing"]              = 'Signing Error: ';
+
+?>
diff --git a/inc/classes/third_party/php_mailer/language/phpmailer.lang-tr.php b/inc/classes/third_party/php_mailer/language/phpmailer.lang-tr.php
new file mode 100644 (file)
index 0000000..c8f388e
--- /dev/null
@@ -0,0 +1,26 @@
+<?php
+/**
+ * PHPMailer dil dosyasý.
+ * Türkçe Versiyonu
+ * ÝZYAZILIM - Elçin Özel - Can Yýlmaz - Mehmet Benlioðlu
+ */
+
+$PHPMAILER_LANG = array();
+
+$PHPMAILER_LANG["provide_address"]      = 'En az bir tane mail adresi belirtmek zorundasýnýz ' .
+                                          'alýcýnýn email adresi.';
+$PHPMAILER_LANG["mailer_not_supported"] = ' mailler desteklenmemektedir.';
+$PHPMAILER_LANG["execute"]              = 'Çalýþtýrýlamýyor: ';
+$PHPMAILER_LANG["instantiate"]          = 'Örnek mail fonksiyonu yaratýlamadý.';
+$PHPMAILER_LANG["authenticate"]         = 'SMTP Hatasý: Doðrulanamýyor.';
+$PHPMAILER_LANG["from_failed"]          = 'Baþarýsýz olan gönderici adresi: ';
+$PHPMAILER_LANG["recipients_failed"]    = 'SMTP Hatasý:  ' .
+                                          'alýcýlara ulaþmadý: ';
+$PHPMAILER_LANG["data_not_accepted"]    = 'SMTP Hatasý: Veri kabul edilmedi.';
+$PHPMAILER_LANG["connect_host"]         = 'SMTP Hatasý: SMTP hosta baðlanýlamýyor.';
+$PHPMAILER_LANG["file_access"]          = 'Dosyaya eriþilemiyor: ';
+$PHPMAILER_LANG["file_open"]            = 'Dosya Hatasý: Dosya açýlamýyor: ';
+$PHPMAILER_LANG["encoding"]             = 'Bilinmeyen þifreleme: ';
+$PHPMAILER_LANG["signing"]              = 'Signing Error: ';
+
+?>
diff --git a/inc/classes/third_party/php_mailer/phpdoc/PHPMailer/PHPMailer.html b/inc/classes/third_party/php_mailer/phpdoc/PHPMailer/PHPMailer.html
new file mode 100644 (file)
index 0000000..87be402
--- /dev/null
@@ -0,0 +1,1475 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+  <html xmlns="http://www.w3.org/1999/xhtml">
+               <head>
+                       <!-- template designed by Marco Von Ballmoos -->
+                       <title>Docs For Class PHPMailer</title>
+                       <link rel="stylesheet" href="../media/stylesheet.css" />
+                       <meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'/>
+               </head>
+               <body>
+                       <div class="page-body">                 
+<h2 class="class-name">Class PHPMailer</h2>
+
+<a name="sec-description"></a>
+<div class="info-box">
+       <div class="info-box-title">Description</div>
+       <div class="nav-bar">
+                                       <span class="disabled">Description</span> |
+                                                                                                       <a href="#sec-var-summary">Vars</a> (<a href="#sec-vars">details</a>)
+                                               |                                                                                       <a href="#sec-method-summary">Methods</a> (<a href="#sec-methods">details</a>)
+                                               
+                       </div>
+       <div class="info-box-body">
+               <!-- ========== Info from phpDoc block ========= -->
+<p class="short-description">PHPMailer - PHP email transport class</p>
+       <ul class="tags">
+                               <li><span class="field">copyright:</span> <p>2001 - 2003 Brent R. Matzelle</p></li>
+                               <li><span class="field">author:</span> <p>Brent R. Matzelle</p></li>
+                       </ul>
+               <p class="notes">
+                       Located in <a class="field" href="_class_phpmailer_php.html">Program_Root/class.phpmailer.php</a> (line <span class="field">20</span>)
+               </p>
+               
+                               
+               <pre></pre>
+       
+                       </div>
+</div>
+
+
+       <a name="sec-var-summary"></a>
+       <div class="info-box">
+               <div class="info-box-title">Variable Summary</span></div>
+               <div class="nav-bar">
+                       <a href="#sec-description">Description</a> |
+                                               <span class="disabled">Vars</span> (<a href="#sec-vars">details</a>)
+                                                       | 
+                                                                       <a href="#sec-method-summary">Methods</a> (<a href="#sec-methods">details</a>)
+                                                       
+                                       </div>
+               <div class="info-box-body">
+                       <div class="var-summary">
+                                                               <div class="var-title">
+                                       <span class="var-type">string</span>
+                                       <a href="#$AltBody" title="details" class="var-name">$AltBody</a>
+                               </div>
+                                                               <div class="var-title">
+                                       <span class="var-type">string</span>
+                                       <a href="#$Body" title="details" class="var-name">$Body</a>
+                               </div>
+                                                               <div class="var-title">
+                                       <span class="var-type">string</span>
+                                       <a href="#$CharSet" title="details" class="var-name">$CharSet</a>
+                               </div>
+                                                               <div class="var-title">
+                                       <span class="var-type">string</span>
+                                       <a href="#$ConfirmReadingTo" title="details" class="var-name">$ConfirmReadingTo</a>
+                               </div>
+                                                               <div class="var-title">
+                                       <span class="var-type">string</span>
+                                       <a href="#$ContentType" title="details" class="var-name">$ContentType</a>
+                               </div>
+                                                               <div class="var-title">
+                                       <span class="var-type">string</span>
+                                       <a href="#$Encoding" title="details" class="var-name">$Encoding</a>
+                               </div>
+                                                               <div class="var-title">
+                                       <span class="var-type">string</span>
+                                       <a href="#$ErrorInfo" title="details" class="var-name">$ErrorInfo</a>
+                               </div>
+                                                               <div class="var-title">
+                                       <span class="var-type">string</span>
+                                       <a href="#$From" title="details" class="var-name">$From</a>
+                               </div>
+                                                               <div class="var-title">
+                                       <span class="var-type">string</span>
+                                       <a href="#$FromName" title="details" class="var-name">$FromName</a>
+                               </div>
+                                                               <div class="var-title">
+                                       <span class="var-type">string</span>
+                                       <a href="#$Helo" title="details" class="var-name">$Helo</a>
+                               </div>
+                                                               <div class="var-title">
+                                       <span class="var-type">string</span>
+                                       <a href="#$Host" title="details" class="var-name">$Host</a>
+                               </div>
+                                                               <div class="var-title">
+                                       <span class="var-type">string</span>
+                                       <a href="#$Hostname" title="details" class="var-name">$Hostname</a>
+                               </div>
+                                                               <div class="var-title">
+                                       <span class="var-type">string</span>
+                                       <a href="#$Mailer" title="details" class="var-name">$Mailer</a>
+                               </div>
+                                                               <div class="var-title">
+                                       <span class="var-type">string</span>
+                                       <a href="#$Password" title="details" class="var-name">$Password</a>
+                               </div>
+                                                               <div class="var-title">
+                                       <span class="var-type">string</span>
+                                       <a href="#$PluginDir" title="details" class="var-name">$PluginDir</a>
+                               </div>
+                                                               <div class="var-title">
+                                       <span class="var-type">int</span>
+                                       <a href="#$Port" title="details" class="var-name">$Port</a>
+                               </div>
+                                                               <div class="var-title">
+                                       <span class="var-type">int</span>
+                                       <a href="#$Priority" title="details" class="var-name">$Priority</a>
+                               </div>
+                                                               <div class="var-title">
+                                       <span class="var-type">string</span>
+                                       <a href="#$Sender" title="details" class="var-name">$Sender</a>
+                               </div>
+                                                               <div class="var-title">
+                                       <span class="var-type">string</span>
+                                       <a href="#$Sendmail" title="details" class="var-name">$Sendmail</a>
+                               </div>
+                                                               <div class="var-title">
+                                       <span class="var-type">bool</span>
+                                       <a href="#$SMTPAuth" title="details" class="var-name">$SMTPAuth</a>
+                               </div>
+                                                               <div class="var-title">
+                                       <span class="var-type">bool</span>
+                                       <a href="#$SMTPDebug" title="details" class="var-name">$SMTPDebug</a>
+                               </div>
+                                                               <div class="var-title">
+                                       <span class="var-type">bool</span>
+                                       <a href="#$SMTPKeepAlive" title="details" class="var-name">$SMTPKeepAlive</a>
+                               </div>
+                                                               <div class="var-title">
+                                       <span class="var-type">string</span>
+                                       <a href="#$Subject" title="details" class="var-name">$Subject</a>
+                               </div>
+                                                               <div class="var-title">
+                                       <span class="var-type">int</span>
+                                       <a href="#$Timeout" title="details" class="var-name">$Timeout</a>
+                               </div>
+                                                               <div class="var-title">
+                                       <span class="var-type">string</span>
+                                       <a href="#$Username" title="details" class="var-name">$Username</a>
+                               </div>
+                                                               <div class="var-title">
+                                       <span class="var-type">string</span>
+                                       <a href="#$Version" title="details" class="var-name">$Version</a>
+                               </div>
+                                                               <div class="var-title">
+                                       <span class="var-type">int</span>
+                                       <a href="#$WordWrap" title="details" class="var-name">$WordWrap</a>
+                               </div>
+                                                       </div>
+               </div>
+       </div>
+
+       <a name="sec-method-summary"></a>
+       <div class="info-box">
+               <div class="info-box-title">Method Summary</span></div>
+               <div class="nav-bar">
+                       <a href="#sec-description">Description</a> |
+                                                                                                                       <a href="#sec-var-summary">Vars</a> (<a href="#sec-vars">details</a>)
+                                
+                               |
+                                               <span class="disabled">Methods</span> (<a href="#sec-methods">details</a>)
+               </div>
+               <div class="info-box-body">                     
+                       <div class="method-summary">
+                                                               
+                               <div class="method-definition">
+                                                                                       <span class="method-result">void</span>
+                                                                               <a href="#AddAddress" title="details" class="method-name">AddAddress</a>
+                                                                                       (<span class="var-type">string</span>&nbsp;<span class="var-name">$address</span>, [<span class="var-type">string</span>&nbsp;<span class="var-name">$name</span> = <span class="var-default">""</span>])
+                                                                       </div>
+                                                               
+                               <div class="method-definition">
+                                                                                       <span class="method-result">bool</span>
+                                                                               <a href="#AddAttachment" title="details" class="method-name">AddAttachment</a>
+                                                                                       (<span class="var-type">string</span>&nbsp;<span class="var-name">$path</span>, [<span class="var-type">string</span>&nbsp;<span class="var-name">$name</span> = <span class="var-default">""</span>], [<span class="var-type">string</span>&nbsp;<span class="var-name">$encoding</span> = <span class="var-default">"base64"</span>], [<span class="var-type">string</span>&nbsp;<span class="var-name">$type</span> = <span class="var-default">"application/octet-stream"</span>])
+                                                                       </div>
+                                                               
+                               <div class="method-definition">
+                                                                                       <span class="method-result">void</span>
+                                                                               <a href="#AddBCC" title="details" class="method-name">AddBCC</a>
+                                                                                       (<span class="var-type">string</span>&nbsp;<span class="var-name">$address</span>, [<span class="var-type">string</span>&nbsp;<span class="var-name">$name</span> = <span class="var-default">""</span>])
+                                                                       </div>
+                                                               
+                               <div class="method-definition">
+                                                                                       <span class="method-result">void</span>
+                                                                               <a href="#AddCC" title="details" class="method-name">AddCC</a>
+                                                                                       (<span class="var-type">string</span>&nbsp;<span class="var-name">$address</span>, [<span class="var-type">string</span>&nbsp;<span class="var-name">$name</span> = <span class="var-default">""</span>])
+                                                                       </div>
+                                                               
+                               <div class="method-definition">
+                                                                                       <span class="method-result">void</span>
+                                                                               <a href="#AddCustomHeader" title="details" class="method-name">AddCustomHeader</a>
+                                                                                       (<span class="var-type">mixed</span>&nbsp;<span class="var-name">$custom_header</span>)
+                                                                       </div>
+                                                               
+                               <div class="method-definition">
+                                                                                       <span class="method-result">bool</span>
+                                                                               <a href="#AddEmbeddedImage" title="details" class="method-name">AddEmbeddedImage</a>
+                                                                                       (<span class="var-type">string</span>&nbsp;<span class="var-name">$path</span>, <span class="var-type">string</span>&nbsp;<span class="var-name">$cid</span>, [<span class="var-type">string</span>&nbsp;<span class="var-name">$name</span> = <span class="var-default">""</span>], [<span class="var-type">string</span>&nbsp;<span class="var-name">$encoding</span> = <span class="var-default">"base64"</span>], [<span class="var-type">string</span>&nbsp;<span class="var-name">$type</span> = <span class="var-default">"application/octet-stream"</span>])
+                                                                       </div>
+                                                               
+                               <div class="method-definition">
+                                                                                       <span class="method-result">void</span>
+                                                                               <a href="#AddReplyTo" title="details" class="method-name">AddReplyTo</a>
+                                                                                       (<span class="var-type">string</span>&nbsp;<span class="var-name">$address</span>, [<span class="var-type">string</span>&nbsp;<span class="var-name">$name</span> = <span class="var-default">""</span>])
+                                                                       </div>
+                                                               
+                               <div class="method-definition">
+                                                                                       <span class="method-result">void</span>
+                                                                               <a href="#AddStringAttachment" title="details" class="method-name">AddStringAttachment</a>
+                                                                                       (<span class="var-type">string</span>&nbsp;<span class="var-name">$string</span>, <span class="var-type">string</span>&nbsp;<span class="var-name">$filename</span>, [<span class="var-type">string</span>&nbsp;<span class="var-name">$encoding</span> = <span class="var-default">"base64"</span>], [<span class="var-type">string</span>&nbsp;<span class="var-name">$type</span> = <span class="var-default">"application/octet-stream"</span>])
+                                                                       </div>
+                                                               
+                               <div class="method-definition">
+                                                                                       <span class="method-result">void</span>
+                                                                               <a href="#ClearAddresses" title="details" class="method-name">ClearAddresses</a>
+                                                                               ()
+                                                                       </div>
+                                                               
+                               <div class="method-definition">
+                                                                                       <span class="method-result">void</span>
+                                                                               <a href="#ClearAllRecipients" title="details" class="method-name">ClearAllRecipients</a>
+                                                                               ()
+                                                                       </div>
+                                                               
+                               <div class="method-definition">
+                                                                                       <span class="method-result">void</span>
+                                                                               <a href="#ClearAttachments" title="details" class="method-name">ClearAttachments</a>
+                                                                               ()
+                                                                       </div>
+                                                               
+                               <div class="method-definition">
+                                                                                       <span class="method-result">void</span>
+                                                                               <a href="#ClearBCCs" title="details" class="method-name">ClearBCCs</a>
+                                                                               ()
+                                                                       </div>
+                                                               
+                               <div class="method-definition">
+                                                                                       <span class="method-result">void</span>
+                                                                               <a href="#ClearCCs" title="details" class="method-name">ClearCCs</a>
+                                                                               ()
+                                                                       </div>
+                                                               
+                               <div class="method-definition">
+                                                                                       <span class="method-result">void</span>
+                                                                               <a href="#ClearCustomHeaders" title="details" class="method-name">ClearCustomHeaders</a>
+                                                                               ()
+                                                                       </div>
+                                                               
+                               <div class="method-definition">
+                                                                                       <span class="method-result">void</span>
+                                                                               <a href="#ClearReplyTos" title="details" class="method-name">ClearReplyTos</a>
+                                                                               ()
+                                                                       </div>
+                                                               
+                               <div class="method-definition">
+                                                                                       <span class="method-result">bool</span>
+                                                                               <a href="#IsError" title="details" class="method-name">IsError</a>
+                                                                               ()
+                                                                       </div>
+                                                               
+                               <div class="method-definition">
+                                                                                       <span class="method-result">void</span>
+                                                                               <a href="#IsHTML" title="details" class="method-name">IsHTML</a>
+                                                                                       (<span class="var-type">bool</span>&nbsp;<span class="var-name">$bool</span>)
+                                                                       </div>
+                                                               
+                               <div class="method-definition">
+                                                                                       <span class="method-result">void</span>
+                                                                               <a href="#IsMail" title="details" class="method-name">IsMail</a>
+                                                                               ()
+                                                                       </div>
+                                                               
+                               <div class="method-definition">
+                                                                                       <span class="method-result">void</span>
+                                                                               <a href="#IsQmail" title="details" class="method-name">IsQmail</a>
+                                                                               ()
+                                                                       </div>
+                                                               
+                               <div class="method-definition">
+                                                                                       <span class="method-result">void</span>
+                                                                               <a href="#IsSendmail" title="details" class="method-name">IsSendmail</a>
+                                                                               ()
+                                                                       </div>
+                                                               
+                               <div class="method-definition">
+                                                                                       <span class="method-result">void</span>
+                                                                               <a href="#IsSMTP" title="details" class="method-name">IsSMTP</a>
+                                                                               ()
+                                                                       </div>
+                                                               
+                               <div class="method-definition">
+                                                                                       <span class="method-result">bool</span>
+                                                                               <a href="#Send" title="details" class="method-name">Send</a>
+                                                                               ()
+                                                                       </div>
+                                                               
+                               <div class="method-definition">
+                                                                                       <span class="method-result">bool</span>
+                                                                               <a href="#SetLanguage" title="details" class="method-name">SetLanguage</a>
+                                                                                       (<span class="var-type">string</span>&nbsp;<span class="var-name">$lang_type</span>, [<span class="var-type">string</span>&nbsp;<span class="var-name">$lang_path</span> = <span class="var-default">""</span>])
+                                                                       </div>
+                                                               
+                               <div class="method-definition">
+                                                                                       <span class="method-result">void</span>
+                                                                               <a href="#SmtpClose" title="details" class="method-name">SmtpClose</a>
+                                                                               ()
+                                                                       </div>
+                                                       </div>
+               </div>
+       </div>          
+
+       <a name="sec-vars"></a>
+       <div class="info-box">
+               <div class="info-box-title">Variables</div>
+               <div class="nav-bar">
+                       <a href="#sec-description">Description</a> |
+                                                                               <a href="#sec-var-summary">Vars</a> (<span class="disabled">details</span>)
+                                               
+                       
+                                                       | 
+                                                                       <a href="#sec-method-summary">Methods</a> (<a href="#sec-methods">details</a>)
+                                                       
+                                       </div>
+               <div class="info-box-body">
+                       <a name="var$AltBody" id="$AltBody"><!-- --></A>
+<div class="evenrow">
+
+       <div class="var-header">
+               <span class="var-title">
+                       <span class="var-type">string</span>
+                       <span class="var-name">$AltBody</span>
+                        = <span class="var-default"> &quot;&quot;</span>                       (line <span class="line-number">96</span>)
+               </span>
+       </div>
+
+       <!-- ========== Info from phpDoc block ========= -->
+<p class="short-description">Sets the text-only body of the message.  This automatically sets the  email to multipart/alternative.  This body can be read by mail  clients that do not have HTML email capability such as mutt. Clients  that can read HTML will view the normal Body.</p>
+       
+       
+               
+               
+
+</div>
+<a name="var$Body" id="$Body"><!-- --></A>
+<div class="oddrow">
+
+       <div class="var-header">
+               <span class="var-title">
+                       <span class="var-type">string</span>
+                       <span class="var-name">$Body</span>
+                        = <span class="var-default"> &quot;&quot;</span>                       (line <span class="line-number">87</span>)
+               </span>
+       </div>
+
+       <!-- ========== Info from phpDoc block ========= -->
+<p class="short-description">Sets the Body of the message.  This can be either an HTML or text body.</p>
+<p class="description"><p>If HTML then run IsHTML(true).</p></p>
+       
+       
+               
+               
+
+</div>
+<a name="var$CharSet" id="$CharSet"><!-- --></A>
+<div class="evenrow">
+
+       <div class="var-header">
+               <span class="var-title">
+                       <span class="var-type">string</span>
+                       <span class="var-name">$CharSet</span>
+                        = <span class="var-default"> &quot;iso-8859-1&quot;</span>                     (line <span class="line-number">36</span>)
+               </span>
+       </div>
+
+       <!-- ========== Info from phpDoc block ========= -->
+<p class="short-description">Sets the CharSet of the message.</p>
+       
+       
+               
+               
+
+</div>
+<a name="var$ConfirmReadingTo" id="$ConfirmReadingTo"><!-- --></A>
+<div class="oddrow">
+
+       <div class="var-header">
+               <span class="var-title">
+                       <span class="var-type">string</span>
+                       <span class="var-name">$ConfirmReadingTo</span>
+                        = <span class="var-default"> &quot;&quot;</span>                       (line <span class="line-number">134</span>)
+               </span>
+       </div>
+
+       <!-- ========== Info from phpDoc block ========= -->
+<p class="short-description">Sets the email address that a reading confirmation will be sent.</p>
+       
+       
+               
+               
+
+</div>
+<a name="var$ContentType" id="$ContentType"><!-- --></A>
+<div class="evenrow">
+
+       <div class="var-header">
+               <span class="var-title">
+                       <span class="var-type">string</span>
+                       <span class="var-name">$ContentType</span>
+                        = <span class="var-default"> &quot;text/plain&quot;</span>                     (line <span class="line-number">42</span>)
+               </span>
+       </div>
+
+       <!-- ========== Info from phpDoc block ========= -->
+<p class="short-description">Sets the Content-type of the message.</p>
+       
+       
+               
+               
+
+</div>
+<a name="var$Encoding" id="$Encoding"><!-- --></A>
+<div class="oddrow">
+
+       <div class="var-header">
+               <span class="var-title">
+                       <span class="var-type">string</span>
+                       <span class="var-name">$Encoding</span>
+                        = <span class="var-default"> &quot;8bit&quot;</span>                   (line <span class="line-number">49</span>)
+               </span>
+       </div>
+
+       <!-- ========== Info from phpDoc block ========= -->
+<p class="short-description">Sets the Encoding of the message. Options for this are &quot;8bit&quot;,  &quot;7bit&quot;, &quot;binary&quot;, &quot;base64&quot;, and &quot;quoted-printable&quot;.</p>
+       
+       
+               
+               
+
+</div>
+<a name="var$ErrorInfo" id="$ErrorInfo"><!-- --></A>
+<div class="evenrow">
+
+       <div class="var-header">
+               <span class="var-title">
+                       <span class="var-type">string</span>
+                       <span class="var-name">$ErrorInfo</span>
+                        = <span class="var-default"> &quot;&quot;</span>                       (line <span class="line-number">55</span>)
+               </span>
+       </div>
+
+       <!-- ========== Info from phpDoc block ========= -->
+<p class="short-description">Holds the most recent mailer error message.</p>
+       
+       
+               
+               
+
+</div>
+<a name="var$From" id="$From"><!-- --></A>
+<div class="oddrow">
+
+       <div class="var-header">
+               <span class="var-title">
+                       <span class="var-type">string</span>
+                       <span class="var-name">$From</span>
+                        = <span class="var-default"> &quot;root@localhost&quot;</span>                 (line <span class="line-number">61</span>)
+               </span>
+       </div>
+
+       <!-- ========== Info from phpDoc block ========= -->
+<p class="short-description">Sets the From email address for the message.</p>
+       
+       
+               
+               
+
+</div>
+<a name="var$FromName" id="$FromName"><!-- --></A>
+<div class="evenrow">
+
+       <div class="var-header">
+               <span class="var-title">
+                       <span class="var-type">string</span>
+                       <span class="var-name">$FromName</span>
+                        = <span class="var-default"> &quot;Root User&quot;</span>                      (line <span class="line-number">67</span>)
+               </span>
+       </div>
+
+       <!-- ========== Info from phpDoc block ========= -->
+<p class="short-description">Sets the From name of the message.</p>
+       
+       
+               
+               
+
+</div>
+<a name="var$Helo" id="$Helo"><!-- --></A>
+<div class="oddrow">
+
+       <div class="var-header">
+               <span class="var-title">
+                       <span class="var-type">string</span>
+                       <span class="var-name">$Helo</span>
+                        = <span class="var-default"> &quot;&quot;</span>                       (line <span class="line-number">169</span>)
+               </span>
+       </div>
+
+       <!-- ========== Info from phpDoc block ========= -->
+<p class="short-description">Sets the SMTP HELO of the message (Default is $Hostname).</p>
+       
+       
+               
+               
+
+</div>
+<a name="var$Host" id="$Host"><!-- --></A>
+<div class="evenrow">
+
+       <div class="var-header">
+               <span class="var-title">
+                       <span class="var-type">string</span>
+                       <span class="var-name">$Host</span>
+                        = <span class="var-default"> &quot;localhost&quot;</span>                      (line <span class="line-number">157</span>)
+               </span>
+       </div>
+
+       <!-- ========== Info from phpDoc block ========= -->
+<p class="short-description">Sets the SMTP hosts.  All hosts must be separated by a   semicolon.  You can also specify a different port   for each host by using this format: [hostname:port]   (e.g. &quot;smtp1.example.com:25;smtp2.example.com&quot;).</p>
+<p class="description"><p>Hosts will be tried in order.</p></p>
+       
+       
+               
+               
+
+</div>
+<a name="var$Hostname" id="$Hostname"><!-- --></A>
+<div class="oddrow">
+
+       <div class="var-header">
+               <span class="var-title">
+                       <span class="var-type">string</span>
+                       <span class="var-name">$Hostname</span>
+                        = <span class="var-default"> &quot;&quot;</span>                       (line <span class="line-number">142</span>)
+               </span>
+       </div>
+
+       <!-- ========== Info from phpDoc block ========= -->
+<p class="short-description">Sets the hostname to use in Message-Id and Received headers   and as default HELO string. If empty, the value returned   by SERVER_NAME is used or 'localhost.localdomain'.</p>
+       
+       
+               
+               
+
+</div>
+<a name="var$Mailer" id="$Mailer"><!-- --></A>
+<div class="evenrow">
+
+       <div class="var-header">
+               <span class="var-title">
+                       <span class="var-type">string</span>
+                       <span class="var-name">$Mailer</span>
+                        = <span class="var-default"> &quot;mail&quot;</span>                   (line <span class="line-number">109</span>)
+               </span>
+       </div>
+
+       <!-- ========== Info from phpDoc block ========= -->
+<p class="short-description">Method to send mail: (&quot;mail&quot;, &quot;sendmail&quot;, or &quot;smtp&quot;).</p>
+       
+       
+               
+               
+
+</div>
+<a name="var$Password" id="$Password"><!-- --></A>
+<div class="oddrow">
+
+       <div class="var-header">
+               <span class="var-title">
+                       <span class="var-type">string</span>
+                       <span class="var-name">$Password</span>
+                        = <span class="var-default"> &quot;&quot;</span>                       (line <span class="line-number">187</span>)
+               </span>
+       </div>
+
+       <!-- ========== Info from phpDoc block ========= -->
+<p class="short-description">Sets SMTP password.</p>
+       
+       
+               
+               
+
+</div>
+<a name="var$PluginDir" id="$PluginDir"><!-- --></A>
+<div class="evenrow">
+
+       <div class="var-header">
+               <span class="var-title">
+                       <span class="var-type">string</span>
+                       <span class="var-name">$PluginDir</span>
+                        = <span class="var-default"> &quot;&quot;</span>                       (line <span class="line-number">122</span>)
+               </span>
+       </div>
+
+       <!-- ========== Info from phpDoc block ========= -->
+<p class="short-description">Path to PHPMailer plugins.  This is now only useful if the SMTP class  is in a different directory than the PHP include path.</p>
+       
+       
+               
+               
+
+</div>
+<a name="var$Port" id="$Port"><!-- --></A>
+<div class="oddrow">
+
+       <div class="var-header">
+               <span class="var-title">
+                       <span class="var-type">int</span>
+                       <span class="var-name">$Port</span>
+                        = <span class="var-default"> 25</span>                 (line <span class="line-number">163</span>)
+               </span>
+       </div>
+
+       <!-- ========== Info from phpDoc block ========= -->
+<p class="short-description">Sets the default SMTP server port.</p>
+       
+       
+               
+               
+
+</div>
+<a name="var$Priority" id="$Priority"><!-- --></A>
+<div class="evenrow">
+
+       <div class="var-header">
+               <span class="var-title">
+                       <span class="var-type">int</span>
+                       <span class="var-name">$Priority</span>
+                        = <span class="var-default"> 3</span>                  (line <span class="line-number">30</span>)
+               </span>
+       </div>
+
+       <!-- ========== Info from phpDoc block ========= -->
+<p class="short-description">Email priority (1 = High, 3 = Normal, 5 = low).</p>
+       
+       
+               
+               
+
+</div>
+<a name="var$Sender" id="$Sender"><!-- --></A>
+<div class="oddrow">
+
+       <div class="var-header">
+               <span class="var-title">
+                       <span class="var-type">string</span>
+                       <span class="var-name">$Sender</span>
+                        = <span class="var-default"> &quot;&quot;</span>                       (line <span class="line-number">74</span>)
+               </span>
+       </div>
+
+       <!-- ========== Info from phpDoc block ========= -->
+<p class="short-description">Sets the Sender email (Return-Path) of the message.  If not empty,  will be sent via -f to sendmail or as 'MAIL FROM' in smtp mode.</p>
+       
+       
+               
+               
+
+</div>
+<a name="var$Sendmail" id="$Sendmail"><!-- --></A>
+<div class="evenrow">
+
+       <div class="var-header">
+               <span class="var-title">
+                       <span class="var-type">string</span>
+                       <span class="var-name">$Sendmail</span>
+                        = <span class="var-default"> &quot;/usr/sbin/sendmail&quot;</span>                     (line <span class="line-number">115</span>)
+               </span>
+       </div>
+
+       <!-- ========== Info from phpDoc block ========= -->
+<p class="short-description">Sets the path of the sendmail program.</p>
+       
+       
+               
+               
+
+</div>
+<a name="var$SMTPAuth" id="$SMTPAuth"><!-- --></A>
+<div class="oddrow">
+
+       <div class="var-header">
+               <span class="var-title">
+                       <span class="var-type">bool</span>
+                       <span class="var-name">$SMTPAuth</span>
+                        = <span class="var-default"> false</span>                      (line <span class="line-number">175</span>)
+               </span>
+       </div>
+
+       <!-- ========== Info from phpDoc block ========= -->
+<p class="short-description">Sets SMTP authentication. Utilizes the Username and Password variables.</p>
+       
+       
+               
+               
+
+</div>
+<a name="var$SMTPDebug" id="$SMTPDebug"><!-- --></A>
+<div class="evenrow">
+
+       <div class="var-header">
+               <span class="var-title">
+                       <span class="var-type">bool</span>
+                       <span class="var-name">$SMTPDebug</span>
+                        = <span class="var-default"> false</span>                      (line <span class="line-number">200</span>)
+               </span>
+       </div>
+
+       <!-- ========== Info from phpDoc block ========= -->
+<p class="short-description">Sets SMTP class debugging on or off.</p>
+       
+       
+               
+               
+
+</div>
+<a name="var$SMTPKeepAlive" id="$SMTPKeepAlive"><!-- --></A>
+<div class="oddrow">
+
+       <div class="var-header">
+               <span class="var-title">
+                       <span class="var-type">bool</span>
+                       <span class="var-name">$SMTPKeepAlive</span>
+                        = <span class="var-default"> false</span>                      (line <span class="line-number">208</span>)
+               </span>
+       </div>
+
+       <!-- ========== Info from phpDoc block ========= -->
+<p class="short-description">Prevents the SMTP connection from being closed after each mail  sending.  If this is set to true then to close the connection  requires an explicit call to SmtpClose().</p>
+       
+       
+               
+               
+
+</div>
+<a name="var$Subject" id="$Subject"><!-- --></A>
+<div class="evenrow">
+
+       <div class="var-header">
+               <span class="var-title">
+                       <span class="var-type">string</span>
+                       <span class="var-name">$Subject</span>
+                        = <span class="var-default"> &quot;&quot;</span>                       (line <span class="line-number">80</span>)
+               </span>
+       </div>
+
+       <!-- ========== Info from phpDoc block ========= -->
+<p class="short-description">Sets the Subject of the message.</p>
+       
+       
+               
+               
+
+</div>
+<a name="var$Timeout" id="$Timeout"><!-- --></A>
+<div class="oddrow">
+
+       <div class="var-header">
+               <span class="var-title">
+                       <span class="var-type">int</span>
+                       <span class="var-name">$Timeout</span>
+                        = <span class="var-default"> 10</span>                 (line <span class="line-number">194</span>)
+               </span>
+       </div>
+
+       <!-- ========== Info from phpDoc block ========= -->
+<p class="short-description">Sets the SMTP server timeout in seconds. This function will not   work with the win32 version.</p>
+       
+       
+               
+               
+
+</div>
+<a name="var$Username" id="$Username"><!-- --></A>
+<div class="evenrow">
+
+       <div class="var-header">
+               <span class="var-title">
+                       <span class="var-type">string</span>
+                       <span class="var-name">$Username</span>
+                        = <span class="var-default"> &quot;&quot;</span>                       (line <span class="line-number">181</span>)
+               </span>
+       </div>
+
+       <!-- ========== Info from phpDoc block ========= -->
+<p class="short-description">Sets SMTP username.</p>
+       
+       
+               
+               
+
+</div>
+<a name="var$Version" id="$Version"><!-- --></A>
+<div class="oddrow">
+
+       <div class="var-header">
+               <span class="var-title">
+                       <span class="var-type">string</span>
+                       <span class="var-name">$Version</span>
+                        = <span class="var-default"> &quot;1.71&quot;</span>                   (line <span class="line-number">128</span>)
+               </span>
+       </div>
+
+       <!-- ========== Info from phpDoc block ========= -->
+<p class="short-description">Holds PHPMailer version.</p>
+       
+       
+               
+               
+
+</div>
+<a name="var$WordWrap" id="$WordWrap"><!-- --></A>
+<div class="evenrow">
+
+       <div class="var-header">
+               <span class="var-title">
+                       <span class="var-type">int</span>
+                       <span class="var-name">$WordWrap</span>
+                        = <span class="var-default"> 0</span>                  (line <span class="line-number">103</span>)
+               </span>
+       </div>
+
+       <!-- ========== Info from phpDoc block ========= -->
+<p class="short-description">Sets word wrapping on the body of the message to a given number of  characters.</p>
+       
+       
+               
+               
+
+</div>
+                                               
+               </div>
+       </div>
+       
+       <a name="sec-methods"></a>
+       <div class="info-box">
+               <div class="info-box-title">Methods</div>
+               <div class="nav-bar">
+                       <a href="#sec-description">Description</a> |
+                                                                                                                       <a href="#sec-var-summary">Vars</a> (<a href="#sec-vars">details</a>)
+                                                                                                               <a href="#sec-method-summary">Methods</a> (<span class="disabled">details</span>)
+                                               
+               </div>
+               <div class="info-box-body">
+                       <A NAME='method_detail'></A>
+<a name="methodAddAddress" id="AddAddress"><!-- --></a>
+<div class="oddrow">
+       
+       <div class="method-header">
+               <span class="method-title">AddAddress</span> (line <span class="line-number">287</span>)
+       </div> 
+       
+       <!-- ========== Info from phpDoc block ========= -->
+<p class="short-description">Adds a &quot;To&quot; address.</p>
+       
+       <div class="method-signature">
+               <span class="method-result">void</span>
+               <span class="method-name">
+                       AddAddress
+               </span>
+                                       (<span class="var-type">string</span>&nbsp;<span class="var-name">$address</span>, [<span class="var-type">string</span>&nbsp;<span class="var-name">$name</span> = <span class="var-default">""</span>])
+                       </div>
+       
+                       <ul class="parameters">
+                                       <li>
+                               <span class="var-type">string</span>
+                               <span class="var-name">$address</span>                  </li>
+                                       <li>
+                               <span class="var-type">string</span>
+                               <span class="var-name">$name</span>                     </li>
+                               </ul>
+               
+               
+       </div>
+<a name="methodAddAttachment" id="AddAttachment"><!-- --></a>
+<div class="evenrow">
+       
+       <div class="method-header">
+               <span class="method-title">AddAttachment</span> (line <span class="line-number">1000</span>)
+       </div> 
+       
+       <!-- ========== Info from phpDoc block ========= -->
+<p class="short-description">Adds an attachment from a path on the filesystem.</p>
+<p class="description"><p>Returns false if the file could not be found  or accessed.</p></p>
+       
+       <div class="method-signature">
+               <span class="method-result">bool</span>
+               <span class="method-name">
+                       AddAttachment
+               </span>
+                                       (<span class="var-type">string</span>&nbsp;<span class="var-name">$path</span>, [<span class="var-type">string</span>&nbsp;<span class="var-name">$name</span> = <span class="var-default">""</span>], [<span class="var-type">string</span>&nbsp;<span class="var-name">$encoding</span> = <span class="var-default">"base64"</span>], [<span class="var-type">string</span>&nbsp;<span class="var-name">$type</span> = <span class="var-default">"application/octet-stream"</span>])
+                       </div>
+       
+                       <ul class="parameters">
+                                       <li>
+                               <span class="var-type">string</span>
+                               <span class="var-name">$path</span><span class="var-description">: <p>Path to the attachment.</p></span>                        </li>
+                                       <li>
+                               <span class="var-type">string</span>
+                               <span class="var-name">$name</span><span class="var-description">: <p>Overrides the attachment name.</p></span>                 </li>
+                                       <li>
+                               <span class="var-type">string</span>
+                               <span class="var-name">$encoding</span><span class="var-description">: <p>File encoding (see $Encoding).</p></span>                     </li>
+                                       <li>
+                               <span class="var-type">string</span>
+                               <span class="var-name">$type</span><span class="var-description">: <p>File extension (MIME) type.</p></span>                    </li>
+                               </ul>
+               
+               
+       </div>
+<a name="methodAddBCC" id="AddBCC"><!-- --></a>
+<div class="oddrow">
+       
+       <div class="method-header">
+               <span class="method-title">AddBCC</span> (line <span class="line-number">315</span>)
+       </div> 
+       
+       <!-- ========== Info from phpDoc block ========= -->
+<p class="short-description">Adds a &quot;Bcc&quot; address. Note: this function works  with the SMTP mailer on win32, not with the &quot;mail&quot;  mailer.</p>
+       
+       <div class="method-signature">
+               <span class="method-result">void</span>
+               <span class="method-name">
+                       AddBCC
+               </span>
+                                       (<span class="var-type">string</span>&nbsp;<span class="var-name">$address</span>, [<span class="var-type">string</span>&nbsp;<span class="var-name">$name</span> = <span class="var-default">""</span>])
+                       </div>
+       
+                       <ul class="parameters">
+                                       <li>
+                               <span class="var-type">string</span>
+                               <span class="var-name">$address</span>                  </li>
+                                       <li>
+                               <span class="var-type">string</span>
+                               <span class="var-name">$name</span>                     </li>
+                               </ul>
+               
+               
+       </div>
+<a name="methodAddCC" id="AddCC"><!-- --></a>
+<div class="evenrow">
+       
+       <div class="method-header">
+               <span class="method-title">AddCC</span> (line <span class="line-number">301</span>)
+       </div> 
+       
+       <!-- ========== Info from phpDoc block ========= -->
+<p class="short-description">Adds a &quot;Cc&quot; address. Note: this function works  with the SMTP mailer on win32, not with the &quot;mail&quot;  mailer.</p>
+       
+       <div class="method-signature">
+               <span class="method-result">void</span>
+               <span class="method-name">
+                       AddCC
+               </span>
+                                       (<span class="var-type">string</span>&nbsp;<span class="var-name">$address</span>, [<span class="var-type">string</span>&nbsp;<span class="var-name">$name</span> = <span class="var-default">""</span>])
+                       </div>
+       
+                       <ul class="parameters">
+                                       <li>
+                               <span class="var-type">string</span>
+                               <span class="var-name">$address</span>                  </li>
+                                       <li>
+                               <span class="var-type">string</span>
+                               <span class="var-name">$name</span>                     </li>
+                               </ul>
+               
+               
+       </div>
+<a name="methodAddCustomHeader" id="AddCustomHeader"><!-- --></a>
+<div class="oddrow">
+       
+       <div class="method-header">
+               <span class="method-title">AddCustomHeader</span> (line <span class="line-number">1525</span>)
+       </div> 
+       
+       <!-- ========== Info from phpDoc block ========= -->
+<p class="short-description">Adds a custom header.</p>
+       
+       <div class="method-signature">
+               <span class="method-result">void</span>
+               <span class="method-name">
+                       AddCustomHeader
+               </span>
+                                       (<span class="var-type">mixed</span>&nbsp;<span class="var-name">$custom_header</span>)
+                       </div>
+       
+               
+               
+       </div>
+<a name="methodAddEmbeddedImage" id="AddEmbeddedImage"><!-- --></a>
+<div class="evenrow">
+       
+       <div class="method-header">
+               <span class="method-title">AddEmbeddedImage</span> (line <span class="line-number">1275</span>)
+       </div> 
+       
+       <!-- ========== Info from phpDoc block ========= -->
+<p class="short-description">Adds an embedded attachment.  This can include images, sounds, and  just about any other document.  Make sure to set the $type to an  image type.  For JPEG images use &quot;image/jpeg&quot; and for GIF images  use &quot;image/gif&quot;.</p>
+       
+       <div class="method-signature">
+               <span class="method-result">bool</span>
+               <span class="method-name">
+                       AddEmbeddedImage
+               </span>
+                                       (<span class="var-type">string</span>&nbsp;<span class="var-name">$path</span>, <span class="var-type">string</span>&nbsp;<span class="var-name">$cid</span>, [<span class="var-type">string</span>&nbsp;<span class="var-name">$name</span> = <span class="var-default">""</span>], [<span class="var-type">string</span>&nbsp;<span class="var-name">$encoding</span> = <span class="var-default">"base64"</span>], [<span class="var-type">string</span>&nbsp;<span class="var-name">$type</span> = <span class="var-default">"application/octet-stream"</span>])
+                       </div>
+       
+                       <ul class="parameters">
+                                       <li>
+                               <span class="var-type">string</span>
+                               <span class="var-name">$path</span><span class="var-description">: <p>Path to the attachment.</p></span>                        </li>
+                                       <li>
+                               <span class="var-type">string</span>
+                               <span class="var-name">$cid</span><span class="var-description">: <p>Content ID of the attachment.  Use this to identify         the Id for accessing the image in an HTML form.</p></span>                     </li>
+                                       <li>
+                               <span class="var-type">string</span>
+                               <span class="var-name">$name</span><span class="var-description">: <p>Overrides the attachment name.</p></span>                 </li>
+                                       <li>
+                               <span class="var-type">string</span>
+                               <span class="var-name">$encoding</span><span class="var-description">: <p>File encoding (see $Encoding).</p></span>                     </li>
+                                       <li>
+                               <span class="var-type">string</span>
+                               <span class="var-name">$type</span><span class="var-description">: <p>File extension (MIME) type.</p></span>                    </li>
+                               </ul>
+               
+               
+       </div>
+<a name="methodAddReplyTo" id="AddReplyTo"><!-- --></a>
+<div class="oddrow">
+       
+       <div class="method-header">
+               <span class="method-title">AddReplyTo</span> (line <span class="line-number">327</span>)
+       </div> 
+       
+       <!-- ========== Info from phpDoc block ========= -->
+<p class="short-description">Adds a &quot;Reply-to&quot; address.</p>
+       
+       <div class="method-signature">
+               <span class="method-result">void</span>
+               <span class="method-name">
+                       AddReplyTo
+               </span>
+                                       (<span class="var-type">string</span>&nbsp;<span class="var-name">$address</span>, [<span class="var-type">string</span>&nbsp;<span class="var-name">$name</span> = <span class="var-default">""</span>])
+                       </div>
+       
+                       <ul class="parameters">
+                                       <li>
+                               <span class="var-type">string</span>
+                               <span class="var-name">$address</span>                  </li>
+                                       <li>
+                               <span class="var-type">string</span>
+                               <span class="var-name">$name</span>                     </li>
+                               </ul>
+               
+               
+       </div>
+<a name="methodAddStringAttachment" id="AddStringAttachment"><!-- --></a>
+<div class="evenrow">
+       
+       <div class="method-header">
+               <span class="method-title">AddStringAttachment</span> (line <span class="line-number">1248</span>)
+       </div> 
+       
+       <!-- ========== Info from phpDoc block ========= -->
+<p class="short-description">Adds a string or binary attachment (non-filesystem) to the list.</p>
+<p class="description"><p>This method can be used to attach ascii or binary data,  such as a BLOB record from a database.</p></p>
+       
+       <div class="method-signature">
+               <span class="method-result">void</span>
+               <span class="method-name">
+                       AddStringAttachment
+               </span>
+                                       (<span class="var-type">string</span>&nbsp;<span class="var-name">$string</span>, <span class="var-type">string</span>&nbsp;<span class="var-name">$filename</span>, [<span class="var-type">string</span>&nbsp;<span class="var-name">$encoding</span> = <span class="var-default">"base64"</span>], [<span class="var-type">string</span>&nbsp;<span class="var-name">$type</span> = <span class="var-default">"application/octet-stream"</span>])
+                       </div>
+       
+                       <ul class="parameters">
+                                       <li>
+                               <span class="var-type">string</span>
+                               <span class="var-name">$string</span><span class="var-description">: <p>String attachment data.</p></span>                      </li>
+                                       <li>
+                               <span class="var-type">string</span>
+                               <span class="var-name">$filename</span><span class="var-description">: <p>Name of the attachment.</p></span>                    </li>
+                                       <li>
+                               <span class="var-type">string</span>
+                               <span class="var-name">$encoding</span><span class="var-description">: <p>File encoding (see $Encoding).</p></span>                     </li>
+                                       <li>
+                               <span class="var-type">string</span>
+                               <span class="var-name">$type</span><span class="var-description">: <p>File extension (MIME) type.</p></span>                    </li>
+                               </ul>
+               
+               
+       </div>
+<a name="methodClearAddresses" id="ClearAddresses"><!-- --></a>
+<div class="oddrow">
+       
+       <div class="method-header">
+               <span class="method-title">ClearAddresses</span> (line <span class="line-number">1329</span>)
+       </div> 
+       
+       <!-- ========== Info from phpDoc block ========= -->
+<p class="short-description">Clears all recipients assigned in the TO array.  Returns void.</p>
+       
+       <div class="method-signature">
+               <span class="method-result">void</span>
+               <span class="method-name">
+                       ClearAddresses
+               </span>
+                               ()
+                       </div>
+       
+               
+               
+       </div>
+<a name="methodClearAllRecipients" id="ClearAllRecipients"><!-- --></a>
+<div class="evenrow">
+       
+       <div class="method-header">
+               <span class="method-title">ClearAllRecipients</span> (line <span class="line-number">1362</span>)
+       </div> 
+       
+       <!-- ========== Info from phpDoc block ========= -->
+<p class="short-description">Clears all recipients assigned in the TO, CC and BCC  array.  Returns void.</p>
+       
+       <div class="method-signature">
+               <span class="method-result">void</span>
+               <span class="method-name">
+                       ClearAllRecipients
+               </span>
+                               ()
+                       </div>
+       
+               
+               
+       </div>
+<a name="methodClearAttachments" id="ClearAttachments"><!-- --></a>
+<div class="oddrow">
+       
+       <div class="method-header">
+               <span class="method-title">ClearAttachments</span> (line <span class="line-number">1373</span>)
+       </div> 
+       
+       <!-- ========== Info from phpDoc block ========= -->
+<p class="short-description">Clears all previously set filesystem, string, and binary  attachments.  Returns void.</p>
+       
+       <div class="method-signature">
+               <span class="method-result">void</span>
+               <span class="method-name">
+                       ClearAttachments
+               </span>
+                               ()
+                       </div>
+       
+               
+               
+       </div>
+<a name="methodClearBCCs" id="ClearBCCs"><!-- --></a>
+<div class="evenrow">
+       
+       <div class="method-header">
+               <span class="method-title">ClearBCCs</span> (line <span class="line-number">1345</span>)
+       </div> 
+       
+       <!-- ========== Info from phpDoc block ========= -->
+<p class="short-description">Clears all recipients assigned in the BCC array.  Returns void.</p>
+       
+       <div class="method-signature">
+               <span class="method-result">void</span>
+               <span class="method-name">
+                       ClearBCCs
+               </span>
+                               ()
+                       </div>
+       
+               
+               
+       </div>
+<a name="methodClearCCs" id="ClearCCs"><!-- --></a>
+<div class="oddrow">
+       
+       <div class="method-header">
+               <span class="method-title">ClearCCs</span> (line <span class="line-number">1337</span>)
+       </div> 
+       
+       <!-- ========== Info from phpDoc block ========= -->
+<p class="short-description">Clears all recipients assigned in the CC array.  Returns void.</p>
+       
+       <div class="method-signature">
+               <span class="method-result">void</span>
+               <span class="method-name">
+                       ClearCCs
+               </span>
+                               ()
+                       </div>
+       
+               
+               
+       </div>
+<a name="methodClearCustomHeaders" id="ClearCustomHeaders"><!-- --></a>
+<div class="evenrow">
+       
+       <div class="method-header">
+               <span class="method-title">ClearCustomHeaders</span> (line <span class="line-number">1381</span>)
+       </div> 
+       
+       <!-- ========== Info from phpDoc block ========= -->
+<p class="short-description">Clears all custom headers.  Returns void.</p>
+       
+       <div class="method-signature">
+               <span class="method-result">void</span>
+               <span class="method-name">
+                       ClearCustomHeaders
+               </span>
+                               ()
+                       </div>
+       
+               
+               
+       </div>
+<a name="methodClearReplyTos" id="ClearReplyTos"><!-- --></a>
+<div class="oddrow">
+       
+       <div class="method-header">
+               <span class="method-title">ClearReplyTos</span> (line <span class="line-number">1353</span>)
+       </div> 
+       
+       <!-- ========== Info from phpDoc block ========= -->
+<p class="short-description">Clears all recipients assigned in the ReplyTo array.  Returns void.</p>
+       
+       <div class="method-signature">
+               <span class="method-result">void</span>
+               <span class="method-name">
+                       ClearReplyTos
+               </span>
+                               ()
+                       </div>
+       
+               
+               
+       </div>
+<a name="methodIsError" id="IsError"><!-- --></a>
+<div class="evenrow">
+       
+       <div class="method-header">
+               <span class="method-title">IsError</span> (line <span class="line-number">1505</span>)
+       </div> 
+       
+       <!-- ========== Info from phpDoc block ========= -->
+<p class="short-description">Returns true if an error occurred.</p>
+       
+       <div class="method-signature">
+               <span class="method-result">bool</span>
+               <span class="method-name">
+                       IsError
+               </span>
+                               ()
+                       </div>
+       
+               
+               
+       </div>
+<a name="methodIsHTML" id="IsHTML"><!-- --></a>
+<div class="oddrow">
+       
+       <div class="method-header">
+               <span class="method-title">IsHTML</span> (line <span class="line-number">236</span>)
+       </div> 
+       
+       <!-- ========== Info from phpDoc block ========= -->
+<p class="short-description">Sets message type to HTML.</p>
+       
+       <div class="method-signature">
+               <span class="method-result">void</span>
+               <span class="method-name">
+                       IsHTML
+               </span>
+                                       (<span class="var-type">bool</span>&nbsp;<span class="var-name">$bool</span>)
+                       </div>
+       
+                       <ul class="parameters">
+                                       <li>
+                               <span class="var-type">bool</span>
+                               <span class="var-name">$bool</span>                     </li>
+                               </ul>
+               
+               
+       </div>
+<a name="methodIsMail" id="IsMail"><!-- --></a>
+<div class="evenrow">
+       
+       <div class="method-header">
+               <span class="method-title">IsMail</span> (line <span class="line-number">255</span>)
+       </div> 
+       
+       <!-- ========== Info from phpDoc block ========= -->
+<p class="short-description">Sets Mailer to send message using PHP mail() function.</p>
+       
+       <div class="method-signature">
+               <span class="method-result">void</span>
+               <span class="method-name">
+                       IsMail
+               </span>
+                               ()
+                       </div>
+       
+               
+               
+       </div>
+<a name="methodIsQmail" id="IsQmail"><!-- --></a>
+<div class="oddrow">
+       
+       <div class="method-header">
+               <span class="method-title">IsQmail</span> (line <span class="line-number">271</span>)
+       </div> 
+       
+       <!-- ========== Info from phpDoc block ========= -->
+<p class="short-description">Sets Mailer to send message using the qmail MTA.</p>
+       
+       <div class="method-signature">
+               <span class="method-result">void</span>
+               <span class="method-name">
+                       IsQmail
+               </span>
+                               ()
+                       </div>
+       
+               
+               
+       </div>
+<a name="methodIsSendmail" id="IsSendmail"><!-- --></a>
+<div class="evenrow">
+       
+       <div class="method-header">
+               <span class="method-title">IsSendmail</span> (line <span class="line-number">263</span>)
+       </div> 
+       
+       <!-- ========== Info from phpDoc block ========= -->
+<p class="short-description">Sets Mailer to send message using the $Sendmail program.</p>
+       
+       <div class="method-signature">
+               <span class="method-result">void</span>
+               <span class="method-name">
+                       IsSendmail
+               </span>
+                               ()
+                       </div>
+       
+               
+               
+       </div>
+<a name="methodIsSMTP" id="IsSMTP"><!-- --></a>
+<div class="oddrow">
+       
+       <div class="method-header">
+               <span class="method-title">IsSMTP</span> (line <span class="line-number">247</span>)
+       </div> 
+       
+       <!-- ========== Info from phpDoc block ========= -->
+<p class="short-description">Sets Mailer to send message using SMTP.</p>
+       
+       <div class="method-signature">
+               <span class="method-result">void</span>
+               <span class="method-name">
+                       IsSMTP
+               </span>
+                               ()
+                       </div>
+       
+               
+               
+       </div>
+<a name="methodSend" id="Send"><!-- --></a>
+<div class="evenrow">
+       
+       <div class="method-header">
+               <span class="method-title">Send</span> (line <span class="line-number">344</span>)
+       </div> 
+       
+       <!-- ========== Info from phpDoc block ========= -->
+<p class="short-description">Creates message and assigns Mailer. If the message is  not sent successfully then it returns false.  Use the ErrorInfo  variable to view description of the error.</p>
+       
+       <div class="method-signature">
+               <span class="method-result">bool</span>
+               <span class="method-name">
+                       Send
+               </span>
+                               ()
+                       </div>
+       
+               
+               
+       </div>
+<a name="methodSetLanguage" id="SetLanguage"><!-- --></a>
+<div class="oddrow">
+       
+       <div class="method-header">
+               <span class="method-title">SetLanguage</span> (line <span class="line-number">599</span>)
+       </div> 
+       
+       <!-- ========== Info from phpDoc block ========= -->
+<p class="short-description">Sets the language for all class error messages.  Returns false  if it cannot load the language file.  The default language type  is English.</p>
+       <ul class="tags">
+                               <li><span class="field">access:</span> public</li>
+                       </ul>
+       
+       <div class="method-signature">
+               <span class="method-result">bool</span>
+               <span class="method-name">
+                       SetLanguage
+               </span>
+                                       (<span class="var-type">string</span>&nbsp;<span class="var-name">$lang_type</span>, [<span class="var-type">string</span>&nbsp;<span class="var-name">$lang_path</span> = <span class="var-default">""</span>])
+                       </div>
+       
+                       <ul class="parameters">
+                                       <li>
+                               <span class="var-type">string</span>
+                               <span class="var-name">$lang_type</span><span class="var-description">: <p>Type of language (e.g. Portuguese: &quot;br&quot;)</p></span>                        </li>
+                                       <li>
+                               <span class="var-type">string</span>
+                               <span class="var-name">$lang_path</span><span class="var-description">: <p>Path to the language file directory</p></span>                       </li>
+                               </ul>
+               
+               
+       </div>
+<a name="methodSmtpClose" id="SmtpClose"><!-- --></a>
+<div class="evenrow">
+       
+       <div class="method-header">
+               <span class="method-title">SmtpClose</span> (line <span class="line-number">579</span>)
+       </div> 
+       
+       <!-- ========== Info from phpDoc block ========= -->
+<p class="short-description">Closes the active SMTP session if one exists.</p>
+       
+       <div class="method-signature">
+               <span class="method-result">void</span>
+               <span class="method-name">
+                       SmtpClose
+               </span>
+                               ()
+                       </div>
+       
+               
+               
+       </div>
+                                               
+               </div>
+       </div>
+       
+       <p class="notes" id="credit">
+               Documention generated on Mon, 28 Jul 2003 23:25:49 -0400 by <a href="http://www.phpdoc.org" target="_blank">phpDocumentor 1.2.0</a>
+       </p>
+       </div></body>
+</html>
\ No newline at end of file
diff --git a/inc/classes/third_party/php_mailer/phpdoc/PHPMailer/SMTP.html b/inc/classes/third_party/php_mailer/phpdoc/PHPMailer/SMTP.html
new file mode 100644 (file)
index 0000000..4fdecb1
--- /dev/null
@@ -0,0 +1,734 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+  <html xmlns="http://www.w3.org/1999/xhtml">
+               <head>
+                       <!-- template designed by Marco Von Ballmoos -->
+                       <title>Docs For Class SMTP</title>
+                       <link rel="stylesheet" href="../media/stylesheet.css" />
+                       <meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'/>
+               </head>
+               <body>
+                       <div class="page-body">                 
+<h2 class="class-name">Class SMTP</h2>
+
+<a name="sec-description"></a>
+<div class="info-box">
+       <div class="info-box-title">Description</div>
+       <div class="nav-bar">
+                                       <span class="disabled">Description</span> |
+                                                                                                       <a href="#sec-var-summary">Vars</a> (<a href="#sec-vars">details</a>)
+                                               |                                                                                       <a href="#sec-method-summary">Methods</a> (<a href="#sec-methods">details</a>)
+                                               
+                       </div>
+       <div class="info-box-body">
+               <!-- ========== Info from phpDoc block ========= -->
+<p class="short-description">SMTP is rfc 821 compliant and implements all the rfc 821 SMTP  commands except TURN which will always return a not implemented  error. SMTP also provides some utility methods for sending mail  to an SMTP server.</p>
+       <ul class="tags">
+                               <li><span class="field">author:</span> <p>Chris Ryan</p></li>
+                       </ul>
+               <p class="notes">
+                       Located in <a class="field" href="_class_smtp_php.html">Program_Root/class.smtp.php</a> (line <span class="field">24</span>)
+               </p>
+               
+                               
+               <pre></pre>
+       
+                       </div>
+</div>
+
+
+       <a name="sec-var-summary"></a>
+       <div class="info-box">
+               <div class="info-box-title">Variable Summary</span></div>
+               <div class="nav-bar">
+                       <a href="#sec-description">Description</a> |
+                                               <span class="disabled">Vars</span> (<a href="#sec-vars">details</a>)
+                                                       | 
+                                                                       <a href="#sec-method-summary">Methods</a> (<a href="#sec-methods">details</a>)
+                                                       
+                                       </div>
+               <div class="info-box-body">
+                       <div class="var-summary">
+                                                               <div class="var-title">
+                                       <span class="var-type">string</span>
+                                       <a href="#$CRLF" title="details" class="var-name">$CRLF</a>
+                               </div>
+                                                               <div class="var-title">
+                                       <span class="var-type">bool</span>
+                                       <a href="#$do_debug" title="details" class="var-name">$do_debug</a>
+                               </div>
+                                                               <div class="var-title">
+                                       <span class="var-type">int</span>
+                                       <a href="#$SMTP_PORT" title="details" class="var-name">$SMTP_PORT</a>
+                               </div>
+                                                       </div>
+               </div>
+       </div>
+
+       <a name="sec-method-summary"></a>
+       <div class="info-box">
+               <div class="info-box-title">Method Summary</span></div>
+               <div class="nav-bar">
+                       <a href="#sec-description">Description</a> |
+                                                                                                                       <a href="#sec-var-summary">Vars</a> (<a href="#sec-vars">details</a>)
+                                
+                               |
+                                               <span class="disabled">Methods</span> (<a href="#sec-methods">details</a>)
+               </div>
+               <div class="info-box-body">                     
+                       <div class="method-summary">
+                                                               
+                               <div class="method-definition">
+                                                                                       <span class="method-result">void</span>
+                                                                               <a href="#SMTP" title="details" class="method-name">SMTP</a>
+                                                                               ()
+                                                                       </div>
+                                                               
+                               <div class="method-definition">
+                                                                                       <span class="method-result">bool</span>
+                                                                               <a href="#Authenticate" title="details" class="method-name">Authenticate</a>
+                                                                                       (<span class="var-type">mixed</span>&nbsp;<span class="var-name">$username</span>, <span class="var-type">mixed</span>&nbsp;<span class="var-name">$password</span>)
+                                                                       </div>
+                                                               
+                               <div class="method-definition">
+                                                                                       <span class="method-result">void</span>
+                                                                               <a href="#Close" title="details" class="method-name">Close</a>
+                                                                               ()
+                                                                       </div>
+                                                               
+                               <div class="method-definition">
+                                                                                       <span class="method-result">bool</span>
+                                                                               <a href="#Connect" title="details" class="method-name">Connect</a>
+                                                                                       (<span class="var-type">mixed</span>&nbsp;<span class="var-name">$host</span>, <span class="var-type">mixed</span>&nbsp;<span class="var-name">$port</span>, [<span class="var-type">mixed</span>&nbsp;<span class="var-name">$tval</span> = <span class="var-default">30</span>])
+                                                                       </div>
+                                                               
+                               <div class="method-definition">
+                                                                                       <span class="method-result">bool</span>
+                                                                               <a href="#Data" title="details" class="method-name">Data</a>
+                                                                                       (<span class="var-type">mixed</span>&nbsp;<span class="var-name">$msg_data</span>)
+                                                                       </div>
+                                                               
+                               <div class="method-definition">
+                                                                                       <span class="method-result">string</span>
+                                                                               <a href="#Expand" title="details" class="method-name">Expand</a>
+                                                                                       (<span class="var-type">mixed</span>&nbsp;<span class="var-name">$name</span>)
+                                                                       </div>
+                                                               
+                               <div class="method-definition">
+                                                                                       <span class="method-result">bool</span>
+                                                                               <a href="#Hello" title="details" class="method-name">Hello</a>
+                                                                                       ([<span class="var-type">mixed</span>&nbsp;<span class="var-name">$host</span> = <span class="var-default">""</span>])
+                                                                       </div>
+                                                               
+                               <div class="method-definition">
+                                                                                       <span class="method-result">string</span>
+                                                                               <a href="#Help" title="details" class="method-name">Help</a>
+                                                                                       ([<span class="var-type">mixed</span>&nbsp;<span class="var-name">$keyword</span> = <span class="var-default">""</span>])
+                                                                       </div>
+                                                               
+                               <div class="method-definition">
+                                                                                       <span class="method-result">bool</span>
+                                                                               <a href="#Mail" title="details" class="method-name">Mail</a>
+                                                                                       (<span class="var-type">mixed</span>&nbsp;<span class="var-name">$from</span>)
+                                                                       </div>
+                                                               
+                               <div class="method-definition">
+                                                                                       <span class="method-result">bool</span>
+                                                                               <a href="#Noop" title="details" class="method-name">Noop</a>
+                                                                               ()
+                                                                       </div>
+                                                               
+                               <div class="method-definition">
+                                                                                       <span class="method-result">bool</span>
+                                                                               <a href="#Quit" title="details" class="method-name">Quit</a>
+                                                                                       ([<span class="var-type">mixed</span>&nbsp;<span class="var-name">$close_on_error</span> = <span class="var-default">true</span>])
+                                                                       </div>
+                                                               
+                               <div class="method-definition">
+                                                                                       <span class="method-result">bool</span>
+                                                                               <a href="#Recipient" title="details" class="method-name">Recipient</a>
+                                                                                       (<span class="var-type">mixed</span>&nbsp;<span class="var-name">$to</span>)
+                                                                       </div>
+                                                               
+                               <div class="method-definition">
+                                                                                       <span class="method-result">bool</span>
+                                                                               <a href="#Reset" title="details" class="method-name">Reset</a>
+                                                                               ()
+                                                                       </div>
+                                                               
+                               <div class="method-definition">
+                                                                                       <span class="method-result">bool</span>
+                                                                               <a href="#Send" title="details" class="method-name">Send</a>
+                                                                                       (<span class="var-type">mixed</span>&nbsp;<span class="var-name">$from</span>)
+                                                                       </div>
+                                                               
+                               <div class="method-definition">
+                                                                                       <span class="method-result">bool</span>
+                                                                               <a href="#SendAndMail" title="details" class="method-name">SendAndMail</a>
+                                                                                       (<span class="var-type">mixed</span>&nbsp;<span class="var-name">$from</span>)
+                                                                       </div>
+                                                               
+                               <div class="method-definition">
+                                                                                       <span class="method-result">bool</span>
+                                                                               <a href="#SendOrMail" title="details" class="method-name">SendOrMail</a>
+                                                                                       (<span class="var-type">mixed</span>&nbsp;<span class="var-name">$from</span>)
+                                                                       </div>
+                                                               
+                               <div class="method-definition">
+                                                                                       <span class="method-result">bool</span>
+                                                                               <a href="#Turn" title="details" class="method-name">Turn</a>
+                                                                               ()
+                                                                       </div>
+                                                               
+                               <div class="method-definition">
+                                                                                       <span class="method-result">int</span>
+                                                                               <a href="#Verify" title="details" class="method-name">Verify</a>
+                                                                                       (<span class="var-type">mixed</span>&nbsp;<span class="var-name">$name</span>)
+                                                                       </div>
+                                                       </div>
+               </div>
+       </div>          
+
+       <a name="sec-vars"></a>
+       <div class="info-box">
+               <div class="info-box-title">Variables</div>
+               <div class="nav-bar">
+                       <a href="#sec-description">Description</a> |
+                                                                               <a href="#sec-var-summary">Vars</a> (<span class="disabled">details</span>)
+                                               
+                       
+                                                       | 
+                                                                       <a href="#sec-method-summary">Methods</a> (<a href="#sec-methods">details</a>)
+                                                       
+                                       </div>
+               <div class="info-box-body">
+                       <a name="var$CRLF" id="$CRLF"><!-- --></A>
+<div class="oddrow">
+
+       <div class="var-header">
+               <span class="var-title">
+                       <span class="var-type">string</span>
+                       <span class="var-name">$CRLF</span>
+                        = <span class="var-default"> &quot;\r\n&quot;</span>                   (line <span class="line-number">36</span>)
+               </span>
+       </div>
+
+       <!-- ========== Info from phpDoc block ========= -->
+<p class="short-description">SMTP reply line ending</p>
+       
+       
+               
+               
+
+</div>
+<a name="var$do_debug" id="$do_debug"><!-- --></A>
+<div class="evenrow">
+
+       <div class="var-header">
+               <span class="var-title">
+                       <span class="var-type">bool</span>
+                       <span class="var-name">$do_debug</span>
+                                               (line <span class="line-number">42</span>)
+               </span>
+       </div>
+
+       <!-- ========== Info from phpDoc block ========= -->
+<p class="short-description">Sets whether debugging is turned on</p>
+       
+       
+               
+               
+
+</div>
+<a name="var$SMTP_PORT" id="$SMTP_PORT"><!-- --></A>
+<div class="oddrow">
+
+       <div class="var-header">
+               <span class="var-title">
+                       <span class="var-type">int</span>
+                       <span class="var-name">$SMTP_PORT</span>
+                        = <span class="var-default"> 25</span>                 (line <span class="line-number">30</span>)
+               </span>
+       </div>
+
+       <!-- ========== Info from phpDoc block ========= -->
+<p class="short-description">SMTP server port</p>
+       
+       
+               
+               
+
+</div>
+                                               
+               </div>
+       </div>
+       
+       <a name="sec-methods"></a>
+       <div class="info-box">
+               <div class="info-box-title">Methods</div>
+               <div class="nav-bar">
+                       <a href="#sec-description">Description</a> |
+                                                                                                                       <a href="#sec-var-summary">Vars</a> (<a href="#sec-vars">details</a>)
+                                                                                                               <a href="#sec-method-summary">Methods</a> (<span class="disabled">details</span>)
+                                               
+               </div>
+               <div class="info-box-body">
+                       <A NAME='method_detail'></A>
+<a name="methodSMTP" id="SMTP"><!-- --></a>
+<div class="evenrow">
+       
+       <div class="method-header">
+               <span class="method-title">Constructor SMTP</span> (line <span class="line-number">57</span>)
+       </div> 
+       
+       <!-- ========== Info from phpDoc block ========= -->
+<p class="short-description">Initialize the class so that the data is in a known state.</p>
+       <ul class="tags">
+                               <li><span class="field">access:</span> public</li>
+                       </ul>
+       
+       <div class="method-signature">
+               <span class="method-result">void</span>
+               <span class="method-name">
+                       SMTP
+               </span>
+                               ()
+                       </div>
+       
+               
+               
+       </div>
+<a name="methodAuthenticate" id="Authenticate"><!-- --></a>
+<div class="oddrow">
+       
+       <div class="method-header">
+               <span class="method-title">Authenticate</span> (line <span class="line-number">144</span>)
+       </div> 
+       
+       <!-- ========== Info from phpDoc block ========= -->
+<p class="short-description">Performs SMTP authentication.  Must be run after running the  Hello() method.  Returns true if successfully authenticated.</p>
+       <ul class="tags">
+                               <li><span class="field">access:</span> public</li>
+                       </ul>
+       
+       <div class="method-signature">
+               <span class="method-result">bool</span>
+               <span class="method-name">
+                       Authenticate
+               </span>
+                                       (<span class="var-type">mixed</span>&nbsp;<span class="var-name">$username</span>, <span class="var-type">mixed</span>&nbsp;<span class="var-name">$password</span>)
+                       </div>
+       
+               
+               
+       </div>
+<a name="methodClose" id="Close"><!-- --></a>
+<div class="evenrow">
+       
+       <div class="method-header">
+               <span class="method-title">Close</span> (line <span class="line-number">232</span>)
+       </div> 
+       
+       <!-- ========== Info from phpDoc block ========= -->
+<p class="short-description">Closes the socket and cleans up the state of the class.</p>
+<p class="description"><p>It is not considered good to use this function without  first trying to use QUIT.</p></p>
+       <ul class="tags">
+                               <li><span class="field">access:</span> public</li>
+                       </ul>
+       
+       <div class="method-signature">
+               <span class="method-result">void</span>
+               <span class="method-name">
+                       Close
+               </span>
+                               ()
+                       </div>
+       
+               
+               
+       </div>
+<a name="methodConnect" id="Connect"><!-- --></a>
+<div class="oddrow">
+       
+       <div class="method-header">
+               <span class="method-title">Connect</span> (line <span class="line-number">82</span>)
+       </div> 
+       
+       <!-- ========== Info from phpDoc block ========= -->
+<p class="short-description">Connect to the server specified on the port specified.</p>
+<p class="description"><p>If the port is not specified use the default SMTP_PORT.  If tval is specified then a connection will try and be  established with the server for that number of seconds.  If tval is not specified the default is 30 seconds to  try on the connection.</p><p>SMTP CODE SUCCESS: 220  SMTP CODE FAILURE: 421</p></p>
+       <ul class="tags">
+                               <li><span class="field">access:</span> public</li>
+                       </ul>
+       
+       <div class="method-signature">
+               <span class="method-result">bool</span>
+               <span class="method-name">
+                       Connect
+               </span>
+                                       (<span class="var-type">mixed</span>&nbsp;<span class="var-name">$host</span>, <span class="var-type">mixed</span>&nbsp;<span class="var-name">$port</span>, [<span class="var-type">mixed</span>&nbsp;<span class="var-name">$tval</span> = <span class="var-default">30</span>])
+                       </div>
+       
+               
+               
+       </div>
+<a name="methodData" id="Data"><!-- --></a>
+<div class="evenrow">
+       
+       <div class="method-header">
+               <span class="method-title">Data</span> (line <span class="line-number">266</span>)
+       </div> 
+       
+       <!-- ========== Info from phpDoc block ========= -->
+<p class="short-description">Issues a data command and sends the msg_data to the server</p>
+<p class="description"><p>finializing the mail transaction. $msg_data is the message  that is to be send with the headers. Each header needs to be  on a single line followed by a &lt;CRLF&gt; with the message headers  and the message body being seperated by and additional &lt;CRLF&gt;.</p><p>Implements rfc 821: DATA &lt;CRLF&gt;</p><p>SMTP CODE INTERMEDIATE: 354      [data]      &lt;CRLF&gt;.&lt;CRLF&gt;      SMTP CODE SUCCESS: 250      SMTP CODE FAILURE: 552,554,451,452  SMTP CODE FAILURE: 451,554  SMTP CODE ERROR  : 500,501,503,421</p></p>
+       <ul class="tags">
+                               <li><span class="field">access:</span> public</li>
+                       </ul>
+       
+       <div class="method-signature">
+               <span class="method-result">bool</span>
+               <span class="method-name">
+                       Data
+               </span>
+                                       (<span class="var-type">mixed</span>&nbsp;<span class="var-name">$msg_data</span>)
+                       </div>
+       
+               
+               
+       </div>
+<a name="methodExpand" id="Expand"><!-- --></a>
+<div class="oddrow">
+       
+       <div class="method-header">
+               <span class="method-title">Expand</span> (line <span class="line-number">399</span>)
+       </div> 
+       
+       <!-- ========== Info from phpDoc block ========= -->
+<p class="short-description">Expand takes the name and asks the server to list all the  people who are members of the _list_. Expand will return  back and array of the result or false if an error occurs.</p>
+<p class="description"><p>Each value in the array returned has the format of:      [ &lt;full-name&gt; &lt;sp&gt; ] &lt;path&gt;  The definition of &lt;path&gt; is defined in rfc 821</p><p>Implements rfc 821: EXPN &lt;SP&gt; &lt;string&gt; &lt;CRLF&gt;</p><p>SMTP CODE SUCCESS: 250  SMTP CODE FAILURE: 550  SMTP CODE ERROR  : 500,501,502,504,421</p></p>
+       <ul class="tags">
+                               <li><span class="field">return:</span> <p>array</p></li>
+                               <li><span class="field">access:</span> public</li>
+                       </ul>
+       
+       <div class="method-signature">
+               <span class="method-result">string</span>
+               <span class="method-name">
+                       Expand
+               </span>
+                                       (<span class="var-type">mixed</span>&nbsp;<span class="var-name">$name</span>)
+                       </div>
+       
+               
+               
+       </div>
+<a name="methodHello" id="Hello"><!-- --></a>
+<div class="evenrow">
+       
+       <div class="method-header">
+               <span class="method-title">Hello</span> (line <span class="line-number">450</span>)
+       </div> 
+       
+       <!-- ========== Info from phpDoc block ========= -->
+<p class="short-description">Sends the HELO command to the smtp server.</p>
+<p class="description"><p>This makes sure that we and the server are in  the same known state.</p><p>Implements from rfc 821: HELO &lt;SP&gt; &lt;domain&gt; &lt;CRLF&gt;</p><p>SMTP CODE SUCCESS: 250  SMTP CODE ERROR  : 500, 501, 504, 421</p></p>
+       <ul class="tags">
+                               <li><span class="field">access:</span> public</li>
+                       </ul>
+       
+       <div class="method-signature">
+               <span class="method-result">bool</span>
+               <span class="method-name">
+                       Hello
+               </span>
+                                       ([<span class="var-type">mixed</span>&nbsp;<span class="var-name">$host</span> = <span class="var-default">""</span>])
+                       </div>
+       
+               
+               
+       </div>
+<a name="methodHelp" id="Help"><!-- --></a>
+<div class="oddrow">
+       
+       <div class="method-header">
+               <span class="method-title">Help</span> (line <span class="line-number">524</span>)
+       </div> 
+       
+       <!-- ========== Info from phpDoc block ========= -->
+<p class="short-description">Gets help information on the keyword specified. If the keyword</p>
+<p class="description"><p>is not specified then returns generic help, ussually contianing  A list of keywords that help is available on. This function  returns the results back to the user. It is up to the user to  handle the returned data. If an error occurs then false is  returned with $this-&gt;error set appropiately.</p><p>Implements rfc 821: HELP [ &lt;SP&gt; &lt;string&gt; ] &lt;CRLF&gt;</p><p>SMTP CODE SUCCESS: 211,214  SMTP CODE ERROR  : 500,501,502,504,421</p></p>
+       <ul class="tags">
+                               <li><span class="field">access:</span> public</li>
+                       </ul>
+       
+       <div class="method-signature">
+               <span class="method-result">string</span>
+               <span class="method-name">
+                       Help
+               </span>
+                                       ([<span class="var-type">mixed</span>&nbsp;<span class="var-name">$keyword</span> = <span class="var-default">""</span>])
+                       </div>
+       
+               
+               
+       </div>
+<a name="methodMail" id="Mail"><!-- --></a>
+<div class="evenrow">
+       
+       <div class="method-header">
+               <span class="method-title">Mail</span> (line <span class="line-number">576</span>)
+       </div> 
+       
+       <!-- ========== Info from phpDoc block ========= -->
+<p class="short-description">Starts a mail transaction from the email address specified in  $from. Returns true if successful or false otherwise. If True  the mail transaction is started and then one or more Recipient  commands may be called followed by a Data command.</p>
+<p class="description"><p>Implements rfc 821: MAIL &lt;SP&gt; FROM:&lt;reverse-path&gt; &lt;CRLF&gt;</p><p>SMTP CODE SUCCESS: 250  SMTP CODE SUCCESS: 552,451,452  SMTP CODE SUCCESS: 500,501,421</p></p>
+       <ul class="tags">
+                               <li><span class="field">access:</span> public</li>
+                       </ul>
+       
+       <div class="method-signature">
+               <span class="method-result">bool</span>
+               <span class="method-name">
+                       Mail
+               </span>
+                                       (<span class="var-type">mixed</span>&nbsp;<span class="var-name">$from</span>)
+                       </div>
+       
+               
+               
+       </div>
+<a name="methodNoop" id="Noop"><!-- --></a>
+<div class="oddrow">
+       
+       <div class="method-header">
+               <span class="method-title">Noop</span> (line <span class="line-number">618</span>)
+       </div> 
+       
+       <!-- ========== Info from phpDoc block ========= -->
+<p class="short-description">Sends the command NOOP to the SMTP server.</p>
+<p class="description"><p>Implements from rfc 821: NOOP &lt;CRLF&gt;</p><p>SMTP CODE SUCCESS: 250  SMTP CODE ERROR  : 500, 421</p></p>
+       <ul class="tags">
+                               <li><span class="field">access:</span> public</li>
+                       </ul>
+       
+       <div class="method-signature">
+               <span class="method-result">bool</span>
+               <span class="method-name">
+                       Noop
+               </span>
+                               ()
+                       </div>
+       
+               
+               
+       </div>
+<a name="methodQuit" id="Quit"><!-- --></a>
+<div class="evenrow">
+       
+       <div class="method-header">
+               <span class="method-title">Quit</span> (line <span class="line-number">661</span>)
+       </div> 
+       
+       <!-- ========== Info from phpDoc block ========= -->
+<p class="short-description">Sends the quit command to the server and then closes the socket  if there is no error or the $close_on_error argument is true.</p>
+<p class="description"><p>Implements from rfc 821: QUIT &lt;CRLF&gt;</p><p>SMTP CODE SUCCESS: 221  SMTP CODE ERROR  : 500</p></p>
+       <ul class="tags">
+                               <li><span class="field">access:</span> public</li>
+                       </ul>
+       
+       <div class="method-signature">
+               <span class="method-result">bool</span>
+               <span class="method-name">
+                       Quit
+               </span>
+                                       ([<span class="var-type">mixed</span>&nbsp;<span class="var-name">$close_on_error</span> = <span class="var-default">true</span>])
+                       </div>
+       
+               
+               
+       </div>
+<a name="methodRecipient" id="Recipient"><!-- --></a>
+<div class="oddrow">
+       
+       <div class="method-header">
+               <span class="method-title">Recipient</span> (line <span class="line-number">715</span>)
+       </div> 
+       
+       <!-- ========== Info from phpDoc block ========= -->
+<p class="short-description">Sends the command RCPT to the SMTP server with the TO: argument of $to.</p>
+<p class="description"><p>Returns true if the recipient was accepted false if it was rejected.</p><p>Implements from rfc 821: RCPT &lt;SP&gt; TO:&lt;forward-path&gt; &lt;CRLF&gt;</p><p>SMTP CODE SUCCESS: 250,251  SMTP CODE FAILURE: 550,551,552,553,450,451,452  SMTP CODE ERROR  : 500,501,503,421</p></p>
+       <ul class="tags">
+                               <li><span class="field">access:</span> public</li>
+                       </ul>
+       
+       <div class="method-signature">
+               <span class="method-result">bool</span>
+               <span class="method-name">
+                       Recipient
+               </span>
+                                       (<span class="var-type">mixed</span>&nbsp;<span class="var-name">$to</span>)
+                       </div>
+       
+               
+               
+       </div>
+<a name="methodReset" id="Reset"><!-- --></a>
+<div class="evenrow">
+       
+       <div class="method-header">
+               <span class="method-title">Reset</span> (line <span class="line-number">759</span>)
+       </div> 
+       
+       <!-- ========== Info from phpDoc block ========= -->
+<p class="short-description">Sends the RSET command to abort and transaction that is  currently in progress. Returns true if successful false  otherwise.</p>
+<p class="description"><p>Implements rfc 821: RSET &lt;CRLF&gt;</p><p>SMTP CODE SUCCESS: 250  SMTP CODE ERROR  : 500,501,504,421</p></p>
+       <ul class="tags">
+                               <li><span class="field">access:</span> public</li>
+                       </ul>
+       
+       <div class="method-signature">
+               <span class="method-result">bool</span>
+               <span class="method-name">
+                       Reset
+               </span>
+                               ()
+                       </div>
+       
+               
+               
+       </div>
+<a name="methodSend" id="Send"><!-- --></a>
+<div class="oddrow">
+       
+       <div class="method-header">
+               <span class="method-title">Send</span> (line <span class="line-number">808</span>)
+       </div> 
+       
+       <!-- ========== Info from phpDoc block ========= -->
+<p class="short-description">Starts a mail transaction from the email address specified in</p>
+<p class="description"><p>$from. Returns true if successful or false otherwise. If True  the mail transaction is started and then one or more Recipient  commands may be called followed by a Data command. This command  will send the message to the users terminal if they are logged  in.</p><p>Implements rfc 821: SEND &lt;SP&gt; FROM:&lt;reverse-path&gt; &lt;CRLF&gt;</p><p>SMTP CODE SUCCESS: 250  SMTP CODE SUCCESS: 552,451,452  SMTP CODE SUCCESS: 500,501,502,421</p></p>
+       <ul class="tags">
+                               <li><span class="field">access:</span> public</li>
+                       </ul>
+       
+       <div class="method-signature">
+               <span class="method-result">bool</span>
+               <span class="method-name">
+                       Send
+               </span>
+                                       (<span class="var-type">mixed</span>&nbsp;<span class="var-name">$from</span>)
+                       </div>
+       
+               
+               
+       </div>
+<a name="methodSendAndMail" id="SendAndMail"><!-- --></a>
+<div class="evenrow">
+       
+       <div class="method-header">
+               <span class="method-title">SendAndMail</span> (line <span class="line-number">856</span>)
+       </div> 
+       
+       <!-- ========== Info from phpDoc block ========= -->
+<p class="short-description">Starts a mail transaction from the email address specified in</p>
+<p class="description"><p>$from. Returns true if successful or false otherwise. If True  the mail transaction is started and then one or more Recipient  commands may be called followed by a Data command. This command  will send the message to the users terminal if they are logged  in and send them an email.</p><p>Implements rfc 821: SAML &lt;SP&gt; FROM:&lt;reverse-path&gt; &lt;CRLF&gt;</p><p>SMTP CODE SUCCESS: 250  SMTP CODE SUCCESS: 552,451,452  SMTP CODE SUCCESS: 500,501,502,421</p></p>
+       <ul class="tags">
+                               <li><span class="field">access:</span> public</li>
+                       </ul>
+       
+       <div class="method-signature">
+               <span class="method-result">bool</span>
+               <span class="method-name">
+                       SendAndMail
+               </span>
+                                       (<span class="var-type">mixed</span>&nbsp;<span class="var-name">$from</span>)
+                       </div>
+       
+               
+               
+       </div>
+<a name="methodSendOrMail" id="SendOrMail"><!-- --></a>
+<div class="oddrow">
+       
+       <div class="method-header">
+               <span class="method-title">SendOrMail</span> (line <span class="line-number">904</span>)
+       </div> 
+       
+       <!-- ========== Info from phpDoc block ========= -->
+<p class="short-description">Starts a mail transaction from the email address specified in</p>
+<p class="description"><p>$from. Returns true if successful or false otherwise. If True  the mail transaction is started and then one or more Recipient  commands may be called followed by a Data command. This command  will send the message to the users terminal if they are logged  in or mail it to them if they are not.</p><p>Implements rfc 821: SOML &lt;SP&gt; FROM:&lt;reverse-path&gt; &lt;CRLF&gt;</p><p>SMTP CODE SUCCESS: 250  SMTP CODE SUCCESS: 552,451,452  SMTP CODE SUCCESS: 500,501,502,421</p></p>
+       <ul class="tags">
+                               <li><span class="field">access:</span> public</li>
+                       </ul>
+       
+       <div class="method-signature">
+               <span class="method-result">bool</span>
+               <span class="method-name">
+                       SendOrMail
+               </span>
+                                       (<span class="var-type">mixed</span>&nbsp;<span class="var-name">$from</span>)
+                       </div>
+       
+               
+               
+       </div>
+<a name="methodTurn" id="Turn"><!-- --></a>
+<div class="evenrow">
+       
+       <div class="method-header">
+               <span class="method-title">Turn</span> (line <span class="line-number">949</span>)
+       </div> 
+       
+       <!-- ========== Info from phpDoc block ========= -->
+<p class="short-description">This is an optional command for SMTP that this class does not  support. This method is here to make the RFC821 Definition  complete for this class and __may__ be implimented in the future</p>
+<p class="description"><p>Implements from rfc 821: TURN &lt;CRLF&gt;</p><p>SMTP CODE SUCCESS: 250  SMTP CODE FAILURE: 502  SMTP CODE ERROR  : 500, 503</p></p>
+       <ul class="tags">
+                               <li><span class="field">access:</span> public</li>
+                       </ul>
+       
+       <div class="method-signature">
+               <span class="method-result">bool</span>
+               <span class="method-name">
+                       Turn
+               </span>
+                               ()
+                       </div>
+       
+               
+               
+       </div>
+<a name="methodVerify" id="Verify"><!-- --></a>
+<div class="oddrow">
+       
+       <div class="method-header">
+               <span class="method-title">Verify</span> (line <span class="line-number">971</span>)
+       </div> 
+       
+       <!-- ========== Info from phpDoc block ========= -->
+<p class="short-description">Verifies that the name is recognized by the server.</p>
+<p class="description"><p>Returns false if the name could not be verified otherwise  the response from the server is returned.</p><p>Implements rfc 821: VRFY &lt;SP&gt; &lt;string&gt; &lt;CRLF&gt;</p><p>SMTP CODE SUCCESS: 250,251  SMTP CODE FAILURE: 550,551,553  SMTP CODE ERROR  : 500,501,502,421</p></p>
+       <ul class="tags">
+                               <li><span class="field">access:</span> public</li>
+                       </ul>
+       
+       <div class="method-signature">
+               <span class="method-result">int</span>
+               <span class="method-name">
+                       Verify
+               </span>
+                                       (<span class="var-type">mixed</span>&nbsp;<span class="var-name">$name</span>)
+                       </div>
+       
+               
+               
+       </div>
+                                               
+               </div>
+       </div>
+       
+       <p class="notes" id="credit">
+               Documention generated on Mon, 28 Jul 2003 23:25:50 -0400 by <a href="http://www.phpdoc.org" target="_blank">phpDocumentor 1.2.0</a>
+       </p>
+       </div></body>
+</html>
\ No newline at end of file
diff --git a/inc/classes/third_party/php_mailer/phpdoc/PHPMailer/_class_phpmailer_php.html b/inc/classes/third_party/php_mailer/phpdoc/PHPMailer/_class_phpmailer_php.html
new file mode 100644 (file)
index 0000000..f7bde2c
--- /dev/null
@@ -0,0 +1,60 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+  <html xmlns="http://www.w3.org/1999/xhtml">
+               <head>
+                       <!-- template designed by Marco Von Ballmoos -->
+                       <title>Docs for page class.phpmailer.php</title>
+                       <link rel="stylesheet" href="../media/stylesheet.css" />
+                       <meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'/>
+               </head>
+               <body>
+                       <div class="page-body">                 
+<h2 class="file-name">Program_Root/class.phpmailer.php</h2>
+
+<a name="sec-description"></a>
+<div class="info-box">
+       <div class="info-box-title">Description</div>
+       <div class="nav-bar">
+                                       <span class="disabled">Description</span> |
+                                                       <a href="#sec-classes">Classes</a>
+                                                                                                               </div>
+       <div class="info-box-body">     
+               <!-- ========== Info from phpDoc block ========= -->
+               
+                       </div>
+</div>
+               
+       <a name="sec-classes"></a>      
+       <div class="info-box">
+               <div class="info-box-title">Classes</div>
+               <div class="nav-bar">
+                       <a href="#sec-description">Description</a> |
+                       <span class="disabled">Classes</span>
+                                                                                                                                       </div>
+               <div class="info-box-body">     
+                       <table cellpadding="2" cellspacing="0" class="class-table">
+                               <tr>
+                                       <th class="class-table-header">Class</th>
+                                       <th class="class-table-header">Description</th>
+                               </tr>
+                                                               <tr>
+                                       <td style="padding-right: 2em; vertical-align: top">
+                                               <a href="../PHPMailer/PHPMailer.html">PHPMailer</a>
+                                       </td>
+                                       <td>
+                                                                                       PHPMailer - PHP email transport class
+                                                                               </td>
+                               </tr>
+                                                       </table>
+               </div>
+       </div>
+
+       
+       
+       
+       
+       <p class="notes" id="credit">
+               Documention generated on Mon, 28 Jul 2003 23:25:49 -0400 by <a href="http://www.phpdoc.org" target="_blank">phpDocumentor 1.2.0</a>
+       </p>
+       </div></body>
+</html>
\ No newline at end of file
diff --git a/inc/classes/third_party/php_mailer/phpdoc/PHPMailer/_class_smtp_php.html b/inc/classes/third_party/php_mailer/phpdoc/PHPMailer/_class_smtp_php.html
new file mode 100644 (file)
index 0000000..1b7d1b5
--- /dev/null
@@ -0,0 +1,60 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+  <html xmlns="http://www.w3.org/1999/xhtml">
+               <head>
+                       <!-- template designed by Marco Von Ballmoos -->
+                       <title>Docs for page class.smtp.php</title>
+                       <link rel="stylesheet" href="../media/stylesheet.css" />
+                       <meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'/>
+               </head>
+               <body>
+                       <div class="page-body">                 
+<h2 class="file-name">Program_Root/class.smtp.php</h2>
+
+<a name="sec-description"></a>
+<div class="info-box">
+       <div class="info-box-title">Description</div>
+       <div class="nav-bar">
+                                       <span class="disabled">Description</span> |
+                                                       <a href="#sec-classes">Classes</a>
+                                                                                                               </div>
+       <div class="info-box-body">     
+               <!-- ========== Info from phpDoc block ========= -->
+               
+                       </div>
+</div>
+               
+       <a name="sec-classes"></a>      
+       <div class="info-box">
+               <div class="info-box-title">Classes</div>
+               <div class="nav-bar">
+                       <a href="#sec-description">Description</a> |
+                       <span class="disabled">Classes</span>
+                                                                                                                                       </div>
+               <div class="info-box-body">     
+                       <table cellpadding="2" cellspacing="0" class="class-table">
+                               <tr>
+                                       <th class="class-table-header">Class</th>
+                                       <th class="class-table-header">Description</th>
+                               </tr>
+                                                               <tr>
+                                       <td style="padding-right: 2em; vertical-align: top">
+                                               <a href="../PHPMailer/SMTP.html">SMTP</a>
+                                       </td>
+                                       <td>
+                                                                                       SMTP is rfc 821 compliant and implements all the rfc 821 SMTP  commands except TURN which will always return a not implemented  error. SMTP also provides some utility methods for sending mail  to an SMTP server.
+                                                                               </td>
+                               </tr>
+                                                       </table>
+               </div>
+       </div>
+
+       
+       
+       
+       
+       <p class="notes" id="credit">
+               Documention generated on Mon, 28 Jul 2003 23:25:50 -0400 by <a href="http://www.phpdoc.org" target="_blank">phpDocumentor 1.2.0</a>
+       </p>
+       </div></body>
+</html>
\ No newline at end of file
diff --git a/inc/classes/third_party/php_mailer/phpdoc/blank.html b/inc/classes/third_party/php_mailer/phpdoc/blank.html
new file mode 100644 (file)
index 0000000..4382bc9
--- /dev/null
@@ -0,0 +1,13 @@
+<html>
+<head>
+       <title>Generated Documentation</title>
+                       <link rel="stylesheet" href="media/stylesheet.css" />
+                       <meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'/>
+</head>
+<body>
+<div align="center"><h1>Generated Documentation</h1></div>
+<b>Welcome to default!</b><br />
+<br />
+This documentation was generated by <a href="http://www.phpdoc.org">phpDocumentor v1.2.0</a><br />
+</body>
+</html>
\ No newline at end of file
diff --git a/inc/classes/third_party/php_mailer/phpdoc/classtrees_PHPMailer.html b/inc/classes/third_party/php_mailer/phpdoc/classtrees_PHPMailer.html
new file mode 100644 (file)
index 0000000..f8a48da
--- /dev/null
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+  <html xmlns="http://www.w3.org/1999/xhtml">
+               <head>
+                       <!-- template designed by Marco Von Ballmoos -->
+                       <title></title>
+                       <link rel="stylesheet" href="media/stylesheet.css" />
+                       <meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'/>
+               </head>
+               <body>
+                                               
+<!-- Start of Class Data -->
+<H2>
+       
+</H2>
+<h2>Root class PHPMailer</h2>
+<ul>
+<li><a href="PHPMailer/PHPMailer.html">PHPMailer</a></li></ul>
+
+<h2>Root class SMTP</h2>
+<ul>
+<li><a href="PHPMailer/SMTP.html">SMTP</a></li></ul>
+
+       <p class="notes" id="credit">
+               Documention generated on Mon, 28 Jul 2003 23:25:49 -0400 by <a href="http://www.phpdoc.org" target="_blank">phpDocumentor 1.2.0</a>
+       </p>
+       </body>
+</html>
\ No newline at end of file
diff --git a/inc/classes/third_party/php_mailer/phpdoc/elementindex.html b/inc/classes/third_party/php_mailer/phpdoc/elementindex.html
new file mode 100644 (file)
index 0000000..7f65a76
--- /dev/null
@@ -0,0 +1,734 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+  <html xmlns="http://www.w3.org/1999/xhtml">
+               <head>
+                       <!-- template designed by Marco Von Ballmoos -->
+                       <title></title>
+                       <link rel="stylesheet" href="media/stylesheet.css" />
+                       <meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'/>
+               </head>
+               <body>
+                                               <a name="top"></a>
+<h2>Full index</h2>
+<h3>Package indexes</h3>
+<ul>
+       <li><a href="elementindex_PHPMailer.html">PHPMailer</a></li>
+</ul>
+<br />
+<div class="index-letter-menu">
+       <a class="index-letter" href="elementindex.html#a">a</a>
+       <a class="index-letter" href="elementindex.html#b">b</a>
+       <a class="index-letter" href="elementindex.html#c">c</a>
+       <a class="index-letter" href="elementindex.html#d">d</a>
+       <a class="index-letter" href="elementindex.html#e">e</a>
+       <a class="index-letter" href="elementindex.html#f">f</a>
+       <a class="index-letter" href="elementindex.html#h">h</a>
+       <a class="index-letter" href="elementindex.html#i">i</a>
+       <a class="index-letter" href="elementindex.html#m">m</a>
+       <a class="index-letter" href="elementindex.html#n">n</a>
+       <a class="index-letter" href="elementindex.html#p">p</a>
+       <a class="index-letter" href="elementindex.html#q">q</a>
+       <a class="index-letter" href="elementindex.html#r">r</a>
+       <a class="index-letter" href="elementindex.html#s">s</a>
+       <a class="index-letter" href="elementindex.html#t">t</a>
+       <a class="index-letter" href="elementindex.html#u">u</a>
+       <a class="index-letter" href="elementindex.html#v">v</a>
+       <a class="index-letter" href="elementindex.html#w">w</a>
+</div>
+
+       <a name="a"></a>
+       <div class="index-letter-section">
+               <div style="float: left" class="index-letter-title">a</div>
+               <div style="float: right"><a href="#top">top</a></div>
+               <div style="clear: both"></div>
+       </div>
+       <dl>
+                       <dt class="field">
+                                               <span class="var-title">$AltBody</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/PHPMailer.html#var$AltBody">PHPMailer::$AltBody</a> in class.phpmailer.php</div>
+                                                       <div class="index-item-description">Sets the text-only body of the message.  This automatically sets the  email to multipart/alternative.  This body can be read by mail  clients that do not have HTML email capability such as mutt. Clients  that can read HTML will view the normal Body.</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="method-title">AddAddress</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/PHPMailer.html#methodAddAddress">PHPMailer::AddAddress()</a> in class.phpmailer.php</div>
+                                                       <div class="index-item-description">Adds a &quot;To&quot; address.</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="method-title">AddAttachment</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/PHPMailer.html#methodAddAttachment">PHPMailer::AddAttachment()</a> in class.phpmailer.php</div>
+                                                       <div class="index-item-description">Adds an attachment from a path on the filesystem.</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="method-title">AddBCC</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/PHPMailer.html#methodAddBCC">PHPMailer::AddBCC()</a> in class.phpmailer.php</div>
+                                                       <div class="index-item-description">Adds a &quot;Bcc&quot; address. Note: this function works  with the SMTP mailer on win32, not with the &quot;mail&quot;  mailer.</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="method-title">AddCC</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/PHPMailer.html#methodAddCC">PHPMailer::AddCC()</a> in class.phpmailer.php</div>
+                                                       <div class="index-item-description">Adds a &quot;Cc&quot; address. Note: this function works  with the SMTP mailer on win32, not with the &quot;mail&quot;  mailer.</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="method-title">AddCustomHeader</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/PHPMailer.html#methodAddCustomHeader">PHPMailer::AddCustomHeader()</a> in class.phpmailer.php</div>
+                                                       <div class="index-item-description">Adds a custom header.</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="method-title">AddEmbeddedImage</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/PHPMailer.html#methodAddEmbeddedImage">PHPMailer::AddEmbeddedImage()</a> in class.phpmailer.php</div>
+                                                       <div class="index-item-description">Adds an embedded attachment.  This can include images, sounds, and  just about any other document.  Make sure to set the $type to an  image type.  For JPEG images use &quot;image/jpeg&quot; and for GIF images  use &quot;image/gif&quot;.</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="method-title">AddReplyTo</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/PHPMailer.html#methodAddReplyTo">PHPMailer::AddReplyTo()</a> in class.phpmailer.php</div>
+                                                       <div class="index-item-description">Adds a &quot;Reply-to&quot; address.</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="method-title">AddStringAttachment</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/PHPMailer.html#methodAddStringAttachment">PHPMailer::AddStringAttachment()</a> in class.phpmailer.php</div>
+                                                       <div class="index-item-description">Adds a string or binary attachment (non-filesystem) to the list.</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="method-title">Authenticate</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/SMTP.html#methodAuthenticate">SMTP::Authenticate()</a> in class.smtp.php</div>
+                                                       <div class="index-item-description">Performs SMTP authentication.  Must be run after running the  Hello() method.  Returns true if successfully authenticated.</div>
+                                       </dd>
+               </dl>
+       <a name="b"></a>
+       <div class="index-letter-section">
+               <div style="float: left" class="index-letter-title">b</div>
+               <div style="float: right"><a href="#top">top</a></div>
+               <div style="clear: both"></div>
+       </div>
+       <dl>
+                       <dt class="field">
+                                               <span class="var-title">$Body</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/PHPMailer.html#var$Body">PHPMailer::$Body</a> in class.phpmailer.php</div>
+                                                       <div class="index-item-description">Sets the Body of the message.  This can be either an HTML or text body.</div>
+                                       </dd>
+               </dl>
+       <a name="c"></a>
+       <div class="index-letter-section">
+               <div style="float: left" class="index-letter-title">c</div>
+               <div style="float: right"><a href="#top">top</a></div>
+               <div style="clear: both"></div>
+       </div>
+       <dl>
+                       <dt class="field">
+                                               <span class="var-title">$CharSet</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/PHPMailer.html#var$CharSet">PHPMailer::$CharSet</a> in class.phpmailer.php</div>
+                                                       <div class="index-item-description">Sets the CharSet of the message.</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="var-title">$ConfirmReadingTo</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/PHPMailer.html#var$ConfirmReadingTo">PHPMailer::$ConfirmReadingTo</a> in class.phpmailer.php</div>
+                                                       <div class="index-item-description">Sets the email address that a reading confirmation will be sent.</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="var-title">$ContentType</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/PHPMailer.html#var$ContentType">PHPMailer::$ContentType</a> in class.phpmailer.php</div>
+                                                       <div class="index-item-description">Sets the Content-type of the message.</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="var-title">$CRLF</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/SMTP.html#var$CRLF">SMTP::$CRLF</a> in class.smtp.php</div>
+                                                       <div class="index-item-description">SMTP reply line ending</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="include-title">class.phpmailer.php</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/_class_phpmailer_php.html">class.phpmailer.php</a> in class.phpmailer.php</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="include-title">class.smtp.php</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/_class_smtp_php.html">class.smtp.php</a> in class.smtp.php</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="method-title">ClearAddresses</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/PHPMailer.html#methodClearAddresses">PHPMailer::ClearAddresses()</a> in class.phpmailer.php</div>
+                                                       <div class="index-item-description">Clears all recipients assigned in the TO array.  Returns void.</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="method-title">ClearAllRecipients</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/PHPMailer.html#methodClearAllRecipients">PHPMailer::ClearAllRecipients()</a> in class.phpmailer.php</div>
+                                                       <div class="index-item-description">Clears all recipients assigned in the TO, CC and BCC  array.  Returns void.</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="method-title">ClearAttachments</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/PHPMailer.html#methodClearAttachments">PHPMailer::ClearAttachments()</a> in class.phpmailer.php</div>
+                                                       <div class="index-item-description">Clears all previously set filesystem, string, and binary  attachments.  Returns void.</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="method-title">ClearBCCs</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/PHPMailer.html#methodClearBCCs">PHPMailer::ClearBCCs()</a> in class.phpmailer.php</div>
+                                                       <div class="index-item-description">Clears all recipients assigned in the BCC array.  Returns void.</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="method-title">ClearCCs</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/PHPMailer.html#methodClearCCs">PHPMailer::ClearCCs()</a> in class.phpmailer.php</div>
+                                                       <div class="index-item-description">Clears all recipients assigned in the CC array.  Returns void.</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="method-title">ClearCustomHeaders</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/PHPMailer.html#methodClearCustomHeaders">PHPMailer::ClearCustomHeaders()</a> in class.phpmailer.php</div>
+                                                       <div class="index-item-description">Clears all custom headers.  Returns void.</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="method-title">ClearReplyTos</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/PHPMailer.html#methodClearReplyTos">PHPMailer::ClearReplyTos()</a> in class.phpmailer.php</div>
+                                                       <div class="index-item-description">Clears all recipients assigned in the ReplyTo array.  Returns void.</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="method-title">Close</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/SMTP.html#methodClose">SMTP::Close()</a> in class.smtp.php</div>
+                                                       <div class="index-item-description">Closes the socket and cleans up the state of the class.</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="method-title">Connect</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/SMTP.html#methodConnect">SMTP::Connect()</a> in class.smtp.php</div>
+                                                       <div class="index-item-description">Connect to the server specified on the port specified.</div>
+                                       </dd>
+               </dl>
+       <a name="d"></a>
+       <div class="index-letter-section">
+               <div style="float: left" class="index-letter-title">d</div>
+               <div style="float: right"><a href="#top">top</a></div>
+               <div style="clear: both"></div>
+       </div>
+       <dl>
+                       <dt class="field">
+                                               <span class="var-title">$do_debug</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/SMTP.html#var$do_debug">SMTP::$do_debug</a> in class.smtp.php</div>
+                                                       <div class="index-item-description">Sets whether debugging is turned on</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="method-title">Data</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/SMTP.html#methodData">SMTP::Data()</a> in class.smtp.php</div>
+                                                       <div class="index-item-description">Issues a data command and sends the msg_data to the server</div>
+                                       </dd>
+               </dl>
+       <a name="e"></a>
+       <div class="index-letter-section">
+               <div style="float: left" class="index-letter-title">e</div>
+               <div style="float: right"><a href="#top">top</a></div>
+               <div style="clear: both"></div>
+       </div>
+       <dl>
+                       <dt class="field">
+                                               <span class="var-title">$Encoding</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/PHPMailer.html#var$Encoding">PHPMailer::$Encoding</a> in class.phpmailer.php</div>
+                                                       <div class="index-item-description">Sets the Encoding of the message. Options for this are &quot;8bit&quot;,  &quot;7bit&quot;, &quot;binary&quot;, &quot;base64&quot;, and &quot;quoted-printable&quot;.</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="var-title">$ErrorInfo</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/PHPMailer.html#var$ErrorInfo">PHPMailer::$ErrorInfo</a> in class.phpmailer.php</div>
+                                                       <div class="index-item-description">Holds the most recent mailer error message.</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="method-title">Expand</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/SMTP.html#methodExpand">SMTP::Expand()</a> in class.smtp.php</div>
+                                                       <div class="index-item-description">Expand takes the name and asks the server to list all the  people who are members of the _list_. Expand will return  back and array of the result or false if an error occurs.</div>
+                                       </dd>
+               </dl>
+       <a name="f"></a>
+       <div class="index-letter-section">
+               <div style="float: left" class="index-letter-title">f</div>
+               <div style="float: right"><a href="#top">top</a></div>
+               <div style="clear: both"></div>
+       </div>
+       <dl>
+                       <dt class="field">
+                                               <span class="var-title">$From</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/PHPMailer.html#var$From">PHPMailer::$From</a> in class.phpmailer.php</div>
+                                                       <div class="index-item-description">Sets the From email address for the message.</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="var-title">$FromName</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/PHPMailer.html#var$FromName">PHPMailer::$FromName</a> in class.phpmailer.php</div>
+                                                       <div class="index-item-description">Sets the From name of the message.</div>
+                                       </dd>
+               </dl>
+       <a name="h"></a>
+       <div class="index-letter-section">
+               <div style="float: left" class="index-letter-title">h</div>
+               <div style="float: right"><a href="#top">top</a></div>
+               <div style="clear: both"></div>
+       </div>
+       <dl>
+                       <dt class="field">
+                                               <span class="var-title">$Helo</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/PHPMailer.html#var$Helo">PHPMailer::$Helo</a> in class.phpmailer.php</div>
+                                                       <div class="index-item-description">Sets the SMTP HELO of the message (Default is $Hostname).</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="var-title">$Host</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/PHPMailer.html#var$Host">PHPMailer::$Host</a> in class.phpmailer.php</div>
+                                                       <div class="index-item-description">Sets the SMTP hosts.  All hosts must be separated by a   semicolon.  You can also specify a different port   for each host by using this format: [hostname:port]   (e.g. &quot;smtp1.example.com:25;smtp2.example.com&quot;).</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="var-title">$Hostname</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/PHPMailer.html#var$Hostname">PHPMailer::$Hostname</a> in class.phpmailer.php</div>
+                                                       <div class="index-item-description">Sets the hostname to use in Message-Id and Received headers   and as default HELO string. If empty, the value returned   by SERVER_NAME is used or 'localhost.localdomain'.</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="method-title">Hello</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/SMTP.html#methodHello">SMTP::Hello()</a> in class.smtp.php</div>
+                                                       <div class="index-item-description">Sends the HELO command to the smtp server.</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="method-title">Help</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/SMTP.html#methodHelp">SMTP::Help()</a> in class.smtp.php</div>
+                                                       <div class="index-item-description">Gets help information on the keyword specified. If the keyword</div>
+                                       </dd>
+               </dl>
+       <a name="i"></a>
+       <div class="index-letter-section">
+               <div style="float: left" class="index-letter-title">i</div>
+               <div style="float: right"><a href="#top">top</a></div>
+               <div style="clear: both"></div>
+       </div>
+       <dl>
+                       <dt class="field">
+                                               <span class="method-title">IsError</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/PHPMailer.html#methodIsError">PHPMailer::IsError()</a> in class.phpmailer.php</div>
+                                                       <div class="index-item-description">Returns true if an error occurred.</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="method-title">IsHTML</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/PHPMailer.html#methodIsHTML">PHPMailer::IsHTML()</a> in class.phpmailer.php</div>
+                                                       <div class="index-item-description">Sets message type to HTML.</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="method-title">IsMail</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/PHPMailer.html#methodIsMail">PHPMailer::IsMail()</a> in class.phpmailer.php</div>
+                                                       <div class="index-item-description">Sets Mailer to send message using PHP mail() function.</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="method-title">IsQmail</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/PHPMailer.html#methodIsQmail">PHPMailer::IsQmail()</a> in class.phpmailer.php</div>
+                                                       <div class="index-item-description">Sets Mailer to send message using the qmail MTA.</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="method-title">IsSendmail</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/PHPMailer.html#methodIsSendmail">PHPMailer::IsSendmail()</a> in class.phpmailer.php</div>
+                                                       <div class="index-item-description">Sets Mailer to send message using the $Sendmail program.</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="method-title">IsSMTP</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/PHPMailer.html#methodIsSMTP">PHPMailer::IsSMTP()</a> in class.phpmailer.php</div>
+                                                       <div class="index-item-description">Sets Mailer to send message using SMTP.</div>
+                                       </dd>
+               </dl>
+       <a name="m"></a>
+       <div class="index-letter-section">
+               <div style="float: left" class="index-letter-title">m</div>
+               <div style="float: right"><a href="#top">top</a></div>
+               <div style="clear: both"></div>
+       </div>
+       <dl>
+                       <dt class="field">
+                                               <span class="var-title">$Mailer</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/PHPMailer.html#var$Mailer">PHPMailer::$Mailer</a> in class.phpmailer.php</div>
+                                                       <div class="index-item-description">Method to send mail: (&quot;mail&quot;, &quot;sendmail&quot;, or &quot;smtp&quot;).</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="method-title">Mail</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/SMTP.html#methodMail">SMTP::Mail()</a> in class.smtp.php</div>
+                                                       <div class="index-item-description">Starts a mail transaction from the email address specified in  $from. Returns true if successful or false otherwise. If True  the mail transaction is started and then one or more Recipient  commands may be called followed by a Data command.</div>
+                                       </dd>
+               </dl>
+       <a name="n"></a>
+       <div class="index-letter-section">
+               <div style="float: left" class="index-letter-title">n</div>
+               <div style="float: right"><a href="#top">top</a></div>
+               <div style="clear: both"></div>
+       </div>
+       <dl>
+                       <dt class="field">
+                                               <span class="method-title">Noop</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/SMTP.html#methodNoop">SMTP::Noop()</a> in class.smtp.php</div>
+                                                       <div class="index-item-description">Sends the command NOOP to the SMTP server.</div>
+                                       </dd>
+               </dl>
+       <a name="p"></a>
+       <div class="index-letter-section">
+               <div style="float: left" class="index-letter-title">p</div>
+               <div style="float: right"><a href="#top">top</a></div>
+               <div style="clear: both"></div>
+       </div>
+       <dl>
+                       <dt class="field">
+                                               <span class="var-title">$Password</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/PHPMailer.html#var$Password">PHPMailer::$Password</a> in class.phpmailer.php</div>
+                                                       <div class="index-item-description">Sets SMTP password.</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="var-title">$PluginDir</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/PHPMailer.html#var$PluginDir">PHPMailer::$PluginDir</a> in class.phpmailer.php</div>
+                                                       <div class="index-item-description">Path to PHPMailer plugins.  This is now only useful if the SMTP class  is in a different directory than the PHP include path.</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="var-title">$Port</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/PHPMailer.html#var$Port">PHPMailer::$Port</a> in class.phpmailer.php</div>
+                                                       <div class="index-item-description">Sets the default SMTP server port.</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="var-title">$Priority</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/PHPMailer.html#var$Priority">PHPMailer::$Priority</a> in class.phpmailer.php</div>
+                                                       <div class="index-item-description">Email priority (1 = High, 3 = Normal, 5 = low).</div>
+                                       </dd>
+                       <dt class="field">
+                                               PHPMailer
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/PHPMailer.html">PHPMailer</a> in class.phpmailer.php</div>
+                                                       <div class="index-item-description">PHPMailer - PHP email transport class</div>
+                                       </dd>
+               </dl>
+       <a name="q"></a>
+       <div class="index-letter-section">
+               <div style="float: left" class="index-letter-title">q</div>
+               <div style="float: right"><a href="#top">top</a></div>
+               <div style="clear: both"></div>
+       </div>
+       <dl>
+                       <dt class="field">
+                                               <span class="method-title">Quit</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/SMTP.html#methodQuit">SMTP::Quit()</a> in class.smtp.php</div>
+                                                       <div class="index-item-description">Sends the quit command to the server and then closes the socket  if there is no error or the $close_on_error argument is true.</div>
+                                       </dd>
+               </dl>
+       <a name="r"></a>
+       <div class="index-letter-section">
+               <div style="float: left" class="index-letter-title">r</div>
+               <div style="float: right"><a href="#top">top</a></div>
+               <div style="clear: both"></div>
+       </div>
+       <dl>
+                       <dt class="field">
+                                               <span class="method-title">Recipient</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/SMTP.html#methodRecipient">SMTP::Recipient()</a> in class.smtp.php</div>
+                                                       <div class="index-item-description">Sends the command RCPT to the SMTP server with the TO: argument of $to.</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="method-title">Reset</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/SMTP.html#methodReset">SMTP::Reset()</a> in class.smtp.php</div>
+                                                       <div class="index-item-description">Sends the RSET command to abort and transaction that is  currently in progress. Returns true if successful false  otherwise.</div>
+                                       </dd>
+               </dl>
+       <a name="s"></a>
+       <div class="index-letter-section">
+               <div style="float: left" class="index-letter-title">s</div>
+               <div style="float: right"><a href="#top">top</a></div>
+               <div style="clear: both"></div>
+       </div>
+       <dl>
+                       <dt class="field">
+                                               <span class="var-title">$Sender</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/PHPMailer.html#var$Sender">PHPMailer::$Sender</a> in class.phpmailer.php</div>
+                                                       <div class="index-item-description">Sets the Sender email (Return-Path) of the message.  If not empty,  will be sent via -f to sendmail or as 'MAIL FROM' in smtp mode.</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="var-title">$Sendmail</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/PHPMailer.html#var$Sendmail">PHPMailer::$Sendmail</a> in class.phpmailer.php</div>
+                                                       <div class="index-item-description">Sets the path of the sendmail program.</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="var-title">$SMTPAuth</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/PHPMailer.html#var$SMTPAuth">PHPMailer::$SMTPAuth</a> in class.phpmailer.php</div>
+                                                       <div class="index-item-description">Sets SMTP authentication. Utilizes the Username and Password variables.</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="var-title">$SMTPDebug</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/PHPMailer.html#var$SMTPDebug">PHPMailer::$SMTPDebug</a> in class.phpmailer.php</div>
+                                                       <div class="index-item-description">Sets SMTP class debugging on or off.</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="var-title">$SMTPKeepAlive</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/PHPMailer.html#var$SMTPKeepAlive">PHPMailer::$SMTPKeepAlive</a> in class.phpmailer.php</div>
+                                                       <div class="index-item-description">Prevents the SMTP connection from being closed after each mail  sending.  If this is set to true then to close the connection  requires an explicit call to SmtpClose().</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="var-title">$SMTP_PORT</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/SMTP.html#var$SMTP_PORT">SMTP::$SMTP_PORT</a> in class.smtp.php</div>
+                                                       <div class="index-item-description">SMTP server port</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="var-title">$Subject</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/PHPMailer.html#var$Subject">PHPMailer::$Subject</a> in class.phpmailer.php</div>
+                                                       <div class="index-item-description">Sets the Subject of the message.</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="method-title">Send</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/SMTP.html#methodSend">SMTP::Send()</a> in class.smtp.php</div>
+                                                       <div class="index-item-description">Starts a mail transaction from the email address specified in</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="method-title">Send</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/PHPMailer.html#methodSend">PHPMailer::Send()</a> in class.phpmailer.php</div>
+                                                       <div class="index-item-description">Creates message and assigns Mailer. If the message is  not sent successfully then it returns false.  Use the ErrorInfo  variable to view description of the error.</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="method-title">SendAndMail</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/SMTP.html#methodSendAndMail">SMTP::SendAndMail()</a> in class.smtp.php</div>
+                                                       <div class="index-item-description">Starts a mail transaction from the email address specified in</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="method-title">SendOrMail</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/SMTP.html#methodSendOrMail">SMTP::SendOrMail()</a> in class.smtp.php</div>
+                                                       <div class="index-item-description">Starts a mail transaction from the email address specified in</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="method-title">SetLanguage</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/PHPMailer.html#methodSetLanguage">PHPMailer::SetLanguage()</a> in class.phpmailer.php</div>
+                                                       <div class="index-item-description">Sets the language for all class error messages.  Returns false  if it cannot load the language file.  The default language type  is English.</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="method-title">SMTP</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/SMTP.html#methodSMTP">SMTP::SMTP()</a> in class.smtp.php</div>
+                                                       <div class="index-item-description">Initialize the class so that the data is in a known state.</div>
+                                       </dd>
+                       <dt class="field">
+                                               SMTP
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/SMTP.html">SMTP</a> in class.smtp.php</div>
+                                                       <div class="index-item-description">SMTP is rfc 821 compliant and implements all the rfc 821 SMTP  commands except TURN which will always return a not implemented  error. SMTP also provides some utility methods for sending mail  to an SMTP server.</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="method-title">SmtpClose</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/PHPMailer.html#methodSmtpClose">PHPMailer::SmtpClose()</a> in class.phpmailer.php</div>
+                                                       <div class="index-item-description">Closes the active SMTP session if one exists.</div>
+                                       </dd>
+               </dl>
+       <a name="t"></a>
+       <div class="index-letter-section">
+               <div style="float: left" class="index-letter-title">t</div>
+               <div style="float: right"><a href="#top">top</a></div>
+               <div style="clear: both"></div>
+       </div>
+       <dl>
+                       <dt class="field">
+                                               <span class="var-title">$Timeout</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/PHPMailer.html#var$Timeout">PHPMailer::$Timeout</a> in class.phpmailer.php</div>
+                                                       <div class="index-item-description">Sets the SMTP server timeout in seconds. This function will not   work with the win32 version.</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="method-title">Turn</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/SMTP.html#methodTurn">SMTP::Turn()</a> in class.smtp.php</div>
+                                                       <div class="index-item-description">This is an optional command for SMTP that this class does not  support. This method is here to make the RFC821 Definition  complete for this class and __may__ be implimented in the future</div>
+                                       </dd>
+               </dl>
+       <a name="u"></a>
+       <div class="index-letter-section">
+               <div style="float: left" class="index-letter-title">u</div>
+               <div style="float: right"><a href="#top">top</a></div>
+               <div style="clear: both"></div>
+       </div>
+       <dl>
+                       <dt class="field">
+                                               <span class="var-title">$Username</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/PHPMailer.html#var$Username">PHPMailer::$Username</a> in class.phpmailer.php</div>
+                                                       <div class="index-item-description">Sets SMTP username.</div>
+                                       </dd>
+               </dl>
+       <a name="v"></a>
+       <div class="index-letter-section">
+               <div style="float: left" class="index-letter-title">v</div>
+               <div style="float: right"><a href="#top">top</a></div>
+               <div style="clear: both"></div>
+       </div>
+       <dl>
+                       <dt class="field">
+                                               <span class="var-title">$Version</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/PHPMailer.html#var$Version">PHPMailer::$Version</a> in class.phpmailer.php</div>
+                                                       <div class="index-item-description">Holds PHPMailer version.</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="method-title">Verify</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/SMTP.html#methodVerify">SMTP::Verify()</a> in class.smtp.php</div>
+                                                       <div class="index-item-description">Verifies that the name is recognized by the server.</div>
+                                       </dd>
+               </dl>
+       <a name="w"></a>
+       <div class="index-letter-section">
+               <div style="float: left" class="index-letter-title">w</div>
+               <div style="float: right"><a href="#top">top</a></div>
+               <div style="clear: both"></div>
+       </div>
+       <dl>
+                       <dt class="field">
+                                               <span class="var-title">$WordWrap</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/PHPMailer.html#var$WordWrap">PHPMailer::$WordWrap</a> in class.phpmailer.php</div>
+                                                       <div class="index-item-description">Sets word wrapping on the body of the message to a given number of  characters.</div>
+                                       </dd>
+               </dl>
+
+<div class="index-letter-menu">
+       <a class="index-letter" href="elementindex.html#a">a</a>
+       <a class="index-letter" href="elementindex.html#b">b</a>
+       <a class="index-letter" href="elementindex.html#c">c</a>
+       <a class="index-letter" href="elementindex.html#d">d</a>
+       <a class="index-letter" href="elementindex.html#e">e</a>
+       <a class="index-letter" href="elementindex.html#f">f</a>
+       <a class="index-letter" href="elementindex.html#h">h</a>
+       <a class="index-letter" href="elementindex.html#i">i</a>
+       <a class="index-letter" href="elementindex.html#m">m</a>
+       <a class="index-letter" href="elementindex.html#n">n</a>
+       <a class="index-letter" href="elementindex.html#p">p</a>
+       <a class="index-letter" href="elementindex.html#q">q</a>
+       <a class="index-letter" href="elementindex.html#r">r</a>
+       <a class="index-letter" href="elementindex.html#s">s</a>
+       <a class="index-letter" href="elementindex.html#t">t</a>
+       <a class="index-letter" href="elementindex.html#u">u</a>
+       <a class="index-letter" href="elementindex.html#v">v</a>
+       <a class="index-letter" href="elementindex.html#w">w</a>
+</div> </body>
+</html>
\ No newline at end of file
diff --git a/inc/classes/third_party/php_mailer/phpdoc/elementindex_PHPMailer.html b/inc/classes/third_party/php_mailer/phpdoc/elementindex_PHPMailer.html
new file mode 100644 (file)
index 0000000..e62d5ed
--- /dev/null
@@ -0,0 +1,731 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+  <html xmlns="http://www.w3.org/1999/xhtml">
+               <head>
+                       <!-- template designed by Marco Von Ballmoos -->
+                       <title></title>
+                       <link rel="stylesheet" href="media/stylesheet.css" />
+                       <meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'/>
+               </head>
+               <body>
+                                               <a name="top"></a>
+<h2>[PHPMailer] element index</h2>
+<a href="elementindex.html">All elements</a>
+<br />
+<div class="index-letter-menu">
+       <a class="index-letter" href="elementindex_PHPMailer.html#a">a</a>
+       <a class="index-letter" href="elementindex_PHPMailer.html#b">b</a>
+       <a class="index-letter" href="elementindex_PHPMailer.html#c">c</a>
+       <a class="index-letter" href="elementindex_PHPMailer.html#d">d</a>
+       <a class="index-letter" href="elementindex_PHPMailer.html#e">e</a>
+       <a class="index-letter" href="elementindex_PHPMailer.html#f">f</a>
+       <a class="index-letter" href="elementindex_PHPMailer.html#h">h</a>
+       <a class="index-letter" href="elementindex_PHPMailer.html#i">i</a>
+       <a class="index-letter" href="elementindex_PHPMailer.html#m">m</a>
+       <a class="index-letter" href="elementindex_PHPMailer.html#n">n</a>
+       <a class="index-letter" href="elementindex_PHPMailer.html#p">p</a>
+       <a class="index-letter" href="elementindex_PHPMailer.html#q">q</a>
+       <a class="index-letter" href="elementindex_PHPMailer.html#r">r</a>
+       <a class="index-letter" href="elementindex_PHPMailer.html#s">s</a>
+       <a class="index-letter" href="elementindex_PHPMailer.html#t">t</a>
+       <a class="index-letter" href="elementindex_PHPMailer.html#u">u</a>
+       <a class="index-letter" href="elementindex_PHPMailer.html#v">v</a>
+       <a class="index-letter" href="elementindex_PHPMailer.html#w">w</a>
+</div>
+
+       <a name="a"></a>
+       <div class="index-letter-section">
+               <div style="float: left" class="index-letter-title">a</div>
+               <div style="float: right"><a href="#top">top</a></div>
+               <div style="clear: both"></div>
+       </div>
+       <dl>
+                       <dt class="field">
+                                               <span class="var-title">$AltBody</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/PHPMailer.html#var$AltBody">PHPMailer::$AltBody</a> in class.phpmailer.php</div>
+                                                       <div class="index-item-description">Sets the text-only body of the message.  This automatically sets the  email to multipart/alternative.  This body can be read by mail  clients that do not have HTML email capability such as mutt. Clients  that can read HTML will view the normal Body.</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="method-title">AddAddress</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/PHPMailer.html#methodAddAddress">PHPMailer::AddAddress()</a> in class.phpmailer.php</div>
+                                                       <div class="index-item-description">Adds a &quot;To&quot; address.</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="method-title">AddAttachment</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/PHPMailer.html#methodAddAttachment">PHPMailer::AddAttachment()</a> in class.phpmailer.php</div>
+                                                       <div class="index-item-description">Adds an attachment from a path on the filesystem.</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="method-title">AddBCC</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/PHPMailer.html#methodAddBCC">PHPMailer::AddBCC()</a> in class.phpmailer.php</div>
+                                                       <div class="index-item-description">Adds a &quot;Bcc&quot; address. Note: this function works  with the SMTP mailer on win32, not with the &quot;mail&quot;  mailer.</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="method-title">AddCC</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/PHPMailer.html#methodAddCC">PHPMailer::AddCC()</a> in class.phpmailer.php</div>
+                                                       <div class="index-item-description">Adds a &quot;Cc&quot; address. Note: this function works  with the SMTP mailer on win32, not with the &quot;mail&quot;  mailer.</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="method-title">AddCustomHeader</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/PHPMailer.html#methodAddCustomHeader">PHPMailer::AddCustomHeader()</a> in class.phpmailer.php</div>
+                                                       <div class="index-item-description">Adds a custom header.</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="method-title">AddEmbeddedImage</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/PHPMailer.html#methodAddEmbeddedImage">PHPMailer::AddEmbeddedImage()</a> in class.phpmailer.php</div>
+                                                       <div class="index-item-description">Adds an embedded attachment.  This can include images, sounds, and  just about any other document.  Make sure to set the $type to an  image type.  For JPEG images use &quot;image/jpeg&quot; and for GIF images  use &quot;image/gif&quot;.</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="method-title">AddReplyTo</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/PHPMailer.html#methodAddReplyTo">PHPMailer::AddReplyTo()</a> in class.phpmailer.php</div>
+                                                       <div class="index-item-description">Adds a &quot;Reply-to&quot; address.</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="method-title">AddStringAttachment</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/PHPMailer.html#methodAddStringAttachment">PHPMailer::AddStringAttachment()</a> in class.phpmailer.php</div>
+                                                       <div class="index-item-description">Adds a string or binary attachment (non-filesystem) to the list.</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="method-title">Authenticate</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/SMTP.html#methodAuthenticate">SMTP::Authenticate()</a> in class.smtp.php</div>
+                                                       <div class="index-item-description">Performs SMTP authentication.  Must be run after running the  Hello() method.  Returns true if successfully authenticated.</div>
+                                       </dd>
+               </dl>
+       <a name="b"></a>
+       <div class="index-letter-section">
+               <div style="float: left" class="index-letter-title">b</div>
+               <div style="float: right"><a href="#top">top</a></div>
+               <div style="clear: both"></div>
+       </div>
+       <dl>
+                       <dt class="field">
+                                               <span class="var-title">$Body</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/PHPMailer.html#var$Body">PHPMailer::$Body</a> in class.phpmailer.php</div>
+                                                       <div class="index-item-description">Sets the Body of the message.  This can be either an HTML or text body.</div>
+                                       </dd>
+               </dl>
+       <a name="c"></a>
+       <div class="index-letter-section">
+               <div style="float: left" class="index-letter-title">c</div>
+               <div style="float: right"><a href="#top">top</a></div>
+               <div style="clear: both"></div>
+       </div>
+       <dl>
+                       <dt class="field">
+                                               <span class="var-title">$CharSet</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/PHPMailer.html#var$CharSet">PHPMailer::$CharSet</a> in class.phpmailer.php</div>
+                                                       <div class="index-item-description">Sets the CharSet of the message.</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="var-title">$ConfirmReadingTo</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/PHPMailer.html#var$ConfirmReadingTo">PHPMailer::$ConfirmReadingTo</a> in class.phpmailer.php</div>
+                                                       <div class="index-item-description">Sets the email address that a reading confirmation will be sent.</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="var-title">$ContentType</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/PHPMailer.html#var$ContentType">PHPMailer::$ContentType</a> in class.phpmailer.php</div>
+                                                       <div class="index-item-description">Sets the Content-type of the message.</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="var-title">$CRLF</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/SMTP.html#var$CRLF">SMTP::$CRLF</a> in class.smtp.php</div>
+                                                       <div class="index-item-description">SMTP reply line ending</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="include-title">class.phpmailer.php</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/_class_phpmailer_php.html">class.phpmailer.php</a> in class.phpmailer.php</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="include-title">class.smtp.php</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/_class_smtp_php.html">class.smtp.php</a> in class.smtp.php</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="method-title">ClearAddresses</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/PHPMailer.html#methodClearAddresses">PHPMailer::ClearAddresses()</a> in class.phpmailer.php</div>
+                                                       <div class="index-item-description">Clears all recipients assigned in the TO array.  Returns void.</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="method-title">ClearAllRecipients</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/PHPMailer.html#methodClearAllRecipients">PHPMailer::ClearAllRecipients()</a> in class.phpmailer.php</div>
+                                                       <div class="index-item-description">Clears all recipients assigned in the TO, CC and BCC  array.  Returns void.</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="method-title">ClearAttachments</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/PHPMailer.html#methodClearAttachments">PHPMailer::ClearAttachments()</a> in class.phpmailer.php</div>
+                                                       <div class="index-item-description">Clears all previously set filesystem, string, and binary  attachments.  Returns void.</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="method-title">ClearBCCs</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/PHPMailer.html#methodClearBCCs">PHPMailer::ClearBCCs()</a> in class.phpmailer.php</div>
+                                                       <div class="index-item-description">Clears all recipients assigned in the BCC array.  Returns void.</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="method-title">ClearCCs</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/PHPMailer.html#methodClearCCs">PHPMailer::ClearCCs()</a> in class.phpmailer.php</div>
+                                                       <div class="index-item-description">Clears all recipients assigned in the CC array.  Returns void.</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="method-title">ClearCustomHeaders</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/PHPMailer.html#methodClearCustomHeaders">PHPMailer::ClearCustomHeaders()</a> in class.phpmailer.php</div>
+                                                       <div class="index-item-description">Clears all custom headers.  Returns void.</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="method-title">ClearReplyTos</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/PHPMailer.html#methodClearReplyTos">PHPMailer::ClearReplyTos()</a> in class.phpmailer.php</div>
+                                                       <div class="index-item-description">Clears all recipients assigned in the ReplyTo array.  Returns void.</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="method-title">Close</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/SMTP.html#methodClose">SMTP::Close()</a> in class.smtp.php</div>
+                                                       <div class="index-item-description">Closes the socket and cleans up the state of the class.</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="method-title">Connect</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/SMTP.html#methodConnect">SMTP::Connect()</a> in class.smtp.php</div>
+                                                       <div class="index-item-description">Connect to the server specified on the port specified.</div>
+                                       </dd>
+               </dl>
+       <a name="d"></a>
+       <div class="index-letter-section">
+               <div style="float: left" class="index-letter-title">d</div>
+               <div style="float: right"><a href="#top">top</a></div>
+               <div style="clear: both"></div>
+       </div>
+       <dl>
+                       <dt class="field">
+                                               <span class="var-title">$do_debug</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/SMTP.html#var$do_debug">SMTP::$do_debug</a> in class.smtp.php</div>
+                                                       <div class="index-item-description">Sets whether debugging is turned on</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="method-title">Data</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/SMTP.html#methodData">SMTP::Data()</a> in class.smtp.php</div>
+                                                       <div class="index-item-description">Issues a data command and sends the msg_data to the server</div>
+                                       </dd>
+               </dl>
+       <a name="e"></a>
+       <div class="index-letter-section">
+               <div style="float: left" class="index-letter-title">e</div>
+               <div style="float: right"><a href="#top">top</a></div>
+               <div style="clear: both"></div>
+       </div>
+       <dl>
+                       <dt class="field">
+                                               <span class="var-title">$Encoding</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/PHPMailer.html#var$Encoding">PHPMailer::$Encoding</a> in class.phpmailer.php</div>
+                                                       <div class="index-item-description">Sets the Encoding of the message. Options for this are &quot;8bit&quot;,  &quot;7bit&quot;, &quot;binary&quot;, &quot;base64&quot;, and &quot;quoted-printable&quot;.</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="var-title">$ErrorInfo</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/PHPMailer.html#var$ErrorInfo">PHPMailer::$ErrorInfo</a> in class.phpmailer.php</div>
+                                                       <div class="index-item-description">Holds the most recent mailer error message.</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="method-title">Expand</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/SMTP.html#methodExpand">SMTP::Expand()</a> in class.smtp.php</div>
+                                                       <div class="index-item-description">Expand takes the name and asks the server to list all the  people who are members of the _list_. Expand will return  back and array of the result or false if an error occurs.</div>
+                                       </dd>
+               </dl>
+       <a name="f"></a>
+       <div class="index-letter-section">
+               <div style="float: left" class="index-letter-title">f</div>
+               <div style="float: right"><a href="#top">top</a></div>
+               <div style="clear: both"></div>
+       </div>
+       <dl>
+                       <dt class="field">
+                                               <span class="var-title">$From</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/PHPMailer.html#var$From">PHPMailer::$From</a> in class.phpmailer.php</div>
+                                                       <div class="index-item-description">Sets the From email address for the message.</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="var-title">$FromName</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/PHPMailer.html#var$FromName">PHPMailer::$FromName</a> in class.phpmailer.php</div>
+                                                       <div class="index-item-description">Sets the From name of the message.</div>
+                                       </dd>
+               </dl>
+       <a name="h"></a>
+       <div class="index-letter-section">
+               <div style="float: left" class="index-letter-title">h</div>
+               <div style="float: right"><a href="#top">top</a></div>
+               <div style="clear: both"></div>
+       </div>
+       <dl>
+                       <dt class="field">
+                                               <span class="var-title">$Helo</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/PHPMailer.html#var$Helo">PHPMailer::$Helo</a> in class.phpmailer.php</div>
+                                                       <div class="index-item-description">Sets the SMTP HELO of the message (Default is $Hostname).</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="var-title">$Host</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/PHPMailer.html#var$Host">PHPMailer::$Host</a> in class.phpmailer.php</div>
+                                                       <div class="index-item-description">Sets the SMTP hosts.  All hosts must be separated by a   semicolon.  You can also specify a different port   for each host by using this format: [hostname:port]   (e.g. &quot;smtp1.example.com:25;smtp2.example.com&quot;).</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="var-title">$Hostname</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/PHPMailer.html#var$Hostname">PHPMailer::$Hostname</a> in class.phpmailer.php</div>
+                                                       <div class="index-item-description">Sets the hostname to use in Message-Id and Received headers   and as default HELO string. If empty, the value returned   by SERVER_NAME is used or 'localhost.localdomain'.</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="method-title">Hello</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/SMTP.html#methodHello">SMTP::Hello()</a> in class.smtp.php</div>
+                                                       <div class="index-item-description">Sends the HELO command to the smtp server.</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="method-title">Help</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/SMTP.html#methodHelp">SMTP::Help()</a> in class.smtp.php</div>
+                                                       <div class="index-item-description">Gets help information on the keyword specified. If the keyword</div>
+                                       </dd>
+               </dl>
+       <a name="i"></a>
+       <div class="index-letter-section">
+               <div style="float: left" class="index-letter-title">i</div>
+               <div style="float: right"><a href="#top">top</a></div>
+               <div style="clear: both"></div>
+       </div>
+       <dl>
+                       <dt class="field">
+                                               <span class="method-title">IsError</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/PHPMailer.html#methodIsError">PHPMailer::IsError()</a> in class.phpmailer.php</div>
+                                                       <div class="index-item-description">Returns true if an error occurred.</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="method-title">IsHTML</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/PHPMailer.html#methodIsHTML">PHPMailer::IsHTML()</a> in class.phpmailer.php</div>
+                                                       <div class="index-item-description">Sets message type to HTML.</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="method-title">IsMail</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/PHPMailer.html#methodIsMail">PHPMailer::IsMail()</a> in class.phpmailer.php</div>
+                                                       <div class="index-item-description">Sets Mailer to send message using PHP mail() function.</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="method-title">IsQmail</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/PHPMailer.html#methodIsQmail">PHPMailer::IsQmail()</a> in class.phpmailer.php</div>
+                                                       <div class="index-item-description">Sets Mailer to send message using the qmail MTA.</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="method-title">IsSendmail</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/PHPMailer.html#methodIsSendmail">PHPMailer::IsSendmail()</a> in class.phpmailer.php</div>
+                                                       <div class="index-item-description">Sets Mailer to send message using the $Sendmail program.</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="method-title">IsSMTP</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/PHPMailer.html#methodIsSMTP">PHPMailer::IsSMTP()</a> in class.phpmailer.php</div>
+                                                       <div class="index-item-description">Sets Mailer to send message using SMTP.</div>
+                                       </dd>
+               </dl>
+       <a name="m"></a>
+       <div class="index-letter-section">
+               <div style="float: left" class="index-letter-title">m</div>
+               <div style="float: right"><a href="#top">top</a></div>
+               <div style="clear: both"></div>
+       </div>
+       <dl>
+                       <dt class="field">
+                                               <span class="var-title">$Mailer</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/PHPMailer.html#var$Mailer">PHPMailer::$Mailer</a> in class.phpmailer.php</div>
+                                                       <div class="index-item-description">Method to send mail: (&quot;mail&quot;, &quot;sendmail&quot;, or &quot;smtp&quot;).</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="method-title">Mail</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/SMTP.html#methodMail">SMTP::Mail()</a> in class.smtp.php</div>
+                                                       <div class="index-item-description">Starts a mail transaction from the email address specified in  $from. Returns true if successful or false otherwise. If True  the mail transaction is started and then one or more Recipient  commands may be called followed by a Data command.</div>
+                                       </dd>
+               </dl>
+       <a name="n"></a>
+       <div class="index-letter-section">
+               <div style="float: left" class="index-letter-title">n</div>
+               <div style="float: right"><a href="#top">top</a></div>
+               <div style="clear: both"></div>
+       </div>
+       <dl>
+                       <dt class="field">
+                                               <span class="method-title">Noop</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/SMTP.html#methodNoop">SMTP::Noop()</a> in class.smtp.php</div>
+                                                       <div class="index-item-description">Sends the command NOOP to the SMTP server.</div>
+                                       </dd>
+               </dl>
+       <a name="p"></a>
+       <div class="index-letter-section">
+               <div style="float: left" class="index-letter-title">p</div>
+               <div style="float: right"><a href="#top">top</a></div>
+               <div style="clear: both"></div>
+       </div>
+       <dl>
+                       <dt class="field">
+                                               <span class="var-title">$Password</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/PHPMailer.html#var$Password">PHPMailer::$Password</a> in class.phpmailer.php</div>
+                                                       <div class="index-item-description">Sets SMTP password.</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="var-title">$PluginDir</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/PHPMailer.html#var$PluginDir">PHPMailer::$PluginDir</a> in class.phpmailer.php</div>
+                                                       <div class="index-item-description">Path to PHPMailer plugins.  This is now only useful if the SMTP class  is in a different directory than the PHP include path.</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="var-title">$Port</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/PHPMailer.html#var$Port">PHPMailer::$Port</a> in class.phpmailer.php</div>
+                                                       <div class="index-item-description">Sets the default SMTP server port.</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="var-title">$Priority</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/PHPMailer.html#var$Priority">PHPMailer::$Priority</a> in class.phpmailer.php</div>
+                                                       <div class="index-item-description">Email priority (1 = High, 3 = Normal, 5 = low).</div>
+                                       </dd>
+                       <dt class="field">
+                                               PHPMailer
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/PHPMailer.html">PHPMailer</a> in class.phpmailer.php</div>
+                                                       <div class="index-item-description">PHPMailer - PHP email transport class</div>
+                                       </dd>
+               </dl>
+       <a name="q"></a>
+       <div class="index-letter-section">
+               <div style="float: left" class="index-letter-title">q</div>
+               <div style="float: right"><a href="#top">top</a></div>
+               <div style="clear: both"></div>
+       </div>
+       <dl>
+                       <dt class="field">
+                                               <span class="method-title">Quit</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/SMTP.html#methodQuit">SMTP::Quit()</a> in class.smtp.php</div>
+                                                       <div class="index-item-description">Sends the quit command to the server and then closes the socket  if there is no error or the $close_on_error argument is true.</div>
+                                       </dd>
+               </dl>
+       <a name="r"></a>
+       <div class="index-letter-section">
+               <div style="float: left" class="index-letter-title">r</div>
+               <div style="float: right"><a href="#top">top</a></div>
+               <div style="clear: both"></div>
+       </div>
+       <dl>
+                       <dt class="field">
+                                               <span class="method-title">Recipient</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/SMTP.html#methodRecipient">SMTP::Recipient()</a> in class.smtp.php</div>
+                                                       <div class="index-item-description">Sends the command RCPT to the SMTP server with the TO: argument of $to.</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="method-title">Reset</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/SMTP.html#methodReset">SMTP::Reset()</a> in class.smtp.php</div>
+                                                       <div class="index-item-description">Sends the RSET command to abort and transaction that is  currently in progress. Returns true if successful false  otherwise.</div>
+                                       </dd>
+               </dl>
+       <a name="s"></a>
+       <div class="index-letter-section">
+               <div style="float: left" class="index-letter-title">s</div>
+               <div style="float: right"><a href="#top">top</a></div>
+               <div style="clear: both"></div>
+       </div>
+       <dl>
+                       <dt class="field">
+                                               <span class="var-title">$Sender</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/PHPMailer.html#var$Sender">PHPMailer::$Sender</a> in class.phpmailer.php</div>
+                                                       <div class="index-item-description">Sets the Sender email (Return-Path) of the message.  If not empty,  will be sent via -f to sendmail or as 'MAIL FROM' in smtp mode.</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="var-title">$Sendmail</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/PHPMailer.html#var$Sendmail">PHPMailer::$Sendmail</a> in class.phpmailer.php</div>
+                                                       <div class="index-item-description">Sets the path of the sendmail program.</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="var-title">$SMTPAuth</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/PHPMailer.html#var$SMTPAuth">PHPMailer::$SMTPAuth</a> in class.phpmailer.php</div>
+                                                       <div class="index-item-description">Sets SMTP authentication. Utilizes the Username and Password variables.</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="var-title">$SMTPDebug</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/PHPMailer.html#var$SMTPDebug">PHPMailer::$SMTPDebug</a> in class.phpmailer.php</div>
+                                                       <div class="index-item-description">Sets SMTP class debugging on or off.</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="var-title">$SMTPKeepAlive</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/PHPMailer.html#var$SMTPKeepAlive">PHPMailer::$SMTPKeepAlive</a> in class.phpmailer.php</div>
+                                                       <div class="index-item-description">Prevents the SMTP connection from being closed after each mail  sending.  If this is set to true then to close the connection  requires an explicit call to SmtpClose().</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="var-title">$SMTP_PORT</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/SMTP.html#var$SMTP_PORT">SMTP::$SMTP_PORT</a> in class.smtp.php</div>
+                                                       <div class="index-item-description">SMTP server port</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="var-title">$Subject</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/PHPMailer.html#var$Subject">PHPMailer::$Subject</a> in class.phpmailer.php</div>
+                                                       <div class="index-item-description">Sets the Subject of the message.</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="method-title">Send</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/SMTP.html#methodSend">SMTP::Send()</a> in class.smtp.php</div>
+                                                       <div class="index-item-description">Starts a mail transaction from the email address specified in</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="method-title">Send</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/PHPMailer.html#methodSend">PHPMailer::Send()</a> in class.phpmailer.php</div>
+                                                       <div class="index-item-description">Creates message and assigns Mailer. If the message is  not sent successfully then it returns false.  Use the ErrorInfo  variable to view description of the error.</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="method-title">SendAndMail</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/SMTP.html#methodSendAndMail">SMTP::SendAndMail()</a> in class.smtp.php</div>
+                                                       <div class="index-item-description">Starts a mail transaction from the email address specified in</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="method-title">SendOrMail</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/SMTP.html#methodSendOrMail">SMTP::SendOrMail()</a> in class.smtp.php</div>
+                                                       <div class="index-item-description">Starts a mail transaction from the email address specified in</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="method-title">SetLanguage</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/PHPMailer.html#methodSetLanguage">PHPMailer::SetLanguage()</a> in class.phpmailer.php</div>
+                                                       <div class="index-item-description">Sets the language for all class error messages.  Returns false  if it cannot load the language file.  The default language type  is English.</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="method-title">SMTP</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/SMTP.html#methodSMTP">SMTP::SMTP()</a> in class.smtp.php</div>
+                                                       <div class="index-item-description">Initialize the class so that the data is in a known state.</div>
+                                       </dd>
+                       <dt class="field">
+                                               SMTP
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/SMTP.html">SMTP</a> in class.smtp.php</div>
+                                                       <div class="index-item-description">SMTP is rfc 821 compliant and implements all the rfc 821 SMTP  commands except TURN which will always return a not implemented  error. SMTP also provides some utility methods for sending mail  to an SMTP server.</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="method-title">SmtpClose</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/PHPMailer.html#methodSmtpClose">PHPMailer::SmtpClose()</a> in class.phpmailer.php</div>
+                                                       <div class="index-item-description">Closes the active SMTP session if one exists.</div>
+                                       </dd>
+               </dl>
+       <a name="t"></a>
+       <div class="index-letter-section">
+               <div style="float: left" class="index-letter-title">t</div>
+               <div style="float: right"><a href="#top">top</a></div>
+               <div style="clear: both"></div>
+       </div>
+       <dl>
+                       <dt class="field">
+                                               <span class="var-title">$Timeout</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/PHPMailer.html#var$Timeout">PHPMailer::$Timeout</a> in class.phpmailer.php</div>
+                                                       <div class="index-item-description">Sets the SMTP server timeout in seconds. This function will not   work with the win32 version.</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="method-title">Turn</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/SMTP.html#methodTurn">SMTP::Turn()</a> in class.smtp.php</div>
+                                                       <div class="index-item-description">This is an optional command for SMTP that this class does not  support. This method is here to make the RFC821 Definition  complete for this class and __may__ be implimented in the future</div>
+                                       </dd>
+               </dl>
+       <a name="u"></a>
+       <div class="index-letter-section">
+               <div style="float: left" class="index-letter-title">u</div>
+               <div style="float: right"><a href="#top">top</a></div>
+               <div style="clear: both"></div>
+       </div>
+       <dl>
+                       <dt class="field">
+                                               <span class="var-title">$Username</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/PHPMailer.html#var$Username">PHPMailer::$Username</a> in class.phpmailer.php</div>
+                                                       <div class="index-item-description">Sets SMTP username.</div>
+                                       </dd>
+               </dl>
+       <a name="v"></a>
+       <div class="index-letter-section">
+               <div style="float: left" class="index-letter-title">v</div>
+               <div style="float: right"><a href="#top">top</a></div>
+               <div style="clear: both"></div>
+       </div>
+       <dl>
+                       <dt class="field">
+                                               <span class="var-title">$Version</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/PHPMailer.html#var$Version">PHPMailer::$Version</a> in class.phpmailer.php</div>
+                                                       <div class="index-item-description">Holds PHPMailer version.</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="method-title">Verify</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/SMTP.html#methodVerify">SMTP::Verify()</a> in class.smtp.php</div>
+                                                       <div class="index-item-description">Verifies that the name is recognized by the server.</div>
+                                       </dd>
+               </dl>
+       <a name="w"></a>
+       <div class="index-letter-section">
+               <div style="float: left" class="index-letter-title">w</div>
+               <div style="float: right"><a href="#top">top</a></div>
+               <div style="clear: both"></div>
+       </div>
+       <dl>
+                       <dt class="field">
+                                               <span class="var-title">$WordWrap</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/PHPMailer.html#var$WordWrap">PHPMailer::$WordWrap</a> in class.phpmailer.php</div>
+                                                       <div class="index-item-description">Sets word wrapping on the body of the message to a given number of  characters.</div>
+                                       </dd>
+               </dl>
+
+<div class="index-letter-menu">
+       <a class="index-letter" href="elementindex_PHPMailer.html#a">a</a>
+       <a class="index-letter" href="elementindex_PHPMailer.html#b">b</a>
+       <a class="index-letter" href="elementindex_PHPMailer.html#c">c</a>
+       <a class="index-letter" href="elementindex_PHPMailer.html#d">d</a>
+       <a class="index-letter" href="elementindex_PHPMailer.html#e">e</a>
+       <a class="index-letter" href="elementindex_PHPMailer.html#f">f</a>
+       <a class="index-letter" href="elementindex_PHPMailer.html#h">h</a>
+       <a class="index-letter" href="elementindex_PHPMailer.html#i">i</a>
+       <a class="index-letter" href="elementindex_PHPMailer.html#m">m</a>
+       <a class="index-letter" href="elementindex_PHPMailer.html#n">n</a>
+       <a class="index-letter" href="elementindex_PHPMailer.html#p">p</a>
+       <a class="index-letter" href="elementindex_PHPMailer.html#q">q</a>
+       <a class="index-letter" href="elementindex_PHPMailer.html#r">r</a>
+       <a class="index-letter" href="elementindex_PHPMailer.html#s">s</a>
+       <a class="index-letter" href="elementindex_PHPMailer.html#t">t</a>
+       <a class="index-letter" href="elementindex_PHPMailer.html#u">u</a>
+       <a class="index-letter" href="elementindex_PHPMailer.html#v">v</a>
+       <a class="index-letter" href="elementindex_PHPMailer.html#w">w</a>
+</div> </body>
+</html>
\ No newline at end of file
diff --git a/inc/classes/third_party/php_mailer/phpdoc/errors.html b/inc/classes/third_party/php_mailer/phpdoc/errors.html
new file mode 100644 (file)
index 0000000..d5781a0
--- /dev/null
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+  <html xmlns="http://www.w3.org/1999/xhtml">
+               <head>
+                       <!-- template designed by Marco Von Ballmoos -->
+                       <title>phpDocumentor Parser Errors and Warnings</title>
+                       <link rel="stylesheet" href="media/stylesheet.css" />
+                       <meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'/>
+               </head>
+               <body>
+                                               <a href="#Post-parsing">Post-parsing</a><br>
+<a href="#class.smtp.php">class.smtp.php</a><br>
+<h1>class.phpmailer.php</h1>
+<h2>Warnings:</h2><br>
+<b>Warning on line 1530</b> - no @package tag was used in a DocBlock for file C:\dev\phpDocumentor-1.2.0\Classes\class.phpmailer.php<br>
+<h1>class.smtp.php</h1>
+<h2>Warnings:</h2><br>
+<b>Warning on line 1039</b> - no @package tag was used in a DocBlock for file C:\dev\phpDocumentor-1.2.0\Classes\class.smtp.php<br>
+       <p class="notes" id="credit">
+               Documention generated on Mon, 28 Jul 2003 23:25:50 -0400 by <a href="http://www.phpdoc.org" target="_blank">phpDocumentor 1.2.0</a>
+       </p>
+       </body>
+</html>
\ No newline at end of file
diff --git a/inc/classes/third_party/php_mailer/phpdoc/index.html b/inc/classes/third_party/php_mailer/phpdoc/index.html
new file mode 100644 (file)
index 0000000..f2b2c7a
--- /dev/null
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html 
+     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//FR"
+     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
+   <html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+       <!-- Generated by phpDocumentor on Mon, 28 Jul 2003 23:25:49 -0400  -->
+  <title>Generated Documentation</title>
+  <meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'/>
+</head>
+
+<FRAMESET rows='100,*'>
+       <FRAME src='packages.html' name='left_top' frameborder="1" bordercolor="#999999">
+       <FRAMESET cols='25%,*'>
+               <FRAME src='li_PHPMailer.html' name='left_bottom' frameborder="1" bordercolor="#999999">
+               <FRAME src='blank.html' name='right' frameborder="1" bordercolor="#999999">
+       </FRAMESET>
+       <NOFRAMES>
+               <H2>Frame Alert</H2>
+               <P>This document is designed to be viewed using the frames feature.
+               If you see this message, you are using a non-frame-capable web client.</P>
+       </NOFRAMES>
+</FRAMESET>
+</HTML>
\ No newline at end of file
diff --git a/inc/classes/third_party/php_mailer/phpdoc/li_PHPMailer.html b/inc/classes/third_party/php_mailer/phpdoc/li_PHPMailer.html
new file mode 100644 (file)
index 0000000..ec8456a
--- /dev/null
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+  <html xmlns="http://www.w3.org/1999/xhtml">
+               <head>
+                       <!-- template designed by Marco Von Ballmoos -->
+                       <title></title>
+                       <link rel="stylesheet" href="media/stylesheet.css" />
+                       <meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'/>
+               </head>
+               <body>
+                                               <div class="package-title">PHPMailer</div>
+<div class="package-details">
+
+       <dl class="tree">
+               
+               <dt class="folder-title">Description</dt>
+               <dd>
+                       <a href='classtrees_PHPMailer.html' target='right'>Class trees</a><br />
+                       <a href='elementindex_PHPMailer.html' target='right'>Index of elements</a><br />
+                                       </dd>
+       
+                                                       
+                                                       
+                                                                                                       <dt class="folder-title">Classes</dt>
+                                                                                       <dd><a href='PHPMailer/PHPMailer.html' target='right'>PHPMailer</a></dd>
+                                                                                       <dd><a href='PHPMailer/SMTP.html' target='right'>SMTP</a></dd>
+                                                                                                                                                                               <dt class="folder-title">Files</dt>
+                                                                                       <dd><a href='PHPMailer/_class_phpmailer_php.html' target='right'>class.phpmailer.php</a></dd>
+                                                                                       <dd><a href='PHPMailer/_class_smtp_php.html' target='right'>class.smtp.php</a></dd>
+                                                                                                                                       
+                                               
+                       </dl>
+</div>
+<p class="notes"><a href="http://www.phpdoc.org" target="_blank">phpDocumentor v <span class="field">1.2.0</span></a></p>
+</BODY>
+</HTML>
\ No newline at end of file
diff --git a/inc/classes/third_party/php_mailer/phpdoc/media/banner.css b/inc/classes/third_party/php_mailer/phpdoc/media/banner.css
new file mode 100644 (file)
index 0000000..f2149eb
--- /dev/null
@@ -0,0 +1,32 @@
+body 
+{ 
+       background-color: #CCCCFF; 
+       margin: 0px; 
+       padding: 0px;
+}
+
+/* Banner (top bar) classes */
+
+.banner {  }
+
+.banner-menu 
+{ 
+       clear: both;
+       padding: .5em;
+       border-top: 2px solid #6666AA;  
+}
+
+.banner-title 
+{ 
+       text-align: right; 
+       font-size: 20pt; 
+       font-weight: bold; 
+       margin: .2em;
+}
+
+.package-selector 
+{ 
+       background-color: #AAAADD; 
+       border: 1px solid black; 
+       color: yellow;
+}
diff --git a/inc/classes/third_party/php_mailer/phpdoc/media/stylesheet.css b/inc/classes/third_party/php_mailer/phpdoc/media/stylesheet.css
new file mode 100644 (file)
index 0000000..7a81139
--- /dev/null
@@ -0,0 +1,133 @@
+a { color: #336699; text-decoration: none; }
+a:hover { color: #6699CC; text-decoration: underline; }
+a:active { color: #6699CC; text-decoration: underline; }
+
+body, table { font-family: Georgia, Times New Roman, Times, serif; font-size: 10pt }
+p, li { line-height: 140% }
+a img { border: 0px; }
+dd { margin-left: 0px; padding-left: 1em; }
+
+/* Page layout/boxes */
+
+.info-box {}
+.info-box-title { margin: 1em 0em 0em 0em; padding: .25em; font-weight: normal; font-size: 14pt; border: 2px solid #999999; background-color: #CCCCFF }
+.info-box-body { border: 1px solid #999999; padding: .5em; }
+.nav-bar { font-size: 8pt; white-space: nowrap; text-align: right; padding: .2em; margin: 0em 0em 1em 0em; }
+
+.oddrow { background-color: #F8F8F8; border: 1px solid #AAAAAA; padding: .5em; margin-bottom: 1em}
+.evenrow { border: 1px solid #AAAAAA; padding: .5em; margin-bottom: 1em}
+
+.page-body { max-width: 800px; margin: auto; }
+.tree dl { margin: 0px }
+
+/* Index formatting classes */
+
+.index-item-body { margin-top: .5em; margin-bottom: .5em}
+.index-item-description { margin-top: .25em }
+.index-item-details { font-weight: normal; font-style: italic; font-size: 8pt }
+.index-letter-section { background-color: #EEEEEE; border: 1px dotted #999999; padding: .5em; margin-bottom: 1em}
+.index-letter-title { font-size: 12pt; font-weight: bold }
+.index-letter-menu { text-align: center; margin: 1em }
+.index-letter { font-size: 12pt }
+
+/* Docbook classes */
+
+.description {}
+.short-description { font-weight: bold; color: #666666; }
+.tags {        padding-left: 0em; margin-left: 3em; color: #666666; list-style-type: square; }
+.parameters {  padding-left: 0em; margin-left: 3em; font-style: italic; list-style-type: square; }
+.redefinitions { font-size: 8pt; padding-left: 0em; margin-left: 2em; }
+.package {  }
+.package-title { font-weight: bold; font-size: 14pt; border-bottom: 1px solid black }
+.package-details { font-size: 85%; }
+.sub-package { font-weight: bold; font-size: 120% }
+.tutorial { border-width: thin; border-color: #0066ff }
+.tutorial-nav-box { width: 100%; border: 1px solid #999999; background-color: #F8F8F8; }
+.nav-button-disabled { color: #999999; }
+.nav-button:active, 
+.nav-button:focus, 
+.nav-button:hover { background-color: #DDDDDD; outline: 1px solid #999999; text-decoration: none }
+.folder-title { font-style: italic }
+
+/* Generic formatting */
+
+.field { font-weight: bold; }
+.detail { font-size: 8pt; }
+.notes { font-style: italic; font-size: 8pt; }
+.separator { background-color: #999999; height: 2px; }
+.warning {  color: #FF6600; }
+.disabled { font-style: italic; color: #999999; }
+
+/* Code elements */
+
+.line-number {  }
+
+.class-table { width: 100%; }
+.class-table-header { border-bottom: 1px dotted #666666; text-align: left}
+.class-name { color: #000000; font-weight: bold; }
+
+.method-summary { padding-left: 1em; font-size: 8pt }
+.method-header { }
+.method-definition { margin-bottom: .3em }
+.method-title { font-weight: bold; }
+.method-name { font-weight: bold; }
+.method-signature { font-size: 85%; color: #666666; margin: .5em 0em }
+.method-result { font-style: italic; }
+
+.var-summary { padding-left: 1em; font-size: 8pt; }
+.var-header { }
+.var-title { margin-bottom: .3em }
+.var-type { font-style: italic; }
+.var-name { font-weight: bold; }
+.var-default {}
+.var-description { font-weight: normal; color: #000000; }
+
+.include-title {  }
+.include-type { font-style: italic; }
+.include-name { font-weight: bold; }
+
+.const-title {  }
+.const-name { font-weight: bold; }
+
+/* Syntax highlighting */
+
+.src-code {  border: 1px solid #336699; padding: 1em; background-color: #EEEEEE; }
+
+.src-comm { color: green; }
+.src-id {  }
+.src-inc { color: #0000FF; }
+.src-key { color: #0000FF; }
+.src-num { color: #CC0000; }
+.src-str { color: #66cccc; }
+.src-sym { font-weight: bold; }
+.src-var { }
+
+.src-php { font-weight: bold; }
+
+.src-doc { color: #009999 }
+.src-doc-close-template { color: #0000FF }
+.src-doc-coretag { color: #0099FF; font-weight: bold }
+.src-doc-inlinetag { color: #0099FF }
+.src-doc-internal { color: #6699cc }
+.src-doc-tag { color: #0080CC }
+.src-doc-template { color: #0000FF }
+.src-doc-type { font-style: italic }
+.src-doc-var { font-style: italic }
+
+/* tutorial */
+
+.authors {  }
+.author { font-style: italic; font-weight: bold }
+.author-blurb { margin: .5em 0em .5em 2em; font-size: 85%; font-weight: normal; font-style: normal }
+.example { border: 1px dashed #999999; background-color: #EEEEEE; padding: .5em }
+.listing { border: 1px dashed #999999; background-color: #EEEEEE; padding: .5em; white-space: nowrap }
+.release-info { font-size: 85%; font-style: italic; margin: 1em 0em }
+.ref-title-box {  }
+.ref-title {  }
+.ref-purpose { font-style: italic; color: #666666 }
+.ref-synopsis {  }
+.title { font-weight: bold; margin: 1em 0em 0em 0em; padding: .25em; border: 2px solid #999999; background-color: #CCCCFF  }
+.cmd-synopsis { margin: 1em 0em }
+.cmd-title { font-weight: bold }
+.toc { margin-left: 2em; padding-left: 0em }
+
diff --git a/inc/classes/third_party/php_mailer/phpdoc/packages.html b/inc/classes/third_party/php_mailer/phpdoc/packages.html
new file mode 100644 (file)
index 0000000..fdf40b0
--- /dev/null
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+  <html xmlns="http://www.w3.org/1999/xhtml">
+               <head>
+                       <!-- template designed by Marco Von Ballmoos -->
+                       <title></title>
+                       <link rel="stylesheet" href="media/stylesheet.css" />
+                       <link rel="stylesheet" href="media/banner.css" />
+                       <meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'/>
+               </head>
+               <body>
+                       <div class="banner">
+                               <div class="banner-title">PHPMailer</div>
+                               <div class="banner-menu">
+               <table cellpadding="0" cellspacing="0" style="width: 100%">
+                 <tr>
+              <td>
+                                                                             </td>
+              <td style="width: 2em">&nbsp;</td>
+              <td style="text-align: right">
+                                                                             </td>
+                                               </tr>
+          </table>
+                               </div>
+                       </div>
+               </body>
+       </html>
\ No newline at end of file
diff --git a/inc/classes/third_party/php_mailer/test/phpmailer_test.php b/inc/classes/third_party/php_mailer/test/phpmailer_test.php
new file mode 100644 (file)
index 0000000..22d6f42
--- /dev/null
@@ -0,0 +1,572 @@
+<?php\r
+/*******************\r
+  Unit Test\r
+  Type: phpmailer class\r
+********************/\r
+\r
+$INCLUDE_DIR = "../";\r
+\r
+require("phpunit.php");\r
+require($INCLUDE_DIR . "class.phpmailer.php");\r
+error_reporting(E_ALL);\r
+\r
+/**\r
+ * Performs authentication tests\r
+ */\r
+class phpmailerTest extends TestCase\r
+{\r
+    /**\r
+     * Holds the default phpmailer instance.\r
+     * @private\r
+     * @type object\r
+     */\r
+    var $Mail = false;\r
+\r
+    /**\r
+     * Holds the SMTP mail host.\r
+     * @public\r
+     * @type string\r
+     */\r
+    var $Host = "";\r
+    \r
+    /**\r
+     * Holds the change log.\r
+     * @private\r
+     * @type string array\r
+     */\r
+    var $ChangeLog = array();\r
+    \r
+     /**\r
+     * Holds the note log.\r
+     * @private\r
+     * @type string array\r
+     */\r
+    var $NoteLog = array();   \r
+\r
+    /**\r
+     * Class constuctor.\r
+     */\r
+    function phpmailerTest($name) {\r
+        /* must define this constructor */\r
+        $this->TestCase( $name );\r
+    }\r
+    \r
+    /**\r
+     * Run before each test is started.\r
+     */\r
+    function setUp() {\r
+        global $global_vars;\r
+        global $INCLUDE_DIR;\r
+\r
+        $this->Mail = new PHPMailer();\r
+\r
+        $this->Mail->Priority = 3;\r
+        $this->Mail->Encoding = "8bit";\r
+        $this->Mail->CharSet = "iso-8859-1";\r
+        $this->Mail->From = "unit_test@phpmailer.sf.net";\r
+        $this->Mail->FromName = "Unit Tester";\r
+        $this->Mail->Sender = "";\r
+        $this->Mail->Subject = "Unit Test";\r
+        $this->Mail->Body = "";\r
+        $this->Mail->AltBody = "";\r
+        $this->Mail->WordWrap = 0;\r
+        $this->Mail->Host = $global_vars["mail_host"];\r
+        $this->Mail->Port = 25;\r
+        $this->Mail->Helo = "localhost.localdomain";\r
+        $this->Mail->SMTPAuth = false;\r
+        $this->Mail->Username = "";\r
+        $this->Mail->Password = "";\r
+        $this->Mail->PluginDir = $INCLUDE_DIR;\r
+               $this->Mail->AddReplyTo("no_reply@phpmailer.sf.net", "Reply Guy");\r
+        $this->Mail->Sender = "unit_test@phpmailer.sf.net";\r
+\r
+        if(strlen($this->Mail->Host) > 0)\r
+            $this->Mail->Mailer = "smtp";\r
+        else\r
+        {\r
+            $this->Mail->Mailer = "mail";\r
+            $this->Sender = "unit_test@phpmailer.sf.net";\r
+        }\r
+        \r
+        global $global_vars;\r
+        $this->SetAddress($global_vars["mail_to"], "Test User");\r
+        if(strlen($global_vars["mail_cc"]) > 0)\r
+            $this->SetAddress($global_vars["mail_cc"], "Carbon User", "cc");\r
+    }     \r
+\r
+    /**\r
+     * Run after each test is completed.\r
+     */\r
+    function tearDown() {\r
+        // Clean global variables\r
+        $this->Mail = NULL;\r
+        $this->ChangeLog = array();\r
+        $this->NoteLog = array();\r
+    }\r
+\r
+\r
+    /**\r
+     * Build the body of the message in the appropriate format.\r
+     * @private\r
+     * @returns void\r
+     */\r
+    function BuildBody() {\r
+        $this->CheckChanges();\r
+        \r
+        // Determine line endings for message        \r
+        if($this->Mail->ContentType == "text/html" || strlen($this->Mail->AltBody) > 0)\r
+        {\r
+            $eol = "<br/>";\r
+            $bullet = "<li>";\r
+            $bullet_start = "<ul>";\r
+            $bullet_end = "</ul>";\r
+        }\r
+        else\r
+        {\r
+            $eol = "\n";\r
+            $bullet = " - ";\r
+            $bullet_start = "";\r
+            $bullet_end = "";\r
+        }\r
+        \r
+        $ReportBody = "";\r
+        \r
+        $ReportBody .= "---------------------" . $eol;\r
+        $ReportBody .= "Unit Test Information" . $eol;\r
+        $ReportBody .= "---------------------" . $eol;\r
+        $ReportBody .= "phpmailer version: " . $this->Mail->Version . $eol;\r
+        $ReportBody .= "Content Type: " . $this->Mail->ContentType . $eol;\r
+        \r
+        if(strlen($this->Mail->Host) > 0)\r
+            $ReportBody .= "Host: " . $this->Mail->Host . $eol;\r
+        \r
+        // If attachments then create an attachment list\r
+        if(count($this->Mail->attachment) > 0)\r
+        {\r
+            $ReportBody .= "Attachments:" . $eol;\r
+            $ReportBody .= $bullet_start;\r
+            for($i = 0; $i < count($this->Mail->attachment); $i++)\r
+            {\r
+                $ReportBody .= $bullet . "Name: " . $this->Mail->attachment[$i][1] . ", ";\r
+                $ReportBody .= "Encoding: " . $this->Mail->attachment[$i][3] . ", ";\r
+                $ReportBody .= "Type: " . $this->Mail->attachment[$i][4] . $eol;\r
+            }\r
+            $ReportBody .= $bullet_end . $eol;\r
+        }\r
+        \r
+        // If there are changes then list them\r
+        if(count($this->ChangeLog) > 0)\r
+        {\r
+            $ReportBody .= "Changes" . $eol;\r
+            $ReportBody .= "-------" . $eol;\r
+\r
+            $ReportBody .= $bullet_start;\r
+            for($i = 0; $i < count($this->ChangeLog); $i++)\r
+            {\r
+                $ReportBody .= $bullet . $this->ChangeLog[$i][0] . " was changed to [" . \r
+                               $this->ChangeLog[$i][1] . "]" . $eol;\r
+            }\r
+            $ReportBody .= $bullet_end . $eol . $eol;\r
+        }\r
+        \r
+        // If there are notes then list them\r
+        if(count($this->NoteLog) > 0)\r
+        {\r
+            $ReportBody .= "Notes" . $eol;\r
+            $ReportBody .= "-----" . $eol;\r
+\r
+            $ReportBody .= $bullet_start;\r
+            for($i = 0; $i < count($this->NoteLog); $i++)\r
+            {\r
+                $ReportBody .= $bullet . $this->NoteLog[$i] . $eol;\r
+            }\r
+            $ReportBody .= $bullet_end;\r
+        }\r
+        \r
+        // Re-attach the original body\r
+        $this->Mail->Body .= $eol . $eol . $ReportBody;\r
+    }\r
+    \r
+    /**\r
+     * Check which default settings have been changed for the report.\r
+     * @private\r
+     * @returns void\r
+     */\r
+    function CheckChanges() {\r
+        if($this->Mail->Priority != 3)\r
+            $this->AddChange("Priority", $this->Mail->Priority);\r
+        if($this->Mail->Encoding != "8bit")\r
+            $this->AddChange("Encoding", $this->Mail->Encoding);\r
+        if($this->Mail->CharSet != "iso-8859-1")\r
+            $this->AddChange("CharSet", $this->Mail->CharSet);\r
+        if($this->Mail->Sender != "")\r
+            $this->AddChange("Sender", $this->Mail->Sender);\r
+        if($this->Mail->WordWrap != 0)\r
+            $this->AddChange("WordWrap", $this->Mail->WordWrap);\r
+        if($this->Mail->Mailer != "mail")\r
+            $this->AddChange("Mailer", $this->Mail->Mailer);\r
+        if($this->Mail->Port != 25)\r
+            $this->AddChange("Port", $this->Mail->Port);\r
+        if($this->Mail->Helo != "localhost.localdomain")\r
+            $this->AddChange("Helo", $this->Mail->Helo);\r
+        if($this->Mail->SMTPAuth)\r
+            $this->AddChange("SMTPAuth", "true");\r
+    }\r
+    \r
+    /**\r
+     * Adds a change entry.\r
+     * @private\r
+     * @returns void\r
+     */\r
+    function AddChange($sName, $sNewValue) {\r
+        $cur = count($this->ChangeLog);\r
+        $this->ChangeLog[$cur][0] = $sName;\r
+        $this->ChangeLog[$cur][1] = $sNewValue;\r
+    }\r
+    \r
+    /**\r
+     * Adds a simple note to the message.\r
+     * @public\r
+     * @returns void\r
+     */\r
+    function AddNote($sValue) {\r
+        $this->NoteLog[] = $sValue;\r
+    }\r
+\r
+    /**\r
+     * Adds all of the addresses\r
+     * @public\r
+     * @returns void\r
+     */\r
+    function SetAddress($sAddress, $sName = "", $sType = "to") {\r
+        switch($sType)\r
+        {\r
+            case "to":\r
+                $this->Mail->AddAddress($sAddress, $sName);\r
+                break;\r
+            case "cc":\r
+                $this->Mail->AddCC($sAddress, $sName);\r
+                break;\r
+            case "bcc":\r
+                $this->Mail->AddBCC($sAddress, $sName);\r
+                break;\r
+        }\r
+    }\r
+\r
+    /////////////////////////////////////////////////\r
+    // UNIT TESTS\r
+    /////////////////////////////////////////////////\r
+\r
+    /**\r
+     * Try a plain message.\r
+     */\r
+    function test_WordWrap() {\r
+\r
+        $this->Mail->WordWrap = 40;\r
+        $my_body = "Here is the main body of this message.  It should " .\r
+                   "be quite a few lines.  It should be wrapped at the " .\r
+                   "40 characters.  Make sure that it is.";\r
+        $nBodyLen = strlen($my_body);\r
+        $my_body .= "\n\nThis is the above body length: " . $nBodyLen;\r
+\r
+        $this->Mail->Body = $my_body;\r
+        $this->Mail->Subject .= ": Wordwrap";\r
+\r
+        $this->BuildBody();\r
+        $this->assert($this->Mail->Send(), $this->Mail->ErrorInfo);\r
+    }\r
+\r
+    /**\r
+     * Try a plain message.\r
+     */\r
+    function test_Low_Priority() {\r
+    \r
+        $this->Mail->Priority = 5;\r
+        $this->Mail->Body = "Here is the main body.  There should be " .\r
+                            "a reply to address in this message.";\r
+        $this->Mail->Subject .= ": Low Priority";\r
+        $this->Mail->AddReplyTo("nobody@nobody.com", "Nobody (Unit Test)");\r
+\r
+        $this->BuildBody();\r
+        $this->assert($this->Mail->Send(), $this->Mail->ErrorInfo);\r
+    }\r
+\r
+    /**\r
+     * Simple plain file attachment test.\r
+     */\r
+    function test_Multiple_Plain_FileAttachment() {\r
+\r
+        $this->Mail->Body = "Here is the text body";\r
+        $this->Mail->Subject .= ": Plain + Multiple FileAttachments";\r
+\r
+        if(!$this->Mail->AddAttachment("test.png"))\r
+        {\r
+            $this->assert(false, $this->Mail->ErrorInfo);\r
+            return;\r
+        }\r
+\r
+        if(!$this->Mail->AddAttachment("phpmailer_test.php", "test.txt"))\r
+        {\r
+            $this->assert(false, $this->Mail->ErrorInfo);\r
+            return;\r
+        }\r
+\r
+        $this->BuildBody();\r
+        $this->assert($this->Mail->Send(), $this->Mail->ErrorInfo);\r
+    }\r
+\r
+    /**\r
+     * Simple plain string attachment test.\r
+     */\r
+    function test_Plain_StringAttachment() {\r
+\r
+        $this->Mail->Body = "Here is the text body";\r
+        $this->Mail->Subject .= ": Plain + StringAttachment";\r
+        \r
+        $sAttachment = "These characters are the content of the " .\r
+                       "string attachment.\nThis might be taken from a ".\r
+                       "database or some other such thing. ";\r
+        \r
+        $this->Mail->AddStringAttachment($sAttachment, "string_attach.txt");\r
+\r
+        $this->BuildBody();\r
+        $this->assert($this->Mail->Send(), $this->Mail->ErrorInfo);\r
+    }\r
+\r
+    /**\r
+     * Plain quoted-printable message.\r
+     */\r
+    function test_Quoted_Printable() {\r
+\r
+        $this->Mail->Body = "Here is the main body";\r
+        $this->Mail->Subject .= ": Plain + Quoted-printable";\r
+        $this->Mail->Encoding = "quoted-printable";\r
+\r
+        $this->BuildBody();\r
+        $this->assert($this->Mail->Send(), $this->Mail->ErrorInfo);\r
+    }\r
+\r
+    /**\r
+     * Try a plain message.\r
+     */\r
+    function test_Html() {\r
+    \r
+        $this->Mail->IsHTML(true);\r
+        $this->Mail->Subject .= ": HTML only";\r
+        \r
+        $this->Mail->Body = "This is a <b>test message</b> written in HTML. </br>" .\r
+                            "Go to <a href=\"http://phpmailer.sourceforge.net/\">" .\r
+                            "http://phpmailer.sourceforge.net/</a> for new versions of " .\r
+                            "phpmailer.  <p/> Thank you!";\r
+\r
+        $this->BuildBody();\r
+        $this->assert($this->Mail->Send(), $this->Mail->ErrorInfo);\r
+    }\r
+\r
+    /**\r
+     * Simple HTML and attachment test\r
+     */\r
+    function test_HTML_Attachment() {\r
+\r
+        $this->Mail->Body = "This is the <b>HTML</b> part of the email.";\r
+        $this->Mail->Subject .= ": HTML + Attachment";\r
+        $this->Mail->IsHTML(true);\r
+        \r
+        if(!$this->Mail->AddAttachment("phpmailer_test.php", "test_attach.txt"))\r
+        {\r
+            $this->assert(false, $this->Mail->ErrorInfo);\r
+            return;\r
+        }\r
+\r
+        $this->BuildBody();\r
+        $this->assert($this->Mail->Send(), $this->Mail->ErrorInfo);\r
+    }\r
+\r
+    /**\r
+     * An embedded attachment test.\r
+     */\r
+    function test_Embedded_Image() {\r
+\r
+        $this->Mail->Body = "Embedded Image: <img alt=\"phpmailer\" src=\"cid:my-attach\">" .\r
+                     "Here is an image!</a>";\r
+        $this->Mail->Subject .= ": Embedded Image";\r
+        $this->Mail->IsHTML(true);\r
+        \r
+        if(!$this->Mail->AddEmbeddedImage("test.png", "my-attach", "test.png",\r
+                                          "base64", "image/png"))\r
+        {\r
+            $this->assert(false, $this->Mail->ErrorInfo);\r
+            return;\r
+        }\r
+\r
+        $this->BuildBody();\r
+        $this->assert($this->Mail->Send(), $this->Mail->ErrorInfo);\r
+    }\r
+\r
+    /**\r
+     * An embedded attachment test.\r
+     */\r
+    function test_Multi_Embedded_Image() {\r
+\r
+        $this->Mail->Body = "Embedded Image: <img alt=\"phpmailer\" src=\"cid:my-attach\">" .\r
+                     "Here is an image!</a>";\r
+        $this->Mail->Subject .= ": Embedded Image + Attachment";\r
+        $this->Mail->IsHTML(true);\r
+        \r
+        if(!$this->Mail->AddEmbeddedImage("test.png", "my-attach", "test.png",\r
+                                          "base64", "image/png"))\r
+        {\r
+            $this->assert(false, $this->Mail->ErrorInfo);\r
+            return;\r
+        }\r
+\r
+        if(!$this->Mail->AddAttachment("phpmailer_test.php", "test.txt"))\r
+        {\r
+            $this->assert(false, $this->Mail->ErrorInfo);\r
+            return;\r
+        }\r
+        \r
+        $this->BuildBody();\r
+        $this->assert($this->Mail->Send(), $this->Mail->ErrorInfo);\r
+    }\r
+\r
+    /**\r
+     * Simple multipart/alternative test.\r
+     */\r
+    function test_AltBody() {\r
+\r
+        $this->Mail->Body = "This is the <b>HTML</b> part of the email.";\r
+        $this->Mail->AltBody = "Here is the text body of this message.  " .\r
+                   "It should be quite a few lines.  It should be wrapped at the " .\r
+                   "40 characters.  Make sure that it is.";\r
+        $this->Mail->WordWrap = 40;\r
+        $this->AddNote("This is a mulipart alternative email");\r
+        $this->Mail->Subject .= ": AltBody + Word Wrap";\r
+\r
+        $this->BuildBody();\r
+        $this->assert($this->Mail->Send(), $this->Mail->ErrorInfo);\r
+    }\r
+\r
+    /**\r
+     * Simple HTML and attachment test\r
+     */\r
+    function test_AltBody_Attachment() {\r
+\r
+        $this->Mail->Body = "This is the <b>HTML</b> part of the email.";\r
+        $this->Mail->AltBody = "This is the text part of the email.";\r
+        $this->Mail->Subject .= ": AltBody + Attachment";\r
+        $this->Mail->IsHTML(true);\r
+        \r
+        if(!$this->Mail->AddAttachment("phpmailer_test.php", "test_attach.txt"))\r
+        {\r
+            $this->assert(false, $this->Mail->ErrorInfo);\r
+            return;\r
+        }\r
+\r
+        $this->BuildBody();\r
+        $this->assert($this->Mail->Send(), $this->Mail->ErrorInfo);\r
+\r
+        $fp = fopen("message.txt", "w");\r
+        fwrite($fp, $this->Mail->CreateHeader() . $this->Mail->CreateBody());\r
+        fclose($fp);\r
+    }    \r
+\r
+    function test_MultipleSend() {\r
+        $this->Mail->Body = "Sending two messages without keepalive";\r
+        $this->BuildBody();\r
+        $subject = $this->Mail->Subject;\r
+\r
+        $this->Mail->Subject = $subject . ": SMTP 1";\r
+        $this->assert($this->Mail->Send(), $this->Mail->ErrorInfo);\r
+        \r
+        $this->Mail->Subject = $subject . ": SMTP 2";\r
+        $this->assert($this->Mail->Send(), $this->Mail->ErrorInfo);\r
+    }\r
+\r
+    function test_SmtpKeepAlive() {\r
+        $this->Mail->Body = "This was done using the SMTP keep-alive.";\r
+        $this->BuildBody();\r
+        $subject = $this->Mail->Subject;\r
+\r
+        $this->Mail->SMTPKeepAlive = true;\r
+        $this->Mail->Subject = $subject . ": SMTP keep-alive 1";\r
+        $this->assert($this->Mail->Send(), $this->Mail->ErrorInfo);\r
+        \r
+        $this->Mail->Subject = $subject . ": SMTP keep-alive 2";\r
+        $this->assert($this->Mail->Send(), $this->Mail->ErrorInfo);\r
+        $this->Mail->SmtpClose();\r
+    }\r
+    \r
+    /**\r
+     * Tests this denial of service attack: \r
+     *    http://www.cybsec.com/vuln/PHPMailer-DOS.pdf\r
+     */\r
+    function test_DenialOfServiceAttack() {\r
+        $this->Mail->Body = "This should no longer cause a denial of service.";\r
+        $this->BuildBody();\r
+       \r
+        $this->Mail->Subject = str_repeat("A", 998);\r
+        $this->assert($this->Mail->Send(), $this->Mail->ErrorInfo);\r
+    }\r
+    \r
+    function test_Error() {\r
+        $this->Mail->Subject .= ": This should be sent"; \r
+        $this->BuildBody();\r
+        $this->Mail->ClearAllRecipients(); // no addresses should cause an error\r
+        $this->assert($this->Mail->IsError() == false, "Error found");\r
+        $this->assert($this->Mail->Send() == false, "Send succeeded");\r
+        $this->assert($this->Mail->IsError(), "No error found");\r
+        $this->assertEquals('You must provide at least one ' .\r
+                            'recipient email address.', $this->Mail->ErrorInfo);\r
+        $this->Mail->AddAddress(get("mail_to"));\r
+        $this->assert($this->Mail->Send(), "Send failed");\r
+    }\r
+}  \r
\r
+/**\r
+ * Create and run test instance.\r
+ */\r
\r
+if(isset($HTTP_GET_VARS))\r
+    $global_vars = $HTTP_GET_VARS;\r
+else\r
+    $global_vars = $_REQUEST;\r
+\r
+if(isset($global_vars["submitted"]))\r
+{\r
+    echo "Test results:<br>";\r
+    $suite = new TestSuite( "phpmailerTest" );\r
+    \r
+    $testRunner = new TestRunner;\r
+    $testRunner->run($suite);\r
+    echo "<hr noshade/>";\r
+}\r
+\r
+function get($sName) {\r
+    global $global_vars;\r
+    if(isset($global_vars[$sName]))\r
+        return $global_vars[$sName];\r
+    else\r
+        return "";\r
+}\r
+\r
+?>\r
+\r
+<html>\r
+<body>\r
+<h3>phpmailer Unit Test</h3>\r
+By entering a SMTP hostname it will automatically perform tests with SMTP.\r
+\r
+<form name="phpmailer_unit" action="phpmailer_test.php" method="get">\r
+<input type="hidden" name="submitted" value="1"/>\r
+To Address: <input type="text" size="50" name="mail_to" value="<?php echo get("mail_to"); ?>"/>\r
+<br/>\r
+Cc Address: <input type="text" size="50" name="mail_cc" value="<?php echo get("mail_cc"); ?>"/>\r
+<br/>\r
+SMTP Hostname: <input type="text" size="50" name="mail_host" value="<?php echo get("mail_host"); ?>"/>\r
+<p/>\r
+<input type="submit" value="Run Test"/>\r
+\r
+</form>\r
+</body>\r
+</html>\r
diff --git a/inc/classes/third_party/php_mailer/test/phpunit.php b/inc/classes/third_party/php_mailer/test/phpunit.php
new file mode 100644 (file)
index 0000000..1d50868
--- /dev/null
@@ -0,0 +1,376 @@
+<?php\r
+//\r
+// PHP framework for testing, based on the design of "JUnit".\r
+//\r
+// Written by Fred Yankowski <fred@ontosys.com>\r
+//            OntoSys, Inc  <http://www.OntoSys.com>\r
+//\r
+// $Id: phpunit.php,v 1.1 2002/03/30 19:32:17 bmatzelle Exp $\r
+\r
+// Copyright (c) 2000 Fred Yankowski\r
+\r
+// Permission is hereby granted, free of charge, to any person\r
+// obtaining a copy of this software and associated documentation\r
+// files (the "Software"), to deal in the Software without\r
+// restriction, including without limitation the rights to use, copy,\r
+// modify, merge, publish, distribute, sublicense, and/or sell copies\r
+// of the Software, and to permit persons to whom the Software is\r
+// furnished to do so, subject to the following conditions:\r
+//\r
+// The above copyright notice and this permission notice shall be\r
+// included in all copies or substantial portions of the Software.\r
+//\r
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,\r
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\r
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS\r
+// BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN\r
+// ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\r
+// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\r
+// SOFTWARE.\r
+//\r
+error_reporting(E_ERROR | E_WARNING | E_PARSE | E_NOTICE |\r
+               E_CORE_ERROR | E_CORE_WARNING);\r
+\r
+/*\r
+interface Test {\r
+  function run(&$aTestResult);\r
+  function countTestCases();\r
+}\r
+*/\r
+\r
+function trace($msg) {\r
+  return;\r
+  print($msg);\r
+  flush();\r
+}\r
+\r
+\r
+class Exception {\r
+    /* Emulate a Java exception, sort of... */\r
+  var $message;\r
+  function Exception($message) {\r
+    $this->message = $message;\r
+  }\r
+  function getMessage() {\r
+    return $this->message;\r
+  }\r
+}\r
+\r
+class Assert {\r
+  function assert($boolean, $message=0) {\r
+    if (! $boolean)\r
+      $this->fail($message);\r
+  }\r
+\r
+  function assertEquals($expected, $actual, $message=0) {\r
+    if ($expected != $actual) {\r
+      $this->failNotEquals($expected, $actual, "expected", $message);\r
+    }\r
+  }\r
+\r
+  function assertRegexp($regexp, $actual, $message=false) {\r
+    if (! preg_match($regexp, $actual)) {\r
+      $this->failNotEquals($regexp, $actual, "pattern", $message);\r
+    }\r
+  }\r
+\r
+  function failNotEquals($expected, $actual, $expected_label, $message=0) {\r
+    // Private function for reporting failure to match.\r
+    $str = $message ? ($message . ' ') : '';\r
+    $str .= "($expected_label/actual)<br>";\r
+    $htmlExpected = htmlspecialchars($expected);\r
+    $htmlActual = htmlspecialchars($actual);\r
+    $str .= sprintf("<pre>%s\n--------\n%s</pre>",\r
+                   $htmlExpected, $htmlActual);\r
+    $this->fail($str);\r
+  }\r
+}\r
+\r
+class TestCase extends Assert /* implements Test */ {\r
+  /* Defines context for running tests.  Specific context -- such as\r
+     instance variables, global variables, global state -- is defined\r
+     by creating a subclass that specializes the setUp() and\r
+     tearDown() methods.  A specific test is defined by a subclass\r
+     that specializes the runTest() method. */\r
+  var $fName;\r
+  var $fResult;\r
+  var $fExceptions = array();\r
+\r
+  function TestCase($name) {\r
+    $this->fName = $name;\r
+  }\r
+\r
+  function run($testResult=0) {\r
+    /* Run this single test, by calling the run() method of the\r
+       TestResult object which will in turn call the runBare() method\r
+       of this object.  That complication allows the TestResult object\r
+       to do various kinds of progress reporting as it invokes each\r
+       test.  Create/obtain a TestResult object if none was passed in.\r
+       Note that if a TestResult object was passed in, it must be by\r
+       reference. */\r
+    if (! $testResult)\r
+      $testResult = $this->_createResult();\r
+    $this->fResult = $testResult;\r
+    $testResult->run(&$this);\r
+    $this->fResult = 0;\r
+    return $testResult;\r
+  }\r
+\r
+  function countTestCases() {\r
+    return 1;\r
+  }\r
+\r
+  function runTest() {\r
+    $name = $this->name();\r
+    // Since isset($this->$name) is false, no way to run defensive checks\r
+    $this->$name();\r
+  }\r
+\r
+  function setUp() /* expect override */ {\r
+    //print("TestCase::setUp()<br>\n");\r
+  }\r
+\r
+  function tearDown() /* possible override */ {\r
+    //print("TestCase::tearDown()<br>\n");\r
+  }\r
+\r
+  ////////////////////////////////////////////////////////////////\r
+\r
+\r
+  function _createResult() /* protected */ {\r
+    /* override this to use specialized subclass of TestResult */\r
+    return new TestResult;\r
+  }\r
+\r
+  function fail($message=0) {\r
+    //printf("TestCase::fail(%s)<br>\n", ($message) ? $message : '');\r
+    /* JUnit throws AssertionFailedError here.  We just record the\r
+       failure and carry on */\r
+    $this->fExceptions[] = new Exception(&$message);\r
+  }\r
+\r
+  function error($message) {\r
+    /* report error that requires correction in the test script\r
+       itself, or (heaven forbid) in this testing infrastructure */\r
+    printf('<b>ERROR: ' . $message . '</b><br>');\r
+    $this->fResult->stop();\r
+  }\r
+\r
+  function failed() {\r
+    return count($this->fExceptions);\r
+  }\r
+\r
+  function getExceptions() {\r
+    return $this->fExceptions;\r
+  }\r
+\r
+  function name() {\r
+    return $this->fName;\r
+  }\r
+\r
+  function runBare() {\r
+    $this->setup();\r
+    $this->runTest();\r
+    $this->tearDown();\r
+  }\r
+}\r
+\r
+\r
+class TestSuite /* implements Test */ {\r
+  /* Compose a set of Tests (instances of TestCase or TestSuite), and\r
+     run them all. */\r
+  var $fTests = array();\r
+\r
+  function TestSuite($classname=false) {\r
+    if ($classname) {\r
+      // Find all methods of the given class whose name starts with\r
+      // "test" and add them to the test suite.  We are just _barely_\r
+      // able to do this with PHP's limited introspection...  Note\r
+      // that PHP seems to store method names in lower case, and we\r
+      // have to avoid the constructor function for the TestCase class\r
+      // superclass.  This will fail when $classname starts with\r
+      // "Test" since that will have a constructor method that will\r
+      // get matched below and then treated (incorrectly) as a test\r
+      // method.  So don't name any TestCase subclasses as "Test..."!\r
+      if (floor(phpversion()) >= 4) {\r
+       // PHP4 introspection, submitted by Dylan Kuhn\r
+       $names = get_class_methods($classname);\r
+       while (list($key, $method) = each($names)) {\r
+         if (preg_match('/^test/', $method) && $method != "testcase") {  \r
+           $this->addTest(new $classname($method));\r
+         }\r
+       }\r
+      }\r
+      else {\r
+       $dummy = new $classname("dummy");\r
+       $names = (array) $dummy;\r
+       while (list($key, $value) = each($names)) {\r
+         $type = gettype($value);\r
+         if ($type == "user function" && preg_match('/^test/', $key)\r
+         && $key != "testcase") {  \r
+           $this->addTest(new $classname($key));\r
+         }\r
+       }\r
+      }\r
+    }\r
+  }\r
+\r
+  function addTest($test) {\r
+    /* Add TestCase or TestSuite to this TestSuite */\r
+    $this->fTests[] = $test;\r
+  }\r
+\r
+  function run(&$testResult) {\r
+    /* Run all TestCases and TestSuites comprising this TestSuite,\r
+       accumulating results in the given TestResult object. */\r
+    reset($this->fTests);\r
+    while (list($na, $test) = each($this->fTests)) {\r
+      if ($testResult->shouldStop())\r
+       break;\r
+      $test->run(&$testResult);\r
+    }\r
+  }\r
+\r
+  function countTestCases() {\r
+    /* Number of TestCases comprising this TestSuite (including those\r
+       in any constituent TestSuites) */\r
+    $count = 0;\r
+    reset($fTests);\r
+    while (list($na, $test_case) = each($this->fTests)) {\r
+      $count += $test_case->countTestCases();\r
+    }\r
+    return $count;\r
+  }\r
+}\r
+\r
+\r
+class TestFailure {\r
+  /* Record failure of a single TestCase, associating it with the\r
+     exception(s) that occurred */\r
+  var $fFailedTestName;\r
+  var $fExceptions;\r
+\r
+  function TestFailure(&$test, &$exceptions) {\r
+    $this->fFailedTestName = $test->name();\r
+    $this->fExceptions = $exceptions;\r
+  }\r
+\r
+  function getExceptions() {\r
+      return $this->fExceptions;\r
+  }\r
+  function getTestName() {\r
+    return $this->fFailedTestName;\r
+  }\r
+}\r
+\r
+\r
+class TestResult {\r
+  /* Collect the results of running a set of TestCases. */\r
+  var $fFailures = array();\r
+  var $fRunTests = 0;\r
+  var $fStop = false;\r
+\r
+  function TestResult() { }\r
+\r
+  function _endTest($test) /* protected */ {\r
+      /* specialize this for end-of-test action, such as progress\r
+        reports  */\r
+  }\r
+\r
+  function getFailures() {\r
+    return $this->fFailures;\r
+  }\r
+\r
+  function run($test) {\r
+    /* Run a single TestCase in the context of this TestResult */\r
+    $this->_startTest($test);\r
+    $this->fRunTests++;\r
+\r
+    $test->runBare();\r
+\r
+    /* this is where JUnit would catch AssertionFailedError */\r
+    $exceptions = $test->getExceptions();\r
+    if ($exceptions)\r
+      $this->fFailures[] = new TestFailure(&$test, &$exceptions);\r
+    $this->_endTest($test);\r
+  }\r
+\r
+  function countTests() {\r
+    return $this->fRunTests;\r
+  }\r
+\r
+  function shouldStop() {\r
+    return $this->fStop;\r
+  }\r
+\r
+  function _startTest($test) /* protected */ {\r
+      /* specialize this for start-of-test actions */\r
+  }\r
+\r
+  function stop() {\r
+    /* set indication that the test sequence should halt */\r
+    $fStop = true;\r
+  }\r
+\r
+  function countFailures() {\r
+    return count($this->fFailures);\r
+  }\r
+}\r
+\r
+\r
+class TextTestResult extends TestResult {\r
+  /* Specialize TestResult to produce text/html report */\r
+  function TextTestResult() {\r
+    $this->TestResult();  // call superclass constructor\r
+  }\r
+  \r
+  function report() {\r
+    /* report result of test run */\r
+    $nRun = $this->countTests();\r
+    $nFailures = $this->countFailures();\r
+    printf("<p>%s test%s run<br>", $nRun, ($nRun == 1) ? '' : 's');\r
+    printf("%s failure%s.<br>\n", $nFailures, ($nFailures == 1) ? '' : 's');\r
+    if ($nFailures == 0)\r
+      return;\r
+\r
+    print("<ol>\n");\r
+    $failures = $this->getFailures();\r
+    while (list($i, $failure) = each($failures)) {\r
+      $failedTestName = $failure->getTestName();\r
+      printf("<li>%s\n", $failedTestName);\r
+\r
+      $exceptions = $failure->getExceptions();\r
+      print("<ul>");\r
+      while (list($na, $exception) = each($exceptions))\r
+       printf("<li>%s\n", $exception->getMessage());\r
+      print("</ul>");\r
+    }\r
+    print("</ol>\n");\r
+  }\r
+\r
+  function _startTest($test) {\r
+    printf("%s ", $test->name());\r
+    flush();\r
+  }\r
+\r
+  function _endTest($test) {\r
+    $outcome = $test->failed()\r
+       ? "<font color=\"red\">FAIL</font>"\r
+       : "<font color=\"green\">ok</font>";\r
+    printf("$outcome<br>\n");\r
+    flush();\r
+  }\r
+}\r
+\r
+\r
+class TestRunner {\r
+  /* Run a suite of tests and report results. */\r
+  function run($suite) {\r
+    $result = new TextTestResult;\r
+    $suite->run($result);\r
+    $result->report();\r
+  }\r
+}\r
+\r
+?>\r
diff --git a/inc/classes/third_party/php_mailer/test/test.png b/inc/classes/third_party/php_mailer/test/test.png
new file mode 100644 (file)
index 0000000..02de5a7
Binary files /dev/null and b/inc/classes/third_party/php_mailer/test/test.png differ
diff --git a/inc/config.php b/inc/config.php
new file mode 100644 (file)
index 0000000..143ad06
--- /dev/null
@@ -0,0 +1,288 @@
+<?php
+/**
+ * General configuration. Do not touch this file! If you need different settings
+ * create a config-local.php in this directory at and set your changed
+ * configuration entries there.
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+// 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');
+
+// Get a new configuration instance
+$cfg = FrameworkConfiguration::getInstance();
+
+// CFG: SERVER-PATH
+$cfg->setConfigEntry('base_path', (dirname(dirname(__FILE__)) . '/'));
+
+// CFG: BASE-URL
+$cfg->setConfigEntry('base_url', $cfg->detectBaseUrl());
+
+// CFG: DATABASE-TYPE
+$cfg->setConfigEntry('db_type', "local");
+
+// CFG: LOCAL-DB-PATH
+$cfg->setConfigEntry('local_db_path', $cfg->readConfig('base_path') . "db/");
+
+// CFG: TIME-ZONE
+$cfg->setDefaultTimezone("Europe/Berlin");
+
+// CFG: MAGIC-QUOTES-RUNTIME
+$cfg->setMagicQuotesRuntime(false);
+
+// CFG: CLASS-PREFIX
+$cfg->setConfigEntry('class_prefix', "class_");
+
+// CFG: CLASS-SUFFIX
+$cfg->setConfigEntry('class_suffix', ".php");
+
+// CFG: RAW-TEMPLATE-EXTENSION
+$cfg->setConfigEntry('raw_template_extension', ".tpl");
+
+// CFG: CODE-TEMPLATE-EXTENSION
+$cfg->setConfigEntry('code_template_extension', ".ctp");
+
+// CFG: SELECTOR-PATH
+$cfg->setConfigEntry('selector_path', "selector");
+
+// CFG: APPLICATION-HELPER
+$cfg->setConfigEntry('app_helper_class', "ApplicationHelper");
+
+// CFG: LAUNCH-METHOD
+$cfg->setConfigEntry('entry_method', "entryPoint");
+
+// CFG: TEMPLATE-BASE-PATH
+$cfg->setConfigEntry('tpl_base_path', "templates/");
+
+// CFG: LANGUAGE-BASE-PATH
+$cfg->setConfigEntry('lang_base_path', "inc/language/");
+
+// CFG: COMPRESSOR-BASE-PATH
+$cfg->setConfigEntry('compressor_base_path', "inc/classes/main/compressor/");
+
+// CFG: APPLICATION-PATH
+$cfg->setConfigEntry('application_path', $cfg->readConfig('base_path') . "application/");
+
+// CFG: COMPILE-OUTPUT-PATH
+$cfg->setConfigEntry('compile_output_path', "templates/_compiled/");
+
+// CFG: TEMPLATE-ENGINE
+$cfg->setConfigEntry('template_class', "WebTemplateEngine");
+
+// CFG: DEBUG-ENGINE
+$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
+
+// CFG: WEB-TEMPLATE-TYPE
+$cfg->setConfigEntry('web_template_type', "html");
+
+// CFG: EMAIL-TEMPLATE-TYPE
+$cfg->setConfigEntry('email_template_type', "emails");
+
+// CFG: CODE-TEMPLATE-TYPE
+$cfg->setConfigEntry('code_template_type', "code");
+
+// CFG: WEB-ENGINE
+$cfg->setConfigEntry('web_engine', "WebOutput");
+
+// CFG: SELECTOR-TEMPLATE-PREFIX
+$cfg->setConfigEntry('tpl_selector_prefix', "selector");
+
+// CFG: WEB-CONTENT-TYPE
+$cfg->setConfigEntry('web_content_type', "text/html");
+
+// CFG: VALID-TEMPLATE-VARIABLE
+$cfg->setConfigEntry('tpl_valid_var', "content");
+
+// CFG: META-AUTHOR
+$cfg->setConfigEntry('meta_author', "Roland H&auml;der");
+
+// CFG: META-PUBLISHER
+$cfg->setConfigEntry('meta_publisher', "Roland H&auml;der");
+
+// CFG: META-KEYWORDS
+$cfg->setConfigEntry('meta_keywords', "test,test,test");
+
+// CFG: META-DESCRIPTION
+$cfg->setConfigEntry('meta_description', "A lame description for an application framework");
+
+// CFG: SELECTOR-MAIN-TEMPLATE
+$cfg->setConfigEntry('selector_main_tpl', "selector_main");
+
+// CFG: SELECTOR-APPS-TEMPLATE
+$cfg->setConfigEntry('selector_apps_tpl', "selector_apps");
+
+// CFG: SELECTOR-NAME
+$cfg->setConfigEntry('selector_name', "selector");
+
+// CFG: DEFAULT-APPLICATION
+$cfg->setConfigEntry('default_application', "selector");
+
+// CFG: VERBOSE-LEVEL
+$cfg->setConfigEntry('verbose_level', 0);
+
+// CFG: CACHE-TYPE
+$cfg->setConfigEntry('cache_class', "MemoryCache");
+
+// CFG: SEARCH-CRITERIA
+$cfg->setConfigEntry('search_criteria_class', "SearchCriteria");
+
+// CFG: DATASET-CRITERIA
+$cfg->setConfigEntry('dataset_criteria_class', "DataSetCriteria");
+
+// CFG: UPDATE-CRITERIA
+$cfg->setConfigEntry('update_criteria_class', "UpdateCriteria");
+
+// CFG: FILE-IO-HANDLER
+$cfg->setConfigEntry('file_io_class', "FileIoHandler");
+
+// CFG: FILTER-CHAIN
+$cfg->setConfigEntry('filter_chain_class', "FilterChain");
+
+// CFG: FILE-INPUT-STREAM
+$cfg->setConfigEntry('file_input_class', "FileIoStream");
+
+// CFG: FILE-OUTPUT-STREAM
+$cfg->setConfigEntry('file_output_class', "FileIoStream");
+
+// CFG: EMAIL-VALIDATOR-FILTER
+$cfg->setConfigEntry('email_validator_filter', "EmailValidatorFilter");
+
+// CFG: USERNAME-VALIDATOR-FILTER
+$cfg->setConfigEntry('username_validator_filter', "UserNameValidatorFilter");
+
+// CFG: USERNAME-IS-GUEST-FILTER
+$cfg->setConfigEntry('username_is_guest_filter', "UserNameIsGuestFilter");
+
+// CFG: PASSWORD-VALIDATOR-FILTER
+$cfg->setConfigEntry('password_validator_filter', "PasswordValidatorFilter");
+
+// CFG: RULES-ACCEPTED-FILTER
+$cfg->setConfigEntry('rules_accepted_filter', "RulesAcceptedFilter");
+
+// CFG: USERNAME-VERIFIER-FILTER
+$cfg->setConfigEntry('username_verifier_filter', "UserNameVerifierFilter");
+
+// CFG: USER-GUEST-VERIFIER-FILTER
+$cfg->setConfigEntry('user_guest_verifier_filter', "UserGuestVerifierFilter");
+
+// CFG: EMAIL-VERIFIER-FILTER
+$cfg->setConfigEntry('email_verifier_filter', "EmailVerifierFilter");
+
+// CFG: PASSWORD-VERIFIER-FILTER
+$cfg->setConfigEntry('password_verifier_filter', "PasswordVerifierFilter");
+
+// CFG: PASSWD-GUEST-VERIFIER-FILTER
+$cfg->setConfigEntry('passwd_guest_verifier_filter', "PasswordGuestVerifierFilter");
+
+// CFG: EMAIL-CHANGE-FILTER
+$cfg->setConfigEntry('email_change_filter', "EmailChangeFilter");
+
+// CFG: PASSWORD-CHANGE-FILTER
+$cfg->setConfigEntry('password_change_filter', "PasswordChangeFilter");
+
+// CFG: ACCOUNT-PASSWORD-FILTER
+$cfg->setConfigEntry('account_password_filter', "AccountPasswordVerifierFilter");
+
+// CFG: USER-STATUS-FILTER
+$cfg->setConfigEntry('user_status_filter', "UserStatusVerifierFilter");
+
+// CFG: USER-UNCONFIRMED-FILTER
+$cfg->setConfigEntry('user_unconfirmed_filter', "UserUnconfirmedVerifierFilter");
+
+// CFG: CRYPTO-CLASS
+$cfg->setConfigEntry('crypto_class', "CryptoHelper");
+
+// CFG: RNG-CLASS
+$cfg->setConfigEntry('rng_class', "RandomNumberGenerator");
+
+// CFG: USER-DB-WRAPPER-CLASS
+$cfg->setConfigEntry('user_db_wrapper_class', "UserDatabaseWrapper");
+
+// CFG: NEWS-DB-WRAPPER-CLASS
+$cfg->setConfigEntry('news_db_wrapper_class', "NewsDatabaseWrapper");
+
+// CFG: WEB-CMD-RESOLVER-CLASS
+$cfg->setConfigEntry('web_cmd_resolver_class', "WebCommandResolver");
+
+// CFG: IMAGE-CMD-RESOLVER-CLASS
+$cfg->setConfigEntry('image_cmd_resolver_class', "ImageCommandResolver");
+
+// CFG: MAILER-CLASS
+$cfg->setConfigEntry('mailer_class', "DebugMailer");
+
+// CFG: MATH-PRIME
+$cfg->setConfigEntry('math_prime', 591623);
+
+// CFG: DATE-KEY
+$cfg->setConfigEntry('date_key', date("d-m-Y (l-F-T)", time()));
+
+// CFG: SALT-LENGTH
+$cfg->setConfigEntry('salt_length', 10);
+
+// CFG: RND-STR-LENGTH
+$cfg->setConfigEntry('rnd_str_length', 128);
+
+// CFG: HASH-MASK
+$cfg->setConfigEntry('hash_mask', "%1s:%2s:%3s"); // 1=salt, 2=extra salt, 3=plain password
+
+// CFG: IS-SINGLE-SERVER
+$cfg->setConfigEntry('is_single_server', "Y");
+
+// CFG: POST-REGISTRATION-ACTION
+$cfg->setConfigEntry('post_registration_class', "LoginAfterRegistrationAction");
+
+// CFG: USER-CLASS
+$cfg->setConfigEntry('user_class', "Member");
+
+// CFG: GUEST-CLASS
+$cfg->setConfigEntry('guest_class', "Guest");
+
+// CFG: COOKIE-EXPIRE
+$cfg->setConfigEntry('cookie_expire', (60*60*2)); // Two hours!
+
+// CFG: COOKIE-PATH
+$cfg->setConfigEntry('cookie_path', $cfg->detectScriptPath() . "/");
+
+// CFG: COOKIE-DOMAIN
+$cfg->setConfigEntry('cookie_domain', $cfg->detectDomain()); // Is mostly the same...
+
+// CFG: COOKIE-SSL
+$cfg->setConfigEntry('cookie_ssl', (isset($_SERVER['HTTPS'])));
+
+// CFG: CRYPT-FIXED-SALT
+$cfg->setConfigEntry('crypt_fixed_salt', "N");
+
+// CFG: DB-UPDATE-PRIMARY-FORCED
+$cfg->setConfigEntry('db_update_primary_forced', "Y");
+
+// CFG: GERMAN-DATE-TIME
+$cfg->setConfigEntry('german_date_time', "%3\$s.%2\$s.%1\$s, %4\$s:%5\$s:%6\$s");
+
+// CFG: PRODUCT-INSTALL-MODE
+$cfg->setConfigEntry('product_install_mode', "debug");
+
+// [EOF]
+?>
diff --git a/inc/config/.htaccess b/inc/config/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/inc/config/class_FrameworkConfiguration.php b/inc/config/class_FrameworkConfiguration.php
new file mode 100644 (file)
index 0000000..e320260
--- /dev/null
@@ -0,0 +1,272 @@
+<?php
+/**
+ * A class for the configuration stuff implemented in a singleton design paddern
+ *
+ * NOTE: We cannot put this in inc/classes/ because it would be loaded (again) in
+ * class loader. See inc/loader/class_ClassLoader.php for instance
+ *
+ * @see                        ClassLoader
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class FrameworkConfiguration implements Registerable {
+       /**
+        * The framework's main configuration array which will be initialized with
+        * hard-coded configuration data and might be overwritten/extended by
+        * config data from the database.
+        */
+       private $config = array();
+
+       /**
+        * The configuration instance itself
+        */
+       private static $cfgInstance = null;
+
+       // Some constants for the configuration system
+       const EXCEPTION_CONFIG_ENTRY_IS_EMPTY      = 0x130;
+       const EXCEPTION_CONFIG_ENTRY_WAS_NOT_FOUND = 0x131;
+
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Empty for now
+       }
+
+       /**
+        * Getter for an instance of this class
+        *
+        * @return      $cfgInstance    An instance of this class
+        */
+       public final static function getInstance () {
+               // is the instance there?
+               if (is_null(self::$cfgInstance))  {
+                       // Create a config instance
+                       self::$cfgInstance = new FrameworkConfiguration();
+               } // END - if
+
+               return self::$cfgInstance;
+       }
+
+       /**
+        * Setter for default time zone (must be correct!)
+        *
+        * @param               $zone   The time-zone string (e.g. Europe/Berlin)
+        * @return      void
+        */
+       public final function setDefaultTimezone ($zone) {
+               // At least 5.1.0 is required for this!
+               if (version_compare(phpversion(), "5.1.0")) {
+                       @date_default_timezone_set($zone);
+               } // END - if
+       }
+
+       /**
+        * Setter for runtime magic quotes
+        */
+       public final function setMagicQuotesRuntime ($enableQuotes) {
+               // Cast it to boolean
+               $enableQuotes = (boolean) $enableQuotes;
+
+               // Set it
+               @set_magic_quotes_runtime($enableQuotes);
+       }
+
+       /**
+        * A private include loader
+        *
+        * @param       $arrayObject    The array object with all include files
+        * @return      void
+        */
+       private function loadIncludes (ArrayObject $arrayObject) {
+               // Load only if there are includes defined
+               if (!is_null($arrayObject)) {
+                       for ($idx = $arrayObject->getIterator(); $idx->valid(); $idx->next()) {
+                               // Get include file
+                               $inc = $idx->current();
+
+                               // Is the file name really set?
+                               if (!empty($inc)) {
+                                       // Base path is by default added
+                                       $fqfn = $inc;
+
+                                       // Base path added? (Uni* / Windows)
+                                       if ((substr($inc, 0, 1) != "/") && (substr($inc, 1, 1) != ":")) {
+                                               // Generate FQFN
+                                               $fqfn = sprintf("%s/inc/extra/%s", $this->readConfig('base_path'), $inc);
+                                       } // END - if
+                               } // END - if
+
+                               // Include them all here
+                               require($fqfn);
+                       }
+               } // END - if
+       }
+
+       /**
+        * Read a configuration element.
+        *
+        * @param       $cfgEntry       The configuration element
+        * @return      $cfgValue       The fetched configuration value
+        * @throws      ConfigEntryIsEmptyException             If $cfgEntry is empty
+        * @throws      ConfigEntryNotFoundException    If a configuration element
+        *                                                                                      was not found
+        */
+       public function readConfig ($cfgEntry) {
+               // Cast to string
+               $cfgEntry = (string) $cfgEntry;
+
+               // Is a valid configuration entry provided?
+               if (empty($cfgEntry)) {
+                       // Entry is empty
+                       throw new ConfigEntryIsEmptyException($this, self::EXCEPTION_CONFIG_ENTRY_IS_EMPTY);
+               } elseif (!isset($this->config[$cfgEntry])) {
+                       // Entry was not found!
+                       throw new ConfigEntryNotFoundException(array(__CLASS__, $cfgEntry), self::EXCEPTION_CONFIG_ENTRY_WAS_NOT_FOUND);
+               }
+
+               // Debug message
+               if ((defined('DEBUG_CONFIG')) || (defined('DEBUG_ALL'))) {
+                       echo "[".__METHOD__."] Configuration entry ".$cfgEntry." requested.<br />\n";
+               } // END - if
+
+               // Return the requested value
+               return $this->config[$cfgEntry];
+       }
+
+       /**
+        * Set a configuration entry.
+        *
+        * @param       $cfgEntry       The configuration entry we want to add/change
+        * @param       $cfgValue       The configuration value we want to set
+        * @return      void
+        * @throws      ConfigEntryIsEmptyException     If $cfgEntry is empty
+        */
+       public final function setConfigEntry ($cfgEntry, $cfgValue) {
+               // Cast to string
+               $cfgEntry = (string) $cfgEntry;
+               $cfgValue = (string) $cfgValue;
+
+               // Is a valid configuration entry provided?
+               if (empty($cfgEntry)) {
+                       // Entry is empty
+                       throw new ConfigEntryIsEmptyException($this, self::EXCEPTION_CONFIG_ENTRY_IS_EMPTY);
+               } // END - if
+
+               // Set the configuration value
+               $this->config[$cfgEntry] = $cfgValue;
+
+               // Resort the array
+               ksort($this->config);
+       }
+
+       /**
+        * Compatiblity method to return this class' name
+        *
+        * @return      __CLASS__               This class' name
+        */
+       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() . $this->detectScriptPath();
+
+               // 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 () {
+               // Full domain is localnet.invalid by default
+               $fullDomain = "localnet.invalid";
+
+               // Is the server name there?
+               if (isset($_SERVER['SERVER_NAME'])) {
+                       // Detect the full domain
+                       $fullDomain = htmlentities(strip_tags($_SERVER['SERVER_NAME']), ENT_QUOTES);
+               } // END - if
+
+               // Return it
+               return $fullDomain;
+       }
+
+       /**
+        * Detect safely the script path without trailing slash which is the part
+        * between "http://your-domain.invalid/" and "script-name.php"
+        */
+       public function detectScriptPath () {
+               // Default is empty
+               $scriptPath = "";
+
+               // Is the scriptname set?
+               if (isset($_SERVER['SCRIPT_NAME'])) {
+                       // Get dirname of it
+                       $scriptPath = dirname($_SERVER['SCRIPT_NAME']);
+               } // END - if
+
+               // Return it
+               return $scriptPath;
+       }
+
+       /**
+        * Getter for field name
+        *
+        * @param       $fieldName              Field name which we shall get
+        * @return      $fieldValue             Field value from the user
+        */
+       function getField ($fieldName) {
+               // Dummy method!
+       }
+
+       /**
+        * Updates a given field with new value
+        *
+        * @param       $fieldName              Field to update
+        * @param       $fieldValue             New value to store
+        * @return      void
+        */
+       public function updateDatabaseField ($fieldName, $fieldValue) {
+               // Dummy method!
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/config/config-hubmaster.php b/inc/config/config-hubmaster.php
new file mode 100644 (file)
index 0000000..0e792b7
--- /dev/null
@@ -0,0 +1,88 @@
+<?php
+/**
+ * Configuration entries for connecting to the hub
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+// Get the configuration instance
+$cfg = FrameworkConfiguration::getInstance();
+
+// CFG: HUB-LISTEN-ADDR
+$cfg->setConfigEntry('hub_listen_addr', "0.0.0.0");
+
+// CFG: HUB-LISTEN-PORT (zero = auto-choose)
+$cfg->setConfigEntry('hub_listen_port', 9060);
+
+// CFG: HUB-MAX-AUTH-TRIES
+$cfg->setConfigEntry('hub_max_auth_tries', 3);
+
+// CFG: HUB-MSG-AUTH-TRIES
+$cfg->setConfigEntry('hub_msg_auth_tries', "AUTH_MAX_TRIES");
+
+// CFG: HUB-MSG-SPOOFING
+$cfg->setConfigEntry('hub_msg_spoofing', "SPOOFING");
+
+// CFG: HUB-MSG-AUTH-REPLY
+$cfg->setConfigEntry('hub_msg_auth_reply_timeout', "TIMEOUT_AUTH");
+
+// CFG: HUB-MSG-BYE
+$cfg->setConfigEntry('hub_msg_bye', "BYE");
+
+// CFG: HUB-MASTER-IP
+$cfg->setConfigEntry('hub_master_ip', "192.168.1.17");
+
+// CFG: HUB-MASTER-PORT
+$cfg->setConfigEntry('hub_master_port', 9060);
+
+// CFG: HUB-AUTH-REQUEST
+$cfg->setConfigEntry('hub_auth_request', "AUTH");
+
+// CFG: HUB-AUTH-REQUEST-TIMEOUT (5 seconds for whole auth procedure shall be fine)
+$cfg->setConfigEntry('hub_auth_request_timeout', 5);
+
+// CFG: HUB-PEER-HELLO
+$cfg->setConfigEntry('hub_peer_hello', "HELLO");
+
+// CFG: HUB-HELLO-REPLY
+$cfg->setConfigEntry('hub_hello_reply', "ELHO");
+
+// CFG: HUB-HELLO-TIMEOUT
+$cfg->setConfigEntry('hub_hello_timeout', 30);
+
+// CFG: HUB-HELLO-RETRIES
+$cfg->setConfigEntry('hub_hello_retires', 3);
+
+// CFG: HUB-PEER-PING
+$cfg->setConfigEntry('hub_peer_ping', "PING");
+
+// CFG: HUB-PING-REPLY
+$cfg->setConfigEntry('hub_ping_reply', "PONG");
+
+// CFG: HUB-PING-TIMEOUT
+$cfg->setConfigEntry('hub_ping_timeout', 10);
+
+// CFG: HUB-PING-MAXDROPS
+$cfg->setConfigEntry('hub_ping_maxdrops', 3);
+
+// CFG: HUB-PEER-MISS-PONG
+$cfg->setConfigEntry('hub_peer_miss_pong', "PONG_MISS");
+
+// [EOF]
+?>
diff --git a/inc/database.php b/inc/database.php
new file mode 100644 (file)
index 0000000..de0c7d8
--- /dev/null
@@ -0,0 +1,92 @@
+<?php
+/**
+ * Initializes the database layer
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+// Initialize layer
+$layerInstance = null;
+
+// Get config instance
+$cfg = FrameworkConfiguration::getInstance();
+
+// Generate FQFN for the database layer
+$INC = sprintf("%sinc/database/lib-%s.php",
+       $cfg->readConfig('base_path'),
+       $cfg->readConfig('db_type')
+);
+
+// Load the database layer include
+if ((file_exists($INC)) && (is_file($INC)) && (is_readable($INC))) {
+       // Load the layer
+       require_once($INC);
+} else {
+       // Layer is missing!
+       ApplicationEntryPoint::app_die(sprintf("[Main:] Database layer is missing! (%s) -&gt; R.I.P.",
+               $cfg->readConfig('db_type')
+       ));
+}
+
+// Clean it up
+unset($INC);
+
+// Prepare database instance
+try {
+       $db = DatabaseConnection::createDatabaseConnection(DebugMiddleware::getInstance(), $layerInstance);
+} catch (NullPointerException $e) {
+       ApplicationEntryPoint::app_die(sprintf("[Main:] Database sub-system not initialized for the follwing reason: <span class=\"exception_reason\">%s</span><br />\n",
+               $e->getMessage()
+       ));
+} catch (InvalidDirectoryResourceException $e) {
+       ApplicationEntryPoint::app_die(sprintf("[Main:] Database sub-system not initialized for the follwing reason: <span class=\"exception_reason\">%s</span><br />\n",
+               $e->getMessage()
+       ));
+} catch (PathIsEmptyException $e) {
+       ApplicationEntryPoint::app_die(sprintf("[Main:] Database sub-system not initialized for the follwing reason: <span class=\"exception_reason\">%s</span><br />\n",
+               $e->getMessage()
+       ));
+} catch (PathIsNoDirectoryException $e) {
+       ApplicationEntryPoint::app_die(sprintf("[Main:] Database sub-system not initialized for the follwing reason: <span class=\"exception_reason\">%s</span><br />\n",
+               $e->getMessage()
+       ));
+} catch (PathReadProtectedException $e) {
+       ApplicationEntryPoint::app_die(sprintf("[Main:] Database sub-system not initialized for the follwing reason: <span class=\"exception_reason\">%s</span><br />\n",
+               $e->getMessage()
+       ));
+} catch (DirPointerNotOpenedException $e) {
+       ApplicationEntryPoint::app_die(sprintf("[Main:] Database sub-system not initialized for the follwing reason: <span class=\"exception_reason\">%s</span><br />\n",
+               $e->getMessage()
+       ));
+}
+
+// Is the app variable there and valid?
+if (is_object($app)) $app->setDatabaseInstance($db);
+
+// Datenbankobjekt debuggen
+if (defined('DEBUG_DATABASE_OBJ')) {
+       DebugMiddleware::getInstance()->output(sprintf("The database sub-system does now look like this:<br />
+<pre>%s</pre>\n",
+               print_r($db, true)
+       ));
+}
+
+// [EOF]
+?>
diff --git a/inc/database/.htaccess b/inc/database/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/inc/database/lib-local.php b/inc/database/lib-local.php
new file mode 100644 (file)
index 0000000..9e9d5a6
--- /dev/null
@@ -0,0 +1,51 @@
+<?php
+/**
+ * Initializes the local file database class
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+// Zum Testen speichern wir in lokale Dateien (LocalFileDatabase)
+try {
+       $layerInstance = LocalFileDatabase::createLocalFileDatabase(FrameworkConfiguration::getInstance()->readConfig('local_db_path'), FileIoHandler::getInstance());
+} catch (SavePathIsEmptyException $e) {
+       ApplicationEntryPoint::app_die(sprintf("[Main:] Database layer could not be initialized. Reason: <span class=\"exception_reason\">%s</span>",
+               $e->getMessage()
+       ));
+} catch (SavePathNotFoundException $e) {
+       ApplicationEntryPoint::app_die(sprintf("[Main:] Database layer could not be initialized. Reason: <span class=\"exception_reason\">%s</span>",
+               $e->getMessage()
+       ));
+} catch (SavePathIsNoDirectoryException $e) {
+       ApplicationEntryPoint::app_die(sprintf("[Main:] Database layer could not be initialized. Reason: <span class=\"exception_reason\">%s</span>",
+               $e->getMessage()
+       ));
+} catch (SavePathReadProtectedException $e) {
+       ApplicationEntryPoint::app_die(sprintf("[Main:] Database layer could not be initialized. Reason: <span class=\"exception_reason\">%s</span>",
+               $e->getMessage()
+       ));
+} catch (SavePathWriteProtectedException $e) {
+       ApplicationEntryPoint::app_die(sprintf("[Main:] Database layer could not be initialized. Reason: <span class=\"exception_reason\">%s</span>",
+               $e->getMessage()
+       ));
+}
+
+// [EOF]
+?>
diff --git a/inc/file_io.php b/inc/file_io.php
new file mode 100644 (file)
index 0000000..c141fea
--- /dev/null
@@ -0,0 +1,34 @@
+<?php
+/**
+ * Initialize the file I/O handler. Currently there is no need to check if
+ * the initialization was successfull or not because only some class
+ * instances will we generated.
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+// Get the instance
+$io = ObjectFactory::createObjectByConfiguredName('file_io_class');
+
+// Is the app variable there and valid?
+if (is_object($app)) $app->setFileIoInstance($io);
+
+// [EOF]
+?>
diff --git a/inc/includes.php b/inc/includes.php
new file mode 100644 (file)
index 0000000..7e3f5c9
--- /dev/null
@@ -0,0 +1,86 @@
+<?php
+/**
+ * Loads more include files by using the generic class loader
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+// Get config instance
+$cfg = FrameworkConfiguration::getInstance();
+
+// Include the class loader function
+require(sprintf("%sinc/loader/class_ClassLoader.php", $cfg->readConfig('base_path')));
+
+// Does the user has an application specified?
+if (!empty($_GET['app'])) {
+       // Set the application from string
+       $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] == 'app') {
+               // Application is valid!
+               $application = trim($app[1]);
+       } else {
+               // Invalid entry found, first must be "app"!
+               $application = $cfg->readConfig('default_application');
+       }
+} else {
+       // Set the "application selector" application
+       $application = $cfg->readConfig('default_application');
+}
+
+// Secure it, by keeping out tags
+$application = htmlentities(strip_tags($application), ENT_QUOTES);
+
+// Secure it a little more with a reg.exp.
+$application = preg_replace('/([^a-z0-9_-])+/i', "", $application);
+
+// Set the application name for later usage
+$cfg->setConfigEntry('app_name', $application);
+
+/**
+ * Autoload-function
+ *
+ * @param      $className      Name of the class to load
+ * @return     void
+ */
+function __autoload ($className) {
+       // Try to include this class
+       ClassLoader::getInstance()->includeClass($className);
+}
+
+/**
+ * Is the devel package included?
+ */
+if (is_dir(sprintf("%sdevel", $cfg->readConfig('base_path')))) {
+       /**
+        * Load all development includes
+        */
+       ClassLoader::getInstance()->loadClasses('devel');
+}
+
+// Shall we include additional configs where you can configure some things? Then
+// Load matching config
+ClassLoader::getInstance()->loadExtraConfigs();
+
+// [EOF]
+?>
diff --git a/inc/language.php b/inc/language.php
new file mode 100644 (file)
index 0000000..fe8847a
--- /dev/null
@@ -0,0 +1,50 @@
+<?php
+/**
+ * Try to initializes the language system
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+try {
+       $lang = LanguageSystem::createLanguageSystem(sprintf("%s%s",
+               $cfg->readConfig('base_path'),
+               FrameworkConfiguration::getInstance()->readConfig('lang_base_path')
+       ));
+} catch (LanguagePathIsEmptyException $e) {
+       ApplicationEntryPoint::app_die(sprintf("[Main:] The language sub-system could not be initialized for the following reason: <span class=\"exception_reason\">%s</span>",
+               $e->getMessage()
+       ));
+} catch (InvalidLanguagePathStringException $e) {
+       ApplicationEntryPoint::app_die(sprintf("[Main:] The language sub-system could not be initialized for the following reason: <span class=\"exception_reason\">%s</span>",
+               $e->getMessage()
+       ));
+} catch (LanguagePathIsNoDirectoryException $e) {
+       ApplicationEntryPoint::app_die(sprintf("[Main:] The language sub-system could not be initialized for the following reason: <span class=\"exception_reason\">%s</span>",
+               $e->getMessage()
+       ));
+} catch (LanguagePathReadProtectedException $e) {
+       ApplicationEntryPoint::app_die(sprintf("[Main:] The language sub-system could not be initialized for the following reason: <span class=\"exception_reason\">%s</span>",
+               $e->getMessage()
+       ));
+}
+
+// Is the app variable there and valid?
+if (is_object($app)) $app->setLanguageInstance($lang);
+
+// [EOF]
+?>
diff --git a/inc/language/.htaccess b/inc/language/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/inc/loader/.htaccess b/inc/loader/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/inc/loader/class_ClassLoader.php b/inc/loader/class_ClassLoader.php
new file mode 100644 (file)
index 0000000..134b8c1
--- /dev/null
@@ -0,0 +1,376 @@
+<?php
+/**
+ * This class loads class include files with a specific prefix and suffix
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * ----------------------------------
+ * 1.2
+ *  - ClassLoader rewritten to PHP SPL's own RecursiveIteratorIterator class
+ * 1.1
+ *  - loadClasses rewritten to fix some notices
+ * 1.0
+ *  - Initial release
+ * ----------------------------------
+ */
+class ClassLoader {
+       /**
+        * Instance of this class
+        */
+       private static $selfInstance = null;
+
+       /**
+        * Configuration array
+        */
+       private $cfg = array();
+
+       /**
+        * Array with all classes
+        */
+       private $classes = array();
+
+       /**
+        * List of loaded classes
+        */
+       private $loadedClasses = array();
+
+       /**
+        * Suffix with extension for all class files
+        */
+       private $prefix = "class_";
+
+       /**
+        * Suffix with extension for all class files
+        */
+       private $suffix = ".php";
+
+       /**
+        * Length of the suffix. Will be overwritten later.
+        */
+       private $suffixLen = 0;
+
+       /**
+        * Length of the prefix. Will be overwritten later.
+        */
+       private $prefixLen = 0;
+
+       /**
+        * A list for directory names (no leading/trailing slashes!) which not be scanned by the path scanner
+        * @see scanLocalPath
+        */
+       private $ignoreList = array();
+
+       /**
+        * Debug this class loader? (true = yes, false = no)
+        */
+       private $debug = false;
+
+       /**
+        * Wether the file list is cached or not
+        */
+       private $listCached = false;
+
+       /**
+        * Wethe class content has been cached
+        */
+       private $classesCached = false;
+
+       /**
+        * Filename for the list cache
+        */
+       private $listCacheFQFN = "";
+
+       /**
+        * Cache for class content
+        */
+       private $classCacheFQFN = "";
+
+       /**
+        * Counter for loaded include files
+        */
+       private $total = 0;
+
+       /**
+        * The *public* constructor
+        *
+        * @param               $cfgInstance            Configuration class instance
+        * @return      void
+        */
+       public function __construct (FrameworkConfiguration $cfgInstance) {
+               // Set configuration instance
+               $this->cfgInstance = $cfgInstance;
+
+               // Construct the FQFN for the cache
+               if (!defined('DEVELOPER')) {
+                       $this->listCacheFQFN  = $this->cfgInstance->readConfig('local_db_path') . "list-" . $this->cfgInstance->readConfig('app_name') . ".cache";
+                       $this->classCacheFQFN = $this->cfgInstance->readConfig('local_db_path') . "class-" . $this->cfgInstance->readConfig('app_name') . ".cache";
+               } // END - if
+
+               // Set suffix and prefix from configuration
+               $this->suffix = $cfgInstance->readConfig('class_suffix');
+               $this->prefix = $cfgInstance->readConfig('class_prefix');
+
+               // Estimate length of prefix and suffix for substr() function (cache)
+               $this->suffixLen = strlen($this->suffix);
+               $this->prefixLen = strlen($this->prefix);
+
+               // Set own instance
+               self::$selfInstance = $this;
+
+               // Skip here if no dev-mode
+               if (defined('DEVELOPER')) return;
+
+               // IS the cache there?
+               if (file_exists($this->listCacheFQFN)) {
+                       // Get content
+                       $cacheContent = file_get_contents($this->listCacheFQFN);
+
+                       // And convert it
+                       $this->classes = unserialize($cacheContent);
+
+                       // List has been restored from cache!
+                       $this->listCached = true;
+               } // END - if
+
+               // Does the class cache exist?
+               if (file_exists($this->classCacheFQFN)) {
+                       // Then include it
+                       require($this->classCacheFQFN);
+
+                       // Mark the class cache as loaded
+                       $this->classesCached = true;
+               } // END - if
+       }
+
+       /**
+        * The destructor makes it sure all caches got flushed
+        *
+        * @return      void
+        */
+       public function __destruct () {
+               // Skip here if dev-mode
+               if (defined('DEVELOPER')) return;
+
+               // Skip here if already cached
+               if ($this->listCached === false) {
+                       // Writes the cache file of our list away
+                       $cacheContent = serialize($this->classes);
+                       file_put_contents($this->listCacheFQFN, $cacheContent);
+               } // END - if
+
+               // Skip here if already cached
+               if ($this->classesCached === false) {
+                       // Generate a full-cache of all classes
+                       $cacheContent = "";
+                       foreach ($this->loadedClasses as $fqfn) {
+                               // Load the file
+                               $cacheContent .= file_get_contents($fqfn);
+                       } // END - foreach
+
+                       // And write it away
+                       file_put_contents($this->classCacheFQFN, $cacheContent);
+               } // END - if
+       }
+
+       /**
+        * Getter for an instance of this class
+        *
+        * @return      $selfInstance           An instance of this class
+        */
+       public final static function getInstance () {
+               // Is the instance there?
+               if (is_null(self::$selfInstance)) {
+                       // Get a new one
+                       self::$selfInstance = new ClassLoader(FrameworkConfiguration::getInstance());
+               } // END - if
+
+               // Return the instance
+               return self::$selfInstance;
+       }
+
+       /**
+        * Scans recursively a local path for class files which must have a prefix and a suffix as given by $this->suffix and $this->prefix
+        *
+        * @param       $basePath               The relative base path to 'base_path' constant for all classes
+        * @param       $ignoreList             An optional list (array or string) of directory names which shall be ignored
+        * @return      void
+        */
+       public function loadClasses ($basePath, $ignoreList = array() ) {
+               // Is a list has been restored from cache, don't read it again
+               if ($this->listCached === true) {
+                       // Abort here
+                       return;
+               }
+
+               // Convert string to array
+               if (!is_array($ignoreList)) $ignoreList = array($ignoreList);
+
+               // Directories which our class loader ignores by default while
+               // deep-scanning the directory structure. See scanLocalPath() for
+               // details.
+               $ignoreList[] = ".";
+               $ignoreList[] = "..";
+               $ignoreList[] = ".htaccess";
+               $ignoreList[] = ".svn";
+
+               // Keep it in class for later usage
+               $this->ignoreList = $ignoreList;
+
+               // Set base directory which holds all our classes, we should use an
+               // absolute path here so is_dir(), is_file() and so on will always
+               // find the correct files and dirs.
+               $basePath2 = realpath($basePath);
+
+               // If the basePath is false it is invalid
+               if ($basePath2 === false) {
+                       /* @todo: Do not die here. */
+                       die("Cannot read {$basePath} !");
+               } else {
+                       // Set base path
+                       $basePath = $basePath2;
+               }
+
+               // Get a new iterator
+               //* DEBUG: */ echo "<strong>Base path: {$basePath}</strong><br />\n";
+               $iterator = new RecursiveDirectoryIterator($basePath);
+               $recursive = new RecursiveIteratorIterator($iterator);
+               foreach ($recursive as $entry) {
+                       // Get filename from iterator
+                       $fileName = $entry->getFileName();
+
+                       // Is this file wanted?
+                       //* DEBUG: */ echo "FOUND:{$fileName}<br />\n";
+                       if ((!in_array($fileName, $this->ignoreList)) && (substr($fileName, 0, $this->prefixLen) == $this->prefix) && (substr($fileName, -$this->suffixLen, $this->suffixLen) == $this->suffix)) {
+                               // Get the FQFN and add it to our class list
+                               $fqfn = $entry->getRealPath();
+                               //* DEBUG: */ echo "ADD: {$fileName}<br />\n";
+                               $this->classes[$fileName] = $fqfn;
+                       } // END - if
+               } // END - foreach
+       }
+
+       /**
+        * Load extra config files
+        *
+        * @return      void
+        */
+       public function loadExtraConfigs () {
+               // Backup old prefix
+               $oldPrefix = $this->prefix;
+
+               // Set new prefix (temporary!)
+               $this->prefix = "config-";
+               $this->prefixLen = strlen($this->prefix);
+
+               // Set base directory
+               $basePath = sprintf("%sinc/config/", $this->cfgInstance->readConfig('base_path'));
+
+               // Load all classes from the config directory
+               $this->loadClasses($basePath);
+
+               // Include these extra configs now
+               $this->includeExtraConfigs();
+
+               // Set the prefix back
+               $this->prefix = $oldPrefix;
+               $this->prefixLen = strlen($this->prefix);
+
+       }
+
+       /**
+        * Tries to find the given class in our list. This method ignores silently
+        * missing classes or interfaces. So if you use class_exists() this method
+        * does not interrupt your program.
+        *
+        * @param       $className      The class we shall load
+        * @return      void
+        */
+       public function includeClass ($className) {
+               // Create a name with prefix and suffix
+               $fileName = $this->prefix . $className . $this->suffix;
+
+               // Now look it up in our index
+               if (isset($this->classes[$fileName])) {
+                       // File is found so load it only once
+                       //* DEBUG: */ echo "LOAD: ".$fileName." - Start<br />\n";
+                       require($this->classes[$fileName]);
+                       //* DEBUG: */ echo "LOAD: ".$fileName." - End<br />\n";
+
+                       // Count this include
+                       $this->total++;
+
+                       // Mark this class as loaded
+                       $this->loadedClasses[] = $this->classes[$fileName];
+
+                       // Developer mode excludes caching (better debugging)
+                       if (!defined('DEVELOPER')) {
+                               // Reset cache
+                               $this->classesCached = false;
+                       } // END - if
+               } // END - if
+       }
+
+       /**
+        * Includes all extra config files
+        *
+        * @return      void
+        */
+       private function includeExtraConfigs () {
+               // Run through all class names (should not be much)
+               foreach ($this->classes as $fileName => $fqfn) {
+                       // Is this a config?
+                       if (substr($fileName, 0, $this->prefixLen) == $this->prefix) {
+                               // Then include it
+                               require($fqfn);
+
+                               // Remove it from the list
+                               unset($this->classes[$fileName]);
+                       } // END - if
+               } // END - foreach
+       }
+
+       /**
+        * Getter for total include counter
+        *
+        * @return      $total  Total loaded include files
+        */
+       public final function getTotal () {
+               return $this->total;
+       }
+
+       /**
+        * Getter for a printable list of included classes/interfaces/exceptions
+        *
+        * @param       $includeList    A printable include list
+        */
+       public function getPrintableIncludeList () {
+               // Prepare the list
+               $includeList = "";
+               foreach ($this->loadedClasses as $classFile) {
+                       $includeList .= basename($classFile)."<br />\n";
+               } // END - foreach
+
+               // And return it
+               return $includeList;
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/output.php b/inc/output.php
new file mode 100644 (file)
index 0000000..83c1372
--- /dev/null
@@ -0,0 +1,32 @@
+<?php
+/**
+ * Initializes the output middleware layer
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+// Get a debugger instance
+$debug = DebugMiddleware::createDebugMiddleware(FrameworkConfiguration::getInstance()->readConfig('debug_class'));
+
+// Empty string should be ignored and used for testing the middleware
+DebugMiddleware::getInstance()->output("");
+
+// [EOF]
+?>
diff --git a/inc/selector.php b/inc/selector.php
new file mode 100644 (file)
index 0000000..d20cbcb
--- /dev/null
@@ -0,0 +1,68 @@
+<?php
+/**
+ * The application selector main include file
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+// Get config instance
+$cfg = FrameworkConfiguration::getInstance();
+
+// Try to load these includes in the given order
+$configAppIncludes = array(
+       sprintf("class_%s", $cfg->readConfig('app_helper_class')), // The ApplicationHelper class
+       "config",               // The application's own configuration
+       "data",                 // Application data
+       "init",                 // The application initializer
+       "loader",               // The application's class loader
+       "debug",                // Some debugging stuff
+       "exceptions",   // The application's own exception handler
+       "starter",              // The application starter (calls entryPoint(), etc.)
+);
+
+// Load them all (try only)
+foreach ($configAppIncludes as $inc) {
+       // Skip starter in test mode
+       if (($inc == "starter") && (defined('TEST'))) {
+               // Skip it here
+               continue;
+       }
+
+       // Generate a FQFN for the helper class
+       $fqfn = sprintf("%s%s/%s.php",
+               $cfg->readConfig('application_path'),
+               $cfg->readConfig('app_name'),
+               $inc
+       );
+
+       // Does the include file exists?
+       if ((file_exists($fqfn)) && (is_file($fqfn)) && (is_readable($fqfn))) {
+               // Load it
+               require_once($fqfn);
+       } elseif ($cfg->readConfig('verbose_level') > 0) {
+               // File is missing
+               trigger_error(sprintf("Cannot load application script %s.php! File is missing or read-protected.",
+                       $inc
+               ));
+       }
+}
+
+// [EOF]
+?>
diff --git a/templates/.htaccess b/templates/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/templates/_compiled/.htaccess b/templates/_compiled/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/templates/de/.htaccess b/templates/de/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/templates/de/code/.htaccess b/templates/de/code/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/templates/de/code/emergency_exit.ctp b/templates/de/code/emergency_exit.ctp
new file mode 100644 (file)
index 0000000..e974daf
--- /dev/null
@@ -0,0 +1,29 @@
+{?header:title="Problem in application framework detected!"?}
+
+<div id="emergency_message">
+       $content[message]
+</div>
+
+<div id="emergency_backtrace">
+       <div id="backtrace_header">
+               File inclusion backtrace:
+       </div>
+       <div id="backtrace_content">
+               $content[backtrace]
+       </div>
+</div>
+
+<div id="stats_box">
+       <div id="stats_header">
+               Statistics
+       </div>
+       <div id="stats_objects">
+               Total objects: $content[total_objects]
+       </div>
+       <div id="stats_includes">
+               Loaded class files: $content[total_includes]
+               <span class="hint">(Including exception and interfaces.)</span>
+       </div>
+</div>
+
+{?footer_msg:footer_msg="Please contact the support and supply the full above message, if you think you are not qualified to fix this problem."?}
diff --git a/templates/de/code/footer_msg.ctp b/templates/de/code/footer_msg.ctp
new file mode 100644 (file)
index 0000000..fb1de36
--- /dev/null
@@ -0,0 +1,8 @@
+       <div id="footer_message">
+               $content[footer_msg]
+       </div>
+
+</div> <!-- masterbox //-->
+
+</body>
+</html>
diff --git a/templates/de/code/header.ctp b/templates/de/code/header.ctp
new file mode 100644 (file)
index 0000000..9273026
--- /dev/null
@@ -0,0 +1,20 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="de" lang="de">
+<head>
+       <title>
+               {?title?}
+       </title>
+
+       <meta name="author" content="$config[meta_author]" />
+       <meta name="publisher" content="$config[meta_publisher]" />
+       <meta name="keywords" content="$config[meta_keywords]" />
+       <meta name="robots" content="index,follow" />
+       <meta name="description" content="$config[meta_description]" />
+       <meta http-equiv="content-type" content="text/html; charset={?header_charset?}" />
+       <meta http-equiv="content-style-type" content="text/css" />
+       <meta http-equiv="content-script-type" content="text/javascript" />
+       <meta http-equiv="language" content="de" />
+</head>
+
+<body>
+<div id="masterbox">
diff --git a/templates/de/html/.htaccess b/templates/de/html/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/templates/images/.htaccess b/templates/images/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/templates/images/_cache/.htaccess b/templates/images/_cache/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/templates/images/de/.htaccess b/templates/images/de/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/templates/images/de/image/.htaccess b/templates/images/de/image/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/templates/images/de/image/base_image.itp b/templates/images/de/image/base_image.itp
new file mode 100644 (file)
index 0000000..6501b56
--- /dev/null
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<image>
+       <type value="{?image_type?}" />
+       <base>
+               <name value="{?image_name?}" />
+       </base>
+       <resolution>
+               <width value="{?image_width?}" />
+               <height value="{?image_height?}" />
+       </resolution>
+       <background-color>
+               <red value="{?image_bg_red?}" />
+               <green value="{?image_bg_green?}" />
+               <blue value="{?image_bg_blue?}" />
+       </background-color>
+       <foreground-color>
+               <red value="{?image_fg_red?}" />
+               <green value="{?image_fg_green?}" />
+               <blue value="{?image_fg_blue?}" />
+       </foreground-color>
+       <image-string value="groupable">
+               <string-name value="{?image_string_name?}" />
+               <x value="{?image_x?}" />
+               <y value="{?image_y?}" />
+               <font-size value="{?image_size?}" />
+               <text value="{?image_string?}" />
+       </image-string>
+</image>
diff --git a/templates/images/de/image/emergency_exit.itp b/templates/images/de/image/emergency_exit.itp
new file mode 100644 (file)
index 0000000..f8abcd6
--- /dev/null
@@ -0,0 +1,40 @@
+<?php
+// Needed in every image template to initialy set the image type
+$helper = ImageHelper::createImageHelper($this, "png");
+$helper->setImageName("emergency_exit");
+$helper->setBaseImage("base_image");
+
+// Set image dimensions
+$helper->setWidth(250);
+$helper->setHeight(100);
+
+// Background and foreground color
+$helper->setBackgroundColorRedGreenBlue(0xA0, 0x00, 0x30);
+$helper->setForegroundColorRedGreenBlue(0xFF, 0xFF, 0xFF);
+
+// Add header line
+$helper->addTextLine("header");
+$helper->setCoord(48, 10);
+$helper->setFontSize(5);
+$helper->setImageString("Fehler-Code: {?code?}");
+
+// Add info line
+$helper->addTextLine("info");
+$helper->setCoord(108, 40);
+$helper->setFontSize(5);
+$helper->setImageString("Info:");
+
+// Add extra line
+$helper->addTextLine("extra");
+$helper->setCoord(10, 70);
+$helper->setFontSize(2);
+$helper->setImageString("{?extra?}");
+
+// Flush content to the template engine
+$helper->flushContent();
+
+// Comment this out if image is done
+//$this->debugInstance();
+
+// [EOF]
+?>
diff --git a/tests/ConfigTest.php b/tests/ConfigTest.php
new file mode 100644 (file)
index 0000000..7c70e61
--- /dev/null
@@ -0,0 +1,165 @@
+<?php
+print (basename(__FILE__).": Init...\n");
+
+// Change directory
+@chdir("..");
+
+// Load config file
+require(dirname(dirname(__FILE__)) . '/inc/config.php');
+
+// Load all include files
+require($cfg->readConfig('base_path') . 'inc/includes.php');
+
+// Load all game classes
+require($cfg->readConfig('base_path') . 'inc/classes.php');
+
+// Set default application
+FrameworkConfiguration::getInstance()->setConfigEntry('default_application', 'ship-simu');
+
+// Set testing mode (no starter.php will be loaded!)
+define('TEST_MODE', true);
+
+// Load the PHPUnit framework
+require_once('PHPUnit/Framework.php');
+
+print (basename(__FILE__).": Init completed.\n\n");
+
+/**
+ * A test case for the configuration sub system
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ * @see                        http://www.phpunit.de
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class ConfigTest extends PHPUnit_Framework_TestCase {
+       /**
+        * Tests the exception ConfigEntryNotFoundException if it is being thrown.
+        * Else the test shall fail
+        *
+        * @return      void
+        */
+       public function testConfigEntryNotFoundException () {
+               // Now try the test
+               $testPassed = false;
+               try {
+                       // Get a configuration instance
+                       $cfg = FrameworkConfiguration::getInstance();
+
+                       // Now find a configuration variable that does not exist
+                       $dummy = $cfg->readConfig('does_not_exist');
+               } catch (ConfigEntryNotFoundException $expected) {
+                       // This exception was expected, so it is fine
+                       $testPassed = true;
+               } catch (FrameworkException $unexptected) {
+                       // This exception was not expected!
+                       $this->fail(sprintf("Unexpected exception %s detected.", $unexpected->__toString()));
+               }
+
+               if (!$testPassed) {
+                       // This test went wrong
+                       $this->fail("Test of thrown exception ConfigEntryNotFoundException failed!");
+               }
+       }
+
+       /**
+        * Tests if the exception ConfigEntryIsEmptyException is being thrown by
+        * "emulating" an empty configuration variable.
+        *
+        * @return      void
+        */
+       public function testConfigEntryIsEmptyExceptionRead () {
+               // Now try the test
+               $testPassed = false;
+               try {
+                       // Get a configuration instance
+                       $cfg = FrameworkConfiguration::getInstance();
+
+                       // Try to read an empty configuration variable
+                       $dummy = $cfg->readConfig("");
+               } catch (ConfigEntryIsEmptyException $expected) {
+                       // This exception was expected, so it is fine
+                       $testPassed = true;
+               } catch (FrameworkException $unexptected) {
+                       // This exception was not expected!
+                       $this->fail(sprintf("Unexpected exception %s detected.", $unexpected->__toString()));
+               }
+
+               if (!$testPassed) {
+                       // This test went wrong
+                       $this->fail("Test of thrown exception ConfigEntryIsEmptyException failed!");
+               }
+       }
+
+       /**
+        * Tests if the exception ConfigEntryIsEmptyException is being thrown by
+        * "emulating" an empty configuration variable.
+        *
+        * @return      void
+        */
+       public function testConfigEntryIsEmptyExceptionWrite () {
+               // Now try the test
+               $testPassed = false;
+               try {
+                       // Get a configuration instance
+                       $cfg = FrameworkConfiguration::getInstance();
+
+                       // Try to read an empty configuration variable
+                       $cfg->setConfigEntry("", 'will_never_be_set');
+               } catch (ConfigEntryIsEmptyException $expected) {
+                       // This exception was expected, so it is fine
+                       $testPassed = true;
+               } catch (FrameworkException $unexptected) {
+                       // This exception was not expected!
+                       $this->fail(sprintf("Unexpected exception %s detected.", $unexpected->__toString()));
+               }
+
+               if (!$testPassed) {
+                       // This test went wrong
+                       $this->fail("Test of thrown exception ConfigEntryIsEmptyException failed!");
+               }
+       }
+
+       /**
+        * Tests if a set value can be returned from the configuration sub-system
+        *
+        * @return      void
+        */
+       public function testWriteReadConfigEntry () {
+               // Try it here
+               $value = "This is a test value";
+               try {
+                       // Get a configuration instance
+                       $cfg = FrameworkConfiguration::getInstance();
+
+                       // Try to read an empty configuration variable
+                       $cfg->setConfigEntry('test_key', "{$value}");
+
+                       // Read the config entry we have just written
+                       $readValue = $cfg->readConfig('test_key');
+
+                       // Now test the values
+                       $this->assertEquals($value, $readValue);
+               } catch (FrameworkException $unexptected) {
+                       // This exception was not expected!
+                       $this->fail(sprintf("Unexpected exception %s detected.", $unexpected->__toString()));
+               }
+       }
+}
+
+?>
diff --git a/tests/RegistryTest.php b/tests/RegistryTest.php
new file mode 100644 (file)
index 0000000..e4dc50e
--- /dev/null
@@ -0,0 +1,94 @@
+<?php
+print (basename(__FILE__).": Init...\n");
+
+// Change directory
+@chdir("..");
+
+// Load config file
+require(dirname(dirname(__FILE__)) . '/inc/config.php');
+
+// Load all include files
+require($cfg->readConfig('base_path') . 'inc/includes.php');
+
+// Load all game classes
+require($cfg->readConfig('base_path') . 'inc/classes.php');
+
+// Set default application
+FrameworkConfiguration::getInstance()->setConfigEntry('default_application', 'ship-simu');
+
+// Set testing mode (no starter.php will be loaded!)
+define('TEST_MODE', true);
+
+// Load the PHPUnit framework
+require_once('PHPUnit/Framework.php');
+
+print (basename(__FILE__).": Init completed.\n\n");
+
+/**
+ * A test case for the registry
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ * @see                        http://www.phpunit.de
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class RegistryTest extends PHPUnit_Framework_TestCase {
+       /**
+        * Tests if we can store an instance to the registry
+        *
+        * @return void
+        */
+       public function testInstanceRegistryAdd () {
+               // Get a registry instance
+               $registryInstance = Registry::getRegistry();
+
+               // Create a User instance
+               $userInstance = Member::createMemberByEmail("webmaster@ship-simu.org");
+
+               // Now store the instance in the registry
+               $registryInstance->addInstance('user', $userInstance);
+
+               // Test if the registry key is there
+               if (!$registryInstance->instanceExists('user')) {
+                       $this->fail("Registry test failed: Cannot locate our user instance in registry!");
+               }
+       }
+
+       /**
+        * Tests if we can store an instance to the registry
+        *
+        * @return void
+        */
+       public function testInstanceRegistryCompare () {
+               // Get a registry instance
+               $registryInstance = Registry::getRegistry();
+
+               // And get it back
+               $userInstance = $registryInstance->getInstance('user');
+
+               // Compare both unique keys
+               $testPassed = ($userInstance instanceof ManageableAccount);
+
+               // Test passed?
+               if (!$testPassed) {
+                       $this->fail("Registry test failed: Method getInstance() returned a non-object.");
+               }
+       }
+}
+
+?>
diff --git a/tests/RequestTest.php b/tests/RequestTest.php
new file mode 100644 (file)
index 0000000..0104f63
--- /dev/null
@@ -0,0 +1,102 @@
+<?php
+print (basename(__FILE__).": Init...\n");
+
+// Change directory
+@chdir("..");
+
+// Load config file
+require(dirname(dirname(__FILE__)) . '/inc/config.php');
+
+// Load all include files
+require($cfg->readConfig('base_path') . 'inc/includes.php');
+
+// Load all game classes
+require($cfg->readConfig('base_path') . 'inc/classes.php');
+
+// Set default application
+FrameworkConfiguration::getInstance()->setConfigEntry('default_application', 'ship-simu');
+
+// Set testing mode (no starter.php will be loaded!)
+define('TEST_MODE', true);
+
+// Load the PHPUnit framework
+require_once('PHPUnit/Framework.php');
+
+print (basename(__FILE__).": Init completed.\n\n");
+
+/**
+ * A test case for faked HTTP requests. This is faked because we *set*
+ * $_REQUEST here. This should be made better in PHP6... :(
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ * @see                        http://www.phpunit.de
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class RequestTest extends PHPUnit_Framework_TestCase {
+       /**
+        * A non-exist request element is being asked for. null is the expected
+        * result from the class
+        *
+        * @return      void
+        */
+       public function testMissingRequestElement () {
+               // Get a request instance
+               $requestInstance = HttpRequest::createHttpRequest();
+
+               // Get the element
+               $nonExist = $requestInstance->getRequestElement('never_there');
+
+               // Is this null?
+               if (!is_null($nonExist)) {
+                       // Is not null!
+                       $this->fail(sprintf("[%s:] Unexpected type %s received from request handler.",
+                               $requestInstance->__toString(),
+                               gettype($nonExists)
+                       ));
+               }
+       }
+
+       /**
+        * Now fake a request array and try the test on it again
+        *
+        * @return      void
+        */
+       public function testFakeRequestElement () {
+               // Fake the request here
+               $_REQUEST = array('test_key' => "test_value");
+
+               // Again get an instance
+               $requestInstance = HttpRequest::createHttpRequest();
+
+               // Get the element
+               $testValue = $requestInstance->getRequestElement('test_key');
+
+               // Is it the same?
+               if ($testValue !== "test_value") {
+                       // Something went wrong
+                       $this->fail(sprintf("[%s] Unexpected value %s (%s) from test key received.",
+                               $requestInstance->__toString(),
+                               $testValue,
+                               gettype($testValue)
+                       ));
+               }
+       }
+}
+
+?>
diff --git a/tests/Test.php b/tests/Test.php
new file mode 100644 (file)
index 0000000..7e5a551
--- /dev/null
@@ -0,0 +1,54 @@
+<?php
+print (basename(__FILE__).": Init...\n");
+
+// Change directory
+@chdir("..");
+
+// Load config file
+require(dirname(dirname(__FILE__)) . '/inc/config.php');
+
+// Load all include files
+require($cfg->readConfig('base_path') . 'inc/includes.php');
+
+// Load all game classes
+require($cfg->readConfig('base_path') . 'inc/classes.php');
+
+// Set default application
+FrameworkConfiguration::getInstance()->setConfigEntry('default_application', 'ship-simu');
+
+// Set testing mode (no starter.php will be loaded!)
+define('TEST_MODE', true);
+
+// Load the PHPUnit framework
+require_once('PHPUnit/Framework.php');
+
+print (basename(__FILE__).": Init completed.\n\n");
+die("You need to remove this line (".__LINE__.") and implement this test!\n");
+
+/**
+ * A test case for 
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ * @see                        http://www.phpunit.de
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class Test extends PHPUnit_Framework_TestCase {
+}
+
+?>
diff --git a/tests/all-tests.sh b/tests/all-tests.sh
new file mode 100644 (file)
index 0000000..13c704a
--- /dev/null
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+find -type f -name "*Test.php" -not -name "Test.php" -exec sh ./unittest.sh {} \;
diff --git a/tests/old/contract-test.php b/tests/old/contract-test.php
new file mode 100644 (file)
index 0000000..fd44cdf
--- /dev/null
@@ -0,0 +1,612 @@
+<?php
+// Change directory
+@chdir("../..");
+
+// Set testing mode (no starter.php will be loaded!)
+define('TEST_MODE', true);
+
+// Load config file
+require(dirname(dirname(dirname(__FILE__))) . "/inc/config.php");
+
+// Load all include files
+require($cfg->readConfig('base_path') . 'inc/includes.php');
+
+// Load all game classes
+require($cfg->readConfig('base_path') . 'inc/classes.php');
+
+// Load file I/O handler
+require($cfg->readConfig('base_path') . 'inc/file_io.php');
+
+// Load database layer
+require($cfg->readConfig('base_path') . 'inc/database.php');
+
+// Set default application
+FrameworkConfiguration::getInstance()->setConfigEntry('default_application', 'ship-simu');
+$application = 'ship-simu';
+
+// Load more includes
+require($cfg->readConfig('base_path') . 'application/ship-simu/loader.php');
+
+// Wir tun hier so, als waere schon das Reederei-Objekt generiert und wir wollen
+// jetzt die Personalliste wiederherstellen
+try {
+       $personell = SimulatorPersonell::createSimulatorPersonellByID('SimulatorPersonell@829292aeca3f6bf78c16e25fc4f75c98');
+} catch (InvalidIDFormatException $e) {
+       die(sprintf("[Main:] Could  not create personal list for follwing reason: <span class=\"exception_reason\">%s</span><br />\n",
+               $e->getMessage()
+       ));
+} catch (InvalidArrayCountException $e) {
+       die(sprintf("[Main:] Could  not create personal list for follwing reason: <span class=\"exception_reason\">%s</span><br />\n",
+               $e->getMessage()
+       ));
+} catch (NullPointerException $e) {
+       die(sprintf("[Main:] Could  not create personal list for follwing reason: <span class=\"exception_reason\">%s</span><br />\n",
+               $e->getMessage()
+       ));
+} catch (NoObjectException $e) {
+       die(sprintf("[Main:] Could  not create personal list for follwing reason: <span class=\"exception_reason\">%s</span><br />\n",
+               $e->getMessage()
+       ));
+} catch (MissingMethodException $e) {
+       die(sprintf("[Main:] Could  not create personal list for follwing reason: <span class=\"exception_reason\">%s</span><br />\n",
+               $e->getMessage()
+       ));
+} catch (FileIsEmptyException $e) {
+       die(sprintf("[Main:] Could  not create personal list for follwing reason: <span class=\"exception_reason\">%s</span><br />\n",
+               $e->getMessage()
+       ));
+} catch (FilePointerNotOpenedException $e) {
+       die(sprintf("[Main:] Could  not create personal list for follwing reason: <span class=\"exception_reason\">%s</span><br />\n",
+               $e->getMessage()
+       ));
+} catch (InvalidArrayCountException $e) {
+       die(sprintf("[Main:] Could  not create personal list for follwing reason: <span class=\"exception_reason\">%s</span><br />\n",
+               $e->getMessage()
+       ));
+} catch (InvalidMD5ChecksumException $e) {
+       die(sprintf("[Main:] Could  not create personal list for follwing reason: <span class=\"exception_reason\">%s</span><br />\n",
+               $e->getMessage()
+       ));
+} catch (InvalidDataLengthException $e) {
+       die(sprintf("[Main:] Could  not create personal list for follwing reason: <span class=\"exception_reason\">%s</span><br />\n",
+               $e->getMessage()
+       ));
+} catch (InvalidSimulatorIDException $e) {
+       die(sprintf("[Main:] Could  not create personal list for follwing reason: <span class=\"exception_reason\">%s</span><br />\n",
+               $e->getMessage()
+       ));
+} catch (MismatchingCompressorsException $e) {
+       die(sprintf("[Main:] Could  not create personal list for follwing reason: <span class=\"exception_reason\">%s</span><br />\n",
+               $e->getMessage()
+       ));
+} catch (ContainerItemIsNullException $e) {
+       die(sprintf("[Main:] Could  not create personal list for follwing reason: <span class=\"exception_reason\">%s</span><br />\n",
+               $e->getMessage()
+       ));
+} catch (ContainerItemIsNoArrayException $e) {
+       die(sprintf("[Main:] Could  not create personal list for follwing reason: <span class=\"exception_reason\">%s</span><br />\n",
+               $e->getMessage()
+       ));
+} catch (ContainerMaybeDamagedException $e) {
+       die(sprintf("[Main:] Could  not create personal list for follwing reason: <span class=\"exception_reason\">%s</span><br />\n",
+               $e->getMessage()
+       ));
+}
+
+// Personal-Objekt debuggen
+if (defined('DEBUG_PERSONELL_OBJ')) {
+       DebugMiddleware::getInstance()->output(sprintf("The personal object looks like this:<br />
+<pre>%s</pre>\n",
+               print_r($personell, true)
+       ));
+}
+
+// Hafen bauen
+$harbor = Harbor::createHarbor("Hamburger Hafen");
+
+// Name ausgeben
+DebugMiddleware::getInstance()->output(sprintf("Der <span class=\"exception_reason\">%s</span> ist gegr&uuml;ndet worden.<br />\n",
+       $harbor->getHarborName()
+));
+
+// Hafen-Objekt debuggen
+if (defined('DEBUG_HARBOR_OBJ')) {
+       DebugMiddleware::getInstance()->output(sprintf("Der <span class=\"exception_reason\">%s</span> sieht wie folgt aus:<br />
+<pre>%s</pre>\n",
+               $harbor->getHarborName(),
+               print_r($harbor, true)
+       ));
+}
+
+// Haendler gruenden
+$merchant = Merchant::createMerchant("Namenlos", $harbor);
+
+// Array mit Einbauten erstellen
+$einbauten = array(
+       'parts' => array(                       // *** Die zu einbauenden Schiffsteile ***
+               'Motor' => array(        // --- Maschinenraum mit Motor ---
+                       "Ocean-Power 2000", // Bezeichnung
+                       20000,              // Pferdestaerken
+                       6,                  // Anzahl Nocken
+                       2.5, 2, 3.5         // Abmasse (Breite/Hoehe/Laenge)
+               ),
+               'Bridge' => array(       // --- Kommandobruecke ---
+                       26, 2.5, 15         // Abmasse (Breite/Hoehe/Laenge)
+               ),
+               'CarDeck' => array(      // --- Autodecks ---
+                       'amount' => 8,      // Anzahl Autodecks (einige liegen hintereinander im selben Deck!)
+                       'dim'    => array(  // Abmessung (Breite/Hoehe/Laenge)
+                               6, 3, 16
+                       )
+               ),
+               'TruckDeck' => array(    // --- Decks fuer LKW/Busse haben vielleicht ein anderes Belueftgungssystem, etc. ---
+                       'amount' => 1,      // Anzahl der Decks
+                       'dim'    => array(  // Abmessung (Breite/Hoehe/Laenge)
+                               8, 5, 195      // Geht durchs gesamte Schiff!
+                       )
+               ),
+               'TrainDeck' => array(    // --- Decks fuer Zuege haben Schienen... ---
+                       'amount' => 1,      // Anzahl der Decks
+                       'dim'    => array(  // Abmessung (Breite/Hoehe/Laenge)
+                               8, 4, 195      // Geht durchs gesamte Schiff!
+                       )
+               ),
+               'LuxuryCabin' => array(  // --- Luxuskabinen ---
+                       'amount' => 20,     // Anzahl Luxuskabinen im Schiff
+                       'rooms'  => 4,      // Raeume: 2 Schlafzimmer, 1 Auffenthaltszimmer, 1 Bad mit Dusche/Toilette/Waschbecken
+                       'bed'    => 3,      // Anzahl Betten (1 Doppelbett 2 Einzelbetten, Doppel-/Einzelbetten in getrennte Raeume)
+                       'dim' => array(     // Abmessung der Luxuskabine (Breite/Hoehe/Laenge)
+                               4, 3, 5
+                       ),
+               ),
+               'PremierCabin' => array( // --- Mittlere Kabinen ---
+                       'amount' => 40,     // Anzahl
+                       'rooms'  => 2,      // Raeume: Schlafzimmer, Bad mit Toilette/Waschbecken
+                       'bed'    => 2,      // Anzahl Betten (1 Doppelbett, 1 Einzelbett; gemeinsamer Raum)
+                       'dim' => array(     // Abmessungen der Kabine (Breite/Hoehe/Laenge)
+                               4, 2.5, 4
+                       )
+               ),
+               'LowCabin' => array(     // --- Untere Kabinen (befinden sich in den Unterbauten) ---
+                       'amount' => 90,     // Anzahl
+                       'rooms'  => 1,      // Raeume: Schlafzimmer, Waschbecken
+                       'bed'    => 2,      // Anzahl Betten (2 Etagenbetten)
+                       'dim' => array(     // Abmessungen der Kabine (Breite/Hoehe/Laenge)
+                               3, 2.5, 4
+                       )
+               ),
+               'EconomyCabin' => array( // --- Unterste Kabinen (befinden sich tief unten im Schiffsbauch) ---
+                       'amount' => 140,    // Anzahl
+                       'rooms'  => 1,      // Raeume: Schlafzimmer, Waschbecken
+                       'bed'    => 1,      // Anzahl Betten (1 Etagenbett)
+                       'dim' => array(     // Abmessungen der Kabine (Breite/Hoehe/Laenge)
+                               2, 2.5, 2
+                       )
+               )
+       ),
+       'builds' => array(            // *** Welche Oberklasse verwendet werden sollen ***
+               'Motor'        => "MaschineRoom",
+               'Bridge'       => "BaseUpperStructure",
+               'LuxuryCabin'  => "BaseCabin",
+               'PremierCabin' => "BaseCabin",
+               'LowCabin'     => "BaseCabin",
+               'EconomyCabin' => "BaseCabin",
+               'CarDeck'      => "BaseDeck",
+               'TrainDeck'    => "BaseDeck",
+               'TruckDeck'    => "BaseDeck"
+       )
+);
+
+// Preisliste auffuellen
+foreach ($einbauten['parts'] as $key=>$part) {
+       // Create item array string
+       $item = "";
+       foreach ($part as $idx=>$itemPart) {
+               if (is_string($itemPart)) {
+                       // String found
+                       $item .= sprintf("\"%s\", ", $itemPart);
+               } elseif (is_int($itemPart)) {
+                       // Integer found
+                       $item .= sprintf("%d, ", $itemPart);
+               } elseif (is_float($itemPart)) {
+                       // Float found
+                       $item .= sprintf("%f, ", $itemPart);
+               } elseif (is_array($itemPart)) {
+                       // Sub-array found
+                       $item .= "array(";
+
+                       // Go all items through
+                       foreach ($itemPart as $idx2=>$subPart) {
+                               if (is_int($subPart)) {
+                                       // Integer again found
+                                       $item .= sprintf("%d, ", $subPart);
+                               } elseif (is_float($subPart)) {
+                                       // Float found
+                                       $item .= sprintf("%f, ", $subPart);
+                               } else {
+                                       // Unsupport part found
+                                       die(sprintf("[Main:] Unsupported sub-array element on pos <strong>%d</strong> in array <span class=\"exception_reason\">%s</span> found: <u>%s</u>", $idx2, $idx, $subPart));
+                               }
+                       }
+
+                       // Remove trailing comma
+                       $item = substr($item, 0, -2);
+
+                       // Add closing bracket
+                       $item .= "), ";
+               } else {
+                       // Unsupport part found
+                       die(sprintf("[Main:] Unsupported array element on pos <strong>%d</strong>: <u>%s</u>", $idx, $itemPart));
+               }
+       }
+
+       // Remove trailing comma
+       $item = substr($item, 0, -2);
+
+       // Random price
+       $price = mt_rand(5, 12) * 10000;
+
+       // Give it a try...
+       try {
+               // Generate command for adding objects to a price list
+               $eval = sprintf("\$merchant->addItemToPriceList(%s::create%s(%s), %d);",
+                       $key,
+                       $key,
+                       $item,
+                       $price
+               );
+
+               // Debug message
+               if ((defined('DEBUG_EVAL')) || (defined('DEBUG_ALL'))) DebugMiddleware::getInstance()->output(sprintf("[Main:] Konstruierte PHP-Anweisung: <pre><em>%s</em></pre><br />\n",
+                       htmlentities($eval)
+               ));
+
+               // Run the constructed command
+               eval($eval);
+       } catch (ItemNotTradeableException $e) {
+               die(sprintf("[Main:] Die Preisliste des H&auml;ndlers <span class=\"exception_reason\">%s</span> kann nicht bef&uuml;llt werden. Grund: <span class=\"exception_reason\">%s</span><br />\n",
+                       $merchant->getMerchantName(),
+                       $e->getMessage()
+               ));
+       }
+}
+
+// Haendler-Objekt debuggen
+if (defined('DEBUG_MERCHANT_OBJ')) {
+       DebugMiddleware::getInstance()->output(sprintf("Der H&auml;ndler <span class=\"exception_reason\">%s</span> sieht wie folgt aus:<br />
+<pre>%s</pre>\n",
+               $merchant->getMerchantName(),
+               print_r($merchant, true)
+       ));
+}
+
+// Reederei gruenden
+$shipping = ShippingCompany::createShippingCompany("Hanseatic Travel Company", $harbor);
+
+// Firmenschef setzen
+try {
+       $shipping->setCompanyFounder(CompanyEmployee::createCompanyEmployee("Roland", "H&auml;der", "M", 1977, 9, 26, true, 2000));
+} catch (BirthdayInvalidException $e) {
+       die(sprintf("[Main:] Reederei-Gr&uuml;nder konnte nicht gesetzt werden. Grund: <span class=\"exception_reason\">%s</span><br />\n",
+               $e->getMessage()
+       ));
+}
+
+// Dann mal ausgeben...
+DebugMiddleware::getInstance()->output(sprintf("Die Reederei <span class=\"exception_reason\">%s</span> ist von <strong>%s %s</strong> gegr&uuml;ndet worden.<br />\n",
+       $shipping->getCompanyName(),
+       $shipping->getFounderInstance()->getSurname(),
+       $shipping->getFounderInstance()->getFamily()
+));
+
+// Die Reederei stellt Personal ein und bedient sich an der $personell-Instanz
+try {
+       $shipping->recruitRandomEmployees(10, $personell);
+} catch (ToMuchEmployeesException $e) {
+       die(sprintf("[Main:] Die Reederei <span class=\"exception_reason\">%s</span> konnte kein Personal einstellen. Grund: <span class=\"exception_reason\">%s</span><br />\n",
+               $shipping->getCompanyName(),
+               $e->getMessage()
+       ));
+} catch (OutOfBoundsException $e) {
+       die(sprintf("[Main:] Die Reederei <span class=\"exception_reason\">%s</span> konnte kein Personal einstellen. Grund: <span class=\"exception_reason\">%s</span><br />\n",
+               $shipping->getCompanyName(),
+               $e->getMessage()
+       ));
+}
+
+// Anzahl Personal ausgeben
+DebugMiddleware::getInstance()->output(sprintf("Die Reederei <span class=\"exception_reason\">%s</span> hat nun <strong>%d</strong> weitere Mitarbeiter.<br />\n",
+       $shipping->getCompanyName(),
+       $shipping->getTotalEmployee()
+));
+
+// Dann die ersten 3 Werften in den Hafen einbauen und Personal zuweisen
+$shipping->createShipyardInHarbor("Werft 1", $harbor);
+$shipping->createShipyardInHarbor("Werft 2", $harbor);
+$shipping->createShipyardInHarbor("Werft 3", $harbor);
+
+// In alle Werften sollen Passagierschiffe gebaut werden koennen
+try {
+       $shipping->addShipTypeToAllShipyards("PassengerShip");
+} catch (ClassNotFoundException $e) {
+       die(sprintf("[Main:] Die Reederei <span class=\"exception_reason\">%s</span> kann ihre Werften nicht besch&auml;ftigen. Grund: <span class=\"exception_reason\">%s</span><br />\n",
+               $shipping->getCompanyName(),
+               $e->getMessage()
+       ));
+} catch (ClassMismatchException $e) {
+       die(sprintf("[Main:] Die Reederei <span class=\"exception_reason\">%s</span> kann ihre Werften nicht besch&auml;ftigen. Grund: <span class=\"exception_reason\">%s</span><br />\n",
+               $shipping->getCompanyName(),
+               $e->getMessage()
+       ));
+} catch (NoObjectException $e) {
+       die(sprintf("[Main:] Die Reederei <span class=\"exception_reason\">%s</span> kann ihre Werften nicht besch&auml;ftigen. Grund: <span class=\"exception_reason\">%s</span><br />\n",
+               $shipping->getCompanyName(),
+               $e->getMessage()
+       ));
+}
+
+// Personal auf die Werften verteilen
+try {
+       $shipping->distributeAllPersonellOnShipyards();
+} catch (NoShipyardsConstructedException $e) {
+       die(sprintf("[Main:] Die Reederei <span class=\"exception_reason\">%s</span> konnte kein Personal den Werften zuteilen. Grund: <span class=\"exception_reason\">%s</span><br />\n",
+               $shipping->getCompanyName(),
+               $e->getMessage()
+       ));
+} catch (ClassMismatchException $e) {
+       die(sprintf("[Main:] Die Reederei <span class=\"exception_reason\">%s</span> konnte kein Personal den Werften zuteilen. Grund: <span class=\"exception_reason\">%s</span><br />\n",
+               $shipping->getCompanyName(),
+               $e->getMessage()
+       ));
+} catch (NullPointerException $e) {
+       die(sprintf("[Main:] Die Reederei <span class=\"exception_reason\">%s</span> konnte kein Personal den Werften zuteilen. Grund: <span class=\"exception_reason\">%s</span><br />\n",
+               $shipping->getCompanyName(),
+               $e->getMessage()
+       ));
+} catch (NoObjectException $e) {
+       die(sprintf("[Main:] Die Reederei <span class=\"exception_reason\">%s</span> konnte kein Personal den Werften zuteilen. Grund: <span class=\"exception_reason\">%s</span><br />\n",
+               $shipping->getCompanyName(),
+               $e->getMessage()
+       ));
+}
+
+// Normale Meldung ausgeben
+DebugMiddleware::getInstance()->output(sprintf("Die Reederei <span class=\"exception_reason\">%s</span> besch&auml;ftigt nun ihre <strong>%d</strong> Mitarbeiter in <strong>%d</strong> Werft(en):<br />\n",
+       $shipping->getCompanyName(),
+       $shipping->getTotalEmployee(),
+       $shipping->getTotalShipyards()
+));
+
+// Dann nimmt die Reederei ihren ersten Bauauftrag entgegen.
+// Sie muss auch sich selber Bauauftraege erteilen!
+try {
+       $shipping->addNewWorksContract(WorksContract::createWorksContract("PassengerShip", "M/S Poseidon", $shipping));
+} catch (ClassNotFoundException $e) {
+       die(sprintf("[Main:] Der Bauauftrag konnte nicht erstellt werden. Grund: <span class=\"exception_reason\">%s</span><br />\n",
+               $e->getMessage()
+       ));
+} catch (NullPointerException $e) {
+       die(sprintf("[Main:] Der Bauauftrag konnte nicht erstellt werden. Grund: <span class=\"exception_reason\">%s</span><br />\n",
+               $e->getMessage()
+       ));
+} catch (NoObjectException $e) {
+       die(sprintf("[Main:] Der Bauauftrag konnte nicht erstellt werden. Grund: <span class=\"exception_reason\">%s</span><br />\n",
+               $e->getMessage()
+       ));
+} catch (MissingMethodException $e) {
+       die(sprintf("[Main:] Der Bauauftrag konnte nicht erstellt werden. Grund: <span class=\"exception_reason\">%s</span><br />\n",
+               $e->getMessage()
+       ));
+} catch (EmptyStructuresListException $e) {
+       die(sprintf("[Main:] Der Bauauftrag konnte nicht erstellt werden. Grund: <span class=\"exception_reason\">%s</span><br />\n",
+               $e->getMessage()
+       ));
+}
+
+// Auftrag-Instanz holen
+$contract = $shipping->getLastContractInstance();
+
+// Die Reederei hat einen Haendler gewaehlt
+try {
+       $shipping->setMerchantInstance($merchant);
+} catch (NullPointerException $e) {
+       die(sprintf("[Main:] Der H&auml;ndler <span class=\"exception_reason\">%s</span> konnte nicht ausgew&auml;hlt werden. Grund: <span class=\"exception_reason\">%s</span><br />\n",
+               $merchant->getMerchantName(),
+               $e->getMessage()
+       ));
+} catch (NoObjectException $e) {
+       die(sprintf("[Main:] Der H&auml;ndler <span class=\"exception_reason\">%s</span> konnte nicht ausgew&auml;hlt werden. Grund: <span class=\"exception_reason\">%s</span><br />\n",
+               $merchant->getMerchantName(),
+               $e->getMessage()
+       ));
+} catch (ClassMismatchException $e) {
+       die(sprintf("[Main:] Der H&auml;ndler <span class=\"exception_reason\">%s</span> konnte nicht ausgew&auml;hlt werden. Grund: <span class=\"exception_reason\">%s</span><br />\n",
+               $merchant->getMerchantName(),
+               $e->getMessage()
+       ));
+}
+
+// Den Bauauftrag mit der Reederei abgleichen, ob sie den Schiffstyp bauen koennen
+try {
+       $typeValid = $shipping->validateWorksContractShipType($contract);
+} catch (NullPointerException $e) {
+       die(sprintf("[Main:] Die Reederei <span class=\"exception_reason\">%s</span> konnte den Bauauftrag nicht validieren. Grund: <span class=\"exception_reason\">%s</span><br />\n",
+               $shipping->getCompanyName(),
+               $e->getMessage()
+       ));
+} catch (NoObjectException $e) {
+       die(sprintf("[Main:] Die Reederei <span class=\"exception_reason\">%s</span> konnte den Bauauftrag nicht validieren. Grund: <span class=\"exception_reason\">%s</span><br />\n",
+               $shipping->getCompanyName(),
+               $e->getMessage()
+       ));
+}
+
+// Kann gebaut werden?
+if ($typeValid) {
+       DebugMiddleware::getInstance()->output(sprintf("Die Reederei <span class=\"exception_reason\">%s</span> kann Schiffe vom Typ <span class=\"exception_reason\">%s</span> bauen.<br />\n",
+               $shipping->getCompanyName(),
+               $contract->getShipInstance()->getObjectDescription()
+       ));
+} else {
+       DebugMiddleware::getInstance()->output(sprintf("Die Reederei <span class=\"exception_reason\">%s</span> kann keine Schiffe vom Typ <span class=\"exception_reason\">%s</span> bauen!<br />\n",
+               $shipping->getCompanyName(),
+               $contract->getShipInstance()->getObjectDescription()
+       ));
+       exit;
+}
+
+// Dann den Bauauftrag verfeinern
+foreach ($einbauten['parts'] as $key=>$part) {
+       try {
+               $contract->addContractDetails($key, $einbauten['builds'][$key], $part);
+       } catch (ShipPartNotConstructableException $e) {
+               // Output message
+               die($e->getMessage());
+       } catch (ShipNotConstructedException $e) {
+               // Output message
+               die($e->getMessage());
+       } catch (ItemNotInPriceListException $e) {
+               die(sprintf("[Main:] Der Artikel <span class=\"exception_reason\">%s</span> konnte nicht in der Preisliste gefunden werden. Grund: <span class=\"exception_reason\">%s</span><br />\n",
+                       $key,
+                       $e->getMessage()
+               ));
+       } catch (InvalidArrayCountException $e) {
+               die(sprintf("[Main:] Der Artikel <span class=\"exception_reason\">%s</span> konnte nicht in der Preisliste gefunden werden. Grund: <span class=\"exception_reason\">%s</span><br />\n",
+                       $key,
+                       $e->getMessage()
+               ));
+       }
+}
+
+// Reederei-Objekt ausgeben
+if (defined('DEBUG_COMPANY_OBJ')) {
+       DebugMiddleware::getInstance()->output(sprintf("Die Reederei <span class=\"exception_reason\">%s</span> sieht wie folgt aus:<br />
+<pre>%s</pre>\n",
+               $shipping->getCompanyName(),
+               print_r($shipping, true)
+       ));
+}
+
+// Clean up a little
+unset($einbauten);
+unset($part);
+unset($eval);
+unset($item);
+unset($key);
+unset($typeValid);
+
+// Gesamtwert ausgeben
+try {
+       $totalValue = $contract->getTotalPrice();
+} catch (NullPointerException $e) {
+       die(sprintf("[Main:] Gesamtbestellwert nicht ermittelbar. Grund: <span class=\"exception_reason\">%s</span><br />\n",
+               $e->getMessage()
+       ));
+} catch (NoObjectException $e) {
+       die(sprintf("[Main:] Gesamtbestellwert nicht ermittelbar. Grund: <span class=\"exception_reason\">%s</span><br />\n",
+               $e->getMessage()
+       ));
+} catch (MissingMethodException $e) {
+       die(sprintf("[Main:] Gesamtbestellwert nicht ermittelbar. Grund: <span class=\"exception_reason\">%s</span><br />\n",
+               $e->getMessage()
+       ));
+} catch (EmptyStructuresListException $e) {
+       die(sprintf("[Main:] Gesamtbestellwert nicht ermittelbar. Grund: <span class=\"exception_reason\">%s</span><br />\n",
+               $e->getMessage()
+       ));
+} catch (TotalPriceNotCalculatedException $e) {
+       die(sprintf("[Main:] Gesamtbestellwert nicht ermittelbar. Grund: <span class=\"exception_reason\">%s</span><br />\n",
+               $e->getMessage()
+       ));
+}
+
+// Wert ausgeben
+DebugMiddleware::getInstance()->output(sprintf("Der Bau der <span class=\"exception_reason\">%s</span> wird der Reederei <span class=\"exception_reason\">%s</span> voraussichtlich <span class=\"exception_reason\">%s</span> kosten.<br />\n",
+       $contract->getShipInstance()->getShipName(),
+       $shipping->getCompanyName(),
+       $contract->formatCurrency($totalValue)
+));
+
+// Clean up a little
+unset($totalValue);
+
+// Den Bauvertrag unterschreiben (damit wird er in den Bau-Queue aufgenommen)
+try {
+       $shipping->signContract($contract, $shipping);
+} catch (NullPointerException $e) {
+       die(sprintf("[Main:] The shipping company <span class=\"exception_reason\">%s</span> was not able to sign the contract for the following reason: <span class=\"exception_reason\">%s</span><br />\n",
+               $shipping->getCompanyName(),
+               $e->getMessage()
+       ));
+} catch (NoObjectException $e) {
+       die(sprintf("[Main:] The shipping company <span class=\"exception_reason\">%s</span> was not able to sign the contract for the following reason: <span class=\"exception_reason\">%s</span><br />\n",
+               $shipping->getCompanyName(),
+               $e->getMessage()
+       ));
+} catch (MissingMethodException $e) {
+       die(sprintf("[Main:] The shipping company <span class=\"exception_reason\">%s</span> was not able to sign the contract for the following reason: <span class=\"exception_reason\">%s</span><br />\n",
+               $shipping->getCompanyName(),
+               $e->getMessage()
+       ));
+} catch (InvalidContractPartnerException $e) {
+       die(sprintf("[Main:] The shipping company <span class=\"exception_reason\">%s</span> was not able to sign the contract for the following reason: <span class=\"exception_reason\">%s</span><br />\n",
+               $shipping->getCompanyName(),
+               $e->getMessage()
+       ));
+} catch (ContractAllreadySignedException $e) {
+       die(sprintf("[Main:] The shipping company <span class=\"exception_reason\">%s</span> was not able to sign the contract for the following reason: <span class=\"exception_reason\">%s</span><br />\n",
+               $shipping->getCompanyName(),
+               $e->getMessage()
+       ));
+} catch (WrongContractPartnerException $e) {
+       die(sprintf("[Main:] The shipping company <span class=\"exception_reason\">%s</span> was not able to sign the contract for the following reason: <span class=\"exception_reason\">%s</span><br />\n",
+               $shipping->getCompanyName(),
+               $e->getMessage()
+       ));
+}
+
+// Meldung ausgeben
+if ($contract->isSigned()) {
+       DebugMiddleware::getInstance()->output(sprintf("Die Reederei <span class=\"exception_reason\">%s</span> hat den Bau der <span class=\"exception_reason\">%s</span> zugestimmt.<br />\n",
+               $shipping->getCompanyName(),
+               $contract->getShipInstance()->getShipName()
+       ));
+} else {
+       DebugMiddleware::getInstance()->output(sprintf("Die Reederei <span class=\"exception_reason\">%s</span> hat den Bau der <span class=\"exception_reason\">%s</span> abgelehnt.<br />\n",
+               $shipping->getCompanyName(),
+               $contract->getShipInstance()->getShipName()
+       ));
+       exit;
+}
+
+// Auftrag-Objekt ausgeben
+if (defined('DEBUG_CONTRACT_OBJ')) {
+       DebugMiddleware::getInstance()->output(sprintf("Der Bauauftrag sieht wie folgt aus:<br />
+<pre>%s</pre>\n",
+               print_r($contract, true)
+       ));
+}
+
+// Erstmal bis hier hin...
+//exit();
+
+// Anzahl Betten ermitteln
+try {
+       $totalBeds = $contract->getShipInstance()->calcTotalBeds();
+} catch (StructuresOutOfBoundsException $e) {
+       die(sprintf("[Main:] Anzahl Betten konnten nicht ermittelt werden. Grund: <span class=\"exception_reason\">%s</span><br />\n",
+               $e->getMessage()
+       ));
+} catch (EmptyStructuresListException $e) {
+       die(sprintf("[Main:] Anzahl Betten konnten nicht ermittelt werden. Grund: <span class=\"exception_reason\">%s</span><br />\n",
+               $e->getMessage()
+       ));
+}
+
+// Bettenanzahl ausgeben
+DebugMiddleware::getInstance()->output(sprintf("Es stehen <strong>%d</strong> Betten zur Verf&uuml;gung.",
+       $totalBeds
+));
+
+//
+?>
diff --git a/tests/old/loader-test.php b/tests/old/loader-test.php
new file mode 100644 (file)
index 0000000..f87b31a
--- /dev/null
@@ -0,0 +1,162 @@
+<?php
+// Change directory
+@chdir("../..");
+
+// Set testing mode (no starter.php will be loaded!)
+define('TEST_MODE', true);
+
+// Load config file
+require(dirname(dirname(dirname(__FILE__))) . "/inc/config.php");
+
+// Load all include files
+require($cfg->readConfig('base_path') . 'inc/includes.php');
+
+// Load all game classes
+require($cfg->readConfig('base_path') . 'inc/classes.php');
+
+// Load file I/O handler
+require($cfg->readConfig('base_path') . 'inc/file_io.php');
+
+// Load database layer
+require($cfg->readConfig('base_path') . 'inc/database.php');
+
+// Set default application
+FrameworkConfiguration::getInstance()->setConfigEntry('default_application', 'ship-simu');
+$application = 'ship-simu';
+
+// Load more includes
+require($cfg->readConfig('base_path') . 'application/ship-simu/loader.php');
+
+// Wir tun hier so, als waere schon das Reederei-Objekt generiert und wir wollen
+// jetzt die Personalliste wiederherstellen
+try {
+       $personell = SimulatorPersonell::createSimulatorPersonellByID('SimulatorPersonell@829292aeca3f6bf78c16e25fc4f75c98');
+} catch (InvalidIDFormatException $e) {
+       die(sprintf("[Main:] Could  not create personal list for follwing reason: <span class=\"exception_reason\">%s</span><br />\n",
+               $e->getMessage()
+       ));
+} catch (InvalidArrayCountException $e) {
+       die(sprintf("[Main:] Could  not create personal list for follwing reason: <span class=\"exception_reason\">%s</span><br />\n",
+               $e->getMessage()
+       ));
+} catch (NullPointerException $e) {
+       die(sprintf("[Main:] Could  not create personal list for follwing reason: <span class=\"exception_reason\">%s</span><br />\n",
+               $e->getMessage()
+       ));
+} catch (NoObjectException $e) {
+       die(sprintf("[Main:] Could  not create personal list for follwing reason: <span class=\"exception_reason\">%s</span><br />\n",
+               $e->getMessage()
+       ));
+} catch (MissingMethodException $e) {
+       die(sprintf("[Main:] Could  not create personal list for follwing reason: <span class=\"exception_reason\">%s</span><br />\n",
+               $e->getMessage()
+       ));
+} catch (FileIsEmptyException $e) {
+       die(sprintf("[Main:] Could  not create personal list for follwing reason: <span class=\"exception_reason\">%s</span><br />\n",
+               $e->getMessage()
+       ));
+} catch (FilePointerNotOpenedException $e) {
+       die(sprintf("[Main:] Could  not create personal list for follwing reason: <span class=\"exception_reason\">%s</span><br />\n",
+               $e->getMessage()
+       ));
+} catch (InvalidArrayCountException $e) {
+       die(sprintf("[Main:] Could  not create personal list for follwing reason: <span class=\"exception_reason\">%s</span><br />\n",
+               $e->getMessage()
+       ));
+} catch (InvalidMD5ChecksumException $e) {
+       die(sprintf("[Main:] Could  not create personal list for follwing reason: <span class=\"exception_reason\">%s</span><br />\n",
+               $e->getMessage()
+       ));
+} catch (InvalidDataLengthException $e) {
+       die(sprintf("[Main:] Could  not create personal list for follwing reason: <span class=\"exception_reason\">%s</span><br />\n",
+               $e->getMessage()
+       ));
+} catch (InvalidSimulatorIDException $e) {
+       die(sprintf("[Main:] Could  not create personal list for follwing reason: <span class=\"exception_reason\">%s</span><br />\n",
+               $e->getMessage()
+       ));
+} catch (MismatchingCompressorsException $e) {
+       die(sprintf("[Main:] Could  not create personal list for follwing reason: <span class=\"exception_reason\">%s</span><br />\n",
+               $e->getMessage()
+       ));
+} catch (ContainerItemIsNullException $e) {
+       die(sprintf("[Main:] Could  not create personal list for follwing reason: <span class=\"exception_reason\">%s</span><br />\n",
+               $e->getMessage()
+       ));
+} catch (ContainerItemIsNoArrayException $e) {
+       die(sprintf("[Main:] Could  not create personal list for follwing reason: <span class=\"exception_reason\">%s</span><br />\n",
+               $e->getMessage()
+       ));
+} catch (ContainerMaybeDamagedException $e) {
+       die(sprintf("[Main:] Could  not create personal list for follwing reason: <span class=\"exception_reason\">%s</span><br />\n",
+               $e->getMessage()
+       ));
+}
+
+// Personal-Objekt debuggen
+if (defined('DEBUG_PERSONELL_OBJ')) {
+       DebugMiddleware::getInstance()->output(sprintf("The personal object looks like this:<br />
+<pre>%s</pre>\n",
+               print_r($personell, true)
+       ));
+}
+
+// Erstmal bis hier hin
+exit();
+
+// Etwas zum Testen...
+try {
+       $personell = SimulatorPersonell::createSimulatorPersonell(20);
+} catch (NullPointerException $e) {
+       die(sprintf("[Main:] Personal list not created for following reason: <span class=\"exception_reason\">%s</span><br />\n",
+               $e->getMessage()
+       ));
+} catch (NoObjectException $e) {
+       die(sprintf("[Main:] Personal list not created for following reason: <span class=\"exception_reason\">%s</span><br />\n",
+               $e->getMessage()
+       ));
+} catch (MissingMethodException $e) {
+       die(sprintf("[Main:] Personal list not created for following reason: <span class=\"exception_reason\">%s</span><br />\n",
+               $e->getMessage()
+       ));
+}
+
+// Personal-Objekt debuggen
+if (defined('DEBUG_PERSONELL_OBJ')) {
+       DebugMiddleware::getInstance()->output(sprintf("The personal object looks like this:<br />
+<pre>%s</pre>\n",
+               print_r($personell, true)
+       ));
+}
+
+// Try to save the object (for testing purposes)
+try {
+       $personell->saveObjectToDatabase();
+} catch (NullPointerException $e) {
+       die(sprintf("[Main:] Object not saved for following reason: <span class=\"exception_reason\">%s</span><br />\n",
+               $e->getMessage()
+       ));
+} catch (NoObjectException $e) {
+       die(sprintf("[Main:] Object not saved for following reason: <span class=\"exception_reason\">%s</span><br />\n",
+               $e->getMessage()
+       ));
+} catch (InvalidObjectException $e) {
+       die(sprintf("[Main:] Object not saved for following reason: <span class=\"exception_reason\">%s</span><br />\n",
+               $e->getMessage()
+       ));
+} catch (MissingMethodException $e) {
+       die(sprintf("[Main:] Object not saved for following reason: <span class=\"exception_reason\">%s</span><br />\n",
+               $e->getMessage()
+       ));
+} catch (UnsupportedLimitationPartException $e) {
+       die(sprintf("[Main:] Object not saved for following reason: <span class=\"exception_reason\">%s</span><br />\n",
+               $e->getMessage()
+       ));
+} catch (InvalidArrayCountException $e) {
+       die(sprintf("[Main:] Object not saved for following reason: <span class=\"exception_reason\">%s</span><br />\n",
+               $e->getMessage()
+       ));
+}
+
+//
+?>
diff --git a/tests/old/personell-test.php b/tests/old/personell-test.php
new file mode 100644 (file)
index 0000000..622c2c7
--- /dev/null
@@ -0,0 +1,162 @@
+<?php
+// Change directory
+@chdir("../..");
+
+// Set testing mode (no starter.php will be loaded!)
+define('TEST_MODE', true);
+
+// Load config file
+require(dirname(dirname(dirname(__FILE__))) . "/inc/config.php");
+
+// Load all include files
+require($cfg->readConfig('base_path') . 'inc/includes.php');
+
+// Load all game classes
+require($cfg->readConfig('base_path') . 'inc/classes.php');
+
+// Load file I/O handler
+require($cfg->readConfig('base_path') . 'inc/file_io.php');
+
+// Load database layer
+require($cfg->readConfig('base_path') . 'inc/database.php');
+
+// Set default application
+FrameworkConfiguration::getInstance()->setConfigEntry('default_application', 'ship-simu');
+$application = 'ship-simu';
+
+// Load more includes
+require($cfg->readConfig('base_path') . 'application/ship-simu/loader.php');
+
+// Wir tun hier so, als waere schon das Reederei-Objekt generiert und wir wollen
+// jetzt die Personalliste wiederherstellen
+try {
+       $personell = SimulatorPersonell::createSimulatorPersonellByID('SimulatorPersonell@829292aeca3f6bf78c16e25fc4f75c98');
+} catch (InvalidIDFormatException $e) {
+       die(sprintf("[Main:] Could  not create personal list for follwing reason: <span class=\"exception_reason\">%s</span><br />\n",
+               $e->getMessage()
+       ));
+} catch (InvalidArrayCountException $e) {
+       die(sprintf("[Main:] Could  not create personal list for follwing reason: <span class=\"exception_reason\">%s</span><br />\n",
+               $e->getMessage()
+       ));
+} catch (NullPointerException $e) {
+       die(sprintf("[Main:] Could  not create personal list for follwing reason: <span class=\"exception_reason\">%s</span><br />\n",
+               $e->getMessage()
+       ));
+} catch (NoObjectException $e) {
+       die(sprintf("[Main:] Could  not create personal list for follwing reason: <span class=\"exception_reason\">%s</span><br />\n",
+               $e->getMessage()
+       ));
+} catch (MissingMethodException $e) {
+       die(sprintf("[Main:] Could  not create personal list for follwing reason: <span class=\"exception_reason\">%s</span><br />\n",
+               $e->getMessage()
+       ));
+} catch (FileIsEmptyException $e) {
+       die(sprintf("[Main:] Could  not create personal list for follwing reason: <span class=\"exception_reason\">%s</span><br />\n",
+               $e->getMessage()
+       ));
+} catch (FilePointerNotOpenedException $e) {
+       die(sprintf("[Main:] Could  not create personal list for follwing reason: <span class=\"exception_reason\">%s</span><br />\n",
+               $e->getMessage()
+       ));
+} catch (InvalidArrayCountException $e) {
+       die(sprintf("[Main:] Could  not create personal list for follwing reason: <span class=\"exception_reason\">%s</span><br />\n",
+               $e->getMessage()
+       ));
+} catch (InvalidMD5ChecksumException $e) {
+       die(sprintf("[Main:] Could  not create personal list for follwing reason: <span class=\"exception_reason\">%s</span><br />\n",
+               $e->getMessage()
+       ));
+} catch (InvalidDataLengthException $e) {
+       die(sprintf("[Main:] Could  not create personal list for follwing reason: <span class=\"exception_reason\">%s</span><br />\n",
+               $e->getMessage()
+       ));
+} catch (InvalidSimulatorIDException $e) {
+       die(sprintf("[Main:] Could  not create personal list for follwing reason: <span class=\"exception_reason\">%s</span><br />\n",
+               $e->getMessage()
+       ));
+} catch (MismatchingCompressorsException $e) {
+       die(sprintf("[Main:] Could  not create personal list for follwing reason: <span class=\"exception_reason\">%s</span><br />\n",
+               $e->getMessage()
+       ));
+} catch (ContainerItemIsNullException $e) {
+       die(sprintf("[Main:] Could  not create personal list for follwing reason: <span class=\"exception_reason\">%s</span><br />\n",
+               $e->getMessage()
+       ));
+} catch (ContainerItemIsNoArrayException $e) {
+       die(sprintf("[Main:] Could  not create personal list for follwing reason: <span class=\"exception_reason\">%s</span><br />\n",
+               $e->getMessage()
+       ));
+} catch (ContainerMaybeDamagedException $e) {
+       die(sprintf("[Main:] Could  not create personal list for follwing reason: <span class=\"exception_reason\">%s</span><br />\n",
+               $e->getMessage()
+       ));
+}
+
+// Personal-Objekt debuggen
+if (defined('DEBUG_PERSONELL_OBJ')) {
+       echo sprintf("The personal object looks like this:<br />
+<pre>%s</pre>\n",
+               print_r($personell, true)
+       );
+}
+
+// Erstmal bis hier hin
+exit();
+
+// Etwas zum Testen...
+try {
+       $personell = SimulatorPersonell::createSimulatorPersonell(20);
+} catch (NullPointerException $e) {
+       die(sprintf("[Main:] Personal list not created for following reason: <span class=\"exception_reason\">%s</span><br />\n",
+               $e->getMessage()
+       ));
+} catch (NoObjectException $e) {
+       die(sprintf("[Main:] Personal list not created for following reason: <span class=\"exception_reason\">%s</span><br />\n",
+               $e->getMessage()
+       ));
+} catch (MissingMethodException $e) {
+       die(sprintf("[Main:] Personal list not created for following reason: <span class=\"exception_reason\">%s</span><br />\n",
+               $e->getMessage()
+       ));
+}
+
+// Personal-Objekt debuggen
+if (defined('DEBUG_PERSONELL_OBJ')) {
+       echo sprintf("The personal object looks like this:<br />
+<pre>%s</pre>\n",
+               print_r($personell, true)
+       );
+}
+
+// Try to save the object (for testing purposes)
+try {
+       $personell->saveObjectToDatabase();
+} catch (NullPointerException $e) {
+       die(sprintf("[Main:] Object not saved for following reason: <span class=\"exception_reason\">%s</span><br />\n",
+               $e->getMessage()
+       ));
+} catch (NoObjectException $e) {
+       die(sprintf("[Main:] Object not saved for following reason: <span class=\"exception_reason\">%s</span><br />\n",
+               $e->getMessage()
+       ));
+} catch (InvalidObjectException $e) {
+       die(sprintf("[Main:] Object not saved for following reason: <span class=\"exception_reason\">%s</span><br />\n",
+               $e->getMessage()
+       ));
+} catch (MissingMethodException $e) {
+       die(sprintf("[Main:] Object not saved for following reason: <span class=\"exception_reason\">%s</span><br />\n",
+               $e->getMessage()
+       ));
+} catch (UnsupportedLimitationPartException $e) {
+       die(sprintf("[Main:] Object not saved for following reason: <span class=\"exception_reason\">%s</span><br />\n",
+               $e->getMessage()
+       ));
+} catch (InvalidArrayCountException $e) {
+       die(sprintf("[Main:] Object not saved for following reason: <span class=\"exception_reason\">%s</span><br />\n",
+               $e->getMessage()
+       ));
+}
+
+//
+?>
diff --git a/tests/unittest.sh b/tests/unittest.sh
new file mode 100644 (file)
index 0000000..18e210c
--- /dev/null
@@ -0,0 +1,5 @@
+#!/bin/sh
+
+FILE=`echo $1 | cut -d "/" -f 2`
+
+phpunit --wait $FILE