summaryrefslogtreecommitdiff
path: root/www/functions
diff options
context:
space:
mode:
authorHorus32014-03-16 20:38:23 +0100
committerHorus32014-03-16 20:38:23 +0100
commit1246415f35b3a45486808d27b0649b373f2740d2 (patch)
treed28fc0b981faea663a28925dae35514c55ad4b5d /www/functions
parent07297d606d209aa4d70d25fe9d72d80e1131c19e (diff)
downloadfiles.iamfabulous.de-1246415f35b3a45486808d27b0649b373f2740d2.tar.gz
Added new constant 'REGISTER_INVITEKEY'
Diffstat (limited to 'www/functions')
-rwxr-xr-xwww/functions/func_register.php8
-rwxr-xr-xwww/functions/func_select.php4
2 files changed, 8 insertions, 4 deletions
diff --git a/www/functions/func_register.php b/www/functions/func_register.php
index 8321339..fc93058 100755
--- a/www/functions/func_register.php
+++ b/www/functions/func_register.php
@@ -25,12 +25,16 @@ function register($db){
$test_status_ar = $test_status_db->fetchArray(SQLITE3_NUM);
$test_status_int = $test_status_ar[0];
+ if (empty($test_status_ar) || $test_status_int != 0){
+ return REGISTER_PROHIBITED;
+ }
+
$test_key_db = $db->query("SELECT key FROM user WHERE email='" . $safe_email . "';");
$test_key_ar = $test_key_db->fetchArray(SQLITE3_NUM);
$test_key = $test_key_ar[0];
- if (empty($test_status_ar) || $test_status_int != 0 || $test_key != $_POST["key"] || $test_key == ""){
- return REGISTER_PROHIBITED;
+ if ($test_key != $_POST["key"] || $test_key == ""){
+ return REGISTER_INVITEKEY;
}
$id_db = $db->query("SELECT id FROM user WHERE email='" . $safe_email . "';");
diff --git a/www/functions/func_select.php b/www/functions/func_select.php
index 204f2d7..f0dc601 100755
--- a/www/functions/func_select.php
+++ b/www/functions/func_select.php
@@ -2,9 +2,9 @@
function select($db, $owner){
if($_SESSION["login"] && $_SESSION["userid"] == $owner){ // TODO: Check if loged in user really the user who does the query - fix 12.3.14
- $share="";
+ $share=""; // to print all files, even hidden ones
} else {
- $share ="AND share='PUBLIC'";
+ $share ="AND share='PUBLIC'"; // just use files with the correct permissions
}
if(empty($_GET["folder"])){