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'; } } $isMobile = isset($_GET['mobile']) ? $_GET['mobile'] == '1' : false; // Logout? if ($_VISSTATE['POST_OUT'] = isset($_GET['logout'])) { $_GET['section'] = 'main'; # Redirect logged out users to the main page. Coach::logout(); } Mobile::setIsMobile($isMobile); if ($isMobile && !Coach::isLoggedIn()) { // Redirect logged out mobile users to login $_GET['section'] = 'login'; } if ($_VISSTATE['COOCKIE'] || $_VISSTATE['POST_IN'] || $_VISSTATE['POST_OUT']) { setupGlobalVars(T_SETUP_GLOBAL_VARS__POST_COACH_LOGINOUT); } if (Mobile::isMobile()) { HTMLOUT::mobile_frame_begin(isset($_SESSION['logged_in']) ? $coach->settings['theme'] : $settings['stylesheet']); # Make page frame, banner and menu. MTS('Header loaded, login auth, html frame generated'); // Check if a menu-link was picked, and execute section code from sections.php accordingly. switch ($_GET['section']) { case 'login': sec_login();