<?php
# ************** LICENCE ****************
/*
	Copyright (c) PORTANEO.
*/
# ***************************************
# index mobile site
#
# !! be careful, this file must be saved under uft8 format, and display an e accentuated here : é
# ***************************************
require_once('includes_mobile.php');

if (isset($_SESSION['user_id'])) {
    $DB->getResults($portalConfiguration_getUserWidgets,$DB->escape($_SESSION['user_id']));
    if ($DB->nbResults()>0) {
        //redirect to portal if user has already configured his portal
        header("location:portal.php");
    }
    else {
        //otherwise redirec to portal configuration
        header("location:portal_configuration.php");
    }
}
else {  
    //user not logged in, redirect to login form
    (isset($_SESSION['smartphone']))     ?       exit()      :     header("location:login.php");
}
?>