$user = User::newFromRow( $r );
$name = $user->getName();
$data[$name]['name'] = $name;
+
if ( isset( $this->prop['editcount'] ) ) {
$data[$name]['editcount'] = intval( $user->getEditCount() );
}
+
if ( isset( $this->prop['registration'] ) ) {
$data[$name]['registration'] = wfTimestampOrNull( TS_ISO_8601, $user->getRegistration() );
}
+
if ( isset( $this->prop['groups'] ) && !is_null( $r->ug_group ) ) {
// This row contains only one group, others will be added from other rows
$data[$name]['groups'][] = $r->ug_group;
}
+
if ( isset( $this->prop['blockinfo'] ) && !is_null( $r->blocker_name ) ) {
$data[$name]['blockedby'] = $r->blocker_name;
$data[$name]['blockreason'] = $r->ipb_reason;
}
+
if ( isset( $this->prop['emailable'] ) && $user->canReceiveEmail() ) {
$data[$name]['emailable'] = '';
}
$data[$u] = array( 'name' => $u );
$urPage = new UserrightsPage;
$iwUser = $urPage->fetchUser( $u );
+
if ( $iwUser instanceof UserRightsProxy ) {
$data[$u]['interwiki'] = '';
+
if ( !is_null( $params['token'] ) ) {
$tokenFunctions = $this->getTokenFunctions();
+
foreach ( $params['token'] as $t ) {
$val = call_user_func( $tokenFunctions[$t], $iwUser );
if ( $val === false ) {
$data[$u]['missing'] = '';
}
} else {
- if ( isset( $this->prop['groups'] ) && isset( $data[$u]['groups'] ) )
- {
+ if ( isset( $this->prop['groups'] ) && isset( $data[$u]['groups'] ) ) {
+ $autolist = array();
+ $autolist[] = "*";
+ foreach( Autopromote::getAutopromoteGroups( User::newFromName( $u ) ) as $group ) {
+ $autolist[] = $group;
+ }
+
+ $data[$u]['groups'] = array_merge( $autolist, $data[$u]['groups'] );
+
$this->getResult()->setIndexedTagName( $data[$u]['groups'], 'g' );
}
}
public function userCanChangeRights( $user, $checkIfSelf = true ) {
$available = $this->changeableGroups();
return !empty( $available['add'] )
- or !empty( $available['remove'] )
- or ( ( $this->isself || !$checkIfSelf ) and
+ || !empty( $available['remove'] )
+ || ( ( $this->isself || !$checkIfSelf ) &&
( !empty( $available['add-self'] )
- or !empty( $available['remove-self'] ) ) );
+ || !empty( $available['remove-self'] ) ) );
}
/**
$this->mTarget = $wgUser->getName();
}
- if ( User::getCanonicalName( $this->mTarget ) == $wgUser->getName() )
+ if ( User::getCanonicalName( $this->mTarget ) == $wgUser->getName() ) {
$this->isself = true;
+ }
if( !$this->userCanChangeRights( $wgUser, true ) ) {
// fixme... there may be intermediate groups we can mention.
$this->setHeaders();
// show the general form
- if ( count( $available['add'] ) || count( $available['remove'] ) )
+ if ( count( $available['add'] ) || count( $available['remove'] ) ) {
$this->switchForm();
+ }
if( $wgRequest->wasPosted() ) {
// save settings