diff options
author | Kosta Harlan <kharlan@wikimedia.org> | 2024-06-13 14:03:53 +0200 |
---|---|---|
committer | Kosta Harlan <kharlan@wikimedia.org> | 2024-06-14 17:26:30 +0200 |
commit | 20638462a74db10b5fbcbdd94fc35dd7801ddb80 (patch) | |
tree | 886ac628c229f317dd14aa1cebca5f20386b026a /maintenance | |
parent | 9cb183acd76cf4d44b75fb0f298d769b6e20d661 (diff) | |
download | mediawikicore-20638462a74db10b5fbcbdd94fc35dd7801ddb80.tar.gz mediawikicore-20638462a74db10b5fbcbdd94fc35dd7801ddb80.zip |
[temp accounts] Make use of isKnown config flag
Why:
- A few places in core should check the isKnown
flag (I4ce534a847461230f7fa276a565bdc1d6c9857e1) rather than isEnabled
What:
- Update ChangesListSpecialPage, UserGroupManager,
UserSelectQueryBuilder, WatchedItemQueryService,
ApiQuerySiteInfo, maintenance/expireTemporaryAccounts and
maintenance/userOptions to used the isKnown() config check
Bug: T356524
Change-Id: I5a88808c7297752c60f6e7ffe16cf6543d783269
Diffstat (limited to 'maintenance')
-rw-r--r-- | maintenance/expireTemporaryAccounts.php | 2 | ||||
-rw-r--r-- | maintenance/populateUserIsTemp.php | 4 | ||||
-rw-r--r-- | maintenance/userOptions.php | 2 |
3 files changed, 4 insertions, 4 deletions
diff --git a/maintenance/expireTemporaryAccounts.php b/maintenance/expireTemporaryAccounts.php index f79a6be3cf92..a4ffada6fcc0 100644 --- a/maintenance/expireTemporaryAccounts.php +++ b/maintenance/expireTemporaryAccounts.php @@ -142,7 +142,7 @@ class ExpireTemporaryAccounts extends Maintenance { public function execute() { $this->initServices(); - if ( !$this->tempUserConfig->isEnabled() ) { + if ( !$this->tempUserConfig->isKnown() ) { $this->output( 'Temporary accounts are disabled' . PHP_EOL ); return; } diff --git a/maintenance/populateUserIsTemp.php b/maintenance/populateUserIsTemp.php index 7c1da98764ef..4d08bce37bcf 100644 --- a/maintenance/populateUserIsTemp.php +++ b/maintenance/populateUserIsTemp.php @@ -55,8 +55,8 @@ class PopulateUserIsTemp extends LoggedUpdateMaintenance { protected function doDBUpdates() { $this->initServices(); - if ( !$this->tempUserConfig->isEnabled() ) { - // If temporary user auto-creation is disabled, then just return early as there will be no rows to update. + if ( !$this->tempUserConfig->isKnown() ) { + // If temporary user auto-creation is not known, then just return early as there will be no rows to update. return true; } diff --git a/maintenance/userOptions.php b/maintenance/userOptions.php index 8ba84dcd59bb..251ba43fff9b 100644 --- a/maintenance/userOptions.php +++ b/maintenance/userOptions.php @@ -200,7 +200,7 @@ WARN $queryBuilderTemplate->andWhere( $dbr->expr( 'user_id', '<=', $toUserId ) ); } - if ( $tempUserConfig->isEnabled() ) { + if ( $tempUserConfig->isKnown() ) { $queryBuilderTemplate->andWhere( $tempUserConfig->getMatchCondition( $dbr, 'user_name', IExpression::NOT_LIKE ) ); |