function connect_user($pseudo)
{
    $_SESSION['pseudo'] = $pseudo;
    include_once 'model/user/update_last_activity.php';
    update_last_activity($pseudo);
    include_once 'model/user/update_last_ip.php';
    update_last_ip($pseudo);
}
 public function __construct($themes_system = 'frontend')
 {
     // Parent Method
     parent::__construct();
     // Development Profiler
     if (ENVIRONMENT == 'development') {
         $this->output->enable_profiler(TRUE);
     }
     // Load Libraries
     $this->load->library('user_agent');
     // Load Drivers
     $this->load->driver('session');
     // Load Database
     $this->load->database();
     // Load Helpers
     $this->load->helper('route');
     $this->load->helper('auth');
     $this->load->helper('date');
     $this->load->helper('url');
     $this->load->helper('cookie');
     $this->load->helper('text_helper');
     $this->load->helper('form');
     $this->load->helper('pagination');
     $this->load->helper('translate');
     $this->load->helper('breadcrumb');
     // Load Specific Models
     $this->load->model('settings_model');
     // Load System Config
     $this->settings_model->load('system');
     // Check if session is locked
     if (is_locked()) {
         redirect('auth/locked');
     } else {
         // Otherwise update last activity
         update_last_activity();
     }
     // Load System Config
     $this->settings_model->load('system');
     // Load Other Model
     $this->load->model('auth_model');
     $this->load->model('mailer_model');
     $this->load->model('translate_model');
     // Load Library
     $this->load->library('template', array('themes_system' => $themes_system, 'themes_default' => $this->settings_model->system['_system_theme_frontend_']));
 }
Esempio n. 3
0
 * @link      http://www.informatikon.com/
 */
session_start();
global $Ossn;
if (!isset($Ossn)) {
    $Ossn = new stdClass();
}
include_once dirname(dirname(__FILE__)) . '/libraries/ossn.lib.route.php';
if (!is_file(ossn_route()->configs . 'ossn.config.site.php') && !is_file(ossn_route()->configs . 'ossn.config.db.php')) {
    header("Location: installation");
    exit;
}
include_once ossn_route()->configs . 'libraries.php';
include_once ossn_route()->configs . 'classes.php';
include_once ossn_route()->configs . 'ossn.config.site.php';
include_once ossn_route()->configs . 'ossn.config.db.php';
foreach ($Ossn->classes as $class) {
    if (!(include_once ossn_route()->classes . "Ossn{$class}.php")) {
        throw new exception('Cannot include all classes');
    }
}
foreach ($Ossn->libraries as $lib) {
    if (!(include_once ossn_route()->libs . "ossn.lib.{$lib}.php")) {
        throw new exception('Cannot include all libraries');
    }
}
ossn_trigger_callback('ossn', 'init');
//need to update user last_action
// @note why its here?
update_last_activity();
Esempio n. 4
-2
<?php

session_start();
//Initialisations
require_once 'controller/global.php';
require_once 'controller/sql.php';
$DB = connect_to_db();
$PAGES_LIST = array('profil', 'profil/modifier', 'messagerie', 'messagerie/envoyer', 'carte', 'carte/creer', 'news', 'news/suivant', 'news/precedent');
$PAGES_USER_LIST = array('inscription', 'connexion', 'deconnexion', 'recuperation');
$STATIC_PAGES_LIST = array('informations');
//Mise à jour de la dernière activité
if (isset($_SESSION['pseudo'])) {
    include_once 'model/user/update_last_activity.php';
    update_last_activity($_SESSION['pseudo']);
}
//Routeur
if (isset($_GET['page']) and $_GET['page'] != NULL) {
    if (in_array($_GET['page'], $PAGES_LIST)) {
        include_once 'controller/' . $_GET['page'] . '/index.php';
    } elseif (in_array($_GET['page'], $PAGES_USER_LIST)) {
        include_once 'controller/user/' . $_GET['page'] . '/index.php';
    } elseif (in_array($_GET['page'], $STATIC_PAGES_LIST)) {
        include_once 'view/' . $_GET['page'] . '/index.php';
    } else {
        header('location: /covoiturage-yann/');
    }
} else {
    include 'controller/index.php';
}