Example #1
0
<?php

require_once "php/config.php";
require_once 'php/admin.php';
require_once "php/header.php";
?>



	<div id="content">

		<?php 
// do poprawy - najpierw sprawdza sesje, pozniej isset
if (isset($_POST['login']) && isset($_POST['pass'])) {
    $admin = new adminPanel($login, $password, $_POST['login'], $_POST['pass']);
    $admin->login();
}
if (isset($_SESSION['admin'])) {
    if ($_SESSION['admin'] == true) {
        require_once 'php/adminPanel-form.php';
    } else {
        require_once 'php/adminPanel-login.php';
        echo '<center><span class="login_error">Błąd. Nieprawidłowe dane.</span></center>';
    }
} else {
    require_once 'php/adminPanel-login.php';
}
?>

	</div>
		
Example #2
0
xRegistry::set('TMS', $TMS = new tMultiSection());
xPDO::setSource(DB_HOST, DB_NAME, DB_USER, DB_PASS);
xRegistry::set('xPDO', xPDO::getInstance());
xNameSpaceHolder::addObjectToNS('E', new ENHANCE());
require_once xConfig::get('PATH', 'XOAD') . 'xoad.php';
require_once xConfig::get('PATH', 'ADM') . 'logger.class.php';
require_once xConfig::get('PATH', 'ADM') . 'adm.class.php';
if ($_REQUEST['xoadCall']) {
    ob_start();
    $adm = new adminPanel();
    $adm->startMapping();
    if (XOAD_Server::runServer()) {
        $all = ob_get_contents();
        ob_end_clean();
        if ($_COMMON_SITE_CONF['output_html_compress']) {
            Common::compress_output($all);
        }
        echo $all;
        exit;
    }
} elseif ($_REQUEST['action']) {
    $adm = new adminPanel();
    echo $adm->dispatchAction($_GET['action']);
} else {
    $tpl = xCore::moduleFactory('templates.back');
    $adm = new adminPanel();
    //$data['xObject']=XOAD_Client::register(new adminPanel());
    $data['xConnector'] = XOAD_Client::register(new Connector());
    echo $adm->buildMainPage($data);
}
die;
Example #3
0
<?php

preg_match('@^(?:www.)?([^/]+)@i', $_SERVER["HTTP_HOST"], $m);
define("REAL_HTTP_HOST", $m[1]);
require_once 'inc/core/helpers.php';
require_once 'conf/init.php';
require_once xConfig::get('PATH', 'CORE') . 'core.php';
require_once xConfig::get('PATH', 'ADM') . 'adm.class.php';
xRegistry::set('TMS', $TMS = new tMultiSection());
xPDO::setSource(DB_HOST, DB_NAME, DB_USER, DB_PASS);
xRegistry::set('xPDO', xPDO::getInstance());
session_start();
@session_destroy();
@session_start();
$adm = new adminPanel();
$_SESSION['lang'] = $_COMMON_SITE_CONF['default_language'];
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
    if ($_POST['login'] && $_POST['password']) {
        $users = xCore::loadCommonClass('users');
        if ($users->checkAndLoadUser($_POST['login'], $_POST['password'])) {
            if ($_POST['lang']) {
                $_SESSION['lang'] = $_POST['lang'];
            }
            if ($_POST['clearGSTORAGE']) {
                $_SESSION['clearGSTORAGE'] = 1;
            }
            header('location: admin.php?');
            exit;
        }
    }
    echo $adm->showLogin(true);