src.dualinventive.com/mtinfo/dist/webroot/rc-4.05/app/index.php

61 lines
2.2 KiB
PHP

<?php
/** \file index.php
* \brief DI index page
* \author Bram Lentjes, Core|Vision
* \version 1.0
* \date 27-05-2013
*
* This file contains the index file.
*/
/*
* Required pages
*/
require_once('include/core_xml.php');
require_once('include/core.php');
require_once('app/include/app_definitions.php');
require_once('app/include/app_utilities.php');
// Go to page passed by href=
if(isset($_GET['href'])) {
// Check for local files => No links!!!
if (CheckDirectory(array($_SESSION[$_PAGE_INFO['id']]['base_path'] . "app/include",
$_SESSION[$_PAGE_INFO['id']]['base_path'] . "app/html/js",
$_SESSION[$_PAGE_INFO['id']]['base_path'] . "app/di_store",
$_SESSION[$_PAGE_INFO['id']]['base_path'] . "app/di_login",
$_SESSION[$_PAGE_INFO['id']]['base_path'] . "app/di_app_projects",
$_SESSION[$_PAGE_INFO['id']]['base_path'] . "app/di_app_news"),
realpath($_GET['redirect']))) {
DBG("checkdir");
}
DBG("index href :".$_GET['href'] . " page id: ".$_PAGE_INFO['id']);
if( ($_GET['href'] == 'app/version/version.txt') || isset($_SESSION[$_PAGE_INFO['id']]['logged_on']) || ($_GET['href'] == 'app/di_login/login.php') || ($_GET['href'] == 'app/di_login/a_login.php') || ($_GET['href'] == 'app/di_app_news/a_get_news.php') || ($_GET['href'] == 'app/di_app_news/app_news_index.php')){
// Normally page open
include($_GET['href']);
}elseif(($_GET['href'] == 'app/di_store/store_index.php') && !isset($_SESSION[$_PAGE_INFO['id']]['logged_on'])){
// Go to the DI store
include('app/di_store/store_index.php');
}else{
// Only when session of the user is removed
if($_GET['href'] == 'app/di_app_projects/a_get_projects.php'){
// Redirect page back to login page from normal
include('app/di_store/store_index.php');
}else{
// Redirect page back to login page from ajax xmlhttp
echo "<script type=\"text/javascript\">\n";
echo "window.open(getBaseURL());";
echo "</script>\n";
}
}
}
else {
// Go to the DI store
include('app/di_store/store_index.php');
}
?>