Go to the documentation of this file.
29 use Wikimedia\IPUtils;
84 parent::__construct(
'DeletedContributions',
'deletedhistory' );
109 $opts->add(
'target',
'' );
110 $opts->add(
'namespace',
'' );
111 $opts->add(
'limit', 20 );
113 $opts->fetchValuesFromRequest( $this->
getRequest() );
114 $opts->validateIntBounds(
'limit', 0, $this->
getConfig()->
get(
'QueryPageDefaultLimit' ) );
116 if ( $par !==
null ) {
118 $par = $this->userNameUtils->getCanonical( $par, UserNameUtils::RIGOR_NONE );
119 $opts->setValue(
'target', (
string)$par );
122 $ns = $opts->getValue(
'namespace' );
123 if ( $ns !==
null && $ns !==
'' ) {
124 $opts->setValue(
'namespace', intval( $ns ) );
127 $this->mOpts = $opts;
129 $target = trim( $opts->getValue(
'target' ) );
130 if ( !strlen( $target ) ) {
142 $this->
getSkin()->setRelevantUser( $userObj );
144 $target = $userObj->getName();
147 $out->addSubtitle( $this->
getSubTitle( $userObj ) );
148 $out->setHTMLTitle( $this->
msg(
150 $this->
msg(
'deletedcontributions-title', $target )->plain()
151 )->inContentLanguage() );
158 $opts->getValue(
'namespace' ),
159 $this->getLinkRenderer(),
160 $this->getHookContainer(),
161 $this->permissionManager,
164 $this->actorMigration,
165 $this->revisionFactory
167 if ( !$pager->getNumRows() ) {
168 $out->addWikiMsg(
'nocontribs' );
173 # Show a message about replica DB lag, if applicable
174 $lag = $pager->getDatabase()->getSessionLagStatus()[
'lag'];
176 $out->showLagWarning( $lag );
180 '<p>' . $pager->getNavigationBar() .
'</p>' .
182 '<p>' . $pager->getNavigationBar() .
'</p>' );
184 # If there were contributions, and it was a valid user or IP, show
185 # the appropriate "footer" message - WHOIS tools, etc.
186 $message = IPUtils::isIPAddress( $target ) ?
187 'sp-contributions-footer-anon' :
188 'sp-contributions-footer';
190 if ( !$this->
msg( $message )->isDisabled() ) {
192 "<div class='mw-contributions-footer'>\n$1\n</div>",
193 [ $message, $target ]
205 if ( $userObj->isAnon() ) {
206 $user = htmlspecialchars( $userObj->getName() );
208 $user =
$linkRenderer->makeLink( $userObj->getUserPage(), $userObj->getName() );
211 $nt = $userObj->getUserPage();
212 $talk = $nt->getTalkPage();
217 $this->permissionManager,
223 $this->msg(
'sp-deletedcontributions-contribs' )->text()
225 if ( isset( $tools[
'deletedcontribs'] ) ) {
228 $tools, [
'contribs' => $contributionsLink ],
'deletedcontribs' );
229 unset( $tools[
'deletedcontribs'] );
231 $tools[
'contribs'] = $contributionsLink;
237 $block = DatabaseBlock::newFromTarget( $userObj, $userObj );
238 if ( $block !==
null && $block->getType() != DatabaseBlock::TYPE_AUTO ) {
239 if ( $block->getType() == DatabaseBlock::TYPE_RANGE ) {
240 $nt = $this->namespaceInfo->getCanonicalName(
NS_USER ) .
':' . $block->getTarget();
252 'showIfEmpty' =>
false,
254 'sp-contributions-blocked-notice',
255 $userObj->getName() # Support GENDER in
'sp-contributions-blocked-notice'
257 'offset' =>
'' # don
't use $this->getRequest() parameter offset
263 return $this->msg( 'contribsub2
' )->rawParams( $user, $links )->params( $userObj->getName() );
269 private function getForm() {
270 $opts = $this->mOpts;
276 'label-message
' => 'sp-contributions-username
',
277 'default' => $opts->getValue( 'target
' ),
282 'type
' => 'namespaceselect
',
283 'name
' => 'namespace',
284 'label-message
' => 'namespace',
289 HTMLForm::factory( 'ooui
', $formDescriptor, $this->getContext() )
290 ->setWrapperLegendMsg( 'sp-contributions-search
' )
291 ->setSubmitTextMsg( 'sp-contributions-submit
' )
292 // prevent setting subpage and 'target
' parameter at the same time
293 ->setAction( $this->getPageTitle()->getLocalURL() )
296 ->displayForm( false );
307 public function prefixSearchSubpages( $search, $limit, $offset ) {
308 $search = $this->userNameUtils->getCanonical( $search );
310 // No prefix suggestion for invalid user
313 // Autocomplete subpage as user list - public to allow caching
314 return $this->userNamePrefixSearch
315 ->search( UserNamePrefixSearch::AUDIENCE_PUBLIC, $search, $limit, $offset );
318 protected function getGroupName() {
LinkRenderer null $linkRenderer
wfArrayInsertAfter(array $array, array $insert, $after)
Insert array into another array after the specified KEY
msg( $key,... $params)
Wrapper around wfMessage that sets the current context.
ActorMigration $actorMigration
getOutput()
Get the OutputPage being used for this instance.
PermissionManager $permissionManager
checkPermissions()
Checks if userCanExecute, and if not throws a PermissionsError.
UserNameUtils $userNameUtils
static newFromName( $name, $validate='valid')
static getTitleFor( $name, $subpage=false, $fragment='')
Get a localised Title object for a specified special page name If you don't need a full Title object,...
getSkin()
Shortcut to get the skin being used for this instance.
getLanguage()
Shortcut to get user's language.
This class handles the logic for the actor table migration and should always be used in lieu of direc...
ILoadBalancer $loadBalancer
static getUserLinks(SpecialPage $sp, User $target, PermissionManager $permissionManager=null, HookRunner $hookRunner=null)
Links to different places.
addHelpLink( $to, $overrideBaseUrl=false)
Adds help link with an icon via page indicators.
RevisionFactory $revisionFactory
getConfig()
Shortcut to get main config object.
getSubTitle( $userObj)
Generates the subheading with links.
execute( $par)
Special page "deleted user contributions".
__construct(PermissionManager $permissionManager, ILoadBalancer $loadBalancer, CommentStore $commentStore, ActorMigration $actorMigration, RevisionFactory $revisionFactory, NamespaceInfo $namespaceInfo, UserNameUtils $userNameUtils, UserNamePrefixSearch $userNamePrefixSearch)
CommentStore $commentStore
setHeaders()
Sets headers - this should be called from the execute() method of all derived classes!...
static showLogExtract(&$out, $types=[], $page='', $user='', $param=[])
Show log extract.
getContext()
Gets the context this SpecialPage is executed in.
UserNamePrefixSearch $userNamePrefixSearch
Implements Special:DeletedContributions to display archived revisions.
Parent class for all special pages.
getRequest()
Get the WebRequest being used for this instance.
This is a utility class for dealing with namespaces that encodes all the "magic" behaviors of them ba...
getForm()
Generates the namespace selector form with hidden attributes.
outputHeader( $summaryMessageKey='')
Outputs a summary message on top of special pages Per default the message key is the canonical name o...
NamespaceInfo $namespaceInfo