/**
* Loader
- *
- * @param $request WebRequest object
*/
function load() {
global $wgAuth, $wgHiddenPrefs, $wgEnableEmail, $wgRedirectOnLogin;
}
if( !$wgAuth->validDomain( $this->mDomain ) ) {
- $this->mDomain = 'invaliddomain';
+ if ( isset( $_SESSION['wsDomain'] ) ) {
+ $this->mDomain = $_SESSION['wsDomain'];
+ } else {
+ $this->mDomain = 'invaliddomain';
+ }
}
$wgAuth->setDomain( $this->mDomain );
# TODO: Allow some magic here for invalid external names, e.g., let the
# user choose a different wiki name.
$u = User::newFromName( $this->mUsername );
- if( !( $u instanceof User ) || !User::isUsableName( $u->getName() ) ) {
+ if( !( $u instanceof User ) ) {
+ wfRunHooks( 'LoginAuthenticateAudit', array( new User, $this->mPassword, self::ILLEGAL ) );
+ return self::ILLEGAL;
+ }
+ if( !User::isUsableName( $u->getName() ) ) {
wfRunHooks( 'LoginAuthenticateAudit', array( $u, $this->mPassword, self::ILLEGAL ) );
return self::ILLEGAL;
}
$code = $request->getVal( 'uselang', $user->getOption( 'language' ) );
$userLang = Language::factory( $code );
$wgLang = $userLang;
- $this->getContext()->setLang( $userLang );
+ $this->getContext()->setLanguage( $userLang );
return $this->successfulLogin();
} else {
return $this->cookieRedirectCheck( 'login' );
wfRunHooks( 'UserLoginComplete', array( &$currentUser, &$injected_html ) );
- //let any extensions change what message is shown
+ /**
+ * Let any extensions change what message is shown.
+ * @see https://www.mediawiki.org/wiki/Manual:Hooks/BeforeWelcomeCreation
+ * @since 1.18
+ */
wfRunHooks( 'BeforeWelcomeCreation', array( &$welcome_creation_msg, &$injected_html ) );
$this->displaySuccessfulLogin( $welcome_creation_msg, $injected_html );
# Prepare language selection links as needed
if( $wgLoginLanguageSelector ) {
$template->set( 'languages', $this->makeLanguageSelector() );
- if( $this->mLanguage )
+ if( $this->mLanguage ) {
$template->set( 'uselang', $this->mLanguage );
+ }
}
// Use loginend-https for HTTPS requests if it's not blank, loginend otherwise