summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--app/file.php24
1 files changed, 24 insertions, 0 deletions
diff --git a/app/file.php b/app/file.php
index 17044f3..3c34a89 100644
--- a/app/file.php
+++ b/app/file.php
@@ -25,6 +25,30 @@ class Resource extends Framework
case "img/heads": $this->heads($file); break;
}
}
+
+ /*
+ * Request a user head (user image)
+ * Requester must be currently logged in
+ */
+ function heads($file)
+ {
+ if (!$this->getCurrentUser())
+ return;
+
+ if (!file_exists("assets/img/heads/" . $file))
+ $file = "null.jpg";
+
+ $file = "assets/img/heads/" . $file;
+ $f = fopen($file, "rb");
+
+ if (!$f)
+ return;
+
+ header("Content-type: " . mime_content_type($file));
+ header("Content-length: " . filesize($file));
+ fpassthru($f);
+ fclose($f);
+ }
}
$res = new Resource();