Example #1
0
 function perform($loginobject)
 {
     $username = $loginobject->getUser();
     $passwd = md5($loginobject->getPassword());
     $remember = $loginobject->getRemember();
     $authenticator =& mamboAuthenticator::getInstance();
     $checkuser = $authenticator->authenticateUser($message, $username, $passwd, $remember);
     return $message;
 }
Example #2
0
 $domain = substr($option, 4);
 session_name(md5(mamboCore::get('mosConfig_live_site')));
 session_start();
 // restore some session variables
 $my = new mosUser();
 $my->getSession();
 if (mosSession::validate($my)) {
     mosSession::purge();
 } else {
     mosSession::purge();
     $my = null;
 }
 if (!$my and $option == 'login') {
     $option = 'admin';
     require_once $configuration->rootPath() . '/includes/authenticator.php';
     $authenticator =& mamboAuthenticator::getInstance();
     $my = $authenticator->loginAdmin($acl);
 } elseif ($option == 'logout') {
     require $configuration->rootPath() . '/administrator/logout.php';
     exit;
 }
 // We can now create the mainframe object
 $mainframe =& new mosMainFrame($database, $option, '..', true);
 // Provided $my is set, we have a valid admin side session and can include remaining code
 if ($my) {
     mamboCore::set('currentUser', $my);
     if ($option == 'simple_mode') {
         $admin_mode = 'on';
     } elseif ($option == 'advanced_mode') {
         $admin_mode = 'off';
     } else {
Example #3
0
/**
* Random password generator
* @return password
*/
function mosMakePassword()
{
    require_once mamboCore::get('mosConfig_absolute_path') . '/includes/authenticator.php';
    $authenticator =& mamboAuthenticator::getInstance();
    return $authenticator->mosMakePassword();
}
Example #4
0
 function &getCurrent()
 {
     static $currentSession;
     if (!is_object($currentSession)) {
         $currentSession = new mosSession();
         mosSession::purge();
         $sessionCookieName = md5('site' . mamboCore::get('mosConfig_live_site'));
         $sessioncookie = mosGetParam($_COOKIE, $sessionCookieName, null);
         $usercookie = mosGetParam($_COOKIE, 'usercookie', null);
         if ($currentSession->load(md5($sessioncookie . $_SERVER['REMOTE_ADDR']))) {
             // Session cookie exists, update time in session table
             $currentSession->time = time();
             $currentSession->update();
         } else {
             $currentSession->generateId();
             if (!$currentSession->insert()) {
                 die($currentSession->getError());
             }
             setcookie($sessionCookieName, $currentSession->getCookie(), time() + 43200, '/');
             //$_COOKIE["sessioncookie"] = $session->getCookie();
             if ($usercookie) {
                 // Remember me cookie exists. Login with usercookie info.
                 require_once mamboCore::get('mosConfig_absolute_path') . '/includes/authenticator.php';
                 $authenticator =& mamboAuthenticator::getInstance();
                 $authenticator->authenticateUser($message, $usercookie['username'], $usercookie['password'], null, $currentSession);
             }
         }
     }
     return $currentSession;
 }