예제 #1
0
 function menu_principal()
 {
     session_start();
     $ss = new SecureSession();
     $ss->check_browser = true;
     $ss->check_ip_blocks = 3;
     $ss->regenerate_id = true;
     if (!$ss->Check() || !isset($_SESSION['logedinnimbus']) || !$_SESSION['logedinnimbus']) {
         $this->login();
     } else {
         if (isset($_SESSION['usuario']) && $_SESSION['usuario'] != "") {
             $datos_menu = $this->main_model->get_menu($_SESSION['usuario']);
             $datos_perfil = $this->main_model->get_profile($_SESSION['usuario']);
             $city_profile = $this->main_model->get_city_assignment($_SESSION['usuario']);
             $category_profile = $this->main_model->get_category_assignment($_SESSION['usuario']);
             $aux = ['area_id', 'faculty_id', 'program_id', 'course_id'];
             foreach ($datos_perfil as $key => $value) {
                 foreach ($value as $k => $v) {
                     if (in_array($k, $aux)) {
                         $_SESSION[$k][$key] = $v;
                     } else {
                         $_SESSION[$k] = $v;
                     }
                 }
             }
             $_SESSION['city'] = $city_profile;
             $_SESSION['category'] = $category_profile;
             $this->load->view('principal', $datos_menu);
         } else {
             $this->login();
         }
     }
 }
예제 #2
0
파일: index.php 프로젝트: hardkap/pritlog
    $_SESSION['timeout'] = time();
}
if (isset($_SESSION['start'])) {
    $_SESSION['start'] = false;
} else {
    $_SESSION['start'] = true;
}
$mypath = isset($_SERVER['PATH_INFO']) ? str_replace("/index.php", "", $_SERVER['PATH_INFO']) : "";
//$referrer=$blogPath.'/index.php'.$mypath;
$referrer = $serverName . $_SERVER['REQUEST_URI'];
if ($option == "mainPage") {
    $_SESSION['url'] = $referrer;
}
$accessArray = array('newEntry', 'newEntryForm', 'newEntrySubmit', 'newEntrySuccess', 'deleteEntry', 'editEntry', 'editEntryForm', 'editEntrySubmit', 'deleteComment', 'myProfile', 'myProfileSubmit');
if (in_array($option, $accessArray)) {
    if (!$ss->Check() || !isset($_SESSION['logged_in']) || !$_SESSION['logged_in']) {
        $_SESSION['notice'] = "";
        $_SESSION['url'] = $referrer;
        $_SESSION['access_type'] = "regular";
        header('Location: ' . $config['blogPath'] . $config['cleanIndex'] . '/loginPage');
        die;
    }
}
$adminAccessArray = array('adminPage', 'adminPageBasic', 'adminPageBasicSubmit', 'adminPageAdvanced', 'adminPageAdvancedSubmit', 'adminPageAuthors', 'adminAuthorsAdd', 'adminAuthorsEdit', 'adminPagePlugins', 'adminPluginsSubmit');
if (in_array($option, $adminAccessArray)) {
    if (!$ss->Check() || !isset($_SESSION['logged_in']) || !$_SESSION['logged_in'] || !$_SESSION['isAdmin']) {
        $_SESSION['notice'] = "";
        $_SESSION['url'] = $referrer;
        $_SESSION['access_type'] = "admin";
        header('Location: ' . $config['blogPath'] . $config['cleanIndex'] . '/loginPage');
        die;