3 * Implements Special:Block
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License along
16 * with this program; if not, write to the Free Software Foundation, Inc.,
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 * http://www.gnu.org/copyleft/gpl.html
21 * @ingroup SpecialPage
25 * A special page that allows users with 'block' right to block users from
26 * editing pages and other actions
28 * @ingroup SpecialPage
30 class SpecialBlock
extends SpecialPage
{
32 /** The maximum number of edits a user can have and still be hidden
33 * TODO: config setting? */
34 const HIDEUSER_CONTRIBLIMIT
= 1000;
36 /** @var User user to be blocked, as passed either by parameter (url?wpTarget=Foo)
37 * or as subpage (Special:Block/Foo) */
40 /// @var Block::TYPE_ constant
43 /// @var User|String the previous block target
44 protected $previousTarget;
46 /// @var Bool whether the previous submission of the form asked for HideUser
47 protected $requestedHideUser;
50 protected $alreadyBlocked;
53 protected $preErrors = array();
55 public function __construct() {
56 parent
::__construct( 'Block', 'block' );
59 public function execute( $par ) {
60 global $wgUser, $wgOut, $wgRequest;
62 # Can't block when the database is locked
64 $wgOut->readOnlyPage();
68 if( !$this->userCanExecute( $wgUser ) ) {
69 $wgOut->permissionRequired( 'block' );
73 # Extract variables from the request. Try not to get into a situation where we
74 # need to extract *every* variable from the form just for processing here, but
75 # there are legitimate uses for some variables
76 list( $this->target
, $this->type
) = self
::getTargetAndType( $par, $wgRequest );
77 if ( $this->target
instanceof User
) {
78 # Set the 'relevant user' in the skin, so it displays links like Contributions,
79 # User logs, UserRights, etc.
80 $wgUser->getSkin()->setRelevantUser( $this->target
);
83 list( $this->previousTarget
, /*...*/ ) = Block
::parseTarget( $wgRequest->getVal( 'wpPreviousTarget' ) );
84 $this->requestedHideUser
= $wgRequest->getBool( 'wpHideUser' );
86 # bug 15810: blocked admins should have limited access here
87 $status = self
::checkUnblockSelf( $this->target
);
88 if ( $status !== true ) {
89 throw new ErrorPageError( 'badaccess', $status );
92 $wgOut->setPageTitle( wfMsg( 'blockip-title' ) );
93 $wgOut->addModules( 'mediawiki.special', 'mediawiki.special.block' );
95 $fields = self
::getFormFields();
96 $this->maybeAlterFormDefaults( $fields );
98 $form = new HTMLForm( $fields, $this->getContext() );
99 $form->setWrapperLegend( wfMsg( 'blockip-legend' ) );
100 $form->setSubmitCallback( array( __CLASS__
, 'processForm' ) );
102 $t = $this->alreadyBlocked
103 ?
wfMsg( 'ipb-change-block' )
104 : wfMsg( 'ipbsubmit' );
105 $form->setSubmitText( $t );
107 $this->doPreText( $form );
108 $this->doHeadertext( $form );
109 $this->doPostText( $form );
112 $wgOut->setPageTitle( wfMsg( 'blockipsuccesssub' ) );
113 $wgOut->addWikiMsg( 'blockipsuccesstext', $this->target
);
118 * Get the HTMLForm descriptor array for the block form
121 protected static function getFormFields(){
122 global $wgUser, $wgBlockAllowsUTEdit;
127 'label-message' => 'ipadressorusername',
129 'id' => 'mw-bi-target',
132 'validation-callback' => array( __CLASS__
, 'validateTargetField' ),
135 'type' => !count( self
::getSuggestedDurations() ) ?
'text' : 'selectorother',
136 'label-message' => 'ipbexpiry',
139 'options' => self
::getSuggestedDurations(),
140 'other' => wfMsg( 'ipbother' ),
143 'type' => 'selectandother',
144 'label-message' => 'ipbreason',
145 'options-message' => 'ipbreason-dropdown',
147 'CreateAccount' => array(
149 'label-message' => 'ipbcreateaccount',
154 if( self
::canBlockEmail( $wgUser ) ) {
155 $a['DisableEmail'] = array(
157 'label-message' => 'ipbemailban',
161 if( $wgBlockAllowsUTEdit ){
162 $a['DisableUTEdit'] = array(
164 'label-message' => 'ipb-disableusertalk',
169 $a['AutoBlock'] = array(
171 'label-message' => 'ipbenableautoblock',
175 # Allow some users to hide name from block log, blocklist and listusers
176 if( $wgUser->isAllowed( 'hideuser' ) ) {
177 $a['HideUser'] = array(
179 'label-message' => 'ipbhidename',
180 'cssclass' => 'mw-block-hideuser',
184 # Watchlist their user page? (Only if user is logged in)
185 if( $wgUser->isLoggedIn() ) {
188 'label-message' => 'ipbwatchuser',
192 $a['HardBlock'] = array(
194 'label-message' => 'ipb-hardblock',
198 # This is basically a copy of the Target field, but the user can't change it, so we
199 # can see if the warnings we maybe showed to the user before still apply
200 $a['PreviousTarget'] = array(
205 # We'll turn this into a checkbox if we need to
206 $a['Confirm'] = array(
209 'label-message' => 'ipb-confirm',
216 * If the user has already been blocked with similar settings, load that block
217 * and change the defaults for the form fields to match the existing settings.
218 * @param &$fields Array HTMLForm descriptor array
219 * @return Bool whether fields were altered (that is, whether the target is
222 protected function maybeAlterFormDefaults( &$fields ){
223 global $wgRequest, $wgUser;
225 # This will be overwritten by request data
226 $fields['Target']['default'] = (string)$this->target
;
229 $fields['PreviousTarget']['default'] = (string)$this->target
;
231 $block = Block
::newFromTarget( $this->target
);
233 if( $block instanceof Block
&& !$block->mAuto
# The block exists and isn't an autoblock
234 && ( $this->type
!= Block
::TYPE_RANGE
# The block isn't a rangeblock
235 ||
$block->getTarget() == $this->target
) # or if it is, the range is what we're about to block
238 $fields['HardBlock']['default'] = $block->isHardblock();
239 $fields['CreateAccount']['default'] = $block->prevents( 'createaccount' );
240 $fields['AutoBlock']['default'] = $block->isAutoblocking();
241 if( isset( $fields['DisableEmail'] ) ){
242 $fields['DisableEmail']['default'] = $block->prevents( 'sendemail' );
244 if( isset( $fields['HideUser'] ) ){
245 $fields['HideUser']['default'] = $block->mHideName
;
247 if( isset( $fields['DisableUTEdit'] ) ){
248 $fields['DisableUTEdit']['default'] = $block->prevents( 'editownusertalk' );
250 $fields['Reason']['default'] = $block->mReason
;
252 if( $wgRequest->wasPosted() ){
253 # Ok, so we got a POST submission asking us to reblock a user. So show the
254 # confirm checkbox; the user will only see it if they haven't previously
255 $fields['Confirm']['type'] = 'check';
257 # We got a target, but it wasn't a POST request, so the user must have gone
258 # to a link like [[Special:Block/User]]. We don't need to show the checkbox
259 # as long as they go ahead and block *that* user
260 $fields['Confirm']['default'] = 1;
263 if( $block->mExpiry
== 'infinity' ) {
264 $fields['Expiry']['default'] = 'indefinite';
266 $fields['Expiry']['default'] = wfTimestamp( TS_RFC2822
, $block->mExpiry
);
269 $this->alreadyBlocked
= true;
270 $this->preErrors
[] = array( 'ipb-needreblock', (string)$block->getTarget() );
273 # We always need confirmation to do HideUser
274 if( $this->requestedHideUser
){
275 $fields['Confirm']['type'] = 'check';
276 unset( $fields['Confirm']['default'] );
277 $this->preErrors
[] = 'ipb-confirmhideuser';
280 # Or if the user is trying to block themselves
281 if( (string)$this->target
=== $wgUser->getName() ){
282 $fields['Confirm']['type'] = 'check';
283 unset( $fields['Confirm']['default'] );
284 $this->preErrors
[] = 'ipb-blockingself';
289 * Add header elements like block log entries, etc.
290 * @param $form HTMLForm
293 protected function doPreText( HTMLForm
&$form ){
294 $form->addPreText( wfMsgExt( 'blockiptext', 'parse' ) );
296 $otherBlockMessages = array();
297 if( $this->target
!== null ) {
298 # Get other blocks, i.e. from GlobalBlocking or TorBlock extension
299 wfRunHooks( 'OtherBlockLogLink', array( &$otherBlockMessages, $this->target
) );
301 if( count( $otherBlockMessages ) ) {
302 $s = Html
::rawElement(
305 wfMsgExt( 'ipb-otherblocks-header', 'parseinline', count( $otherBlockMessages ) )
308 foreach( $otherBlockMessages as $link ) {
309 $list .= Html
::rawElement( 'li', array(), $link ) . "\n";
311 $s .= Html
::rawElement(
313 array( 'class' => 'mw-blockip-alreadyblocked' ),
316 $form->addPreText( $s );
322 * Add header text inside the form, just underneath where the errors would go
323 * @param $form HTMLForm
326 protected function doHeaderText( HTMLForm
&$form ){
328 # Don't need to do anything if the form has been posted
329 if( !$wgRequest->wasPosted() && $this->preErrors
){
330 $s = HTMLForm
::formatErrors( $this->preErrors
);
332 $form->addHeaderText( Html
::rawElement(
334 array( 'class' => 'error' ),
342 * Add footer elements to the form
343 * @param $form HTMLForm
346 protected function doPostText( HTMLForm
&$form ){
347 global $wgUser, $wgLang;
349 $skin = $wgUser->getSkin();
351 # Link to the user's contributions, if applicable
352 if( $this->target
instanceof User
){
353 $contribsPage = SpecialPage
::getTitleFor( 'Contributions', $this->target
->getName() );
354 $links[] = $skin->link(
356 wfMsgExt( 'ipb-blocklist-contribs', 'escape', $this->target
->getName() )
360 # Link to unblock the specified user, or to a blank unblock form
361 if( $this->target
instanceof User
) {
362 $message = wfMsgExt( 'ipb-unblock-addr', array( 'parseinline' ), $this->target
->getName() );
363 $list = SpecialPage
::getTitleFor( 'Unblock', $this->target
->getName() );
365 $message = wfMsgExt( 'ipb-unblock', array( 'parseinline' ) );
366 $list = SpecialPage
::getTitleFor( 'Unblock' );
368 $links[] = $skin->linkKnown( $list, $message, array() );
370 # Link to the block list
371 $links[] = $skin->linkKnown(
372 SpecialPage
::getTitleFor( 'BlockList' ),
373 wfMsg( 'ipb-blocklist' )
376 # Link to edit the block dropdown reasons, if applicable
377 if ( $wgUser->isAllowed( 'editinterface' ) ) {
378 $links[] = $skin->link(
379 Title
::makeTitle( NS_MEDIAWIKI
, 'Ipbreason-dropdown' ),
380 wfMsgHtml( 'ipb-edit-dropdown' ),
382 array( 'action' => 'edit' )
386 $form->addPostText( Html
::rawElement(
388 array( 'class' => 'mw-ipb-conveniencelinks' ),
389 $wgLang->pipeList( $links )
392 if( $this->target
instanceof User
){
393 # Get relevant extracts from the block and suppression logs, if possible
394 $userpage = $this->target
->getUserPage();
397 LogEventsList
::showLogExtract(
400 $userpage->getPrefixedText(),
404 'msgKey' => array( 'blocklog-showlog', $userpage->getText() ),
405 'showIfEmpty' => false
408 $form->addPostText( $out );
410 # Add suppression block entries if allowed
411 if( $wgUser->isAllowed( 'suppressionlog' ) ) {
412 LogEventsList
::showLogExtract(
415 $userpage->getPrefixedText(),
419 'conds' => array( 'log_action' => array( 'block', 'reblock', 'unblock' ) ),
420 'msgKey' => array( 'blocklog-showsuppresslog', $userpage->getText() ),
421 'showIfEmpty' => false
424 $form->addPostText( $out );
430 * Determine the target of the block, and the type of target
431 * TODO: should be in Block.php?
432 * @param $par String subpage parameter passed to setup, or data value from
434 * @param $request WebRequest optionally try and get data from a request too
437 public static function getTargetAndType( $par, WebRequest
$request = null ){
443 # The HTMLForm will check wpTarget first and only if it doesn't get
444 # a value use the default, which will be generated from the options
445 # below; so this has to have a higher precedence here than $par, or
446 # we could end up with different values in $this->target and the HTMLForm!
447 if( $request instanceof WebRequest
){
448 $target = $request->getText( 'wpTarget', null );
455 if( $request instanceof WebRequest
){
456 $target = $request->getText( 'ip', null );
461 if( $request instanceof WebRequest
){
462 $target = $request->getText( 'wpBlockAddress', null );
468 list( $target, $type ) = Block
::parseTarget( $target );
469 if( $type !== null ){
470 return array( $target, $type );
473 return array( null, null );
477 * HTMLForm field validation-callback for Target field.
481 public static function validateTargetField( $value, $alldata = null ) {
482 global $wgBlockCIDRLimit;
484 list( $target, $type ) = self
::getTargetAndType( $value );
486 if( $type == Block
::TYPE_USER
){
487 # TODO: why do we not have a User->exists() method?
488 if( !$target->getId() ){
489 return wfMessage( 'nosuchusershort', $target->getName() );
492 $status = self
::checkUnblockSelf( $target );
493 if ( $status !== true ) {
494 return wfMessage( 'badaccess', $status );
497 } elseif( $type == Block
::TYPE_RANGE
){
498 list( $ip, $range ) = explode( '/', $target, 2 );
500 if( ( IP
::isIPv4( $ip ) && $wgBlockCIDRLimit['IPv4'] == 32 )
501 ||
( IP
::isIPv6( $ip ) && $wgBlockCIDRLimit['IPV6'] == 128 ) )
503 # Range block effectively disabled
504 return wfMessage( 'range_block_disabled' );
507 if( ( IP
::isIPv4( $ip ) && $range > 32 )
508 ||
( IP
::isIPv6( $ip ) && $range > 128 ) )
511 return wfMessage( 'ip_range_invalid' );
514 if( IP
::isIPv4( $ip ) && $range < $wgBlockCIDRLimit['IPv4'] ) {
515 return wfMessage( 'ip_range_toolarge', $wgBlockCIDRLimit['IPv4'] );
518 if( IP
::isIPv6( $ip ) && $range < $wgBlockCIDRLimit['IPv6'] ) {
519 return wfMessage( 'ip_range_toolarge', $wgBlockCIDRLimit['IPv6'] );
522 } elseif( $type == Block
::TYPE_IP
){
526 return wfMessage( 'badipaddress' );
533 * Given the form data, actually implement a block
535 * @return Bool|String
537 public static function processForm( array $data ){
538 global $wgUser, $wgBlockAllowsUTEdit;
540 // Handled by field validator callback
541 // self::validateTargetField( $data['Target'] );
543 # This might have been a hidden field or a checkbox, so interesting data
545 $data['Confirm'] = !in_array( $data['Confirm'], array( '', '0', null, false ), true );
547 list( $target, $type ) = self
::getTargetAndType( $data['Target'] );
548 if( $type == Block
::TYPE_USER
){
550 $target = $user->getName();
551 $userId = $user->getId();
553 # Give admins a heads-up before they go and block themselves. Much messier
554 # to do this for IPs, but it's pretty unlikely they'd ever get the 'block'
555 # permission anyway, although the code does allow for it
556 if( $target === $wgUser->getName() && ( $data['PreviousTarget'] != $data['Target'] ||
!$data['Confirm'] ) )
558 return array( 'ipb-blockingself' );
561 } elseif( $type == Block
::TYPE_RANGE
){
564 } elseif( $type == Block
::TYPE_IP
){
565 $target = $target->getName();
569 # This should have been caught in the form field validation
570 return array( 'badipaddress' );
573 if( ( strlen( $data['Expiry'] ) == 0) ||
( strlen( $data['Expiry'] ) > 50 )
574 ||
!self
::parseExpiryInput( $data['Expiry'] ) )
576 return array( 'ipb_expiry_invalid' );
579 if( !isset( $data['DisableEmail'] ) ){
580 $data['DisableEmail'] = false;
583 # If the user has done the form 'properly', they won't even have been given the
584 # option to suppress-block unless they have the 'hideuser' permission
585 if( !isset( $data['HideUser'] ) ){
586 $data['HideUser'] = false;
588 if( $data['HideUser'] ) {
589 if( !$wgUser->isAllowed('hideuser') ){
590 # this codepath is unreachable except by a malicious user spoofing forms,
591 # or by race conditions (user has oversight and sysop, loads block form,
592 # and is de-oversighted before submission); so need to fail completely
593 # rather than just silently disable hiding
594 return array( 'badaccess-group0' );
597 # Recheck params here...
598 if( $type != Block
::TYPE_USER
) {
599 $data['HideUser'] = false; # IP users should not be hidden
601 } elseif( !in_array( $data['Expiry'], array( 'infinite', 'infinity', 'indefinite' ) ) ) {
603 return array( 'ipb_expiry_temp' );
605 } elseif( $user->getEditCount() > self
::HIDEUSER_CONTRIBLIMIT
) {
606 # Typically, the user should have a handful of edits.
607 # Disallow hiding users with many edits for performance.
608 return array( 'ipb_hide_invalid' );
610 } elseif( !$data['Confirm'] ){
611 return array( 'ipb-confirmhideuser' );
615 # Create block object.
616 $block = new Block();
617 $block->setTarget( $target );
618 $block->setBlocker( $wgUser );
619 $block->mReason
= $data['Reason'][0];
620 $block->mExpiry
= self
::parseExpiryInput( $data['Expiry'] );
621 $block->prevents( 'createaccount', $data['CreateAccount'] );
622 $block->prevents( 'editownusertalk', ( !$wgBlockAllowsUTEdit ||
$data['DisableUTEdit'] ) );
623 $block->prevents( 'sendemail', $data['DisableEmail'] );
624 $block->isHardblock( $data['HardBlock'] );
625 $block->isAutoblocking( $data['AutoBlock'] );
626 $block->mHideName
= $data['HideUser'];
628 if( !wfRunHooks( 'BlockIp', array( &$block, &$wgUser ) ) ) {
629 return array( 'hookaborted' );
632 # Try to insert block. Is there a conflicting block?
633 $status = $block->insert();
635 # Show form unless the user is already aware of this...
636 if( ( $data['PreviousTarget'] != htmlspecialchars( $block->getTarget() ) ) ||
!$data['Confirm'] ) {
637 return array( array( 'ipb_already_blocked', $block->getTarget() ) );
638 # Otherwise, try to update the block...
640 # This returns direct blocks before autoblocks/rangeblocks, since we should
641 # be sure the user is blocked by now it should work for our purposes
642 $currentBlock = Block
::newFromTarget( $target );
644 if( $block->equals( $currentBlock ) ) {
645 return array( array( 'ipb_already_blocked', $block->getTarget() ) );
648 # If the name was hidden and the blocking user cannot hide
649 # names, then don't allow any block changes...
650 if( $currentBlock->mHideName
&& !$wgUser->isAllowed( 'hideuser' ) ) {
651 return array( 'cant-see-hidden-user' );
654 $currentBlock->delete();
655 $status = $block->insert();
656 $logaction = 'reblock';
658 # Unset _deleted fields if requested
659 if( $currentBlock->mHideName
&& !$data['HideUser'] ) {
660 RevisionDeleteUser
::unsuppressUserName( $target, $userId );
663 # If hiding/unhiding a name, this should go in the private logs
664 if( (bool)$currentBlock->mHideName
){
665 $data['HideUser'] = true;
669 $logaction = 'block';
672 wfRunHooks( 'BlockIpComplete', array( $block, $wgUser ) );
674 # Set *_deleted fields if requested
675 if( $data['HideUser'] ) {
676 RevisionDeleteUser
::suppressUserName( $target, $userId );
679 # Can't watch a rangeblock
680 if( $type != Block
::TYPE_RANGE
&& $data['Watch'] ) {
681 $wgUser->addWatch( Title
::makeTitle( NS_USER
, $target ) );
684 # Block constructor sanitizes certain block options on insert
685 $data['BlockEmail'] = $block->prevents( 'sendemail' );
686 $data['AutoBlock'] = $block->isAutoblocking();
688 # Prepare log parameters
689 $logParams = array();
690 $logParams[] = $data['Expiry'];
691 $logParams[] = self
::blockLogFlags( $data, $type );
693 # Make log entry, if the name is hidden, put it in the oversight log
694 $log_type = $data['HideUser'] ?
'suppress' : 'block';
695 $log = new LogPage( $log_type );
696 $log_id = $log->addEntry(
698 Title
::makeTitle( NS_USER
, $target ),
702 # Relate log ID to block IDs (bug 25763)
703 $blockIds = array_merge( array( $status['id'] ), $status['autoIds'] );
704 $log->addRelations( 'ipb_id', $blockIds, $log_id );
711 * Get an array of suggested block durations from MediaWiki:Ipboptions
712 * FIXME: this uses a rather odd syntax for the options, should it be converted
713 * to the standard "**<duration>|<displayname>" format?
716 public static function getSuggestedDurations( $lang = null ){
718 $msg = $lang === null
719 ?
wfMessage( 'ipboptions' )->inContentLanguage()->text()
720 : wfMessage( 'ipboptions' )->inLanguage( $lang )->text();
726 foreach( explode( ',', $msg ) as $option ) {
727 if( strpos( $option, ':' ) === false ){
728 $option = "$option:$option";
730 list( $show, $value ) = explode( ':', $option );
731 $a[htmlspecialchars( $show )] = htmlspecialchars( $value );
737 * Convert a submitted expiry time, which may be relative ("2 weeks", etc) or absolute
738 * ("24 May 2034", etc), into an absolute timestamp we can put into the database.
739 * @param $expiry String: whatever was typed into the form
740 * @return String: timestamp or "infinity" string for the DB implementation
742 public static function parseExpiryInput( $expiry ) {
744 if( $infinity == null ){
745 $infinity = wfGetDB( DB_READ
)->getInfinity();
747 if ( $expiry == 'infinite' ||
$expiry == 'indefinite' ) {
750 $expiry = strtotime( $expiry );
751 if ( $expiry < 0 ||
$expiry === false ) {
754 $expiry = wfTimestamp( TS_MW
, $expiry );
760 * Can we do an email block?
761 * @param $user User: the sysop wanting to make a block
764 public static function canBlockEmail( $user ) {
765 global $wgEnableUserEmail, $wgSysopEmailBans;
766 return ( $wgEnableUserEmail && $wgSysopEmailBans && $user->isAllowed( 'blockemail' ) );
770 * bug 15810: blocked admins should not be able to block/unblock
771 * others, and probably shouldn't be able to unblock themselves
773 * @param $user User|Int|String
775 public static function checkUnblockSelf( $user ) {
777 if ( is_int( $user ) ) {
778 $user = User
::newFromId( $user );
779 } elseif ( is_string( $user ) ) {
780 $user = User
::newFromName( $user );
782 if( $wgUser->isBlocked() ){
783 if( $user instanceof User
&& $user->getId() == $wgUser->getId() ) {
784 # User is trying to unblock themselves
785 if ( $wgUser->isAllowed( 'unblockself' ) ) {
788 return 'ipbnounblockself';
791 # User is trying to block/unblock someone else
800 * Return a comma-delimited list of "flags" to be passed to the log
801 * reader for this block, to provide more information in the logs
802 * @param $data Array from HTMLForm data
803 * @param $type Block::TYPE_ constant
806 protected static function blockLogFlags( array $data, $type ) {
807 global $wgBlockAllowsUTEdit;
810 # when blocking a user the option 'anononly' is not available/has no effect -> do not write this into log
811 if( !$data['HardBlock'] && $type != Block
::TYPE_USER
){
812 $flags[] = 'anononly';
815 if( $data['CreateAccount'] ){
816 $flags[] = 'nocreate';
819 # Same as anononly, this is not displayed when blocking an IP address
820 if( !$data['AutoBlock'] && $type != Block
::TYPE_IP
){
821 $flags[] = 'noautoblock';
824 if( $data['DisableEmail'] ){
825 $flags[] = 'noemail';
828 if( $wgBlockAllowsUTEdit && $data['DisableUTEdit'] ){
829 $flags[] = 'nousertalk';
832 if( $data['HideUser'] ){
833 $flags[] = 'hiddenname';
836 return implode( ',', $flags );
841 class IPBlockForm
extends SpecialBlock
{}