// Paranoia: avoid brute force searches (bug 17792)
if ( !$user->isAllowed( 'deletedhistory' ) ) {
$conds[] = $this->mDb->bitAnd( 'ar_deleted', Revision::DELETED_USER ) . ' = 0';
- } elseif ( !$user->isAllowed( 'suppressrevision' ) ) {
+ } elseif ( !$user->isAllowedAny( 'suppressrevision', 'viewsuppressed' ) ) {
$conds[] = $this->mDb->bitAnd( 'ar_deleted', Revision::SUPPRESSED_USER ) .
' != ' . Revision::SUPPRESSED_USER;
}
* @param string $par (optional) user name of the user for which to show the contributions
*/
function execute( $par ) {
- global $wgQueryPageDefaultLimit;
-
$this->setHeaders();
$this->outputHeader();
return;
}
- $options['limit'] = $request->getInt( 'limit', $wgQueryPageDefaultLimit );
+ $options['limit'] = $request->getInt( 'limit', $this->getConfig()->get( 'QueryPageDefaultLimit' ) );
$options['target'] = $target;
$userObj = User::newFromName( $target, false );
$links = $this->getLanguage()->pipeList( $tools );
// Show a note if the user is blocked and display the last block log entry.
- if ( $userObj->isBlocked() ) {
+ $block = Block::newFromTarget( $userObj, $userObj );
+ if ( !is_null( $block ) && $block->getType() != Block::TYPE_AUTO ) {
+ if ( $block->getType() == Block::TYPE_RANGE ) {
+ $nt = MWNamespace::getCanonicalName( NS_USER ) . ':' . $block->getTarget();
+ }
+
// LogEventsList::showLogExtract() wants the first parameter by ref
$out = $this->getOutput();
LogEventsList::showLogExtract(
'showIfEmpty' => false,
'msgKey' => array(
'sp-contributions-blocked-notice',
- $nt->getText() # Support GENDER in 'sp-contributions-blocked-notice'
+ $userObj->getName() # Support GENDER in 'sp-contributions-blocked-notice'
),
'offset' => '' # don't use $this->getRequest() parameter offset
)
* @return string
*/
function getForm( $options ) {
- global $wgScript;
-
$options['title'] = $this->getPageTitle()->getPrefixedText();
if ( !isset( $options['target'] ) ) {
$options['target'] = '';
$options['target'] = '';
}
- $f = Xml::openElement( 'form', array( 'method' => 'get', 'action' => $wgScript ) );
+ $f = Xml::openElement( 'form', array( 'method' => 'get', 'action' => wfScript() ) );
foreach ( $options as $name => $value ) {
if ( in_array( $name, array( 'namespace', 'target', 'contribs' ) ) ) {