/**
  * Sets the Server Request Parameters
  * 
  * Singleton-ish implementation
  * We should only write theese values once
  * 
  * @param array $server - $_SERVER
  * @param array $get    - $_GET
  * @param array $post   - $_POST
  * @return bool
  */
 public static function setRequestData($server, $get, $post)
 {
     // this could also have an exception thrown
     // but calling a function that only checks a value and returns false is harmless (and costless)
     if (self::$_isDataSet != true) {
         self::$_server = $server;
         self::$_get = $get;
         self::$_post = $post;
         self::$_isDataSet = true;
         return true;
     }
     return false;
 }
*
* @category   DotKernel
* @package    Frontend
 * @copyright  Copyright (c) 2009-2015 DotBoost Technologies Inc. (http://www.dotboost.com)
* @license    http://opensource.org/licenses/osl-3.0.php  Open Software License (OSL 3.0)
* @version    $Id: IndexController.php 897 2015-02-24 18:04:40Z gabi $
*/
/**
 * Frontend Module - Index Controller
 * Is doing all the job for specific frontend control stuff
 * @author     DotKernel Team <*****@*****.**>
 */
// initialize the session
// if you don't use the session object in this module, feel free to remove this line
Dot_Session::start();
if (Dot_UserAgent_Utilities::isMobile(Dot_Request::getUserAgent())) {
    if (!$registry->session->visitId) {
        $registry->session->visitId = Dot_Statistic::registerVisit();
    }
    // if the Statistic module is integrate, record the deviceInfo too, and record TRUE in $session->mobile
    if (!$registry->session->mobile) {
        $registry->session->mobile = Dot_Statistic::registerMobileDetails($registry->session->visitId, array());
        //redirect to mobile controller , only if the session is not set.
        //Otherwise will trap the user in mobile controller
        if (isset($registry->configuration->settings->mobile->redirect) && $registry->configuration->settings->mobile->redirect == true) {
            header('location: ' . $registry->configuration->website->params->url . '/mobile');
            exit;
        }
    }
}
// start the template object, empty for the moment
}
//Set include  path to library directory
set_include_path(implode(PATH_SEPARATOR, array(APPLICATION_PATH . '/library', get_include_path())));
// Define PATH's (absolute paths)  to configuration, controllers, DotKernel, templates  directories
define('CONFIGURATION_PATH', APPLICATION_PATH . '/configs');
define('CONTROLLERS_PATH', APPLICATION_PATH . '/controllers');
define('DOTKERNEL_PATH', APPLICATION_PATH . '/DotKernel');
define('TEMPLATES_PATH', APPLICATION_PATH . '/templates');
// Define DIRECTORIES  ( relative paths)
define('TEMPLATES_DIR', '/templates');
define('IMAGES_DIR', '/images');
// Load Zend Framework
require_once 'Zend/Loader/Autoloader.php';
$zendLoader = Zend_Loader_Autoloader::getInstance();
//includes all classes in library folder. That class names must start with Dot_
$zendLoader->registerNamespace('Dot_');
// also load plugin classes
$zendLoader->registerNamespace('Plugin_');
// getting the request related params
Dot_Request::setRequestData($_SERVER, $_GET, $_POST);
// initialize the DotKernel Enviromnment
Dot_Kernel::initialize($startTime);
/** Pass control to the controller
                .''
      ._.-.___.' (`\
     //(        ( `'
    '/ )\ ).__. )
    ' <' `\ ._/'\
       `   \     \
*/
Dot_Kernel::gallop();
 * DotBoost Technologies Inc.
 * DotKernel Application Framework
 *
 * @category   DotKernel
 * @package    Frontend
 * @copyright  Copyright (c) 2009-2015 DotBoost Technologies Inc. (http://www.dotboost.com)
 * @license    http://opensource.org/licenses/osl-3.0.php  Open Software License (OSL 3.0)
 * @version    $Id: UserController.php 872 2015-01-05 16:34:50Z gabi $
 */
/**
 * User Controller
 * @author     DotKernel Team <*****@*****.**>
 */
$session = Zend_Registry::get('session');
// instantiate classes related to User module: model & view
$userModel = new User(Dot_Request::getUserAgent(), Dot_Request::getHttpReffer());
$userView = new User_View($tpl);
// all actions MUST set  the variable  $pageTitle
$pageTitle = $option->pageTitle->action->{$registry->requestAction};
switch ($registry->requestAction) {
    default:
    case 'login':
        if (!isset($session->user)) {
            // display Login form
            $userView->loginForm('login');
        } else {
            header('Location: ' . $registry->configuration->website->params->url . '/user/account');
            exit;
        }
        break;
    case 'authorize':
/**
* DotBoost Technologies Inc.
* DotKernel Application Framework
*
* @category   DotKernel
* @package    Admin
 * @copyright  Copyright (c) 2009-2015 DotBoost Technologies Inc. (http://www.dotboost.com)
* @license    http://opensource.org/licenses/osl-3.0.php  Open Software License (OSL 3.0)
* @version    $Id: AdminController.php 872 2015-01-05 16:34:50Z gabi $
*/
/**
* Admin Controller
* @author     DotKernel Team <*****@*****.**>
*/
$adminView = new Admin_View($tpl);
$adminModel = new Admin(Dot_Request::getUserAgent(), Dot_Request::getHttpReffer());
// switch based on the action, NO default action here
$pageTitle = $option->pageTitle->action->{$registry->requestAction};
switch ($registry->requestAction) {
    case 'login':
        $session = Zend_Registry::get("session");
        if ($session->admin !== null) {
            header('location: ' . $registry->configuration->website->params->url . '/admin');
            exit;
        }
        // show the Login form
        $adminView->loginForm('login');
        break;
    case 'logout':
        $dotAuth = Dot_Auth::getInstance();
        $dotAuth->clearIdentity('admin');