<?php
require_once(__DIR__.'/../includes/sysinit.php'); //-->needed here for AJAX calls. "require_once" eliminates it being included twice.
if (!SableSystem::loggedIn())
{
	// define who may/may not access this page:
	$allowedPages = ['register.php', 'confirm.php', 'join.php', 'done.php'];
	$allow = SableSystem::loggedIn()||in_array($_SESSION['current_page'], $allowedPages)||isSableAdmin();
	if (!$allow) 
	{
		SableGeneralFunctions::revertToLoginPage();
	}
} 