示例#1
0
<?php

defined('__SIEVAL__') or die('Acces interdit');
global $session;
switch ($tache) {
    case 'base':
        base();
        break;
    case 'creer_session':
        creer_session();
        break;
    case 'modifier_session':
        modifier_session();
        break;
    case 'supprimer_session':
        supprimer_session();
        break;
    case 'gerer_candidature':
        gerer_candidature();
        break;
    case 'modifier_candidature':
        modifier_candidature();
        break;
    case 'modifier_motif':
        modifier_motif();
        break;
    case 'lister_session':
        lister_session();
        break;
    case 'importer':
        importer();
示例#2
0
function verifier_session($id_session)
{
    // Test with the current alea
    $ok = false;
    if ($id_session) {
        $session_file = get_session_file($id_session, read_meta('alea_ephemere'));
        if (@file_exists($session_file)) {
            include $session_file;
            $ok = true;
        } else {
            // Else, check with the previous alea
            $session_file = get_session_file($id_session, read_meta('alea_ephemere_ancien'));
            if (@file_exists($session_file)) {
                // Renouveler la session (avec l'alea courant)
                include $session_file;
                supprimer_session($id_session);
                lcm_add_session($GLOBALS['author_session'], $id_session);
                $ok = true;
            }
        }
    }
    // if necessary, mark the session as 'ip-change'
    if ($ok and hash_env() != $GLOBALS['author_session']['hash_env'] and !$GLOBALS['author_session']['ip_change']) {
        $GLOBALS['author_session']['ip_change'] = true;
        lcm_add_session($GLOBALS['author_session'], $id_session);
    }
    // Clean included data from session file
    // It used to be done in inc_version, but makes more sense only here
    // Example where it applies: lcm_author.name_first = Math'ieu, etc.
    // Note: Variable not always set, e.g. auth failed
    if (isset($GLOBALS['author_session']) && count($GLOBALS['author_session'])) {
        foreach ($GLOBALS['author_session'] as $key => $val) {
            $GLOBALS['author_session'][$key] = stripslashes($val);
        }
    }
    return $ok;
}