dépôts
/
lhc
/
web
/
wiklou.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge "Rename autonym for 'no' from 'norsk bokmål' to 'norsk'"
[lhc/web/wiklou.git]
/
includes
/
auth
/
AuthManager.php
diff --git
a/includes/auth/AuthManager.php
b/includes/auth/AuthManager.php
index
e223e16
..
c3f798f
100644
(file)
--- a/
includes/auth/AuthManager.php
+++ b/
includes/auth/AuthManager.php
@@
-24,6
+24,7
@@
namespace MediaWiki\Auth;
use Config;
namespace MediaWiki\Auth;
use Config;
+use MediaWiki\MediaWikiServices;
use Psr\Log\LoggerAwareInterface;
use Psr\Log\LoggerInterface;
use Status;
use Psr\Log\LoggerAwareInterface;
use Psr\Log\LoggerInterface;
use Status;
@@
-146,7
+147,7
@@
class AuthManager implements LoggerAwareInterface {
if ( self::$instance === null ) {
self::$instance = new self(
\RequestContext::getMain()->getRequest(),
if ( self::$instance === null ) {
self::$instance = new self(
\RequestContext::getMain()->getRequest(),
-
\ConfigFactory::getDefaultInstance()->makeConfig( 'main'
)
+
MediaWikiServices::getInstance()->getMainConfig(
)
);
}
return self::$instance;
);
}
return self::$instance;
@@
-1659,7
+1660,7
@@
class AuthManager implements LoggerAwareInterface {
}
}
}
}
- $backoffKey =
wfMemc
Key( 'AuthManager', 'autocreate-failed', md5( $username ) );
+ $backoffKey =
$cache->make
Key( 'AuthManager', 'autocreate-failed', md5( $username ) );
if ( $cache->get( $backoffKey ) ) {
$this->logger->debug( __METHOD__ . ': {username} denied by prior creation attempt failures', [
'username' => $username,
if ( $cache->get( $backoffKey ) ) {
$this->logger->debug( __METHOD__ . ': {username} denied by prior creation attempt failures', [
'username' => $username,
@@
-1678,7
+1679,7
@@
class AuthManager implements LoggerAwareInterface {
// Ignore warnings about master connections/writes...hard to avoid here
$trxProfiler = \Profiler::instance()->getTransactionProfiler();
// Ignore warnings about master connections/writes...hard to avoid here
$trxProfiler = \Profiler::instance()->getTransactionProfiler();
- $trxProfiler->setSilenced( true );
+ $
old = $
trxProfiler->setSilenced( true );
try {
$status = $user->addToDatabase();
if ( !$status->isOK() ) {
try {
$status = $user->addToDatabase();
if ( !$status->isOK() ) {
@@
-1704,7
+1705,7
@@
class AuthManager implements LoggerAwareInterface {
return $status;
}
} catch ( \Exception $ex ) {
return $status;
}
} catch ( \Exception $ex ) {
- $trxProfiler->setSilenced(
false
);
+ $trxProfiler->setSilenced(
$old
);
$this->logger->error( __METHOD__ . ': {username} failed with exception {exception}', [
'username' => $username,
'exception' => $ex,
$this->logger->error( __METHOD__ . ': {username} failed with exception {exception}', [
'username' => $username,
'exception' => $ex,
@@
-1743,7
+1744,7
@@
class AuthManager implements LoggerAwareInterface {
$logEntry->insert();
}
$logEntry->insert();
}
- $trxProfiler->setSilenced(
false
);
+ $trxProfiler->setSilenced(
$old
);
if ( $login ) {
$this->setSessionDataForUser( $user );
if ( $login ) {
$this->setSessionDataForUser( $user );
@@
-2382,7
+2383,7
@@
class AuthManager implements LoggerAwareInterface {
$session->set( 'AuthManager:lastAuthTimestamp', time() );
$session->persist();
$session->set( 'AuthManager:lastAuthTimestamp', time() );
$session->persist();
- \ScopedCallback::consume( $delay );
+ \
Wikimedia\
ScopedCallback::consume( $delay );
\Hooks::run( 'UserLoggedIn', [ $user ] );
}
\Hooks::run( 'UserLoggedIn', [ $user ] );
}