Logout procedure basicly finished, login area splitted in main and action-dependent...
authorRoland Häder <roland@mxchange.org>
Thu, 19 Jun 2008 17:11:54 +0000 (17:11 +0000)
committerRoland Häder <roland@mxchange.org>
Thu, 19 Jun 2008 17:11:54 +0000 (17:11 +0000)
18 files changed:
.gitattributes
application/selector/class_ApplicationSelector.php
application/ship-simu/config.php
application/ship-simu/main/actions/class_ShipSimuLogoutAction.php [new file with mode: 0644]
application/ship-simu/templates/de/code/login_failed.ctp
application/ship-simu/templates/de/code/login_logout.ctp [new file with mode: 0644]
application/ship-simu/templates/de/code/login_main.ctp [new file with mode: 0644]
application/ship-simu/templates/de/code/login_welcome.ctp
application/ship-simu/templates/de/code/logout_done.ctp [new file with mode: 0644]
inc/classes/main/commands/web/class_WebDoFormCommand.php
inc/classes/main/commands/web/class_WebLoginAreaCommand.php
inc/classes/main/commands/web/class_WebLoginCommand.php
inc/classes/main/commands/web/class_WebLoginFailedCommand.php
inc/classes/main/commands/web/class_WebLogoutDoneCommand.php [new file with mode: 0644]
inc/classes/main/request/class_HttpRequest.php
inc/classes/main/resolver/web/class_WebCommandResolver.php
inc/classes/main/resolver/web/class_WebControllerResolver.php
inc/classes/main/template/class_TemplateEngine.php

index 3fe37b7..84cffb0 100644 (file)
@@ -56,6 +56,7 @@ application/ship-simu/loader.php -text
 application/ship-simu/main/.htaccess -text
 application/ship-simu/main/actions/.htaccess -text
 application/ship-simu/main/actions/class_ShipSimuLoginAction.php -text
+application/ship-simu/main/actions/class_ShipSimuLogoutAction.php -text
 application/ship-simu/main/class_ -text
 application/ship-simu/main/class_BasePersonell.php -text
 application/ship-simu/main/class_BaseSimulator.php -text
@@ -134,7 +135,10 @@ application/ship-simu/templates/de/code/header.ctp -text
 application/ship-simu/templates/de/code/home.ctp -text
 application/ship-simu/templates/de/code/login_failed.ctp -text
 application/ship-simu/templates/de/code/login_form.ctp -text
+application/ship-simu/templates/de/code/login_logout.ctp -text
+application/ship-simu/templates/de/code/login_main.ctp -text
 application/ship-simu/templates/de/code/login_welcome.ctp -text
+application/ship-simu/templates/de/code/logout_done.ctp -text
 application/ship-simu/templates/de/code/register_form.ctp -text
 application/ship-simu/templates/de/code/shipsimu_main.ctp -text
 application/ship-simu/templates/de/html/.htaccess -text
@@ -334,6 +338,7 @@ 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_WebLogoutDoneCommand.php -text
 inc/classes/main/commands/web/class_WebRegisterCommand.php -text
 inc/classes/main/compressor/.htaccess -text
 inc/classes/main/compressor/class_Bzip2Compressor.php -text
