bootstrapping finish

This commit is contained in:
Philip Häusler 2011-06-01 15:03:10 +02:00
parent e050c0dc7f
commit 62762a9368
3 changed files with 51 additions and 47 deletions

View File

@ -1,51 +1,53 @@
<?php <?php
include "../../camp2011/includes/config.php"; require_once ('bootstrap.php');
include "../../camp2011/includes/error_handler.php";
include "../../camp2011/includes/config_db.php";
if(!isset($_SESSION)) include "config/config.php";
session_start(); include "includes/error_handler.php";
include "config/config_db.php";
include "../../camp2011/includes/secure.php"; if (!isset ($_SESSION))
session_start();
// Parameter check include "includes/secure.php";
if(!isset($_GET["UID"]))
$_GET["UID"] = "-1";
$SQL = "SELECT * FROM `UserPicture` WHERE `UID`='" . $_GET["UID"] . "'"; // Parameter check
$res = mysql_query($SQL, $con); if (!isset ($_GET["UID"]))
$_GET["UID"] = "-1";
if(mysql_num_rows($res) == 1) { $SQL = "SELECT * FROM `UserPicture` WHERE `UID`='" . $_GET["UID"] . "'";
// genuegend rechte $res = mysql_query($SQL, $con);
if(!isset($_SESSION['UID']) || $_SESSION['UID'] == -1) {
header("HTTP/1.0 403 Forbidden");
die("403 Forbidden");
}
// ist das bild sichtbar? if (mysql_num_rows($res) == 1) {
if((mysql_result($res, 0, "show") == "N") AND ($_SESSION['UID']!=$_GET["UID"]) AND ($_SESSION['CVS'][ "admin/UserPicture.php" ] == "N")) { // genuegend rechte
$SQL = "SELECT * FROM `UserPicture` WHERE `UID`='-1'"; if (!isset ($_SESSION['UID']) || $_SESSION['UID'] == -1) {
$res = mysql_query($SQL, $con); header("HTTP/1.0 403 Forbidden");
die("403 Forbidden");
}
if(mysql_num_rows($res) != 1) { // ist das bild sichtbar?
header("HTTP/1.0 404 Not Found"); if ((mysql_result($res, 0, "show") == "N") AND ($_SESSION['UID'] != $_GET["UID"]) AND ($_SESSION['CVS']["admin/UserPicture.php"] == "N")) {
die("404 Not Found"); $SQL = "SELECT * FROM `UserPicture` WHERE `UID`='-1'";
} $res = mysql_query($SQL, $con);
}
// bild aus db auslesen if (mysql_num_rows($res) != 1) {
$bild = mysql_result($res, 0, "Bild"); header("HTTP/1.0 404 Not Found");
die("404 Not Found");
}
}
// ausgabe bild // bild aus db auslesen
header("Accept-Ranges: bytes"); $bild = mysql_result($res, 0, "Bild");
header("Content-Length: " . strlen($bild));
header("Content-type: " . mysql_result($res, 0, "ContentType")); // ausgabe bild
header("Cache-control: public"); header("Accept-Ranges: bytes");
header("Cache-request-directive: min-fresh = 120"); header("Content-Length: " . strlen($bild));
header("Cache-request-directive: max-age = 360"); header("Content-type: " . mysql_result($res, 0, "ContentType"));
echo $bild; header("Cache-control: public");
} else { header("Cache-request-directive: min-fresh = 120");
header("HTTP/1.0 404 Not Found"); header("Cache-request-directive: max-age = 360");
die( "404 Not Found"); echo $bild;
} } else {
header("HTTP/1.0 404 Not Found");
die("404 Not Found");
}
?> ?>

View File

@ -6,7 +6,7 @@ $header = "DECT send call";
include ("includes/header.php"); include ("includes/header.php");
include ("config/config_IAX.php"); include ("config/config_IAX.php");
//include ("../../../camp2011/includes/funktion_modem.php"); //include ("includes/funktion_modem.php");
include ("includes/funktion_cron.php"); include ("includes/funktion_cron.php");
if (!isset ($_GET["dial"])) if (!isset ($_GET["dial"]))

View File

@ -1,10 +1,12 @@
<?php <?php
$title = "Index"; require_once ('bootstrap.php');
$header = "Lageplan";
include "../../camp2011/includes/header.php";
echo "<p>" . Get_Text("lageplan_text1") . "</p>"; $title = "Index";
echo "<p><img src=\"./pic/lageplan/lageplan.jpg\" alt=\"\" />"; $header = "Lageplan";
include "includes/header.php";
include "../../camp2011/includes/footer.php"; echo "<p>" . Get_Text("lageplan_text1") . "</p>";
echo "<p><img src=\"./pic/lageplan/lageplan.jpg\" alt=\"\" />";
include "includes/footer.php";
?> ?>