<?php
require_once(__DIR__.'/../includes/sysinit.php'); //-->needed here for AJAX calls. "require_once" eliminates it being included twice.
$_SESSION['module']['add'] = '0';
$loginRequired = true;
$loggedIn = SableSystem::loggedIn();
$allowModuleAccess = $loggedIn&&$loginRequired;
if ($allowModuleAccess)
{
	/**
		To be here means that the user is logged in, as is required.
	**/
	if ($_SESSION['current_page']==='add.php')
	{
		if ($_SESSION['user']['access_level'] < SABLE_ACCESS_MANAGER) SableGeneralFunctions::divertFromPage();
	}
}
else
{
	/* 
		To be in here means that the user is NOT logged in. 
		If not logged in, we only permit access to the registration page:
	*/
	if ($_SESSION['current_page']!=='register.php') SableGeneralFunctions::revertToLoginPage();
}
?>