diff options
| author | root | 2014-10-19 03:54:53 +0200 |
|---|---|---|
| committer | root | 2014-10-19 03:54:53 +0200 |
| commit | 2330bb06ececee220d854883a2870a3adf17c277 (patch) | |
| tree | e49f6b561faf5b39a81d57d54fa57a1550074c0f /foto/protected.php | |
| parent | a3009bf57d50fbc25a707b32fb3c5c170d011680 (diff) | |
| download | jungegemeinde-2330bb06ececee220d854883a2870a3adf17c277.tar.gz | |
Version 4.1. Support for photo galleries and advanced caching.
Diffstat (limited to 'foto/protected.php')
| -rw-r--r-- | foto/protected.php | 25 |
1 files changed, 0 insertions, 25 deletions
diff --git a/foto/protected.php b/foto/protected.php deleted file mode 100644 index c70772d..0000000 --- a/foto/protected.php +++ /dev/null @@ -1,25 +0,0 @@ -<?php - -lredirect("index"); - -if ( ! isset($_GET["type"]) || ! isset($_GET["id"]) ) - exit; - -switch($_GET["type"]){ - case("image"): - $sql = $db->prepare("SELECT name, mime, size, hash FROM " . DBPREFIX . "image WHERE id = %s;", $_GET["id"]); - $result = $db->doQuery($sql); - $f = $result->fetch_array(MYSQLI_ASSOC); - if ( ! file_exists(IMAGE_PATH . $f["hash"] . ".gz") ){ - header($_SERVER["HTTP_PROTOCOL"] . " 404 Not Found"); - } else { - header("Content-Type: " . $f["mime"]); - header("Content-Disposition: inline; filename=".$f["name"]); - header("Content-Length: " . $f["size"]); - - readgzfile(IMAGE_PATH . $f["hash"] . ".gz"); - } - break; - default: - header($_SERVER["HTTP_PROTOCOL"] . " 404 Not Found"); -} |
