From ca32f08966f1b51fcb19460f0996bb0c4048e6fe Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Sat, 3 Dec 2011 13:29:22 +0100 Subject: Update to MediaWiki 1.18.0 * also update ArchLinux skin to chagnes in MonoBook * Use only css to hide our menu bar when printing --- includes/api/ApiLogin.php | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) (limited to 'includes/api/ApiLogin.php') diff --git a/includes/api/ApiLogin.php b/includes/api/ApiLogin.php index 0675de7b..a09f0335 100644 --- a/includes/api/ApiLogin.php +++ b/includes/api/ApiLogin.php @@ -1,6 +1,6 @@ authenticateUserData() ) { + $authRes = $loginForm->authenticateUserData(); + switch ( $authRes ) { case LoginForm::SUCCESS: $wgUser->setOption( 'rememberpassword', 1 ); - $wgUser->setCookies(); + $wgUser->setCookies( $this->getMain()->getRequest() ); - // Run hooks. FIXME: split back and frontend from this hook. - // FIXME: This hook should be placed in the backend + // Run hooks. + // @todo FIXME: Split back and frontend from this hook. + // @todo FIXME: This hook should be placed in the backend $injected_html = ''; wfRunHooks( 'UserLoginComplete', array( &$wgUser, &$injected_html ) ); @@ -140,6 +142,11 @@ class ApiLogin extends ApiBase { $result['result'] = 'Blocked'; break; + case LoginForm::ABORTED: + $result['result'] = 'Aborted'; + $result['reason'] = $loginForm->mAbortLoginErrorMsg; + break; + default: ApiBase::dieDebug( __METHOD__, "Unhandled case value: {$authRes}" ); } @@ -175,7 +182,7 @@ class ApiLogin extends ApiBase { public function getDescription() { return array( - 'This module is used to login and get the authentication tokens. ', + 'Log in and get the authentication tokens. ', 'In the event of a successful log-in, a cookie will be attached', 'to your session. In the event of a failed log-in, you will not ', 'be able to attempt another log-in through this method for 5 seconds.', @@ -205,7 +212,11 @@ class ApiLogin extends ApiBase { ); } + public function getHelpUrls() { + return 'https://www.mediawiki.org/wiki/API:Login'; + } + public function getVersion() { - return __CLASS__ . ': $Id: ApiLogin.php 76080 2010-11-05 11:54:35Z catrope $'; + return __CLASS__ . ': $Id: ApiLogin.php 104449 2011-11-28 15:52:04Z reedy $'; } } -- cgit v1.2.3-54-g00ecf