hopefully working now
This commit is contained in:
		
							
								
								
									
										17
									
								
								index.php
									
									
									
									
									
								
							
							
						
						
									
										17
									
								
								index.php
									
									
									
									
									
								
							@@ -16,13 +16,24 @@ require_once 'config.php';
 | 
			
		||||
 | 
			
		||||
$paths_to_check = array();
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
$page = basename($_SERVER['QUERY_STRING']);
 | 
			
		||||
 | 
			
		||||
$nav = include_ob("$template_dir/navigation.html");
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
if($page_dir == "global") {
 | 
			
		||||
    if(!file_exists("$page_dir/index.html")) {
 | 
			
		||||
        $page_file = "$page_dir/login.html";
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
if(empty($page)){
 | 
			
		||||
    $page = 'index';
 | 
			
		||||
    if(isset($_SESSION['user_id'])){
 | 
			
		||||
        $page = 'index';
 | 
			
		||||
    }
 | 
			
		||||
    else{
 | 
			
		||||
        $page = 'login';
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// Check if user is logged in
 | 
			
		||||
@@ -37,6 +48,8 @@ $paths_to_check[] = "pages/global";
 | 
			
		||||
 | 
			
		||||
$page_file = "$template_dir/404.html";
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
foreach($paths_to_check as $page_dir){
 | 
			
		||||
    $page_file_tmp = "$page_dir/$page.html";
 | 
			
		||||
    if(file_exists($page_file_tmp)){
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user