* text=auto !eol
/Doxyfile -text
+application/install/.htaccess -text
+application/install/class_ApplicationHelper.php -text
+application/install/config.php -text
+application/install/data.php -text
+application/install/debug.php -text
+application/install/exceptions.php -text
+application/install/exceptions/.htaccess -text
+application/install/init.php -text
+application/install/interfaces/.htaccess -text
+application/install/loader.php -text
+application/install/main/.htaccess -text
+application/install/main/actions/.htaccess -text
+application/install/main/actions/class_ -text
+application/install/main/actions/class_BaseInstallAction.php -text
+application/install/main/actions/web/.htaccess -text
+application/install/main/class_ -text
+application/install/main/commands/.htaccess -text
+application/install/main/commands/web/.htaccess -text
+application/install/main/commands/web/failed/.htaccess -text
+application/install/main/commands/web/failed/class_WebInstallFailedCommand.php -text
+application/install/main/controller/.htaccess -text
+application/install/main/controller/web/.htaccess -text
+application/install/main/controller/web/class_WebInstallFailedController.php -text
+application/install/main/filter/.htaccess -text
+application/install/main/filter/class_ -text
+application/install/main/filter/class_BaseInstallFilter.php -text
+application/install/main/filter/install/.htaccess -text
+application/install/starter.php -text
+application/install/templates/.htaccess -text
+application/install/templates/de/.htaccess -text
+application/install/templates/de/code/footer.ctp -text
+application/install/templates/de/code/header.ctp -text
+application/install/templates/de/code/home.ctp -text
+application/install/templates/de/code/install_main.ctp -text
+application/install/templates/de/code/mail_debug.ctp -text
+application/install/templates/de/emails/.htaccess -text
+application/install/templates/de/emails/text_resend_link.tpl -text
+application/install/templates/de/html/.htaccess -text
+application/install/templates/de/html/nav_advert.tpl -text
+application/install/templates/de/html/selector_ship-simu.tpl -text
+application/install/templates/images/.htaccess -text
+application/install/templates/images/_cache/.htaccess -text
+application/install/templates/images/de/.htaccess -text
+application/install/templates/images/de/image/.htaccess -text
+application/install/templates/images/de/image/base_code.itp -text
+application/install/templates/images/de/image/code_captcha.itp -text
/clear-cache.sh -text
db/.htaccess -text
docs/COPYING -text
--- /dev/null
+Deny from all
--- /dev/null
+<?php
+/**
+ * A class holding general data about the application and some methods for
+ * the management including the entry point.
+ *
+ * E.g.:
+ *
+ * index.php?app=my_app
+ *
+ * You need to create a folder in the folder "application" named "my_app"
+ * (without the quotes) and create a include file called
+ * class_ApplicationHelper.php. You have to write the same class for your
+ * application and implement the same interface called ManageableApplication
+ * because this class include file will be searched for.
+ *
+ * It is good when you avoid more GET parameters to keep URLs short and sweet.
+ * But sometimes you need some GET paramerers e.g. for your imprint or info page
+ * or other linked pages which you have to create and state some informations.
+ *
+ * Please remember that this include file is being loaded *before* the class
+ * loader is loading classes from "exceptions", "interfaces" and "main"!
+ *
+ * @author Roland Haeder <webmaster@ship-simu.org>
+ * @version 0.0.0
+ * @copyright Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license GNU GPL 3.0 or any newer version
+ * @link http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class ApplicationHelper extends BaseApplication implements ManageableApplication, Registerable {
+ /**
+ * The version number of this application
+ */
+ private $appVersion = "";
+
+ /**
+ * The human-readable name for this application
+ */
+ private $appName = "";
+
+ /**
+ * The short uni*-like name for this application
+ */
+ private $shortName = "";
+
+ /**
+ * An instance of a controller
+ */
+ private $controllerInstance = null;
+
+ /**
+ * An instance of this class
+ */
+ private static $thisInstance = null;
+
+ /**
+ * Protected constructor
+ *
+ * @return void
+ */
+ protected function __construct () {
+ // Call parent constructor
+ parent::__construct(__CLASS__);
+ }
+
+ /**
+ * Getter for an instance of this class
+ *
+ * @return $thisInstance An instance of this class
+ */
+ public final static function getInstance () {
+ // Is the instance there?
+ if (is_null(self::$thisInstance)) {
+ self::$thisInstance = new ApplicationHelper();
+ }
+
+ // Return the instance
+ return self::$thisInstance;
+ }
+
+ /**
+ * Getter for the version number
+ *
+ * @return $appVersion The application's version number
+ */
+ public final function getAppVersion () {
+ return $this->appVersion;
+ }
+
+ /**
+ * Setter for the version number
+ *
+ * @param $appVersion The application's version number
+ * @return void
+ */
+ public final function setAppVersion ($appVersion) {
+ // Cast and set it
+ $appVersion = (string) $appVersion;
+ $this->appVersion = $appVersion;
+ }
+
+ /**
+ * Getter for human-readable name
+ *
+ * @return $appName The application's human-readable name
+ */
+ public final function getAppName () {
+ return $this->appName;
+ }
+
+ /**
+ * Setter for human-readable name
+ *
+ * @param $appName The application's human-readable name
+ * @return void
+ */
+ public final function setAppName ($appName) {
+ // Cast and set it
+ $appName = (string) $appName;
+ $this->appName = $appName;
+ }
+
+ /**
+ * Getter for short uni*-like name
+ *
+ * @return $shortName The application's short uni*-like name
+ */
+ public final function getAppShortName () {
+ return $this->shortName;
+ }
+
+ /**
+ * Setter for short uni*-like name
+ *
+ * @param $shortName The application's short uni*-like name
+ * @return void
+ */
+ public final function setAppShortName ($shortName) {
+ // Cast and set it
+ $shortName = (string) $shortName;
+ $this->shortName = $shortName;
+ }
+
+ /**
+ * Builds the master template's name
+ *
+ * @return $masterTemplateName Name of the master template
+ */
+ public function buildMasterTemplateName () {
+ // Get short name and add suffix
+ $masterTemplateName = str_replace("-", "", $this->getAppShortName()) . "_main";
+
+ // Return it
+ return $masterTemplateName;
+ }
+
+ /**
+ * Launches the admin area
+ *
+ * @return void
+ */
+ public final function entryPoint () {
+ // Create a new request object
+ $requestInstance = ObjectFactory::createObjectByName('HttpRequest');
+
+ // Default response is HTTP (HTML page) and type is "Web"
+ $response = "http";
+ $responseType = "web";
+
+ // Do we have another response?
+ if ($requestInstance->isRequestElementSet('request')) {
+ // Then use it
+ $response = strtolower($requestInstance->getRequestElement('request'));
+ $responseType = $response;
+ } // END - if
+
+ // ... and a new response object
+ $responseClass = sprintf("%sResponse", $this->convertToClassName($response));
+ $responseInstance = ObjectFactory::createObjectByName($responseClass, array($this));
+
+ // Remember both in this application
+ $this->setRequestInstance($requestInstance);
+ $this->setResponseInstance($responseInstance);
+
+ // Get the parameter from the request
+ $commandName = $requestInstance->getRequestElement('page');
+
+ // If it is null then get default command
+ if (is_null($commandName)) {
+ $commandName = $responseInstance->getDefaultCommand();
+ } // END - if
+
+ // Get a resolver
+ $resolverClass = sprintf("%sControllerResolver", $this->convertToClassName($responseType));
+ $resolverInstance = ObjectFactory::createObjectByName($resolverClass, array($commandName, $this));
+
+ // Get a controller instance as well
+ $this->controllerInstance = $resolverInstance->resolveController();
+
+ // Handle the request
+ $this->controllerInstance->handleRequest($requestInstance, $responseInstance);
+ }
+
+ /**
+ * Handle the indexed array of fatal messages and puts them out in an
+ * acceptable fasion
+ *
+ * @param $messageList An array of fatal messages
+ * @return void
+ */
+ public function handleFatalMessages (array $messageList) {
+ // Walk through all messages
+ foreach ($messageList as $message) {
+ print("MSG:".$message."<br />\n");
+ } // END - if
+ }
+
+ /**
+ * Assigns application-depending data
+ *
+ * @param $templateInstance An instance of a template engine
+ * @return void
+ */
+ public function assignExtraTemplateData (CompileableTemplate $templateInstance) {
+ // Assign charset
+ $templateInstance->assignConfigVariable('header_charset');
+ }
+}
+
+// [EOF]
+?>
--- /dev/null
+<?php
+/**
+ * Additional/overwritten configuration parts
+ *
+ * @author Roland Haeder <webmaster@ship-simu.org>
+ * @version 0.0.0
+ * @copyright Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license GNU GPL 3.0 or any newer version
+ * @link http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * 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 configuration instance for shorter lines
+$cfg = FrameworkConfiguration::getInstance();
+
+// CFG: HEADER-CHARSET
+$cfg->setConfigEntry('header_charset', "utf-8");
+
+// CFG: DEFAULT-WEB-COMMAND
+$cfg->setConfigEntry('default_web_command', "home");
+
+// CFG: PAGE-WITH-NEWS
+$cfg->setConfigEntry('page_with_news', "home");
+
+// CFG: FORM-METHOD
+$cfg->setConfigEntry('form_method', "post");
+
+// CFG: FORM-TARGET
+$cfg->setConfigEntry('form_target', "_self");
+
+// CFG: WEB-BLOCK-HELPER
+$cfg->setConfigEntry('web_block_helper', "WebBlockHelper");
+
+// CFG: WEB-FORM-HELPER
+$cfg->setConfigEntry('web_form_helper', "WebFormHelper");
+
+// CFG: WEB-LINK-HELPER
+$cfg->setConfigEntry('web_link_helper', "WebLinkHelper");
+
+// [EOF]
+?>
--- /dev/null
+<?php
+/**
+ * Application data
+ *
+ * Please remember that this include file is being loaded *before* the class
+ * loader is loading classes from "exceptions", "interfaces" and "main"!
+ *
+ * You can prevent adding this application to the selector by uncommenting the
+ * following line:
+ *
+ * if ((isset($this)) && (is_object($this)) && ($this->isClass("ApplicationSelector"))) { return; }
+ *
+ * isset() is required to prevent a warning and is_object() is highly required
+ * when the application itself is requested in URL (hint: index.php?app=your_app)
+ *
+ * @author Roland Haeder <webmaster@ship-simu.org>
+ * @version 0.0.0
+ * @copyright Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license GNU GPL 3.0 or any newer version
+ * @link http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * 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();
+
+// Get an instance of the helper
+$app = call_user_func_array(
+ array($cfg->readConfig('app_helper_class'), "getInstance"),
+ array()
+);
+
+// Set application name and version
+$app->setAppName("Generic Installation Wizard");
+$app->setAppVersion("0.0");
+$app->setAppShortName("install");
+
+// [EOF]
+?>
--- /dev/null
+<?php
+/**
+ * Some debugging stuff for this 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/>.
+ */
+
+// Reederei-Objekt debuggen
+//define('DEBUG_COMPANY_OBJ', true);
+// Hafen-Objekt debuggen
+//define('DEBUG_HARBOR_OBJ', true);
+// Schiff-Objekt debuggen
+//define('DEBUG_SHIP_OBJ', true);
+// Auftrag-Objekt debuggen
+//define('DEBUG_CONTRACT_OBJ', true);
+// Haendler-Objekt debuggen
+//define('DEBUG_MERCHANT_OBJ', true);
+// Personal-Objekt debuggen
+//define('DEBUG_PERSONELL_OBJ', true);
+// Personal debuggen
+//define('DEBUG_PERSONELL', true);
+// Reederei debuggen
+//define('DEBUG_COMPANY', true);
+// Mitarbeiter debuggen
+//define('DEBUG_COMPANY_EMPLOYEE', true);
+// Hafen debuggen
+//define('DEBUG_HARBOR', true);
+// Werft debuggen
+//define('DEBUG_SHIPYARD', true);
+// Schiff debuggen
+//define('DEBUG_SHIP', true);
+// Schiffstruktur debuggen
+//define('DEBUG_STRUCTURE', true);
+// Kabinen debuggen
+//define('DEBUG_CABIN', true);
+// Decks debuggen
+//define('DEBUG_DECK', true);
+// Bauauftraege debuggen
+//define('DEBUG_CONTRACT', true);
+// Haendler debuggen
+//define('DEBUG_MERCHANT', true);
+
+// [EOF]
+?>
--- /dev/null
+<?php
+/**
+ * The exception handler for this 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/>.
+ */
+
+// Our own exception handler
+function __exceptionHandler (FrameworkException $e) {
+ // Call the app_die() method
+ ApplicationEntryPoint::app_die(sprintf("[Main:] The application <span class=\"app_name\">%s</span> (<span class=\"app_short_name\">%s</span>) has terminated due to an uncaught exception: <span class=\"exception_name\">%s</span> <span class=\"exception_number\">[%s]</span>: <span class=\"debug_exception\">%s</span> Backtrace: <div class=\"debug_backtrace\">%s</div>",
+ ApplicationHelper::getInstance()->getAppName(),
+ ApplicationHelper::getInstance()->getAppShortName(),
+ $e->__toString(),
+ $e->getHexCode(),
+ $e->getMessage(),
+ $e->getPrintableBackTrace()
+ ),
+ $e->getHexCode(),
+ $e->getExtraData()
+ );
+} // END - function
+
+// Set the new handler
+set_exception_handler('__exceptionHandler');
+
+// Error handler
+function __errorHandler ($errno, $errstr, $errfile, $errline, array $errcontext) {
+ // Construct the message
+ $message = sprintf("File: <span class=\"debug_file\">%s</span>, Line: <span class=\"debug_line\">%s</span>, Code: <span class=\"debug_code\">%s</span>, Message: <span class=\"debug_message\">%s</span>",
+ basename($errfile),
+ $errline,
+ $errno,
+ $errstr
+ );
+
+ // Throw an exception here
+ throw new FatalErrorException($message, BaseFrameworkSystem::EXCEPTION_FATAL_ERROR);
+} // END - function
+
+// Set error handler
+set_error_handler('__errorHandler');
+
+// Assertion handler
+function __assertHandler ($file, $line, $code) {
+ // Empty code?
+ if ($code === "") $code = "<em>Unknown</em>";
+
+ // Create message
+ $message = sprintf("File: <span class=\"debug_file\">%s</span>, Line: <span class=\"debug_line\">%s</span>, Code: <span class=\"debug_code\">%s</span>",
+ basename($file),
+ $line,
+ $code
+ );
+
+ // Throw an exception here
+ throw new AssertionException($message, BaseFrameworkSystem::EXCEPTION_ASSERTION_FAILED);
+} // END - function
+
+// Init assert handling
+assert_options(ASSERT_ACTIVE, 1);
+assert_options(ASSERT_WARNING, 0);
+assert_options(ASSERT_BAIL, 0);
+assert_options(ASSERT_QUIET_EVAL, 0);
+assert_options(ASSERT_CALLBACK, '__assertHandler');
+
+// [EOF]
+?>
--- /dev/null
+Deny from all
--- /dev/null
+<?php
+/**
+ * Application initializer
+ *
+ * Please remember that this include file is being loaded *before* the class
+ * loader is loading classes from "exceptions", "interfaces" and "main"!
+ *
+ * You can prevent adding this application to the selector by uncommenting the
+ * following line:
+ *
+ * if ((isset($this)) && (is_object($this)) && ($this->isClass("ApplicationSelector"))) { return; }
+ *
+ * isset() is required to prevent a warning and is_object() is highly required
+ * when the application itself is requested in URL (hint: index.php?app=your_app)
+ *
+ * @author Roland Haeder <webmaster@ship-simu.org>
+ * @version 0.0.0
+ * @copyright Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license GNU GPL 3.0 or any newer version
+ * @link http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * 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();
+
+// Initialize output system
+require($cfg->readConfig('base_path') . 'inc/output.php');
+
+// Initialize file i/o system
+require($cfg->readConfig('base_path') . 'inc/file_io.php');
+
+// Include the language sub-system
+require($cfg->readConfig('base_path') . 'inc/language.php');
+
+// This application needs a database connection then we have to simply include
+// the inc/database.php script
+require($cfg->readConfig('base_path') . 'inc/database.php');
+
+// [EOF]
+?>
--- /dev/null
+Deny from all
--- /dev/null
+<?php
+/**
+ * A specialized class loader for 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/>.
+ */
+
+// Get config instance
+$cfg = FrameworkConfiguration::getInstance();
+
+// Load all classes for the application
+foreach ($lowerClasses as $className) {
+ // Load the application classes
+ ClassLoader::getInstance()->scanClassPath(sprintf("%s/%s/%s", $cfg->readConfig('application_path'), $cfg->readConfig('app_name'), $className));
+} // END - if
+
+// Clean up the global namespace
+unset($lowerClasses);
+unset($className);
+
+// [EOF]
+?>
--- /dev/null
+Deny from all
--- /dev/null
+Deny from all
--- /dev/null
+<?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 BaseBlogAction 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 create???Action (ActionResolver $resolverInstance) {
+ // 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) {
+ // Call parent execute method
+ parent::execute($requestInstance, $responseInstance);
+
+ // Add your code here
+ $this->partialStub("You have to implement me.");
+ }
+
+ /**
+ * 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
+ * @todo Add some filters here
+ */
+ public function addExtraFilters (Controller $controllerInstance, Requestable $requestInstance) {
+ // Call parent addExtraFilters method
+ parent::addExtraFilters($controllerInstance, $requestInstance);
+
+ // Unfinished method
+ }
+}
+
+// [EOF]
+?>
--- /dev/null
+<?php
+/**
+ * A general action class for install
+ *
+ * @author Roland Haeder <webmaster@ship-simu.org>
+ * @version 0.0.0
+ * @copyright Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license GNU GPL 3.0 or any newer version
+ * @link http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class BaseInstallAction extends BaseAction {
+ /**
+ * Protected constructor
+ *
+ * @param $className Name of the class
+ * @return void
+ */
+ protected function __construct ($className) {
+ // Call parent constructor
+ parent::__construct($className);
+ }
+
+ /**
+ * 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) {
+ // Add code here executed with every action
+ }
+
+ /**
+ * 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
+ * @todo Add some filters here
+ */
+ public function addExtraFilters (Controller $controllerInstance, Requestable $requestInstance) {
+ // Fetch some install data
+ $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('install_data_filter', array($controllerInstance)));
+ }
+}
+
+// [EOF]
+?>
--- /dev/null
+Deny from all
--- /dev/null
+<?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]
+?>
--- /dev/null
+Deny from all
--- /dev/null
+Deny from all
--- /dev/null
+Deny from all
--- /dev/null
+<?php
+/**
+ * A command for failed install "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/>.
+ */
+class WebInstallFailedCommand 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 createWebInstallFailedCommand (CommandResolver $resolverInstance) {
+ // Get new instance
+ $commandInstance = new WebInstallFailedCommand();
+
+ // 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]
+?>
--- /dev/null
+Deny from all
--- /dev/null
+Deny from all
--- /dev/null
+<?php
+/**
+ * Controller for failed install data "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/>.
+ */
+class WebInstallFailedController 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 createWebInstallFailedController (CommandResolver $resolverInstance) {
+ // Create the instance
+ $controllerInstance = new WebInstallFailedController();
+
+ // 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]
+?>
--- /dev/null
+Deny from all
--- /dev/null
+<?php
+/**
+ * A filter for money refill 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 ???Filter extends BaseBlogFilter 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 Add code being executed in this filter
+ */
+ public function execute (Requestable $requestInstance, Responseable $responseInstance) {
+ // Execute the parent execute method
+ parent::execute($requestInstance, $responseInstance);
+
+ $this->partialStub("Add code here for your specific filter.");
+ }
+}
+
+// [EOF]
+?>
--- /dev/null
+<?php
+/**
+ * A general filter class for Ship-Simu
+ *
+ * @author Roland Haeder <webmaster@ship-simu.org>
+ * @version 0.0.0
+ * @copyright Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license GNU GPL 3.0 or any newer version
+ * @link http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class BaseInstallFilter extends BaseFilter {
+ /**
+ * Protected constructor
+ *
+ * @param $className Name of the filter class
+ * @return void
+ */
+ protected function __construct ($className) {
+ // Call parent constructor
+ parent::__construct($className);
+ }
+
+ /**
+ * 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%
+ */
+ public function execute (Requestable $requestInstance, Responseable $responseInstance) {
+ // Add something to do on every filter
+ }
+}
+
+// [EOF]
+?>
--- /dev/null
+Deny from all
--- /dev/null
+<?php
+/**
+ * The application launcher
+ *
+ * @author Roland Haeder <webmaster@ship-simu.org>
+ * @version 0.0.0
+ * @copyright Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license GNU GPL 3.0 or any newer version
+ * @link http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+// Is there an application helper instance? We need the method main() for
+// maining the application
+$app = call_user_func_array(array(FrameworkConfiguration::getInstance()->readConfig('app_helper_class'), "getInstance"), array());
+
+// Some sanity checks
+if ((empty($app)) || (is_null($app))) {
+ // Something went wrong!
+ ApplicationEntryPoint::app_die(sprintf("[Main:] The application <span class=\"app_name\">%s</span> could not be launched because the helper class <span class=\"class_name\">%s</span> is not loaded.",
+ $application,
+ FrameworkConfiguration::getInstance()->readConfig('app_helper_class')
+ ));
+} elseif (!is_object($app)) {
+ // No object!
+ ApplicationEntryPoint::app_die(sprintf("[Main:] The application <span class=\"app_name\">%s</span> could not be launched because 'app' is not an object.",
+ $application
+ ));
+} elseif (!method_exists($app, FrameworkConfiguration::getInstance()->readConfig('entry_method'))) {
+ // Method not found!
+ ApplicationEntryPoint::app_die(sprintf("[Main:] The application <span class=\"app_name\">%s</span> could not be launched because the method <span class=\"method_name\">%s</span> is missing.",
+ $application,
+ FrameworkConfiguration::getInstance()->readConfig('entry_method')
+ ));
+}
+
+// Call user function
+call_user_func_array(array($app, FrameworkConfiguration::getInstance()->readConfig('entry_method')), array());
+
+// [EOF]
+?>
--- /dev/null
+Deny from all
--- /dev/null
+Deny from all
--- /dev/null
+</div> <!-- masterbox //-->
+
+</body>
+</html>
--- /dev/null
+<!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>
+ {?app_full_name?} - {?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=UTF-8" />
+ <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">
--- /dev/null
+<div id="content_header">
+ Willkommen zum Installationsassistenten Version {?app_version?}
+</div>
--- /dev/null
+{?header?}
+
+<div id="main_header">
+ {?install_header?}
+</div>
+
+<div id="navigation">
+ {?navigation?}
+</div>
+
+<div id="advert">
+ {?nav_advert?}
+</div>
+
+<div id="main_content">
+ {?content?}
+</div>
+
+<div id="main_footer">
+ {?install_footer?}
+</div>
+
+{?footer?}
--- /dev/null
+<div class="debug_header">
+ Mail-Debug-Ausgabe:
+</div>
+
+<div class="mail_header">
+ <div class="mail_header_line">
+ <span class="mail_sender">Von:</span> <span class="mail_info">{?sender?}</span>
+ </div>
+ <div class="mail_header_line">
+ <span class="mail_recipient">An:</span> <span class="mail_info">{?recipient?}</span>
+ </div>
+ <div class="mail_header_line">
+ <span class="mail_subject">Betreff:</span> <span class="mail_info">{?subject?}</span>
+ </div>
+</div>
+
+<div class="mail_text_box">
+ <div class="mail_message">
+ Nachricht:
+ </div>
+
+ <div class="mail_content">
+ {?message?}
+ </div>
+</div>
--- /dev/null
+Deny from all
--- /dev/null
+<?xml version="1.0" encoding="UTF-8" ?>
+<text-mail>
+ <mail-data>
+ <sender-address value="$config[admin_email]" />
+ <subject-line value="Anforderung deines Bestätigungslinks" />
+ <recipient-address value="{?email?}" />
+ <message>
+ <![CDATA[Hallo {?username?}!
+
+Du (oder ein anderer) hattest soeben deinen Bestätigungslink erneut angefordert. Solltest du dies nicht gewesen sein, bitten wir dich den Vorfall zu entschuldigen.
+
+Hier ist nun dein Bestätigungslink. Der alte aus der Anmeldemail ist somit nicht mehr gültig!
+
+$config[base_url]/index.php?app={?app_short_name?}&page=confirm&username={?username?}&confirm={?confirm_hash?}
+
+Solltest du die URL nicht anklicken können, versuche diese in die Adresszeile deines Browsers zu kopieren.
+
+Alternativ kannst du im Loginbereich unter Bestätigungscode den folgenden Code reinkopieren oder eingeben:
+
+{?confirm_hash?}
+
+Solltest du Fragen dazu oder Probleme mit der Bestätigung haben, so melde dich bitte beim Support-Team.
+
+Mit freundlichen Grüßen,
+ Dein {?app_short_name?}-Team
+
+{?mail_footer?}]]>
+ </message>
+ </mail-data>
+</text-mail>
--- /dev/null
+Deny from all
--- /dev/null
+<!-- Put your ads code here which shall be shown below the navigation //-->
--- /dev/null
+<div id="selector_content">
+ <div style="text-align: left; padding-top: 15px; padding-left: 10px; padding-right: 10px">
+ Gründen Sie eine virtuelle Reederei an den bedeutestens
+ Welthäfen! Oder treten Sie einer Reederei als Angestellter bei und
+ arbeiten Sie sich bis in die Chef-Etagge hoch!
+ </div>
+
+ <div style="text-align: left; padding-top: 15px; padding-left: 10px; padding-right: 10px">
+ Oder fangen Sie als Matrose auf einem Passagierschiff (virtuell) an zu
+ arbeiten und werden Sie nach wenigen Kreuzfahrten bald Kapitän!
+ </div>
+
+ <div style="text-align: left; padding-top: 15px; padding-left: 10px; padding-right: 10px">
+ Oder buchen Sie eine virtuelle Kreuzfahrt durch die bekannten Meeren in
+ {!POINTS!} in einer Luxus-Suite!
+ </div>
+</div>
--- /dev/null
+Deny from all
--- /dev/null
+Deny from all
--- /dev/null
+Deny from all
--- /dev/null
+Deny from all
--- /dev/null
+<?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>
--- /dev/null
+<?php
+// Needed in every image template to initialy set the image type
+$helper = ImageHelper::createImageHelper($this, "png");
+$helper->setImageName("code_captcha");
+$helper->setBaseImage("base_code");
+
+// Set image dimensions
+$helper->setWidth(100);
+$helper->setHeight(50);
+
+// Get random number
+$rand = $helper->getRngInstance()->randomNumber(0, 6);
+
+// Background and foreground color
+switch ($rand) {
+ case 1:
+ // First varriant
+ $helper->setBackgroundColorRedGreenBlue('rand', 0x90 , 0x00 );
+ $helper->setForegroundColorRedGreenBlue(0x00 , 0xff , 'rand');
+ break;
+
+ case 2:
+ // Second varriant
+ $helper->setBackgroundColorRedGreenBlue(0x90 , 'rand', 0x00 );
+ $helper->setForegroundColorRedGreenBlue(0xff , 0x00 , 'rand');
+ break;
+
+ case 3:
+ // Third varriant
+ $helper->setBackgroundColorRedGreenBlue('rand', 0x00 , 0x90 );
+ $helper->setForegroundColorRedGreenBlue(0x00 , 'rand', 0xff );
+ break;
+
+ case 4:
+ // Forth varriant
+ $helper->setBackgroundColorRedGreenBlue(0x00 , 0x90 , 'rand');
+ $helper->setForegroundColorRedGreenBlue(0x00 , 'rand', 0xa0 );
+ break;
+
+ case 5:
+ // Fith varriant
+ $helper->setBackgroundColorRedGreenBlue('rand', 0x00 , 0x90 );
+ $helper->setForegroundColorRedGreenBlue(0x00 , 0xe0 , 'rand');
+ break;
+
+ default:
+ // Last varriant
+ $helper->setBackgroundColorRedGreenBlue(0x00 , 'rand', 0x90 );
+ $helper->setForegroundColorRedGreenBlue(0xff , 0x00 , 'rand');
+ break;
+}
+
+// Random X/Y factors...
+$xRand = $helper->getRngInstance()->randomNumber(0, 45);
+$yRand = $helper->getRngInstance()->randomNumber(0, 25);
+
+// Add code
+$helper->addTextLine("code");
+$helper->setCoord((5 + $xRand), (5 + $yRand));
+$helper->setFontSize('rand');
+$helper->setImageString("{?decrypted_code?}");
+
+// Only for debug!
+/*
+$helper->addTextLine("debug");
+$helper->setCoord(90, 35);
+$helper->setFontSize(3);
+$helper->setImageString($rand);
+*/
+
+// Flush content to the template engine
+$helper->flushContent();
+
+// Comment this out if image is done
+//$this->debugInstance();
+
+// [EOF]
+?>