*
* @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