Example #1
0
 /**
  * Return default skin path from configuration
  */
 private static function GetDefault()
 {
     /**
      *	Multilenguage Support
      */
     $lang = Session::Get('lang');
     if (!$lang) {
         $default = Configuration::Query("/configuration/skins/skin[@default='1']");
         /* We should have one default skin */
         if (!$default) {
             Error::Alert('Default Skin is not defined.');
         }
         /* Default skin should have the language defined */
         $lang = $default->item(0)->getAttribute('lang');
         if (empty($lang)) {
             Error::Alert('Default Skin does not have a language defined.');
         }
         Session::Set('lang', $lang);
     }
     // Util::debug($lang);
     $skin = Configuration::Query("/configuration/skins/skin[@lang='" . $lang . "']/path");
     /* If there is not a skin for the language stored, something is really wrong */
     if (!$skin) {
         Session::Destroy('lang');
         Error::Alert('Could not load the skin for language "' . $lang . '".');
     }
     $default = $skin->item(0)->nodeValue;
     $subdir = Configuration::Query('/configuration/domain/@subdir');
     if ($subdir) {
         $default = '/' . $subdir->item(0)->nodeValue . $default;
     }
     return $default;
 }
include 'Sorteios.php';
include 'Participantes.php';
include 'Ganhadores.php';
include 'Checkout.php';
include 'Vendas.php';
include 'Cadastros.php';
include 'ProdutosInfo.php';
$querys = new Querys();
// Inicia Classe Querys
$session = new Session();
// Inicia Classe Session
$session->StartSession();
// Inicia SESSION
$user = new User();
// Inicia Classe User
$sorteios = new Sorteios();
$participantes = new Participantes();
$ganhadores = new Ganhadores();
$produtos_info = new ProdutosInfo();
$vendas = new Vendas();
if (!isset($session->data['user']['user_login']) and !isset($session->data['user']['user_cpf'])) {
    $session->Destroy('user');
} else {
    $user->CheckLogin($session->data);
    if ($user->isLoggedUser()) {
        if ($user->isConfirmed() == '0') {
            $S_NotConfirmed = true;
        }
        $S_UserLogin = $user->isLoggedUser();
    }
}
Example #3
0
 case 'pin':
     $Headers = apache_request_headers();
     $IsAjax = isset($Headers['X-Requested-With']) && $Headers['X-Requested-With'] == 'XMLHttpRequest';
     if ($IsAjax) {
         Account::PinCharacter($_SESSION['username'], $_REQUEST['lastcategory']);
     } else {
         header('Location: /');
     }
     break;
 case 'create':
     $Smarty->assign('CSRFToken', Session::GenerateCSRFToken());
     $Smarty->assign('Page', Page::Info('login', array('bodycss' => 'login-template web wow', 'pagetitle' => $Smarty->GetConfigVars('Account_Create') . ' - ')));
     $Smarty->display('pages/account_create');
     break;
 case 'signout':
     Session::Destroy(session_id());
     session_destroy();
     setcookie("FreedomCoreLanguage", null, time() - 3600);
     header('Location: /');
     break;
 case 'management':
     if ($_SESSION['loggedin'] != true) {
         header('Location: /account/login');
     }
     $Smarty->translate('Account');
     if (String::IsNull($_REQUEST['lastcategory'])) {
         $Smarty->assign('User', $User);
         $Smarty->assign('Accounts', Account::GetGameAccounts($User['username']));
         $Smarty->assign('Page', Page::Info('account_management', array('bodycss' => '', 'pagetitle' => $Smarty->GetConfigVars('Account_Management'))));
         $Smarty->display('account/account_management');
     } else {
Example #4
0
<?php

require_once "../classes/Session.php";
$session = new Session();
$session->Destroy();
 /**
  * Metodo login logoutUser
  *
  * @access public
  * @return void
  */
 public function logoutUser()
 {
     $session = new Session();
     $session->StartSession();
     $session->Destroy('user');
     $this->act_accounts_id = '';
     $this->act_account_nome = '';
     $this->act_account_cpf = '';
     $this->act_account_email = '';
     session_destroy();
 }
Example #6
0
$emsg = "";
if (Request::Post('login_key') == "1") {
    $username = Request::Post('username');
    $password = Request::Post('password');
    if ($username == "" || $password == "") {
        $emsg = "Please enter both username and password.";
    } else {
        $db = new Db($db_config);
        $sql = <<<SQL
SELECT * FROM `users`
WHERE `username` = '%s' AND `password` = '%s' AND `active` = 1
SQL;
        $sql = sprintf($sql, $db->escString($username), $db->escString(md5($password . SALT)));
        if ($db->numRows($sql) > 0) {
            $user = $db->row($sql);
            $db->execute(sprintf("UPDATE `users` SET `logged_at` = '%s' WHERE `id` = %d", date('Y-m-d h:i:s'), (int) $db->escString($user['id'])));
            Session::Set('username', $user['username']);
            Session::Set('id', $user['id']);
            Response::Redirect(ADMIN_ROOT . 'index.php');
        } else {
            $emsg = "Login Failed";
        }
    }
}
if (Request::Get('logout') == 'true') {
    Session::Destroy('username');
    Session::Destroy('id');
    Response::Redirect(ADMIN_ROOT . 'login.php');
}
//-------------------------------------------------------
echo Util::Render('master.phtml', array('page_title' => 'Login', 'content' => Util::Render('login.phtml', array('emsg' => $emsg))));
Example #7
0
<?php

Session::Destroy();
RedirectTimer("dashboard", 0);