summaryrefslogtreecommitdiff
path: root/www
diff options
context:
space:
mode:
authorroot2014-03-26 23:51:57 +0100
committerroot2014-03-26 23:51:57 +0100
commit43933b5939b329a4ab333b093a370dabe995e0ad (patch)
tree2a91a58038943a8998776edaf33ab003860c7b6f /www
parentcb74ce9e9702677225102fc06b5adda8ce692cdc (diff)
downloadfiles.iamfabulous.de-43933b5939b329a4ab333b093a370dabe995e0ad.tar.gz
Small changes.
Diffstat (limited to 'www')
-rwxr-xr-xwww/functions/func_rewrite.php2
-rwxr-xr-xwww/functions/func_upload.php7
-rwxr-xr-xwww/index.php16
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 8059191..dd113fc 100755
--- a/www/functions/func_upload.php
+++ b/www/functions/func_upload.php
@@ -50,10 +50,7 @@ function upload($db){
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;
@@ -62,7 +59,7 @@ function upload($db){
$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;