summaryrefslogtreecommitdiff
path: root/www
diff options
context:
space:
mode:
Diffstat (limited to 'www')
-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;
+ }
+}