diff options
| author | Horus3 | 2014-03-27 00:23:09 +0100 |
|---|---|---|
| committer | Horus3 | 2014-03-27 00:23:09 +0100 |
| commit | 09b1bac5a4543cdacc67be1752d9593d58a3eee0 (patch) | |
| tree | 19458c42cd699ea98d9b423618db633cb9e886f3 /www | |
| parent | 768f0f6a1ec5aaaa576fdc1bd283973a8a5ffc89 (diff) | |
| parent | 43933b5939b329a4ab333b093a370dabe995e0ad (diff) | |
| download | files.iamfabulous.de-09b1bac5a4543cdacc67be1752d9593d58a3eee0.tar.gz | |
Merge branch 'master' of git.iamfabulous.de:files.iamfabulous.de
Diffstat (limited to 'www')
| -rwxr-xr-x | www/functions/func_rewrite.php | 2 | ||||
| -rwxr-xr-x | www/functions/func_upload.php | 7 | ||||
| -rwxr-xr-x | www/index.php | 16 |
3 files changed, 10 insertions, 15 deletions
diff --git a/www/functions/func_rewrite.php b/www/functions/func_rewrite.php index d9f694d..0a123d6 100755 --- a/www/functions/func_rewrite.php +++ b/www/functions/func_rewrite.php @@ -16,7 +16,9 @@ function rewrite($db){ } if($_SESSION["login"]){ + $scheme = $GLOBALS["scheme"]; header("Refresh: 0; ".$scheme.$_SERVER["HTTP_HOST"]."/" . $_SESSION['username'] . "/" . $_GET["name"] . "/" . $folder . ""); + exit; } return false; diff --git a/www/functions/func_upload.php b/www/functions/func_upload.php index 674b4cd..89bfbc0 100755 --- a/www/functions/func_upload.php +++ b/www/functions/func_upload.php @@ -33,10 +33,7 @@ function upload($path){ return UPLOAD_FOLDER_NOT_OWNER; } - $ownername = SQLite3::escapeString($_SESSION['username']); - $owner_db = $db->query("SELECT id FROM user WHERE name='" . $ownername . "';"); - $owner_ar = $owner_db->fetchArray(SQLITE3_NUM); - $owner = $owner_ar[0]; + $owner = $_SESSION["userid"]; $overall_size_db = $db->query("SELECT size FROM files WHERE owner=" . $owner . " AND size > 0;"); $overall_size = 0; @@ -45,7 +42,7 @@ function upload($path){ $overall_size = $overall_size + $row[$count]; $count++; } - + if($overall_size > 2147483648){ // == 2GB return UPLOAD_QUOTA; } diff --git a/www/index.php b/www/index.php index 5866411..de33f64 100755 --- a/www/index.php +++ b/www/index.php @@ -23,11 +23,12 @@ if(empty($_GET)){ if(empty($_GET["name"])){ switch($_GET["task"]){ case("login"): + if($_SESSION["login"]){ + header("Refresh: 0; ".$scheme.$_SERVER["HTTP_HOST"]."/".$_SESSION["username"]); + exit; + } + 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"]); @@ -36,12 +37,7 @@ if(empty($_GET)){ print_login($var); } } else { - if(!$_SESSION["login"]){ - print_login(constant("EMPTY")); - } else { - header("Refresh: 0; ".$scheme.$_SERVER["HTTP_HOST"]."/" . $_SESSION["username"]); - exit; - } + print_login(constant("EMPTY")); } break; |
