Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- ini_set('display_errors', 1); // function script allows a script to temporarily override a setting in PHP congif file - display errprs set to on, represented by 1
- ini_set('display_startup_errors', 1); // set to true with 1 to display to override and display the errors
- error_reporting(E_ALL & ~E_NOTICE); // report all errors except E_NOTICE
- require_once(__DIR__.'/includes/boot.include.php');
- require_once(__DIR__.'/classes/user.class.php');
- if($_GET['p']){ // check if a page is requested and assign smarty to display the requested view
- $_SESSION['user_data'] = $user_data;
- // array which stores which pages should be secure
- $secure_pages = array('account','my_crate','changepassword', 'search_db', 'wantlist');
- //check if page being requested by the user is in the array
- if(in_array($_GET['p'], $secure_pages)){
- // if page being requested is in the array check if the user is logged in
- if(!$_SESSION['is_loggedin']) {
- header("Location: index.php?p=login");
- exit();
- }
- }
- $smarty->assign('view_name',$_GET['p']);
- require_once('controllers/'.$_GET['p'].'.php');
- $smarty->display('pages/'.$_GET['p'].'.tpl');
- }else{
- $smarty->assign('view_name', 'login');
- require_once('controllers/login.php');
- $smarty->display('pages/login.tpl');
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement