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
{
31 /** The maximum number of edits a user can have and still be hidden
32 * TODO: config setting? */
33 const HIDEUSER_CONTRIBLIMIT
= 1000;
35 /** @var User user to be blocked, as passed either by parameter (url?wpTarget=Foo)
36 * or as subpage (Special:Block/Foo) */
39 /// @var Block::TYPE_ constant
42 /// @var User|String the previous block target
43 protected $previousTarget;
45 /// @var Bool whether the previous submission of the form asked for HideUser
46 protected $requestedHideUser;
49 protected $alreadyBlocked;
52 protected $preErrors = array();
54 public function __construct() {
55 parent
::__construct( 'Block', 'block' );
58 public function execute( $par ) {
60 if( !$this->userCanExecute( $this->getUser() ) ) {
61 $this->displayRestrictionError();
65 # Can't block when the database is locked
67 throw new ReadOnlyError
;
70 # Extract variables from the request. Try not to get into a situation where we
71 # need to extract *every* variable from the form just for processing here, but
72 # there are legitimate uses for some variables
73 $request = $this->getRequest();
74 list( $this->target
, $this->type
) = self
::getTargetAndType( $par, $request );
75 if ( $this->target
instanceof User
) {
76 # Set the 'relevant user' in the skin, so it displays links like Contributions,
77 # User logs, UserRights, etc.
78 $this->getSkin()->setRelevantUser( $this->target
);
81 list( $this->previousTarget
, /*...*/ ) = Block
::parseTarget( $request->getVal( 'wpPreviousTarget' ) );
82 $this->requestedHideUser
= $request->getBool( 'wpHideUser' );
84 # bug 15810: blocked admins should have limited access here
85 $status = self
::checkUnblockSelf( $this->target
);
86 if ( $status !== true ) {
87 throw new ErrorPageError( 'badaccess', $status );
91 $this->outputHeader();
93 $out = $this->getOutput();
94 $out->setPageTitle( wfMsg( 'blockip-title' ) );
95 $out->addModules( 'mediawiki.special', 'mediawiki.special.block' );
97 $fields = $this->getFormFields();
98 $this->maybeAlterFormDefaults( $fields );
100 $form = new HTMLForm( $fields, $this->getContext() );
101 $form->setWrapperLegend( wfMsg( 'blockip-legend' ) );
102 $form->setSubmitCallback( array( __CLASS__
, 'processForm' ) );
104 $t = $this->alreadyBlocked
105 ?
wfMsg( 'ipb-change-block' )
106 : wfMsg( 'ipbsubmit' );
107 $form->setSubmitText( $t );
109 $this->doPreText( $form );
110 $this->doHeadertext( $form );
111 $this->doPostText( $form );
114 $out->setPageTitle( wfMsg( 'blockipsuccesssub' ) );
115 $out->addWikiMsg( 'blockipsuccesstext', $this->target
);
120 * Get the HTMLForm descriptor array for the block form
123 protected function getFormFields(){
124 global $wgBlockAllowsUTEdit;
126 $user = $this->getUser();
131 'label-message' => 'ipadressorusername',
133 'id' => 'mw-bi-target',
136 'validation-callback' => array( __CLASS__
, 'validateTargetField' ),
139 'type' => !count( self
::getSuggestedDurations() ) ?
'text' : 'selectorother',
140 'label-message' => 'ipbexpiry',
143 'options' => self
::getSuggestedDurations(),
144 'other' => wfMsg( 'ipbother' ),
147 'type' => 'selectandother',
148 'label-message' => 'ipbreason',
149 'options-message' => 'ipbreason-dropdown',
151 'CreateAccount' => array(
153 'label-message' => 'ipbcreateaccount',
158 if( self
::canBlockEmail( $user ) ) {
159 $a['DisableEmail'] = array(
161 'label-message' => 'ipbemailban',
165 if( $wgBlockAllowsUTEdit ){
166 $a['DisableUTEdit'] = array(
168 'label-message' => 'ipb-disableusertalk',
173 $a['AutoBlock'] = array(
175 'label-message' => 'ipbenableautoblock',
179 # Allow some users to hide name from block log, blocklist and listusers
180 if( $user->isAllowed( 'hideuser' ) ) {
181 $a['HideUser'] = array(
183 'label-message' => 'ipbhidename',
184 'cssclass' => 'mw-block-hideuser',
188 # Watchlist their user page? (Only if user is logged in)
189 if( $user->isLoggedIn() ) {
192 'label-message' => 'ipbwatchuser',
196 $a['HardBlock'] = array(
198 'label-message' => 'ipb-hardblock',
202 # This is basically a copy of the Target field, but the user can't change it, so we
203 # can see if the warnings we maybe showed to the user before still apply
204 $a['PreviousTarget'] = array(
209 # We'll turn this into a checkbox if we need to
210 $a['Confirm'] = array(
213 'label-message' => 'ipb-confirm',
220 * If the user has already been blocked with similar settings, load that block
221 * and change the defaults for the form fields to match the existing settings.
222 * @param &$fields Array HTMLForm descriptor array
223 * @return Bool whether fields were altered (that is, whether the target is
226 protected function maybeAlterFormDefaults( &$fields ){
227 # This will be overwritten by request data
228 $fields['Target']['default'] = (string)$this->target
;
231 $fields['PreviousTarget']['default'] = (string)$this->target
;
233 $block = Block
::newFromTarget( $this->target
);
235 if( $block instanceof Block
&& !$block->mAuto
# The block exists and isn't an autoblock
236 && ( $this->type
!= Block
::TYPE_RANGE
# The block isn't a rangeblock
237 ||
$block->getTarget() == $this->target
) # or if it is, the range is what we're about to block
240 $fields['HardBlock']['default'] = $block->isHardblock();
241 $fields['CreateAccount']['default'] = $block->prevents( 'createaccount' );
242 $fields['AutoBlock']['default'] = $block->isAutoblocking();
244 if( isset( $fields['DisableEmail'] ) ){
245 $fields['DisableEmail']['default'] = $block->prevents( 'sendemail' );
248 if( isset( $fields['HideUser'] ) ){
249 $fields['HideUser']['default'] = $block->mHideName
;
252 if( isset( $fields['DisableUTEdit'] ) ){
253 $fields['DisableUTEdit']['default'] = $block->prevents( 'editownusertalk' );
256 $fields['Reason']['default'] = $block->mReason
;
258 if( $this->getRequest()->wasPosted() ){
259 # Ok, so we got a POST submission asking us to reblock a user. So show the
260 # confirm checkbox; the user will only see it if they haven't previously
261 $fields['Confirm']['type'] = 'check';
263 # We got a target, but it wasn't a POST request, so the user must have gone
264 # to a link like [[Special:Block/User]]. We don't need to show the checkbox
265 # as long as they go ahead and block *that* user
266 $fields['Confirm']['default'] = 1;
269 if( $block->mExpiry
== 'infinity' ) {
270 $fields['Expiry']['default'] = 'indefinite';
272 $fields['Expiry']['default'] = wfTimestamp( TS_RFC2822
, $block->mExpiry
);
275 $this->alreadyBlocked
= true;
276 $this->preErrors
[] = array( 'ipb-needreblock', (string)$block->getTarget() );
279 # We always need confirmation to do HideUser
280 if( $this->requestedHideUser
){
281 $fields['Confirm']['type'] = 'check';
282 unset( $fields['Confirm']['default'] );
283 $this->preErrors
[] = 'ipb-confirmhideuser';
286 # Or if the user is trying to block themselves
287 if( (string)$this->target
=== $this->getUser()->getName() ){
288 $fields['Confirm']['type'] = 'check';
289 unset( $fields['Confirm']['default'] );
290 $this->preErrors
[] = 'ipb-blockingself';
295 * Add header elements like block log entries, etc.
296 * @param $form HTMLForm
299 protected function doPreText( HTMLForm
&$form ){
300 $form->addPreText( wfMsgExt( 'blockiptext', 'parse' ) );
302 $otherBlockMessages = array();
303 if( $this->target
!== null ) {
304 # Get other blocks, i.e. from GlobalBlocking or TorBlock extension
305 wfRunHooks( 'OtherBlockLogLink', array( &$otherBlockMessages, $this->target
) );
307 if( count( $otherBlockMessages ) ) {
308 $s = Html
::rawElement(
311 wfMsgExt( 'ipb-otherblocks-header', 'parseinline', count( $otherBlockMessages ) )
316 foreach( $otherBlockMessages as $link ) {
317 $list .= Html
::rawElement( 'li', array(), $link ) . "\n";
320 $s .= Html
::rawElement(
322 array( 'class' => 'mw-blockip-alreadyblocked' ),
326 $form->addPreText( $s );
332 * Add header text inside the form, just underneath where the errors would go
333 * @param $form HTMLForm
336 protected function doHeaderText( HTMLForm
&$form ){
337 # Don't need to do anything if the form has been posted
338 if( !$this->getRequest()->wasPosted() && $this->preErrors
){
339 $s = HTMLForm
::formatErrors( $this->preErrors
);
341 $form->addHeaderText( Html
::rawElement(
343 array( 'class' => 'error' ),
351 * Add footer elements to the form
352 * @param $form HTMLForm
355 protected function doPostText( HTMLForm
&$form ){
356 # Link to the user's contributions, if applicable
357 if( $this->target
instanceof User
){
358 $contribsPage = SpecialPage
::getTitleFor( 'Contributions', $this->target
->getName() );
359 $links[] = Linker
::link(
361 wfMsgExt( 'ipb-blocklist-contribs', 'escape', $this->target
->getName() )
365 # Link to unblock the specified user, or to a blank unblock form
366 if( $this->target
instanceof User
) {
367 $message = wfMsgExt( 'ipb-unblock-addr', array( 'parseinline' ), $this->target
->getName() );
368 $list = SpecialPage
::getTitleFor( 'Unblock', $this->target
->getName() );
370 $message = wfMsgExt( 'ipb-unblock', array( 'parseinline' ) );
371 $list = SpecialPage
::getTitleFor( 'Unblock' );
373 $links[] = Linker
::linkKnown( $list, $message, array() );
375 # Link to the block list
376 $links[] = Linker
::linkKnown(
377 SpecialPage
::getTitleFor( 'BlockList' ),
378 wfMsg( 'ipb-blocklist' )
381 $user = $this->getUser();
383 # Link to edit the block dropdown reasons, if applicable
384 if ( $user->isAllowed( 'editinterface' ) ) {
385 $links[] = Linker
::link(
386 Title
::makeTitle( NS_MEDIAWIKI
, 'Ipbreason-dropdown' ),
387 wfMsgHtml( 'ipb-edit-dropdown' ),
389 array( 'action' => 'edit' )
393 $form->addPostText( Html
::rawElement(
395 array( 'class' => 'mw-ipb-conveniencelinks' ),
396 $this->getLang()->pipeList( $links )
399 if( $this->target
instanceof User
){
400 # Get relevant extracts from the block and suppression logs, if possible
401 $userpage = $this->target
->getUserPage();
404 LogEventsList
::showLogExtract(
411 'msgKey' => array( 'blocklog-showlog', $userpage->getText() ),
412 'showIfEmpty' => false
415 $form->addPostText( $out );
417 # Add suppression block entries if allowed
418 if( $user->isAllowed( 'suppressionlog' ) ) {
419 LogEventsList
::showLogExtract(
426 'conds' => array( 'log_action' => array( 'block', 'reblock', 'unblock' ) ),
427 'msgKey' => array( 'blocklog-showsuppresslog', $userpage->getText() ),
428 'showIfEmpty' => false
432 $form->addPostText( $out );
438 * Determine the target of the block, and the type of target
439 * TODO: should be in Block.php?
440 * @param $par String subpage parameter passed to setup, or data value from
442 * @param $request WebRequest optionally try and get data from a request too
443 * @return array( User|string|null, Block::TYPE_ constant|null )
445 public static function getTargetAndType( $par, WebRequest
$request = null ){
452 # The HTMLForm will check wpTarget first and only if it doesn't get
453 # a value use the default, which will be generated from the options
454 # below; so this has to have a higher precedence here than $par, or
455 # we could end up with different values in $this->target and the HTMLForm!
456 if( $request instanceof WebRequest
){
457 $target = $request->getText( 'wpTarget', null );
464 if( $request instanceof WebRequest
){
465 $target = $request->getText( 'ip', null );
470 if( $request instanceof WebRequest
){
471 $target = $request->getText( 'wpBlockAddress', null );
478 list( $target, $type ) = Block
::parseTarget( $target );
480 if( $type !== null ){
481 return array( $target, $type );
485 return array( null, null );
489 * HTMLForm field validation-callback for Target field.
491 * @param $value String
492 * @param $alldata Array
495 public static function validateTargetField( $value, $alldata = null ) {
496 global $wgBlockCIDRLimit;
498 list( $target, $type ) = self
::getTargetAndType( $value );
500 if( $type == Block
::TYPE_USER
){
501 # TODO: why do we not have a User->exists() method?
502 if( !$target->getId() ){
503 return wfMessage( 'nosuchusershort',
504 wfEscapeWikiText( $target->getName() ) );
507 $status = self
::checkUnblockSelf( $target );
508 if ( $status !== true ) {
509 return wfMessage( 'badaccess', $status );
512 } elseif( $type == Block
::TYPE_RANGE
){
513 list( $ip, $range ) = explode( '/', $target, 2 );
515 if( ( IP
::isIPv4( $ip ) && $wgBlockCIDRLimit['IPv4'] == 32 )
516 ||
( IP
::isIPv6( $ip ) && $wgBlockCIDRLimit['IPV6'] == 128 ) )
518 # Range block effectively disabled
519 return wfMessage( 'range_block_disabled' );
522 if( ( IP
::isIPv4( $ip ) && $range > 32 )
523 ||
( IP
::isIPv6( $ip ) && $range > 128 ) )
526 return wfMessage( 'ip_range_invalid' );
529 if( IP
::isIPv4( $ip ) && $range < $wgBlockCIDRLimit['IPv4'] ) {
530 return wfMessage( 'ip_range_toolarge', $wgBlockCIDRLimit['IPv4'] );
533 if( IP
::isIPv6( $ip ) && $range < $wgBlockCIDRLimit['IPv6'] ) {
534 return wfMessage( 'ip_range_toolarge', $wgBlockCIDRLimit['IPv6'] );
536 } elseif( $type == Block
::TYPE_IP
){
539 return wfMessage( 'badipaddress' );
546 * Given the form data, actually implement a block
548 * @return Bool|String
550 public static function processForm( array $data ){
551 global $wgUser, $wgBlockAllowsUTEdit;
553 // Handled by field validator callback
554 // self::validateTargetField( $data['Target'] );
556 # This might have been a hidden field or a checkbox, so interesting data
558 $data['Confirm'] = !in_array( $data['Confirm'], array( '', '0', null, false ), true );
560 list( $target, $type ) = self
::getTargetAndType( $data['Target'] );
561 if( $type == Block
::TYPE_USER
){
563 $target = $user->getName();
564 $userId = $user->getId();
566 # Give admins a heads-up before they go and block themselves. Much messier
567 # to do this for IPs, but it's pretty unlikely they'd ever get the 'block'
568 # permission anyway, although the code does allow for it
569 if( $target === $wgUser->getName() &&
570 ( $data['PreviousTarget'] !== $data['Target'] ||
!$data['Confirm'] ) )
572 return array( 'ipb-blockingself' );
574 } elseif( $type == Block
::TYPE_RANGE
){
576 } elseif( $type == Block
::TYPE_IP
){
577 $target = $target->getName();
580 # This should have been caught in the form field validation
581 return array( 'badipaddress' );
584 if( ( strlen( $data['Expiry'] ) == 0) ||
( strlen( $data['Expiry'] ) > 50 )
585 ||
!self
::parseExpiryInput( $data['Expiry'] ) )
587 return array( 'ipb_expiry_invalid' );
590 if( !isset( $data['DisableEmail'] ) ){
591 $data['DisableEmail'] = false;
594 # If the user has done the form 'properly', they won't even have been given the
595 # option to suppress-block unless they have the 'hideuser' permission
596 if( !isset( $data['HideUser'] ) ){
597 $data['HideUser'] = false;
600 if( $data['HideUser'] ) {
601 if( !$wgUser->isAllowed('hideuser') ){
602 # this codepath is unreachable except by a malicious user spoofing forms,
603 # or by race conditions (user has oversight and sysop, loads block form,
604 # and is de-oversighted before submission); so need to fail completely
605 # rather than just silently disable hiding
606 return array( 'badaccess-group0' );
609 # Recheck params here...
610 if( $type != Block
::TYPE_USER
) {
611 $data['HideUser'] = false; # IP users should not be hidden
612 } elseif( !in_array( $data['Expiry'], array( 'infinite', 'infinity', 'indefinite' ) ) ) {
614 return array( 'ipb_expiry_temp' );
615 } elseif( $user->getEditCount() > self
::HIDEUSER_CONTRIBLIMIT
) {
616 # Typically, the user should have a handful of edits.
617 # Disallow hiding users with many edits for performance.
618 return array( 'ipb_hide_invalid' );
619 } elseif( !$data['Confirm'] ){
620 return array( 'ipb-confirmhideuser' );
624 # Create block object.
625 $block = new Block();
626 $block->setTarget( $target );
627 $block->setBlocker( $wgUser );
628 $block->mReason
= $data['Reason'][0];
629 $block->mExpiry
= self
::parseExpiryInput( $data['Expiry'] );
630 $block->prevents( 'createaccount', $data['CreateAccount'] );
631 $block->prevents( 'editownusertalk', ( !$wgBlockAllowsUTEdit ||
$data['DisableUTEdit'] ) );
632 $block->prevents( 'sendemail', $data['DisableEmail'] );
633 $block->isHardblock( $data['HardBlock'] );
634 $block->isAutoblocking( $data['AutoBlock'] );
635 $block->mHideName
= $data['HideUser'];
637 if( !wfRunHooks( 'BlockIp', array( &$block, &$wgUser ) ) ) {
638 return array( 'hookaborted' );
641 # Try to insert block. Is there a conflicting block?
642 $status = $block->insert();
644 # Show form unless the user is already aware of this...
645 if( !$data['Confirm'] ||
( array_key_exists( 'PreviousTarget', $data )
646 && $data['PreviousTarget'] !== $block->getTarget() ) )
648 return array( array( 'ipb_already_blocked', $block->getTarget() ) );
649 # Otherwise, try to update the block...
651 # This returns direct blocks before autoblocks/rangeblocks, since we should
652 # be sure the user is blocked by now it should work for our purposes
653 $currentBlock = Block
::newFromTarget( $target );
655 if( $block->equals( $currentBlock ) ) {
656 return array( array( 'ipb_already_blocked', $block->getTarget() ) );
659 # If the name was hidden and the blocking user cannot hide
660 # names, then don't allow any block changes...
661 if( $currentBlock->mHideName
&& !$wgUser->isAllowed( 'hideuser' ) ) {
662 return array( 'cant-see-hidden-user' );
665 $currentBlock->delete();
666 $status = $block->insert();
667 $logaction = 'reblock';
669 # Unset _deleted fields if requested
670 if( $currentBlock->mHideName
&& !$data['HideUser'] ) {
671 RevisionDeleteUser
::unsuppressUserName( $target, $userId );
674 # If hiding/unhiding a name, this should go in the private logs
675 if( (bool)$currentBlock->mHideName
){
676 $data['HideUser'] = true;
680 $logaction = 'block';
683 wfRunHooks( 'BlockIpComplete', array( $block, $wgUser ) );
685 # Set *_deleted fields if requested
686 if( $data['HideUser'] ) {
687 RevisionDeleteUser
::suppressUserName( $target, $userId );
690 # Can't watch a rangeblock
691 if( $type != Block
::TYPE_RANGE
&& $data['Watch'] ) {
692 $wgUser->addWatch( Title
::makeTitle( NS_USER
, $target ) );
695 # Block constructor sanitizes certain block options on insert
696 $data['BlockEmail'] = $block->prevents( 'sendemail' );
697 $data['AutoBlock'] = $block->isAutoblocking();
699 # Prepare log parameters
700 $logParams = array();
701 $logParams[] = $data['Expiry'];
702 $logParams[] = self
::blockLogFlags( $data, $type );
704 # Make log entry, if the name is hidden, put it in the oversight log
705 $log_type = $data['HideUser'] ?
'suppress' : 'block';
706 $log = new LogPage( $log_type );
707 $log_id = $log->addEntry(
709 Title
::makeTitle( NS_USER
, $target ),
713 # Relate log ID to block IDs (bug 25763)
714 $blockIds = array_merge( array( $status['id'] ), $status['autoIds'] );
715 $log->addRelations( 'ipb_id', $blockIds, $log_id );
722 * Get an array of suggested block durations from MediaWiki:Ipboptions
723 * @todo FIXME: This uses a rather odd syntax for the options, should it be converted
724 * to the standard "**<duration>|<displayname>" format?
725 * @param $lang Language|null the language to get the durations in, or null to use
726 * the wiki's content language
729 public static function getSuggestedDurations( $lang = null ){
731 $msg = $lang === null
732 ?
wfMessage( 'ipboptions' )->inContentLanguage()->text()
733 : wfMessage( 'ipboptions' )->inLanguage( $lang )->text();
739 foreach( explode( ',', $msg ) as $option ) {
740 if( strpos( $option, ':' ) === false ){
741 $option = "$option:$option";
744 list( $show, $value ) = explode( ':', $option );
745 $a[htmlspecialchars( $show )] = htmlspecialchars( $value );
752 * Convert a submitted expiry time, which may be relative ("2 weeks", etc) or absolute
753 * ("24 May 2034", etc), into an absolute timestamp we can put into the database.
754 * @param $expiry String: whatever was typed into the form
755 * @return String: timestamp or "infinity" string for the DB implementation
757 public static function parseExpiryInput( $expiry ) {
759 if( $infinity == null ){
760 $infinity = wfGetDB( DB_SLAVE
)->getInfinity();
763 if ( $expiry == 'infinite' ||
$expiry == 'indefinite' ) {
766 $expiry = strtotime( $expiry );
768 if ( $expiry < 0 ||
$expiry === false ) {
772 $expiry = wfTimestamp( TS_MW
, $expiry );
779 * Can we do an email block?
780 * @param $user User: the sysop wanting to make a block
783 public static function canBlockEmail( $user ) {
784 global $wgEnableUserEmail, $wgSysopEmailBans;
786 return ( $wgEnableUserEmail && $wgSysopEmailBans && $user->isAllowed( 'blockemail' ) );
790 * bug 15810: blocked admins should not be able to block/unblock
791 * others, and probably shouldn't be able to unblock themselves
793 * @param $user User|Int|String
794 * @return Bool|String true or error message key
796 public static function checkUnblockSelf( $user ) {
799 if ( is_int( $user ) ) {
800 $user = User
::newFromId( $user );
801 } elseif ( is_string( $user ) ) {
802 $user = User
::newFromName( $user );
805 if( $wgUser->isBlocked() ){
806 if( $user instanceof User
&& $user->getId() == $wgUser->getId() ) {
807 # User is trying to unblock themselves
808 if ( $wgUser->isAllowed( 'unblockself' ) ) {
810 # User blocked themselves and is now trying to reverse it
811 } elseif ( $wgUser->blockedBy() === $wgUser->getName() ) {
814 return 'ipbnounblockself';
817 # User is trying to block/unblock someone else
826 * Return a comma-delimited list of "flags" to be passed to the log
827 * reader for this block, to provide more information in the logs
828 * @param $data Array from HTMLForm data
829 * @param $type Block::TYPE_ constant
832 protected static function blockLogFlags( array $data, $type ) {
833 global $wgBlockAllowsUTEdit;
836 # when blocking a user the option 'anononly' is not available/has no effect -> do not write this into log
837 if( !$data['HardBlock'] && $type != Block
::TYPE_USER
){
838 // For grepping: message block-log-flags-anononly
839 $flags[] = 'anononly';
842 if( $data['CreateAccount'] ){
843 // For grepping: message block-log-flags-nocreate
844 $flags[] = 'nocreate';
847 # Same as anononly, this is not displayed when blocking an IP address
848 if( !$data['AutoBlock'] && $type != Block
::TYPE_IP
){
849 // For grepping: message block-log-flags-noautoblock
850 $flags[] = 'noautoblock';
853 if( $data['DisableEmail'] ){
854 // For grepping: message block-log-flags-noemail
855 $flags[] = 'noemail';
858 if( $wgBlockAllowsUTEdit && $data['DisableUTEdit'] ){
859 // For grepping: message block-log-flags-nousertalk
860 $flags[] = 'nousertalk';
863 if( $data['HideUser'] ){
864 // For grepping: message block-log-flags-hiddenname
865 $flags[] = 'hiddenname';
868 return implode( ',', $flags );
873 class IPBlockForm
extends SpecialBlock
{}