|
// | Copyright (c) 2004 Max Baryshnikov |
// | http://sapid.sourceforge.net |
// +----------------------------------------------------------------------+
// | This source file is free software; you can redistribute it and/or |
// | modify it under the terms of the GNU Lesser General Public |
// | License as published by the Free Software Foundation; either |
// | version 2.1 of the License, or (at your option) any later version. |
// | |
// | This source file is distributed in the hope that it will be useful, |
// | but WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
// | Lesser General Public License for more details. |
// +----------------------------------------------------------------------+
// Release: 06.12.04 (dd/mm/yy)
// $Id: index.php,v 1.10 2005/08/15 15:18:05 mephius Exp $
//Cut off lost picture requests
if (preg_match("/\.[gjpi][ipnc][fgo]/i", $_SERVER['REQUEST_URI'])) exit;
include (dirname(__FILE__) . "/etc/rc.conf.php");
if(!@include(ROOT_PATH."etc/rc.d/debug.inc.php")) header("Location: install.php");
if(!$http_path or !is_file(ROOT_PATH . "index.php")) message_die("SAPID not yet been configured or configuration is broken.
Please, enter the configuration utility and create a new configuration.");
include(ROOT_PATH . "etc/startup.inc.php");
if (!isset($_SESSION["user"]["login"])) {
include(ROOT_PATH . "usr/system/counter.inc.php");
}else{
$env["user"]=$_SESSION["user"];
}
include(ROOT_PATH."mvc/controller/user_requests_analysis.inc.php");
$env["area51"]=0;
if (isset($_SESSION["user"]["LOGIN"]) and $_SESSION["user"]["NOLOGIN"]=="") {
$env["user.aStatus"]=1;
$env["area51"]=1;
if(isset($_GET["mode"])){
switch ($_GET["mode"]) {
case "edit":
if($env["page"]["pWrite"]) {
$env["mode"]=1;
$env["area51"]=2;
}else{
$env["mode"]=0;
}
break;
default:
$env["mode"]=0;
break;
}
}
}
if($panel=="") $sapi_obj = new sapi_parser(ROOT_PATH . "usr/templates/" . $env["page"]["TEMPLATE"], $env);
// Looking for an information about current page children
if($tree->map) {
foreach($tree->map as $k=>$v) {
if($v["ID"]==$env["page.ID"]) { $curPointer = $v["POINTER"]; break; }
}
eval("\$val = \$tree->structure".$curPointer."['CHILDREN'];");
$env["document.children"] = count($val);
}
$parse=($panel==""?$sapi_obj->build_page():$panel);
$stream="";
if (isset($_SESSION["user"]["LOGIN"]) and $_SESSION["user"]["NOLOGIN"]=="") {
if($env["mode"]==1){
// Delete QC in