From ed99654d2e139a847a63e9295bf976d17462ee34 Mon Sep 17 00:00:00 2001 From: Malf Furious Date: Sat, 22 Oct 2016 00:29:30 -0400 Subject: Deprecate application code Setup to perform an iteration of development focused on a simpler implementation and eliminating redundancy in design. --- examples/app/file.php | 71 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 examples/app/file.php (limited to 'examples/app/file.php') diff --git a/examples/app/file.php b/examples/app/file.php new file mode 100644 index 0000000..ceee9f7 --- /dev/null +++ b/examples/app/file.php @@ -0,0 +1,71 @@ +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(); +$res->handle($_REQUEST['d'], $_REQUEST['f']); + +?> -- cgit v1.2.3