} else { $configuration->initGzip(); $path = $configuration->rootPath() . '/administrator/templates/' . $mainframe->getTemplate() . '/login.php'; require_once $path; $configuration->doGzip(); } } else { $option = $configuration->determineOptionAndItemid(); $Itemid = $configuration->get('Itemid'); $mainframe =& new mosMainFrame($database, $option, '.'); if ($option == 'login') { $configuration->handleLogin(); } elseif ($option == 'logout') { $configuration->handleLogout(); } $session =& mosSession::getCurrent(); $my =& new mosUser(); $my->getSessionData(); mamboCore::set('currentUser', $my); $configuration->offlineCheck($my, $database); $gid = intval($my->gid); // gets template for page $cur_template = $mainframe->getTemplate(); require_once $configuration->rootPath() . '/includes/frontend.php'; require_once $configuration->rootPath() . '/includes/mambo.php'; require_once $configuration->rootPath() . '/includes/mambofunc.php'; require_once $configuration->rootPath() . '/includes/mamboHTML.php'; if ($indextype == 2 and $do_pdf == 1) { include_once 'includes/pdf.php'; exit; }
/** * User logout * * Reverts the current session record back to 'anonymous' parameters */ function logoutUser() { $session =& mosSession::getCurrent(); if ($session) { $mambothandler =& mosMambotHandler::getInstance(); $mambothandler->loadBotGroup('authenticator'); $loginfo = new mosLoginDetails($session->username); $mambothandler->trigger('beforeLogout', array($loginfo)); $this->clearSession($session); } }
/** * Initialises the user session * * Old sessions are flushed based on the configuration value for the cookie * lifetime. If an existing session, then the last access time is updated. * If a new session, a session id is generated and a record is created in * the mos_sessions table. */ function &initSession() { $session =& mosSession::getCurrent(); return $session; }
/** * Returns the Joomla/Mambo Session ID * @static */ function getSessionId() { global $mainframe; // Joomla >= 1.0.8 if (is_callable(array('mosMainframe', 'sessionCookieName'))) { // Session Cookie `name` $sessionCookieName = mosMainFrame::sessionCookieName(); // Get Session Cookie `value` $sessionCookie = vmGet($_COOKIE, $sessionCookieName, null); // Session ID / `value` return mosMainFrame::sessionCookieValue($sessionCookie); } elseif (is_callable(array('mosSession', 'getCurrent'))) { $session =& mosSession::getCurrent(); return $session->session_id; } elseif (!empty($mainframe->_session->session_id)) { // Set the sessioncookie if its missing // this is needed for joomla sites only return $mainframe->_session->session_id; } else { return session_id(); } }