use MediaWiki\Auth\AuthManager;
use MediaWiki\Auth\Throttler;
use MediaWiki\Logger\LoggerFactory;
+use MediaWiki\MediaWikiServices;
use MediaWiki\Session\SessionManager;
+use Wikimedia\ScopedCallback;
/**
* Holds shared logic for login and account creation pages.
/**
* Load basic request parameters for this Special page.
- * @param $subPage
+ * @param string $subPage
*/
private function loadRequestParameters( $subPage ) {
if ( $this->mLoadedRequest ) {
* @param string|null $subPage
*/
public function execute( $subPage ) {
+ if ( $this->mPosted ) {
+ $time = microtime( true );
+ $profilingScope = new ScopedCallback( function () use ( $time ) {
+ $time = microtime( true ) - $time;
+ $statsd = MediaWikiServices::getInstance()->getStatsdDataFactory();
+ $statsd->timing( "timing.login.ui.{$this->authAction}", $time * 1000 );
+ } );
+ }
+
$authManager = AuthManager::singleton();
$session = SessionManager::getGlobalSession();
// Don't show a "create account" link if the user can't.
if ( $this->showCreateAccountLink() ) {
// link to the other action
- $linkTitle = $this->getTitleFor( $this->isSignup() ? 'Userlogin' :'CreateAccount' );
+ $linkTitle = $this->getTitleFor( $this->isSignup() ? 'Userlogin' : 'CreateAccount' );
$linkq = $this->getReturnToQueryStringFragment();
// Pass any language selection on to the mode switch link
if ( $this->mLanguage ) {
],
$this->msg(
$loggedIn ? 'userlogin-createanother' : 'userlogin-joinproject'
- )->escaped()
+ )->text()
)
);
},
/**
* Adds fields provided via the deprecated UserLoginForm / UserCreateForm hooks
- * @param $fieldDefinitions array
+ * @param array $fieldDefinitions
* @param FakeAuthTemplate $template
* @return array
*/
/**
* Returns a string that can be appended to the URL (without encoding) to preserve the
* return target. Does not include leading '?'/'&'.
+ * @return string
*/
protected function getReturnToQueryStringFragment() {
$returnto = '';
}
/**
- * @param array $formDescriptor
+ * @param array &$formDescriptor
+ * @param array $requests
*/
protected function postProcessFormDescriptor( &$formDescriptor, $requests ) {
// Pre-fill username (if not creating an account, T46775).
/**
* Extensions (AntiSpoof and TitleBlacklist) call this in response to
* UserCreateForm hook to add checkboxes to the create account form.
+ * @param string $name
+ * @param string $value
+ * @param string $type
+ * @param string $msg
+ * @param string|bool $helptext
*/
public function addInputItem( $name, $value, $type, $msg, $helptext = false ) {
// use the same indexes as UserCreateForm just in case someone adds an item manually
/**
* @deprecated since 1.27 - call LoginHelper::getValidErrorMessages instead.
+ * @return array
*/
public static function getValidErrorMessages() {
return LoginHelper::getValidErrorMessages();
/**
* @deprecated since 1.27 - don't use LoginForm, use AuthManager instead
+ * @param string $username
+ * @return array|false
*/
public static function incrementLoginThrottle( $username ) {
wfDeprecated( __METHOD__, "1.27" );
/**
* @deprecated since 1.27 - don't use LoginForm, use AuthManager instead
+ * @param string $username
+ * @return bool|int
*/
public static function incLoginThrottle( $username ) {
wfDeprecated( __METHOD__, "1.27" );
/**
* @deprecated since 1.27 - don't use LoginForm, use AuthManager instead
+ * @param string $username
+ * @return void
*/
public static function clearLoginThrottle( $username ) {
wfDeprecated( __METHOD__, "1.27" );
/**
* @deprecated since 1.27 - don't use LoginForm, use AuthManager instead
+ * @return string
*/
public static function getCreateaccountToken() {
wfDeprecated( __METHOD__, '1.27' );