<?php
ob_start();
if(!(is_readable(realpath(dirname(__FILE__)).'/include/includesroutines.inc'))) {
	die('Error - Could not open or read file '.realpath(dirname(__FILE__)).'/include/includesroutines.inc');
} else {
	include_once(realpath(dirname(__FILE__)).'/include/includesroutines.inc');
}

if ( getSetting('portal','useRights', 0) == 1 ){
	if( !IsUserLogin() ){
		header("Location: ".getCurPageURLWO()."/login.php");
		ob_end_flush();
		exit;
	} else {
		header("Location: ".getCurPageURLWO()."/personal.php");
		ob_end_flush();
		exit;
	}
} else {
	if (isset($_COOKIE['mobilemode']) && $_COOKIE['mobilemode'] == 1) {
		header("Location: ".getCurPageURLWO()."/mnavigator.php");
	} else {
		header("Location: ".getCurPageURLWO()."/businessmodel.php");
	}
	ob_end_flush();
	exit;
}
?>
