private function setSessions($aUser)
 {
     $_SESSION['session'] = session_id();
     cCfg::setUserData('id', $aUser['id']);
     cCfg::setUserData('name', $aUser['name']);
     cCfg::setUserData('surname', $aUser['surname']);
     cCfg::setUserData('roleid', $aUser['role']);
     cCfg::setUserData('role', $aUser['rolename']);
 }
Пример #2
0
 public function setUserAccount()
 {
     $result = cDb::select('useraccount', '*', array('user', '=', self::getUserData('id')));
     cCfg::$aUserData['account'] = array();
     if (is_array($result) && count($result)) {
         //cCfg::$idActiveUseraccount = $result[0]['id'];
         cCfg::$aUserData['account'] = $result[0];
     }
     $aDod = cDb::select('dodavatele', '*', array('useracc', '=', $result[0]['id']));
     cCfg::$aUserData['dodavatele'] = array();
     foreach ($aDod as $dod) {
         cCfg::$aUserData['dodavatele'][$dod['id']] = $dod;
         if (is_null(cCfg::$idActiveUseraccount)) {
             cCfg::$idActiveUseraccount = $dod['id'];
         }
     }
     cCfg::$logs->addLog(cCfg::$aUserData, 'aUserData');
 }
 private function setActualPageTree($sAction)
 {
     switch ($sAction) {
         case "":
             $this->aPageTree = self::getPageTree(cCfg::getDefaultPage('id'));
             break;
         default:
             $page = self::getLngPageData($sAction, 'url');
             /// page is published ///
             if ($page['published'] == '1') {
                 $this->aPageTree = self::getPageTree($page['id']);
             }
             break;
     }
     if (!count($this->aPageTree)) {
         $page = self::getPageData(cCfg::$sPageNotFound, 'name');
         $this->aPageTree = self::getPageTree($page['id']);
     }
 }
Пример #4
0
<?php

if (!session_id()) {
    @session_start();
}
require_once "../core/core_defines.inc.php";
require_once ROOT_PATH . "core/global_fce.php";
requireFile("admin/admin_fce.php");
$DB = new cDb();
$DB->connect();
$CFG = new cCfg();
$Logs = new cLogs("index.php");
$Logs->on();
$Logs->addLog($_POST, "POST");
$_aErrors = array();
$_aAlerts = array();
$Authent = new cAuthentication();
$bAut = $Authent->authenticate();
if (!$bAut && ADMIN_PAGE_ACCESS_AUTHORIZIED || $bAut && !$CFG->hasCapability('superadmin')) {
    header("Location: " . HTTP_PATH);
}
$_index_rights = true;
foreach ($_GET as $k => $v) {
    $_GET[$k] = get_magic_quotes_gpc() ? trim($v) : trim(addslashes($v));
}
/// update capabilities ///
if (isset($_POST['update_capab'])) {
    _updateCapabilities();
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
Пример #5
0
<?php

if (!session_id()) {
    @session_start();
}
require_once "core/core_defines.inc.php";
require_once "core/global_fce.php";
require_once "custom_defines.inc.php";
$Logs = new cLogs("index.php");
$Logs->on();
$Logs->addLog($_POST, "POST");
$DB = new cDb();
$connection = $DB->connect();
if ($connection) {
    $CFG = new cCfg();
    if (!isset($_GET['_pageAction_'])) {
        if (is_string($CFG->getDefaultPage('path'))) {
            header("Location: " . $CFG->getDefaultPage('path'));
        } else {
            if (!ADMIN_PAGE_ACCESS_AUTHORIZIED) {
                header("Location: " . HTTP_PATH . "admin");
            }
        }
    }
    $action = get_magic_quotes_gpc() ? $_GET['_pageAction_'] : addslashes($_GET['_pageAction_']);
    //$Logs->addLog($action,"_pageAction_");
    $CORE = new cBuildIndex($action);
    if (MK_DEBUG) {
        $CORE->addCssToHead("core/logs.css");
    }
    $Authent = new cAuthentication();