Added a config.php file
[bizou.git] / index.php
index 97f7e59..c20a4dc 100644 (file)
--- a/index.php
+++ b/index.php
     along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
 
-define('THUMB_SIZE', 100);
-define('DATA_DIR', 'data');
-define('IMAGES_DIR', 'images');
-define('USE_VIEWER', true);
+require 'config.php';
 
 function getPreview($imgFile, $maxSize = THUMB_SIZE)
 {
@@ -103,6 +100,11 @@ $otherFiles = array();
 
 $realDir = IMAGES_DIR.$shortPath;
 
+if (! is_dir($realDir)) {
+       header("HTTP/1.1 404 Not Found");
+       die("Directory Not Found");
+}
+
 foreach (scandir($realDir) as $file) if ($file != '.' and $file != '..')
 {
        if (is_dir("$realDir/$file"))