diff options
Diffstat (limited to 'www')
| -rwxr-xr-x | www/createfolder.php | 6 | ||||
| -rwxr-xr-x | www/functions/func_login.php | 3 | ||||
| -rwxr-xr-x | www/index.php | 5 |
3 files changed, 10 insertions, 4 deletions
diff --git a/www/createfolder.php b/www/createfolder.php index bdba626..563f352 100755 --- a/www/createfolder.php +++ b/www/createfolder.php @@ -1,8 +1,10 @@ <?php +/* DO NOT TOUCH! This is buggy as hell. */ + session_start(); -if(!isset($_SESSION["login"])){ +if(!$_SESSION["login"]){ header("Refresh: 0; /login"); exit; } @@ -59,7 +61,7 @@ if($_SERVER['REQUEST_METHOD'] == 'POST'){ database_error(); } } else { - $primary_key_db = $db->query("SELECT id FROM files WHERE name='".$pwd."';"); //TODO That doesn't make any sense to me at all! + $primary_key_db = $db->query("SELECT id FROM files WHERE name='".$pwd."';"); //TODO That doesn't make any sense to me at all! //This makes sense in the context. $primary_key_ar = $primary_key_db->fetchArray(SQLITE3_NUM); $primary_key = $primary_key_ar[0]; if($db->exec(" diff --git a/www/functions/func_login.php b/www/functions/func_login.php index 86caf40..46bb6d0 100755 --- a/www/functions/func_login.php +++ b/www/functions/func_login.php @@ -45,10 +45,11 @@ function login($db){ return false; } } else { - if(isset($_SESSION["login"])){ + if($_SESSION["login"]){ header("Refresh: 0; /"); return false; } + include("login.php"); return false; } diff --git a/www/index.php b/www/index.php index 25a63e4..b73353b 100755 --- a/www/index.php +++ b/www/index.php @@ -6,9 +6,12 @@ require_once("include.php"); // handles all the stuff that needs to be included $db = new SQLite3("../database/sqlite.db"); +if(!isset($_SESSION["login"])){ + $_SESSION["login"] = false; +} if(empty($_GET)){ - if(!isset($_SESSION["login"])){ + if(!$_SESSION["login"]){ header("Refresh: 0; /login"); exit; } else { |
