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.
* @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();
if ( $this->showCreateAccountLink() ) {
# Pass any language selection on to the mode switch link
if ( $this->mLanguage ) {
- $linkq .= '&uselang=' . $this->mLanguage;
+ $linkq .= '&uselang=' . urlencode( $this->mLanguage );
}
// Supply URL, login template creates the button.
$template->set( 'createOrLoginHref', $titleObj->getLocalURL( $linkq ) );
$linkq = $this->getReturnToQueryStringFragment();
// Pass any language selection on to the mode switch link
if ( $this->mLanguage ) {
- $linkq .= '&uselang=' . $this->mLanguage;
+ $linkq .= '&uselang=' . urlencode( $this->mLanguage );
}
$loggedIn = $this->getUser()->isLoggedIn();