summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHorus32014-03-17 17:12:11 +0100
committerHorus32014-03-17 17:12:11 +0100
commit1c8afbfabc15a35f84290ca7320da0e9e373747e (patch)
tree28084922eda13521d038f3eb9564f072c69ae5f2
parentfe5bc45ab8c7a9675e74319fac37b2f4931a5a8a (diff)
downloadfiles.iamfabulous.de-1c8afbfabc15a35f84290ca7320da0e9e373747e.tar.gz
func user_is_owner
-rwxr-xr-xwww/functions/func_user.php13
1 files changed, 13 insertions, 0 deletions
diff --git a/www/functions/func_user.php b/www/functions/func_user.php
index 193d0e0..5ee342f 100755
--- a/www/functions/func_user.php
+++ b/www/functions/func_user.php
@@ -22,3 +22,16 @@ function user($db, $user){
$owner = $owner_ar[0];
return $owner;
}
+
+function user_is_owner($username, $file_id){
+ $db = $GLOBALS["db"];
+
+ $owner_db = $db->query("SELECT owner FROM files WHERE id=". SQLite3::escapeString('$file_id') . ";");
+ $owner_ar = $owner_db->fetchArray(SQLITE3_NUM);
+
+ if($owner_ar[0] != $username){
+ return false;
+ } else {
+ return true;
+ }
+}