*/ $time_start = microtime(true); # Used by MTS(). /* Includes, constants, error_reporting() level, session_start(), OBBLM run requirements, MySQL connection, language load. */ require 'header.php'; /******************** * Main routine ********************/ // Make 'main' the default section if no GET section request was sent. if (!isset($_GET['section'])) { $_GET['section'] = 'main'; } // Login? $_VISSTATE['COOCKIE'] = Coach::cookieLogin(); # If not already logged in then check for login-cookie and try to log in using the stored credentials. if ($_VISSTATE['POST_IN'] = isset($_POST['login'])) { if (get_magic_quotes_gpc()) { $_POST['coach'] = stripslashes($_POST['coach']); $_POST['passwd'] = stripslashes($_POST['passwd']); } if (!Coach::login($_POST['coach'], $_POST['passwd'], isset($_POST['remember']))) { $_GET['section'] = 'login'; } } // Logout? if ($_VISSTATE['POST_OUT'] = isset($_GET['logout'])) { $_GET['section'] = 'main'; # Redirect logged out users to the main page. Coach::logout();