]> Softwares of Agnibho - simpleipd.git/blob - require.php
Major restructuring of code
[simpleipd.git] / require.php
1 <?php
2 require(__DIR__."/config.php");
3 require("lib/access.php");
4 require("lib/db.php");
5 require("lib/functions.php");
6 session_start();
7 $page=basename($_SERVER["PHP_SELF"]);
8 if($page!="login.php" && $page!="index.php"){
9 if(empty($_SESSION["user"])){
10 header("Location: login.php");
11 exit();
12 }
13 $access=checkAccess(basename($_SERVER["PHP_SELF"], ".php"));
14 if($access!="all" && $access!="view"){
15 header("Location: error.php");
16 exit();
17 }
18 }
19 if(!empty($_GET)){
20 foreach($_GET as $k=>$v){
21 $_GET[$k]=htmlspecialchars($v);
22 }
23 }
24 if(!empty($_POST)){
25 foreach($_POST as $k=>$v){
26 $_POST[$k]=htmlspecialchars($v);
27 }
28 }
29 ?>