index 928fcda..be289bf 100644 (file)
@@ -315,9 +315,9 @@ class ApplicationSelector extends BaseFrameworkSystem {
         * @throws      NullPointerException            If $curr is null
         * @throws      NoArrayException                        If $curr is not an array
         * @throws      InvalidArrayCountException      If $curr contains an
-        *                                                                      unexpected count of elements
+        *                                                                              unexpected count of elements
         * @throws      MissingArrayElementsException   If $curr is missing expected
-        *                                                                      array elements
+        *                                                                                      array elements
         */
        public function insertApplicationTemplates () {
                // First prepare the instance
index 9c000d8..cba02a1 100644 (file)
@@ -88,6 +88,9 @@ $cfg->setConfigEntry('app_login_url', "index.php?app=ship-simu&page=login_area")
 // CFG: LOGIN-FAILED-URL
 $cfg->setConfigEntry('login_failed_url', "index.php?app=ship-simu&page=login_failed");
 
+// CFG: LOGOUT-DONE-URL
+$cfg->setConfigEntry('logout_done_url', "index.php?app=ship-simu&page=logout_done");
+
 // CFG: LOGIN-DEFAULT-ACTION
 $cfg->setConfigEntry('login_default_action', "welcome");
 
@@ -133,5 +136,11 @@ $cfg->setConfigEntry('guest_login_password', "guest");
 // CFG: LOGIN-WELCOME-ACTION-CLASS
 $cfg->setConfigEntry('login_welcome_action_class', "ShipSimuLoginAction");
 
+// CFG: LOGIN-LOGOUT-ACTION-CLASS
+$cfg->setConfigEntry('login_logout_action_class', "ShipSimuLogoutAction");
+
+// CFG: LOGOUT-IMMEDIATE
+$cfg->setConfigEntry('logout_immediate', "N");
+
 // [EOF]
 ?>
diff --git a/application/ship-simu/main/actions/class_ShipSimuLogoutAction.php b/application/ship-simu/main/actions/class_ShipSimuLogoutAction.php
new file mode 100644 (file)
index 0000000..e1c0014
--- /dev/null
@@ -0,0 +1,80 @@
+<?php
+/**
+ * An action class for the 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
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+class ShipSimuLogoutAction extends BaseAction implements Commandable {
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+
+               // Set description
+               $this->setObjectDescription("Logout action");
+
+               // Generate unique key
+               $this->generateUniqueId();
+       }
+
+       /**
+        * Creates an instance of this action
+        *
+        * @return      $actionInstance         An instance of this action class
+        */
+       public final static function createShipSimuLogoutAction () {
+               // Get a new instance
+               $actionInstance = new ShipSimuLogoutAction();
+
+               // 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) {
+               // Shall we logout or display logout page or logout immediately?
+               if (($this->getConfigInstance()->readConfig('logout_immediate') == "Y") || ($requestInstance->isRequestElementSet('logout'))) {
+                       // 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');
+               } // END - if
+       }
+}
+
+// [EOF]
+?>
index 5ed3cbb..e823120 100644 (file)
@@ -19,5 +19,6 @@
 </div>
 
 <div id="content_footer">
+       [<a href="$config[base_url]/index.php?app=ship-simu&amp;page=login">Login erneut probieren</a>]
        Vielen Dank f&uuml;r deine Mitarbeit! :-)
 </div>
diff --git a/application/ship-simu/templates/de/code/login_logout.ctp b/application/ship-simu/templates/de/code/login_logout.ctp
new file mode 100644 (file)
index 0000000..e0eb6d6
--- /dev/null
@@ -0,0 +1,8 @@
+<div id="logout_box">
+       <div id="logout_header">
+               Willst du dich wirklich aus dem Spiel aussloggen?
+       </div>
+       <div id="logout_links">
+               [<a href="$config[base_url]/index.php?app=ship-simu&amp;page=login_area&amp;action=logout&amp;logout=1">Ja</a>] | [<a href="$config[base_url]/index.php?app=ship-simu&amp;page=login_area">Nein</a>]
+       </div>
+</div>
diff --git a/application/ship-simu/templates/de/code/login_main.ctp b/application/ship-simu/templates/de/code/login_main.ctp
new file mode 100644 (file)
index 0000000..3f7cf5f
--- /dev/null
@@ -0,0 +1,25 @@
+<div id="content_header">
+       Willkommen im Loginbereich  von {?app_full_name?}!
+</div>
+
+<div id="content_body">
+       {?login_content?}
+</div>
+
+<div id="persona_data" title="Informationen zu Deinem Spieleaccount">
+       <div id="persona_header">
+               Account-Infos:
+       </div>
+       {?persona_data?}
+       <div id="logout_link">
+               [<a href="$config[base_url]/index.php?app=ship-simu&amp;page=login_area&amp;action=logout"
+                title="Aus dem Spiel ausloggen">Ausloggen</a>]
+       </div>
+</div>
+
+<div id="company_data" title="Informationen zu der aktuell ausgew&auml;hlten Reederei">
+       <div id="company_header">
+               Reederei-Infos:
+       </div>
+       {?company_data?}
+</div>
index 7d3df54..64c04da 100644 (file)
@@ -1,7 +1,3 @@
-<div id="content_header">
-       Willkommen im Loginbereich  von {?app_full_name?}
-</div>
-
 <div id="news_frame">
        {?ship_simu_login_news?}
 </div>
