aboutsummaryrefslogtreecommitdiff
path: root/images/index.php
diff options
context:
space:
mode:
authorroot2014-10-19 03:54:53 +0200
committerroot2014-10-19 03:54:53 +0200
commit2330bb06ececee220d854883a2870a3adf17c277 (patch)
treee49f6b561faf5b39a81d57d54fa57a1550074c0f /images/index.php
parenta3009bf57d50fbc25a707b32fb3c5c170d011680 (diff)
downloadjungegemeinde-2330bb06ececee220d854883a2870a3adf17c277.tar.gz
Version 4.1. Support for photo galleries and advanced caching.
Diffstat (limited to 'images/index.php')
-rw-r--r--images/index.php47
1 files changed, 47 insertions, 0 deletions
diff --git a/images/index.php b/images/index.php
new file mode 100644
index 0000000..b839b69
--- /dev/null
+++ b/images/index.php
@@ -0,0 +1,47 @@
+<?php
+/*
+ * jQuery File Upload Plugin PHP Example 5.14
+ * https://github.com/blueimp/jQuery-File-Upload
+ *
+ * Copyright 2010, Sebastian Tschan
+ * https://blueimp.net
+ *
+ * Licensed under the MIT license:
+ * http://www.opensource.org/licenses/MIT
+ */
+
+error_reporting(E_ALL | E_STRICT);
+require "../bootstrap.php";
+session_name(SESSION);
+session_start();
+$c = new cache(REDIS_CONNECT, REDIS_DB);
+$c->bypassCache = true;
+$db = new db();
+if ( ! isset($_SESSION["username"]))
+ $u = null;
+else
+ $u = $_SESSION["username"];
+
+$user = new jg($u);
+
+if ( ! isset($_SESSION["gallery"]) || is_null($_SESSION["gallery"]) || $_SESSION["gallery"] == "" ){
+ $_SESSION["gallery"] = 1;
+}
+
+
+if ( isset($_GET["thumb"]) ){
+ if( ! isset($_GET["file"]) || $_GET["file"] == "" ){
+ header($_SERVER["SERVER_PROTOCOL"] . " 404 Not Found");
+ redirect("404");
+ exit;
+ }
+
+ if ( is_file(IMAGE_PATH . $_SESSION["gallery"] . '/thumbnail/' . $_GET["file"]) ){
+ header("X-Accel-Redirect: " . '/protected/' . $_SESSION["gallery"] . '/thumbnail/' . $_GET["file"]);
+ }
+
+} else {
+ require('UploadHandler.php');
+ $upload_handler = new UploadHandler();
+ $c->flush2();
+}