Пример #1
0
 public final function __construct()
 {
     \Logger::configure("..\\config\\logger.xml");
     $this->log = \Logger::getLogger(__CLASS__);
     /** @var $this->Session Session */
     $this->Session = \src\singleton\Session::inst();
     $this->Session->Start();
     $this->RenderPage();
 }
Пример #2
0
<?php

require_once 'Core/Core.php';
$ClassConstructor = array($Database, $Smarty);
switch ($_REQUEST['category']) {
    case 'account':
        if (!Session::SessionStatus()) {
            Session::Start('FreedomCore', false);
        }
        if (!Text::IsNull($_REQUEST['subcategory'])) {
            if (isset($User['id'])) {
                $AccountBalance = Account::GetBalance($User['username']);
                $Smarty->assign('AccountBalance', $AccountBalance);
            }
            switch ($_REQUEST['subcategory']) {
                case 'login':
                    $Smarty->assign('CSRFToken', Session::GenerateCSRFToken());
                    $Smarty->assign('Page', Page::Info('login', array('bodycss' => 'login-template web wow', 'pagetitle' => $Smarty->GetConfigVars('Account_Login') . ' - ')));
                    $Smarty->display('pages/account_login');
                    break;
                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());
Пример #3
0
*/
spl_autoload_extensions('.php');
spl_autoload_register();
ini_set("memory_limit", "128M");
/**
*	Set Error reporting
*/
error_reporting(E_STRICT | E_ALL);
ini_set('track_errors', 1);
/* Set application path */
PathManager::SetApplicationPath(dirname(dirname(__FILE__)));
/**
*	Load Configuration
*/
Configuration::LoadConfiguration();
/**
*	We will handle Errors
*/
set_error_handler(array('Error', 'ErrorHandler'));
set_exception_handler(array('Error', 'ExceptionHandler'));
/**
*	default timezone should be in configuration
*/
date_default_timezone_set(Configuration::Query('/configuration/timezone')->item(0)->nodeValue);
/**
* Start Session
*/
session_set_cookie_params(0, '/', '', 0, 1);
ini_set('session.cookie_httponly', 1);
Session::Start();
Пример #4
0
 * @author     Serg Podtynnyi <*****@*****.**>
 */
if (basename($_SERVER["SCRIPT_NAME"]) == basename(__FILE__)) {
    die;
}
/**
 *
 * @param string $class_name
 * @return void
 */
function __autoload($class_name)
{
    if (stristr($class_name, "exception")) {
        require_once "include/" . 'exceptions.class.php';
        Debug::Log("Exceptions loaded!");
    } else {
        require_once "include/" . strtolower($class_name) . '.class.php';
        Debug::Log("Class " . $class_name . " loaded!");
    }
}
include "settings.php";
// Internal settings (do not modify if you are not sure what you are doing).
$SYSTEM_FOLDERS = array("/idea", "/ideas", "/img", "/include", "/login", "/logout", "/profile", "/dashboard", "/register", "/themes", "/lang");
$out = str_replace($SYSTEM_FOLDERS, "#", $_SERVER["REQUEST_URI"]);
define("PREFIX", strstr($out, '#') != "" ? '..' : '.');
define("THEME_PREFIX", (strstr($out, '#') != "" ? '..' : '.') . "/themes/" . SITE_THEME);
define("REQ_URL", $_SERVER["HTTP_HOST"] . $_SERVER["REQUEST_URI"]);
Server::Normalize();
I18n::Load();
User::$current = Session::Start();