summaryrefslogtreecommitdiff
path: root/includes/specials/SpecialUnblock.php
diff options
context:
space:
mode:
Diffstat (limited to 'includes/specials/SpecialUnblock.php')
-rw-r--r--includes/specials/SpecialUnblock.php29
1 files changed, 17 insertions, 12 deletions
diff --git a/includes/specials/SpecialUnblock.php b/includes/specials/SpecialUnblock.php
index fb2005b5..c4a53cf0 100644
--- a/includes/specials/SpecialUnblock.php
+++ b/includes/specials/SpecialUnblock.php
@@ -32,11 +32,11 @@ class SpecialUnblock extends SpecialPage {
protected $type;
protected $block;
- public function __construct(){
+ public function __construct() {
parent::__construct( 'Unblock', 'block' );
}
- public function execute( $par ){
+ public function execute( $par ) {
$this->checkPermissions();
$this->checkReadOnly();
@@ -56,8 +56,8 @@ class SpecialUnblock extends SpecialPage {
$form->setSubmitTextMsg( 'ipusubmit' );
$form->addPreText( $this->msg( 'unblockiptext' )->parseAsBlock() );
- if( $form->show() ){
- switch( $this->type ){
+ if( $form->show() ) {
+ switch( $this->type ) {
case Block::TYPE_USER:
case Block::TYPE_IP:
$out->addWikiMsg( 'unblocked', wfEscapeWikiText( $this->target ) );
@@ -73,7 +73,7 @@ class SpecialUnblock extends SpecialPage {
}
}
- protected function getFields(){
+ protected function getFields() {
$fields = array(
'Target' => array(
'type' => 'text',
@@ -92,21 +92,21 @@ class SpecialUnblock extends SpecialPage {
)
);
- if( $this->block instanceof Block ){
+ if( $this->block instanceof Block ) {
list( $target, $type ) = $this->block->getTargetAndType();
# Autoblocks are logged as "autoblock #123 because the IP was recently used by
# User:Foo, and we've just got any block, auto or not, that applies to a target
# the user has specified. Someone could be fishing to connect IPs to autoblocks,
# so don't show any distinction between unblocked IPs and autoblocked IPs
- if( $type == Block::TYPE_AUTO && $this->type == Block::TYPE_IP ){
+ if( $type == Block::TYPE_AUTO && $this->type == Block::TYPE_IP ) {
$fields['Target']['default'] = $this->target;
unset( $fields['Name'] );
} else {
$fields['Target']['default'] = $target;
$fields['Target']['type'] = 'hidden';
- switch( $type ){
+ switch( $type ) {
case Block::TYPE_USER:
case Block::TYPE_IP:
$fields['Name']['default'] = Linker::link(
@@ -149,14 +149,15 @@ class SpecialUnblock extends SpecialPage {
*
* @param $data Array
* @param $context IContextSource
+ * @throws ErrorPageError
* @return Array( Array(message key, parameters) ) on failure, True on success
*/
- public static function processUnblock( array $data, IContextSource $context ){
+ public static function processUnblock( array $data, IContextSource $context ) {
$performer = $context->getUser();
$target = $data['Target'];
$block = Block::newFromTarget( $data['Target'] );
- if( !$block instanceof Block ){
+ if( !$block instanceof Block ) {
return array( array( 'ipb_cant_unblock', $target ) );
}
@@ -172,8 +173,8 @@ class SpecialUnblock extends SpecialPage {
# unblock the whole range.
list( $target, $type ) = SpecialBlock::getTargetAndType( $target );
if( $block->getType() == Block::TYPE_RANGE && $type == Block::TYPE_IP ) {
- $range = $block->getTarget();
- return array( array( 'ipb_blocked_as_range', $target, $range ) );
+ $range = $block->getTarget();
+ return array( array( 'ipb_blocked_as_range', $target, $range ) );
}
# If the name was hidden and the blocking user cannot hide
@@ -212,4 +213,8 @@ class SpecialUnblock extends SpecialPage {
return true;
}
+
+ protected function getGroupName() {
+ return 'users';
+ }
}