(bug 25832) query=allimages now outputs ns/title as well
[lhc/web/wiklou.git] / includes / api / ApiLogin.php
index 7f518b6..2bd773a 100644 (file)
@@ -1,9 +1,8 @@
 <?php
-
 /**
- * Created on Sep 19, 2006
  *
- * API for MediaWiki 1.8+
+ *
+ * Created on Sep 19, 2006
  *
  * Copyright © 2006-2007 Yuri Astrakhan <Firstname><Lastname>@gmail.com,
  * Daniel Cannon (cannon dot danielc at gmail dot com)
@@ -22,6 +21,8 @@
  * with this program; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  * http://www.gnu.org/copyleft/gpl.html
+ *
+ * @file
  */
 
 if ( !defined( 'MEDIAWIKI' ) ) {
@@ -69,12 +70,10 @@ class ApiLogin extends ApiBase {
 
                $loginForm = new LoginForm( $req );
 
-               global $wgCookiePrefix;
+               global $wgCookiePrefix, $wgUser, $wgPasswordAttemptThrottle;
 
                switch ( $authRes = $loginForm->authenticateUserData() ) {
                        case LoginForm::SUCCESS:
-                               global $wgUser;
-
                                $wgUser->setOption( 'rememberpassword', 1 );
                                $wgUser->setCookies();
 
@@ -133,7 +132,6 @@ class ApiLogin extends ApiBase {
                                break;
 
                        case LoginForm::THROTTLED:
-                               global $wgPasswordAttemptThrottle;
                                $result['result'] = 'Throttled';
                                $result['wait'] = intval( $wgPasswordAttemptThrottle['seconds'] );
                                break;