Exemplo n.º 1
0
 function admin_setCookies()
 {
     $admin_id = !empty($this->admin_info['admin_id']) ? $this->admin_info['admin_id'] : '';
     $admin_username = !empty($this->admin_info['admin_username']) ? $this->admin_password_crypt($this->admin_info['admin_username']) : '';
     $admin_password = !empty($this->admin_info['admin_password']) ? $this->admin_info['admin_password'] : '';
     // SAFE MODE (cookies)
     if (defined('SE_ADMIN_SAFE_MODE') && SE_ADMIN_SAFE_MODE === TRUE) {
         setcookie("admin_id", $admin_id, 0, "/");
         setcookie("admin_username", $admin_username, 0, "/");
         setcookie("admin_password", $admin_password, 0, "/");
     } else {
         $session_object =& SESession::getInstance();
         //$session_object->restart();
         $session_object->set('admin_id', $admin_id);
         $session_object->set('admin_username', $admin_username);
         $session_object->set('admin_password', $admin_password);
     }
 }
Exemplo n.º 2
0
<?php

define('SE_PAGE_AJAX', TRUE);
$page = "ie6_ajax";
include "header.php";
//Taking the session object
$session_object =& SESession::getInstance();
//Getting the value of show_ie6_popup from the session
$show_ie6_popups = $session_object->get('show_ie6_popup');
$task = $_POST['task'];
if ($task == 'show_popup') {
    if ($show_ie6_popups == 2) {
        //Setting the show_ie6_popup to 1 in the session
        $session_object->set('show_ie6_popup', 1);
    }
}
Exemplo n.º 3
0
$_GET = security($_GET);
$_COOKIE = security($_COOKIE);
// CREATE SESSION
$session_options = @unserialize($setting['setting_session_options']);
if (!empty($session_options)) {
    if (!empty($session_options['storage'])) {
        Configure::write('Session.save', $session_options['storage']);
    }
    if (!empty($session_options['name'])) {
        Configure::write('Session.cookie', $session_options['name']);
    }
    if (!empty($session_options['expire'])) {
        Configure::write('Session.timeout', $session_options['expire']);
    }
}
$session =& SESession::getInstance(null, true);
$session->engine(@$session_options['storage'], $session_options);
if (defined('SE_SESSION_RESUME') && SE_SESSION_RESUME && isset($session_id)) {
    $session->_userAgent = md5(env('HTTP_USER_AGENT') . Configure::read('Security.salt'));
    $session->id($session_id);
}
$session->start();
// CREATE CACHE OBJECT
$cache =& SECache::getInstance();
if (!empty($setting['setting_cache_enabled']) && !empty($setting['setting_cache_default'])) {
    $config = array();
    $config['engine'] = ucfirst($setting['setting_cache_default']);
    $config['duration'] = !empty($setting['setting_cache_lifetime']) ? $setting['setting_cache_lifetime'] : 3600;
    $config['prefix'] = 'se_';
    $cache_options = @unserialize($setting['setting_cache_' . $setting['setting_cache_default'] . '_options']);
    if (!$cache_options) {
Exemplo n.º 4
0
$database =& SEDatabase::getInstance();
// Use this line if you changed the way database connection is loaded
//$database = new se_database($database_host, $database_username, $database_password, $database_name);
// SET LANGUAGE CHARSET
$database->database_set_charset(SE_Language::info('charset'));
// GET SETTINGS
$setting = $database->database_fetch_assoc($database->database_query("SELECT * FROM se_settings LIMIT 1"));
// Instantiate caching object
$cache_object = SECache::getInstance();
// ENSURE NO SQL INJECTIONS THROUGH POST OR GET ARRAYS
$_POST = security($_POST);
$_GET = security($_GET);
$_COOKIE = security($_COOKIE);
// CREATE SESSION OBJECT
$session_options = defined('SE_SESSION_RESUME') && !empty($session_id) ? array('id' => $session_id, 'security' => array()) : array();
$session =& SESession::getInstance($session_options);
if ($session->getState() == 'expired') {
    $session->restart();
}
// CREATE URL CLASS
$url = new se_url();
// CREATE DATETIME CLASS
$datetime = new se_datetime();
// CREATE ADMIN OBJECT AND ATTEMPT TO LOG ADMIN IN
$admin = new SEAdmin();
$admin->admin_checkCookies();
// INSTANTIATE JAVASCRIPT OBJECT
$se_javascript = new SE_Javascript();
$smarty->assign_by_ref('se_javascript', $se_javascript);
// ADMIN IS NOT LOGGED IN AND NOT ON LOGIN PAGE
if ($page != "admin_login" && $page != "admin_lostpass" && $page != "admin_lostpass_reset" && $admin->admin_exists == 0) {
Exemplo n.º 5
0
    }
    if (!in_array($setting_session_options['storage'], $available_storage)) {
        $setting_session_options['storage'] = 'none';
    }
    // Serialize
    $setting_session_options = serialize($setting_session_options);
    // Assign
    $setting['setting_session_options'] = $setting_session_options;
    $smarty->assign_by_ref('setting', $setting);
    $sql = "UPDATE se_settings SET setting_session_options='{$setting_session_options}'";
    $database->database_query($sql) or die($database->database_error());
}
// Unserialize options for template/config generation
if ($setting['setting_session_options'] && is_string($setting['setting_session_options'])) {
    $session_options = @unserialize($setting['setting_session_options']);
}
if ($task != "dosave") {
    $filesession_test_root = preg_replace('/^[.]/', SE_ROOT, $session_options['root']);
    $memcache_test_servers = $session_options['servers'];
    $available_storage = SESession::getStorageHandlers();
    if (!is_array($available_storage)) {
        $available_storage = array();
    }
}
// ASSIGN VARIABLES AND SHOW PAGE
$smarty->assign('result', $result);
$smarty->assign('is_error', $is_error);
$smarty->assign('task', $task);
$smarty->assign('available_storage', $available_storage);
$smarty->assign('session_options', $session_options);
include "admin_footer.php";
Exemplo n.º 6
0
 function user_logout()
 {
     global $database;
     $session_object =& SESession::getInstance();
     // REMOVE AUTH TOKEN
     $this->user_auth_token_delete();
     // CLEAR LAST ACTIVITY DATE
     $database->database_query("DELETE FROM se_visitors WHERE visitor_user_id='{$this->user_info['user_id']}'");
     $session_object->clear('user_lastactive');
     // CREATE PLAINTEXT USER EMAIL COOKIE WHILE LOGGED OUT
     setcookie("prev_email", $this->user_info['user_email'], time() + 99999999, "/");
     $this->user_clear();
     $this->user_setcookies();
 }
Exemplo n.º 7
0
 function provider_setCookies()
 {
     $provider_id = !empty($this->provider_info['provider_id']) ? $this->provider_info['provider_id'] : '';
     $provider_username = !empty($this->provider_info['username']) ? $this->provider_password_crypt($this->provider_info['username']) : '';
     $provider_password = !empty($this->provider_info['password']) ? $this->provider_info['password'] : '';
     $provider_category = !empty($this->provider_info['category']) ? $this->provider_info['category'] : '';
     $provider_active = !empty($this->active_login) ? $this->active_login : '';
     // SAFE MODE (cookies)
     if (defined('SE_PROVIDER_SAFE_MODE') && SE_PROVIDER_SAFE_MODE === TRUE) {
         setcookie("provider_id", $provider_id, 0, "/");
         setcookie("username", $provider_username, 0, "/");
         setcookie("password", $provider_password, 0, "/");
         setcookie("category", $provider_category, 0, "/");
         setcookie("active", $provider_active, 0, "/");
     } else {
         $session_object =& SESession::getInstance();
         //$session_object->restart();
         $session_object->set('provider_id', $provider_id);
         $session_object->set('username', $provider_username);
         $session_object->set('password', $provider_password);
         $session_object->set('category', $provider_category);
         $session_object->set('active', $provider_active);
     }
 }
Exemplo n.º 8
0
 function engine($name = 'None', $settings = array())
 {
     $sessionClass = 'Session' . $name . 'Engine';
     $_this =& SESession::getInstance();
     if (!isset($_this->_Engine[$name])) {
         if ($_this->__loadEngine($name) === false) {
             return false;
         }
         $_this->_Engine[$name] =& new $sessionClass();
     }
     if ($_this->_Engine[$name]->init($settings)) {
         if (time() % $_this->_Engine[$name]->settings['probability'] === 0) {
             $_this->_Engine[$name]->gc();
         }
         return true;
     }
     $_this->_Engine[$name] = null;
     return false;
 }