diff --git a/application/ship-simu/templates/de/code/logout_done.ctp b/application/ship-simu/templates/de/code/logout_done.ctp
new file mode 100644 (file)
index 0000000..9d441da
--- /dev/null
@@ -0,0 +1,7 @@
+<div id="content_header">
+       Du bist jetzt aus dem Spiel ausgeloggt!
+</div>
+
+<div id="content_body">
+       Du kannst dich nun [<a href="$config[base_url]/index.php?app=ship-simu&amp;page=login">erneut einloggen</a>] oder weiter auf unseren Seiten bleiben. ;-)
+</div>
index cdfd716..87bd1d1 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * A command for the "home" page
+ * A command for the form processor
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
index 9908233..ac26849 100644 (file)
@@ -32,7 +32,7 @@ class WebLoginAreaCommand extends BaseCommand implements Commandable {
                parent::__construct(__CLASS__);
 
                // Set special description
-               $this->setObjectDescription("Command for the &quot;home&quot; page");
+               $this->setObjectDescription("Command for the &quot;login area&quot; page");
 
                // Create unique ID number
                $this->generateUniqueId();
@@ -128,13 +128,22 @@ class WebLoginAreaCommand extends BaseCommand implements Commandable {
                $templateInstance->loadCodeTemplate($action);
 
                // Assign the template with the master template as a content ... ;)
-               $templateInstance->assignTemplateWithVariable($action, "content");
+               $templateInstance->assignTemplateWithVariable($action, "login_content");
+
+               // Load main template
+               $templateInstance->loadCodeTemplate("login_main");
+
+               // Assign the main template with the master template as a content ... ;)
+               $templateInstance->assignTemplateWithVariable("login_main", "content");
 
                // Load the master template
                $templateInstance->loadCodeTemplate($masterTemplate);
 
                // Set title
-               $templateInstance->assignVariable('title', $this->getLanguageInstance()->getMessage("login_{$action}_title"));
+               $templateInstance->assignVariable('title', $this->getLanguageInstance()->getMessage($action."_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
index 3f56321..64cba33 100644 (file)
@@ -32,7 +32,7 @@ class WebLoginCommand extends BaseCommand implements Commandable {
                parent::__construct(__CLASS__);
 
                // Set special description
-               $this->setObjectDescription("Command for the &quot;home&quot; page");
+               $this->setObjectDescription("Command for the login form page");
 
                // Create unique ID number
                $this->generateUniqueId();
index 34a1970..04b02c1 100644 (file)
@@ -32,7 +32,7 @@ class WebLoginFailedCommand extends BaseCommand implements Commandable {
                parent::__construct(__CLASS__);
 
                // Set special description
-               $this->setObjectDescription("Command for the &quot;home&quot; page");
+               $this->setObjectDescription("Command for the &quot;login failed&quot; page");
 
                // Create unique ID number
                $this->generateUniqueId();
@@ -101,6 +101,9 @@ class WebLoginFailedCommand extends BaseCommand implements Commandable {
                // 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.
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..528f4b5
--- /dev/null
@@ -0,0 +1,118 @@
+<?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__);
+
+               // Set special description
+               $this->setObjectDescription("Command for the &quot;logout done&quot; page");
+
+               // Create unique ID number
+               $this->generateUniqueId();
+
+               // Clean up a little
+               $this->removeSystemArray();
+       }
+
+       /**
+        * Creates an instance of this class
+        *
+        * @param       $resolverInstance               An instance of a command resolver class
+        * @return      $commandInstance                An instance a prepared command class
+        */
+       public final static function 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->prepareTemplateEngine($appInstance);
+
+               // Load the master template
+               $masterTemplate = $appInstance->getMasterTemplate();
+
+               // Load header template
+               $templateInstance->loadCodeTemplate("header");
+
+               // Compile and assign it with a variable
+               $templateInstance->compileTemplate();
+               $templateInstance->assignTemplateWithVariable("header", "header");
+
+               // Load footer template
+               $templateInstance->loadCodeTemplate("footer");
+
+               // Compile and assign it with a variable
+               $templateInstance->compileTemplate();
+               $templateInstance->assignTemplateWithVariable("footer", "footer");
+
+               // 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 the response class
+               $templateInstance->transferToResponse($responseInstance);
+       }
+}
+
+// [EOF]
+?>
index b6f9b95..1a64747 100644 (file)
@@ -86,13 +86,12 @@ class HttpRequest extends BaseFrameworkSystem implements Requestable {
         * 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
         */
        public function isRequestElementSet ($element) {
                // Is this element found?
                if (!isset($this->requestData[$element])) {
-                       // Then throw an exception
-                       throw new MissingArrayElementsException(array($this, 'requestData', $element), self::EXCEPTION_MISSING_ELEMENT);
+                       // Then return false
+                       return false;
                } // END - if
 
                // All clear
@@ -110,13 +109,9 @@ class HttpRequest extends BaseFrameworkSystem implements Requestable {
                // Initialize value
                $value = null;
 
-               try {
-                       if ($this->isRequestElementSet($element)) {
+               if ($this->isRequestElementSet($element)) {
                                $value = $this->requestData[$element];
-                       } // END - if
-               } catch (MissingArrayElementsException $e) {
-                       // Do nothing here
-               }
+               } // END - if
 
                // Return the element's value
                return $value;
index f4b87a2..ba0eb15 100644 (file)
@@ -77,7 +77,7 @@ class WebCommandResolver extends BaseResolver implements CommandResolver {
 
        /**
         * Returns an command instance for a given request class or null if
-        * MissingArrayElementsException was thrown
+        * it was not found
         *
         * @param       $requestInstance        An instance of a request class
         * @return      $commandInstance        An instance of the resolved command
@@ -91,34 +91,29 @@ class WebCommandResolver extends BaseResolver implements CommandResolver {
                $commandName = "";
                $commandInstance = null;
 
-               // Test if the required parameter is set
-               try {
-                       // This goes fine so let's resolv the command
-                       $commandName = $requestInstance->getRequestElement("page");
+               // 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_command');
+               // Is the command empty? Then fall back to default command
+               if (empty($commandName)) $commandName = $this->getConfigInstance()->readConfig('default_command');
 
-                       // Check if the command is valid
-                       if (!$this->isCommandValid($commandName)) {
-                               // This command is invalid!
-                               throw new InvalidCommandException(array($this, $commandName), self::EXCEPTION_INVALID_COMMAND);
-                       }
+               // Check if the command is valid
+               if (!$this->isCommandValid($commandName)) {
+                       // This command is invalid!
+                       throw new InvalidCommandException(array($this, $commandName), self::EXCEPTION_INVALID_COMMAND);
+               } // END - if
 
-                       // Get the command
-                       $commandInstance = $this->loadCommand($commandName);
+               // 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);
-                       }
+               // 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;
-               } catch (MissingArrayElementsException $e) {
-                       // Just catch it here...
-               }
+               // Set last command
+               $this->lastCommandInstance = $commandInstance;
 
                // Return the resolved command instance
                return $commandInstance;
index 6dd5a39..1debf14 100644 (file)
@@ -95,31 +95,26 @@ class WebControllerResolver extends BaseResolver implements ControllerResolver {
                $commandName = "";
                $controllerInstance = null;
 
-               // Try to resolv the command
-               try {
-                       // Get the command name 
-                       $commandName = $this->getCommandName();
-
-                       // Check if the command is valid
-                       if (!$this->isCommandValid($commandName)) {
-                               // This command is invalid!
-                               throw new InvalidCommandException(array($this, $commandName), self::EXCEPTION_INVALID_COMMAND);
-                       }
+               // Get the command name 
+               $commandName = $this->getCommandName();
 
-                       // Get the command
-                       $controllerInstance = $this->loadController($commandName);
+               // Check if the command is valid
+               if (!$this->isCommandValid($commandName)) {
+                       // This command is invalid!
+                       throw new InvalidCommandException(array($this, $commandName), self::EXCEPTION_INVALID_COMMAND);
+               } // END - if
 
-                       // And validate it
-                       if ((!is_object($controllerInstance)) || (!$controllerInstance instanceof Controller)) {
-                               // This command has an invalid instance!
-                               throw new InvalidControllerInstanceException(array($this, $commandName), self::EXCEPTION_INVALID_CONTROLLER);
-                       }
+               // Get the command
+               $controllerInstance = $this->loadController($commandName);
 
-                       // Set last controller
-                       $this->lastControllerInstance = $controllerInstance;
-               } catch (MissingArrayElementsException $e) {
-                       // Just catch it here...
-               }
+               // And validate it
+               if ((!is_object($controllerInstance)) || (!$controllerInstance instanceof Controller)) {
+                       // This command has an invalid instance!
+                       throw new InvalidControllerInstanceException(array($this, $commandName), self::EXCEPTION_INVALID_CONTROLLER);
+               } // END - if
+
+               // Set last controller
+               $this->lastControllerInstance = $controllerInstance;
 
                // Return the maybe resolved instance
                return $controllerInstance;
index 7378a40..7bbf2e1 100644 (file)
@@ -320,17 +320,6 @@ class TemplateEngine extends BaseFrameworkSystem implements CompileableTemplate
        }
 
        /**
-        * Assign a given congfiguration variable with a value
-        *
-        * @param       $var    The configuration variable we want to assign
-        * @return      void
-        */
-       private final function assignConfigVariable ($var) {
-               // Sweet and simple...
-               $this->configVariables[$var] = $this->getConfigInstance()->readConfig($var);
-       }
-
-       /**
         * Initialize the variable stack. This holds all variables for later
         * compilation.
         *
@@ -511,7 +500,7 @@ class TemplateEngine extends BaseFrameworkSystem implements CompileableTemplate
         * @param       $template       The template we shall load
         * @return      void
         */
-       private final function loadTemplate ($template) {
+       private function loadTemplate ($template) {
                // Cast it to string
                $template = (string) $template;
 
@@ -904,7 +893,7 @@ class TemplateEngine extends BaseFrameworkSystem implements CompileableTemplate
         *                                              located in "html" by default
         * @return      void
         */
-       public final function loadWebTemplate ($template) {
+       public function loadWebTemplate ($template) {
                // Set template type
                $this->setTemplateType($this->getConfigInstance()->readConfig('web_template_type'));
 
@@ -913,13 +902,24 @@ class TemplateEngine extends BaseFrameworkSystem implements CompileableTemplate
        }
 
        /**
+        * 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...
+               $this->configVariables[$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 final function loadEmailTemplate ($template) {
+       public function loadEmailTemplate ($template) {
                // Set template type
                $this->setTemplateType($this->getConfigInstance()->readConfig('email_template_type'));
 
@@ -934,7 +934,7 @@ class TemplateEngine extends BaseFrameworkSystem implements CompileableTemplate
         *                                              located in "code" by default
         * @return      void
         */
-       public final function loadCodeTemplate ($template) {
+       public function loadCodeTemplate ($template) {
                // Set template type
                $this->setTemplateType($this->getConfigInstance()->readConfig('code_template_type'));