Alex Monk has uploaded a new change for review.
https://gerrit.wikimedia.org/r/124280
Change subject: Move logic for checking CA status (locked or non-unified) to
userBlockFlags
......................................................................
Move logic for checking CA status (locked or non-unified) to userBlockFlags
So we see that information on get edits as well as get users.
This also includes the list of groups that the user is in.
Bug: 45631
Change-Id: I48124be7a047e0eee6fda96910dd8785ddaac4a8
---
M specials/SpecialCheckUser.php
1 file changed, 25 insertions(+), 23 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CheckUser
refs/changes/80/124280/1
diff --git a/specials/SpecialCheckUser.php b/specials/SpecialCheckUser.php
index 0293cbf..c5b1ab1 100644
--- a/specials/SpecialCheckUser.php
+++ b/specials/SpecialCheckUser.php
@@ -956,7 +956,6 @@
if ( !$dbr->numRows( $ret ) ) {
$s = $this->noMatchesMessage( $ip, !$xfor ) . "\n";
} else {
- global $wgAuth;
foreach ( $ret as $row ) {
if ( !array_key_exists( $row->cuc_user_text,
$users_edits ) ) {
$users_last[$row->cuc_user_text] =
$row->cuc_timestamp;
@@ -1013,28 +1012,6 @@
# Check if this user or IP is blocked. If so,
give a link to the block log...
$ip = IP::isIPAddress( $name ) ? $name : '';
$flags = $this->userBlockFlags( $ip,
$users_ids[$name], $user );
- # Show if account is local only
- $authUser = $wgAuth->getUserInstance( $user );
- if ( $user->getId() && $authUser->getId() === 0
) {
- // @todo FIXME: i18n issue: Hard coded
parentheses.
- $flags[] = '<strong>(' . $this->msg(
'checkuser-localonly' )->escaped() . ')</strong>';
- }
- # Check for extra user rights...
- if ( $users_ids[$name] ) {
- if ( $user->isLocked() ) {
- // @todo FIXME: i18n issue:
Hard coded parentheses.
- $flags[] = '<b>(' . $this->msg(
'checkuser-locked' )->escaped() . ')</b>';
- }
- $list = array();
- foreach ( $user->getGroups() as $group
) {
- $list[] = self::buildGroupLink(
$group, $user->getName() );
- }
- $groups =
$this->getLanguage()->commaList( $list );
- if ( $groups ) {
- // @todo FIXME: i18n issue:
Hard coded parentheses.
- $flags[] = '<i>(' . $groups .
')</i>';
- }
- }
# Check how many accounts the user made
recently?
if ( $ip ) {
$key = wfMemcKey( 'acctcreate', 'ip',
$ip );
@@ -1113,6 +1090,7 @@
* @return array
*/
protected function userBlockFlags( $ip, $userId, $user ) {
+ global $wgAuth;
static $logs, $blocklist;
$logs = SpecialPage::getTitleFor( 'Log' );
$blocklist = SpecialPage::getTitleFor( 'BlockList' );
@@ -1173,6 +1151,30 @@
// @todo FIXME: Hard coded parentheses.
$flags[] = '<strong>(' . $blocklog . ')</strong>';
}
+
+ # Show if account is local only
+ $authUser = $wgAuth->getUserInstance( $user );
+ if ( $user->getId() && $authUser->getId() === 0 ) {
+ // @todo FIXME: i18n issue: Hard coded parentheses.
+ $flags[] = '<strong>(' . $this->msg(
'checkuser-localonly' )->escaped() . ')</strong>';
+ }
+ # Check for extra user rights...
+ if ( $userId ) {
+ if ( $user->isLocked() ) {
+ // @todo FIXME: i18n issue: Hard coded
parentheses.
+ $flags[] = '<b>(' . $this->msg(
'checkuser-locked' )->escaped() . ')</b>';
+ }
+ $list = array();
+ foreach ( $user->getGroups() as $group ) {
+ $list[] = self::buildGroupLink( $group,
$user->getName() );
+ }
+ $groups = $this->getLanguage()->commaList( $list );
+ if ( $groups ) {
+ // @todo FIXME: i18n issue: Hard coded
parentheses.
+ $flags[] = '<i>(' . $groups . ')</i>';
+ }
+ }
+
return $flags;
}
--
To view, visit https://gerrit.wikimedia.org/r/124280
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I48124be7a047e0eee6fda96910dd8785ddaac4a8
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CheckUser
Gerrit-Branch: master
Gerrit-Owner: Alex Monk <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits