diff options
| author | moehm | 2014-03-26 13:06:09 +0100 |
|---|---|---|
| committer | moehm | 2014-03-26 13:06:09 +0100 |
| commit | cb74ce9e9702677225102fc06b5adda8ce692cdc (patch) | |
| tree | 2597430952958147f12f36d8ea8fd367b1b8715e /www/index.php | |
| parent | caa6a7afee2da0d62cd31ef76506d0f37e259f4d (diff) | |
| download | files.iamfabulous.de-cb74ce9e9702677225102fc06b5adda8ce692cdc.tar.gz | |
More improvements. Fix in the index, also added password_recover and changed the requirements for the upload interface.
Diffstat (limited to 'www/index.php')
| -rwxr-xr-x | www/index.php | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/www/index.php b/www/index.php index 4b09452..5866411 100755 --- a/www/index.php +++ b/www/index.php @@ -24,6 +24,10 @@ if(empty($_GET)){ switch($_GET["task"]){ case("login"): if($_SERVER['REQUEST_METHOD'] == 'POST'){ + if($_SESSION["login"]){ + header("Refresh: 0; ".$scheme.$_SERVER["HTTP_HOST"]."/".$_SESSION["username"]); + exit; + } $var = login($db); if($var == LOGIN_SUCCESSFULL){ header("Refresh: 0; ".$scheme.$_SERVER["HTTP_HOST"]."/".$_SESSION["username"]); @@ -42,6 +46,11 @@ if(empty($_GET)){ break; case("logout"): + if(!$_SESSION["login"]){ + print_login(constant("EMPTY")); + exit; + } + $var = logout(); if($var == LOGOUT_SUCCESSFULL){ print_login($var); @@ -53,6 +62,7 @@ if(empty($_GET)){ case("invite"): if(!$_SESSION["login"]){ print_login(constant("EMPTY")); + exit; } if($_SERVER['REQUEST_METHOD'] == 'POST'){ @@ -85,7 +95,7 @@ if(empty($_GET)){ } break; - case("download"): //not implemented yet + case("download"): if(!isset($_GET["hash"])){ $download_hash = ""; } else { @@ -107,6 +117,18 @@ if(empty($_GET)){ account($db); break; + case("password_recover"): + if($_SERVER['REQUEST_METHOD'] == 'POST'){ + $var = recover_password($db); //TODO: Print error message + if($var == RECOVER_PROHIBITED || $var = RECOVER_EMAIL){ + echo $var; + exit; + } + } else { + print_recover_password(); + } + break; + default: get_404($_GET["task"], $_GET["task"]); //TODO: Commit EMPTY constant break; |
