checkPassword($password)) { Log::addAuthenticationLog('Login failed (incorrect password): ' . $username); throw new Exception(WT_I18N::translate('The username or password is incorrect.')); } if (!$user->getPreference('verified')) { Log::addAuthenticationLog('Login failed (not verified by user): ' . $username); throw new Exception(WT_I18N::translate('This account has not been verified. Please check your email for a verification message.')); } if (!$user->getPreference('verified_by_admin')) { Log::addAuthenticationLog('Login failed (not approved by admin): ' . $username); throw new Exception(WT_I18N::translate('This account has not been approved. Please wait for an administrator to approve it.')); } Auth::login($user); Log::addAuthenticationLog('Login: ' . Auth::user()->getUserName() . '/' . Auth::user()->getRealName()); $WT_SESSION->timediff = $timediff; $WT_SESSION->locale = Auth::user()->getPreference('language'); $WT_SESSION->theme_dir = Auth::user()->getPreference('theme'); // If we’ve clicked login from the login page, we don’t want to go back there. if (strpos($url, WT_SCRIPT_NAME) === 0) { $url = ''; } // We're logging in as an administrator if (Auth::isAdmin()) { // Check for updates $latest_version_txt = fetch_latest_version(); if (preg_match('/^[0-9.]+\|[0-9.]+\|/', $latest_version_txt)) { list($latest_version, $earliest_version, $download_url) = explode('|', $latest_version_txt); if (version_compare(WT_VERSION, $latest_version)<0) { // An upgrade is available. Let the admin know, by redirecting to the upgrade wizard $url = 'admin_site_upgrade.php'; } } else { // Cannot determine the latest version } } // Redirect to the target URL header('Location: ' . WT_SERVER_NAME . WT_SCRIPT_PATH . $url); // Explicitly write the session data before we exit, // as it doesn’t always happen when using APC. Zend_Session::writeClose(); exit; } catch (Exception $ex) { $message = $ex->getMessage(); } // No break; default: $controller ->setPageTitle(WT_I18N::translate('Login')) ->pageHeader() ->addInlineJavascript(' jQuery("#new_passwd_form").hide(); jQuery("#passwd_click").click(function() { jQuery("#new_passwd_form").slideToggle(100, function() { jQuery("#new_passwd_username").focus() }); return false; }); '); echo '
', WT_Site::getPreference('WELCOME_TEXT_AUTH_MODE_'.WT_LOCALE), '
'; break; } echo '', /* I18N: %s is a username */ WT_I18N::translate('A new password has been created and emailed to %s. You can change this password after you login.', $user_name), '
', WT_I18N::translate('Hello %s…
Thank you for your registration.', $user->getRealName()), '
';
if ($REQUIRE_ADMIN_AUTH_REGISTRATION) {
echo WT_I18N::translate('We will now send a confirmation email to the address %s. You must verify your account request by following instructions in the confirmation email. If you do not confirm your account request within seven days, your application will be rejected automatically. You will have to apply again.
After you have followed the instructions in the confirmation email, the administrator still has to approve your request before your account can be used.
To login to this site, you will need to know your user name and password.', $user->getEmail());
} else {
echo WT_I18N::translate('We will now send a confirmation email to the address %s. You must verify your account request by following instructions in the confirmation email. If you do not confirm your account request within seven days, your application will be rejected automatically. You will have to apply again.
After you have followed the instructions in the confirmation email, you can login. To login to this site, you will need to know your user name and password.', $user->getEmail());
}
echo '