-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.php
32 lines (30 loc) · 928 Bytes
/
index.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<?php
global $settings;
$settings = require( 'settings.php' );
require_once "models/db.php";
require_once "models/user.php";
//$user = getCurrentUser();
//$page = 'register';
$page = $_POST[ 'page' ];
if( !isset( $_POST[ 'page' ] ) ){
die("error");
}
/*
if( $user == false && !in_array( $page, array( 'login', 'register', 'dologin', 'doregister' ) ) ){
header( 'Location: ./?page=login' );
exit();
}
$whitelist = array( 'posts', 'post', 'dopost', 'docomment', 'login', 'register', 'dologin', 'doregister' );
if( !in_array( $page, $whitelist ) ){
die( "Could not find page $page." );
}*/
function clude( $path ) {
static $included = array();
if ( !isset( $included[ $path ] ) ) {
$included[ $path ] = true;
return include $path;
}
return true;
}
require "models/{$page}.php";
?>