hopefully working now
This commit is contained in:
		
							
								
								
									
										15
									
								
								index.php
									
									
									
									
									
								
							
							
						
						
									
										15
									
								
								index.php
									
									
									
									
									
								
							@@ -16,14 +16,25 @@ require_once 'config.php';
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
$paths_to_check = array();
 | 
					$paths_to_check = array();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 | 
				
			||||||
$page = basename($_SERVER['QUERY_STRING']);
 | 
					$page = basename($_SERVER['QUERY_STRING']);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
$nav = include_ob("$template_dir/navigation.html");
 | 
					$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)){
 | 
					if(empty($page)){
 | 
				
			||||||
 | 
					    if(isset($_SESSION['user_id'])){
 | 
				
			||||||
        $page = 'index';
 | 
					        $page = 'index';
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					    else{
 | 
				
			||||||
 | 
					        $page = 'login';
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// Check if user is logged in
 | 
					// Check if user is logged in
 | 
				
			||||||
if (isset($_SESSION['user_id'])) {
 | 
					if (isset($_SESSION['user_id'])) {
 | 
				
			||||||
@@ -37,6 +48,8 @@ $paths_to_check[] = "pages/global";
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
$page_file = "$template_dir/404.html";
 | 
					$page_file = "$template_dir/404.html";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
foreach($paths_to_check as $page_dir){
 | 
					foreach($paths_to_check as $page_dir){
 | 
				
			||||||
    $page_file_tmp = "$page_dir/$page.html";
 | 
					    $page_file_tmp = "$page_dir/$page.html";
 | 
				
			||||||
    if(file_exists($page_file_tmp)){
 | 
					    if(file_exists($page_file_tmp)){
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,2 +0,0 @@
 | 
				
			|||||||
<!--PAGENAME=You dont have any rights-->
 | 
					 | 
				
			||||||
<h1>Watch something</h1>
 | 
					 | 
				
			||||||
@@ -1,5 +1,6 @@
 | 
				
			|||||||
<?php
 | 
					<?php
 | 
				
			||||||
if ($_SERVER["REQUEST_METHOD"] == "POST") {
 | 
					if ($_SERVER["REQUEST_METHOD"] == "POST") {
 | 
				
			||||||
 | 
					    global $mysqli;
 | 
				
			||||||
    // Handle login form submission
 | 
					    // Handle login form submission
 | 
				
			||||||
    $email = $_POST['email'];
 | 
					    $email = $_POST['email'];
 | 
				
			||||||
    $password = $_POST['password'];
 | 
					    $password = $_POST['password'];
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user