Main Page   Namespace List   Class Hierarchy   Compound List   File List   Compound Members   File Members   Related Pages  

index.php

Go to the documentation of this file.
00001 <?php
00002 /* $Id: index.php,v 1.6 2003/10/17 08:14:46 mikko Exp $ */
00003 /*
00004  * ImaComm - a web based photo album software
00005  * Copyright (C) 2003, Mikko Kokkonen
00006  *
00007  * This program is free software; you can redistribute it and/or modify
00008  * it under the terms of the GNU General Public License as published by
00009  * the Free Software Foundation; either version 2 of the License, or (at
00010  * your option) any later version.
00011  * 
00012  * This program is distributed in the hope that it will be useful, but
00013  * WITHOUT ANY WARRANTY; without even the implied warranty of
00014  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00015  * General Public License for more details.
00016  * 
00017  * You should have received a copy of the GNU General Public License
00018  * along with this program; if not, write to the Free Software
00019  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
00020  */
00021 ?>
00022 <?php
00023 $__setup_dir = realpath(dirname(__FILE__)."/../");
00024 require_once "$__setup_dir/helper/setup.php";
00025 require_once "$__setup_dir/setup/classes/SetupDocument.php";
00026 require_once "$__setup_dir/classes/ProgressBar.php";
00027 
00028 // Start session handling...
00029 session_start();
00030 
00031 // Are we finished...
00032 if (isset($_REQUEST['finish']))
00033 {
00034         header("Location: ../");
00035 }
00036 // Are we already configured...
00037 // Or did we requested re-config?
00038 if ((file_exists("$__setup_dir/conf/settings") || file_exists("$__setup_dir/conf/settings.bz2")) && !file_exists("$__dir/conf/allow.cfg"))
00039 {
00040         header("Location: ../");
00041 }
00042 if (file_exists("$__setup_dir/conf/allow.cfg"))
00043 {
00044         // Try to read allowed IP addresses...
00045         $ips = file("$__setup_dir/conf/allow.cfg");
00046         foreach ($ips as $ln => $line)
00047         {
00048                 list ($ip, $key) = explode(":", $line);
00049                 if ($_SERVER['REMOTE_ADDR'] != $ip || $_SESSION['config_key'] != $key)
00050                 {
00051                         header("Location: ../");
00052                 }
00053         }
00054 }
00055 // Do we have writable conf-dir?
00056 if (!is_writable("$__setup_dir/conf"))
00057 {
00058         $cfg = realpath("$__setup_dir/conf");
00059         die("Sorry but there is a fatal error. $cfg is not writable and so on ImaComm setup cannot continue. Please fix access rights!");
00060 }
00061 // We are authorized to configure this ImaComm...
00062 $document = new SetupDocument();
00063 
00064 // Are we having page?
00065 $_numofpages = 7;
00066 if (is_null($_REQUEST['page']))
00067 {
00068         $_page = 1;
00069 }
00070 else
00071 {
00072         $_page = $_REQUEST['page'];
00073 }
00074 if (isset($_REQUEST['next']))
00075 {
00076         $_page++;
00077 }
00078 if (isset($_REQUEST['prev']))
00079 {
00080         $_page--;
00081 }
00082 // We support themes also here...
00083 // It is just the easiest way...
00084 theme("default");
00085 
00086 // Spawn theme engine...
00087 showPage();
00088 ?>

Generated on Sun Oct 19 11:08:00 2003 for ImaComm by doxygen1.3