mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/LoginNotify
synced 2024-09-23 18:29:17 +00:00
Add more checks for user existence
Bug: T173888 Change-Id: Ibcf2dcb867030c0a71534dc0349fb259d04f1706
This commit is contained in:
parent
c5d5020e6b
commit
fc6f25c514
|
@ -31,7 +31,7 @@ class DeferredChecksJob extends Job {
|
|||
$checkType = $this->params['checkType'];
|
||||
$userId = $this->params['userId'];
|
||||
$user = User::newFromId( $userId );
|
||||
if ( !$user ) {
|
||||
if ( !$user || $user->isAnon() ) {
|
||||
throw new Exception( "Can't find user for user id=" . print_r( $userId, true ) );
|
||||
}
|
||||
if ( !isset( $this->params['subnet'] ) || !is_string( $this->params['subnet'] ) ) {
|
||||
|
|
|
@ -17,6 +17,7 @@ use JobQueueGroup;
|
|||
use JobSpecification;
|
||||
use MediaWiki\MediaWikiServices;
|
||||
use WebRequest;
|
||||
use Wikimedia\Assert\Assert;
|
||||
use Wikimedia\Rdbms\Database;
|
||||
use Exception;
|
||||
use IP;
|
||||
|
@ -216,6 +217,8 @@ class LoginNotify implements LoggerAwareInterface {
|
|||
* @return string One of USER_* constants
|
||||
*/
|
||||
private function checkUserAllWikis( User $user, $subnet ) {
|
||||
Assert::parameter( $user->isLoggedIn(), '$user', 'User must be logged in' );
|
||||
|
||||
if ( !$this->config->get( 'LoginNotifyCheckKnownIPs' )
|
||||
|| !class_exists( 'CheckUser' )
|
||||
) {
|
||||
|
|
Loading…
Reference in a new issue