Apsdehal has uploaded a new change for review.
https://gerrit.wikimedia.org/r/101178
Change subject: Updated Special:GlobalUsers to show creation date of global
user account
......................................................................
Updated Special:GlobalUsers to show creation date of global user account
Earlier the Special:GlobalUsers in CentralAuth didn't showed the creation date
of global user account, some minor changes have been included in the code to
show the same, like addition of new field gu_registration and then modifying
the formatRow() to output it correctly
Bug:21481
Change-Id: I02c57e3934bab5ec0be99af709d37fc3df372f99
---
M specials/SpecialGlobalUsers.php
1 file changed, 13 insertions(+), 2 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CentralAuth
refs/changes/78/101178/1
diff --git a/specials/SpecialGlobalUsers.php b/specials/SpecialGlobalUsers.php
index 45d5fc8..ed19b10 100644
--- a/specials/SpecialGlobalUsers.php
+++ b/specials/SpecialGlobalUsers.php
@@ -107,7 +107,7 @@
return array(
'tables' => array( 'globaluser', 'localuser',
'global_user_groups' ),
- 'fields' => array( 'gu_id', 'gu_name', 'gu_locked',
'lu_attached_method', 'COUNT(gug_group) AS gug_numgroups', 'MAX(gug_group) AS
gug_singlegroup' ),
+ 'fields' => array( 'gu_id', 'gu_name', 'gu_locked',
'gu_registration','lu_attached_method', 'COUNT(gug_group) AS gug_numgroups',
'MAX(gug_group) AS gug_singlegroup' ),
'conds' => $conds,
'options' => array( 'GROUP BY' => 'gu_name' ),
'join_conds' => array(
@@ -123,7 +123,9 @@
* @return string HTML li element with username and info about this user
*/
function formatRow( $row ) {
+ $lang= $this->getLanguage();
$user = htmlspecialchars( $row->gu_name );
+ $user_host = $this->getUser();
$info = array();
if ( $row->gu_locked ) {
$info[] = $this->msg( 'centralauth-listusers-locked'
)->text();
@@ -133,13 +135,22 @@
} else {
$info[] = $this->msg( 'centralauth-listusers-nolocal'
)->text();
}
+
+ if ( !$this->including && $row->gu_registration ) {
+ $date_created = $lang->userDate( $row->gu_registration,
$user_host );
+ $time_created = $lang->userTime( $row->gu_registration,
$user_host );
+ $created = $this->msg( 'usercreated', $date_created,
$time_created, $user )->escaped();
+ $created = ' ' . $this->msg( 'parentheses'
)->rawParams( $created )->escaped();
+ }
+
+
$groups = $this->getUserGroups( $row );
if ( $groups ) {
$info[] = $groups;
}
$info = $this->getLanguage()->commaList( $info );
- return Html::rawElement( 'li', array(), $this->msg(
'centralauth-listusers-item', $user, $info )->parse() );
+ return Html::rawElement( 'li', array(), $this->msg(
'centralauth-listusers-item', $user, $info)->parse().$created);
}
function doBatchLookups() {
--
To view, visit https://gerrit.wikimedia.org/r/101178
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I02c57e3934bab5ec0be99af709d37fc3df372f99
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CentralAuth
Gerrit-Branch: master
Gerrit-Owner: Apsdehal <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits