<?php
	namespace Mocha\UI\Pages;
	
	use Mocha\Core\KnownAttributeGuids;
	
	use Mocha\Core\KnownClassGuids;
	use Mocha\Core\KnownInstanceGuids;
	use Mocha\Core\KnownRelationshipGuids;
	use Phast\RenderingEventArgs;
	use Phast\System;
	use Phast\WebPage;

	class LogoutPage extends WebPage
	{

		protected function OnRendering(RenderingEventArgs $re)
		{
			/**
			 * @var \Mocha\Oms\MySQLDatabaseOms
			 */
			$oms = mocha_get_oms();

			unset($_SESSION["user_token_" . $oms->getTenant()->ID]);

			System::Redirect("~/" . $_SESSION["CurrentTenantName"], true);
			exit();
		}

	}
?>