mirror of
https://port.numenaute.org/aleajactaest/khanat-opennel-code.git
synced 2024-12-22 08:58:43 +00:00
9e6597e937
--HG-- branch : quitta-gsoc-2013
54 lines
1.2 KiB
PHP
54 lines
1.2 KiB
PHP
<?php
|
|
error_reporting(E_ALL);
|
|
ini_set('display_errors', 'on');
|
|
require( '../config.php' );
|
|
require( '../../ams_lib/libinclude.php' );
|
|
session_start();
|
|
|
|
//print_r($_SESSION);
|
|
|
|
//Decide what page to load
|
|
if(isset($_SESSION['user'])){
|
|
$page = 'home';
|
|
}else{
|
|
//default page
|
|
$page = 'login';
|
|
}
|
|
|
|
if ( isset( $_GET["page"] ) ){
|
|
$page = $_GET["page"];
|
|
}
|
|
|
|
//perform an action in case one is specified
|
|
if ( isset( $_POST["function"] ) ){
|
|
require( "inc/" . $_POST["function"] . ".php" );
|
|
$return = $_POST["function"]();
|
|
}
|
|
|
|
|
|
function loadpage ( $page ){
|
|
$filename = 'autoload/' . $page . '.php';
|
|
if(is_file($filename)){
|
|
require_once($filename);
|
|
}
|
|
}
|
|
|
|
loadpage($page);
|
|
|
|
//Set permission
|
|
if(isset($_SESSION['permission'])){
|
|
$return['permission'] = $_SESSION['permission'];
|
|
}else{
|
|
//default permission
|
|
$return['permission'] = 0;
|
|
}
|
|
|
|
|
|
//hide sidebar + topbar in case of login/register
|
|
if($page == 'login' || $page == 'register' || $page == 'logout'){
|
|
$return['no_visible_elements'] = 'TRUE';
|
|
}else{
|
|
$return['no_visible_elements'] = 'FALSE';
|
|
}
|
|
//print_r($return);
|
|
helpers :: loadTemplate( $page , $return );
|