escape HTML elements in docblock with double quotes
[lhc/web/wiklou.git] / includes / api / ApiLogin.php
index ae660fd..1f91fe9 100644 (file)
@@ -4,7 +4,7 @@
  *
  * Created on Sep 19, 2006
  *
- * Copyright © 2006-2007 Yuri Astrakhan <Firstname><Lastname>@gmail.com,
+ * Copyright © 2006-2007 Yuri Astrakhan "<Firstname><Lastname>@gmail.com",
  * Daniel Cannon (cannon dot danielc at gmail dot com)
  *
  * This program is free software; you can redistribute it and/or modify
  * @file
  */
 
-if ( !defined( 'MEDIAWIKI' ) ) {
-       // Eclipse helper - will be ignored in production
-       require_once( 'ApiBase.php' );
-}
-
 /**
  * Unit to authenticate log-in attempts to the current wiki.
  *
@@ -84,6 +79,8 @@ class ApiLogin extends ApiBase {
                                $user->setOption( 'rememberpassword', 1 );
                                $user->setCookies( $this->getRequest() );
 
+                               ApiQueryInfo::resetTokenCache();
+
                                // Run hooks.
                                // @todo FIXME: Split back and frontend from this hook.
                                // @todo FIXME: This hook should be placed in the backend
@@ -186,6 +183,66 @@ class ApiLogin extends ApiBase {
                );
        }
 
+       public function getResultProperties() {
+               return array(
+                       '' => array(
+                               'result' => array(
+                                       ApiBase::PROP_TYPE => array(
+                                               'Success',
+                                               'NeedToken',
+                                               'WrongToken',
+                                               'NoName',
+                                               'Illegal',
+                                               'WrongPluginPass',
+                                               'NotExists',
+                                               'WrongPass',
+                                               'EmptyPass',
+                                               'CreateBlocked',
+                                               'Throttled',
+                                               'Blocked',
+                                               'Aborted'
+                                       )
+                               ),
+                               'lguserid' => array(
+                                       ApiBase::PROP_TYPE => 'integer',
+                                       ApiBase::PROP_NULLABLE => true
+                               ),
+                               'lgusername' => array(
+                                       ApiBase::PROP_TYPE => 'string',
+                                       ApiBase::PROP_NULLABLE => true
+                               ),
+                               'lgtoken' => array(
+                                       ApiBase::PROP_TYPE => 'string',
+                                       ApiBase::PROP_NULLABLE => true
+                               ),
+                               'cookieprefix' => array(
+                                       ApiBase::PROP_TYPE => 'string',
+                                       ApiBase::PROP_NULLABLE => true
+                               ),
+                               'sessionid' => array(
+                                       ApiBase::PROP_TYPE => 'string',
+                                       ApiBase::PROP_NULLABLE => true
+                               ),
+                               'token' => array(
+                                       ApiBase::PROP_TYPE => 'string',
+                                       ApiBase::PROP_NULLABLE => true
+                               ),
+                               'details' => array(
+                                       ApiBase::PROP_TYPE => 'string',
+                                       ApiBase::PROP_NULLABLE => true
+                               ),
+                               'wait' => array(
+                                       ApiBase::PROP_TYPE => 'integer',
+                                       ApiBase::PROP_NULLABLE => true
+                               ),
+                               'reason' => array(
+                                       ApiBase::PROP_TYPE => 'string',
+                                       ApiBase::PROP_NULLABLE => true
+                               )
+                       )
+               );
+       }
+
        public function getDescription() {
                return array(
                        'Log in and get the authentication tokens. ',
@@ -205,7 +262,7 @@ class ApiLogin extends ApiBase {
                        array( 'code' => 'NotExists', 'info' => ' The username you provided doesn\'t exist' ),
                        array( 'code' => 'EmptyPass', 'info' => ' You didn\'t set the lgpassword parameter or you left it empty' ),
                        array( 'code' => 'WrongPass', 'info' => ' The password you provided is incorrect' ),
-                       array( 'code' => 'WrongPluginPass', 'info' => 'Same as `WrongPass", returned when an authentication plugin rather than MediaWiki itself rejected the password' ),
+                       array( 'code' => 'WrongPluginPass', 'info' => 'Same as "WrongPass", returned when an authentication plugin rather than MediaWiki itself rejected the password' ),
                        array( 'code' => 'CreateBlocked', 'info' => 'The wiki tried to automatically create a new account for you, but your IP address has been blocked from account creation' ),
                        array( 'code' => 'Throttled', 'info' => 'You\'ve logged in too many times in a short time' ),
                        array( 'code' => 'Blocked', 'info' => 'User is blocked' ),
@@ -219,7 +276,7 @@ class ApiLogin extends ApiBase {
        }
 
        public function getHelpUrls() {
-               return 'http://www.mediawiki.org/wiki/API:Login';
+               return 'https://www.mediawiki.org/wiki/API:Login';
        }
 
        public function getVersion() {