summaryrefslogtreecommitdiff
path: root/includes/specials/SpecialIpblocklist.php
diff options
context:
space:
mode:
authorPierre Schmitz <pierre@archlinux.de>2009-06-10 13:00:47 +0200
committerPierre Schmitz <pierre@archlinux.de>2009-06-10 13:00:47 +0200
commit72e90545454c0e014318fa3c81658e035aac58c1 (patch)
tree9212e3f46868989c4d57ae9a5c8a1a80e4dc0702 /includes/specials/SpecialIpblocklist.php
parent565a0ccc371ec1a2a0e9b39487cbac18e6f60e25 (diff)
applying patch to version 1.15.0
Diffstat (limited to 'includes/specials/SpecialIpblocklist.php')
-rw-r--r--includes/specials/SpecialIpblocklist.php27
1 files changed, 19 insertions, 8 deletions
diff --git a/includes/specials/SpecialIpblocklist.php b/includes/specials/SpecialIpblocklist.php
index 8d573547..4ba1c811 100644
--- a/includes/specials/SpecialIpblocklist.php
+++ b/includes/specials/SpecialIpblocklist.php
@@ -162,7 +162,7 @@ class IPUnblockForm {
* @return array array(message key, parameters) on failure, empty array on success
*/
- static function doUnblock(&$id, &$ip, &$reason, &$range = null) {
+ static function doUnblock(&$id, &$ip, &$reason, &$range = null, $blocker=null) {
if ( $id ) {
$block = Block::newFromID( $id );
if ( !$block ) {
@@ -195,11 +195,22 @@ class IPUnblockForm {
}
// Yes, this is really necessary
$id = $block->mId;
+
+ # If the name was hidden and the blocking user cannot hide
+ # names, then don't allow any block removals...
+ if( $blocker && $block->mHideName && !$blocker->isAllowed('hideuser') ) {
+ return array('ipb_cant_unblock', htmlspecialchars($id));
+ }
# Delete block
if ( !$block->delete() ) {
return array('ipb_cant_unblock', htmlspecialchars($id));
}
+
+ # Unset _deleted fields as needed
+ if( $block->mHideName ) {
+ IPBlockForm::unsuppressUserName( $block->mAddress, $block->mUser );
+ }
# Make log entry
$log = new LogPage( 'block' );
@@ -208,8 +219,8 @@ class IPUnblockForm {
}
function doSubmit() {
- global $wgOut;
- $retval = self::doUnblock($this->id, $this->ip, $this->reason, $range);
+ global $wgOut, $wgUser;
+ $retval = self::doUnblock($this->id, $this->ip, $this->reason, $range, $wgUser);
if(!empty($retval))
{
$key = array_shift($retval);
@@ -238,7 +249,7 @@ class IPUnblockForm {
$conds = array();
$matches = array();
// Is user allowed to see all the blocks?
- if ( !$wgUser->isAllowed( 'suppress' ) )
+ if ( !$wgUser->isAllowed( 'hideuser' ) )
$conds['ipb_deleted'] = 0;
if ( $this->ip == '' ) {
// No extra conditions
@@ -306,7 +317,7 @@ class IPUnblockForm {
}
function searchForm() {
- global $wgTitle, $wgScript, $wgRequest;
+ global $wgTitle, $wgScript, $wgRequest, $wgLang;
$showhide = array( wfMsg( 'show' ), wfMsg( 'hide' ) );
$nondefaults = array();
@@ -330,7 +341,7 @@ class IPUnblockForm {
$links[] = wfMsgHtml( 'ipblocklist-sh-userblocks', $ubLink );
$links[] = wfMsgHtml( 'ipblocklist-sh-tempblocks', $tbLink );
$links[] = wfMsgHtml( 'ipblocklist-sh-addressblocks', $sipbLink );
- $hl = implode( ' ' . wfMsg( 'pipe-separator' ) . ' ', $links );
+ $hl = $wgLang->pipeList( $links );
return
Xml::tags( 'form', array( 'action' => $wgScript ),
@@ -418,7 +429,7 @@ class IPUnblockForm {
$properties[] = $msg['blocklist-nousertalk'];
}
- $properties = implode( ', ', $properties );
+ $properties = $wgLang->commaList( $properties );
$line = wfMsgReplaceArgs( $msg['blocklistline'], array( $formattedTime, $blocker, $target, $properties ) );
@@ -434,7 +445,7 @@ class IPUnblockForm {
# Create changeblocklink for all blocks with exception of autoblocks
if( !$block->mAuto ) {
- $changeblocklink = ' ' . wfMsg( 'pipe-separator' ) . ' ' .
+ $changeblocklink = wfMsg( 'pipe-separator' ) .
$sk->link( SpecialPage::getTitleFor( 'Blockip', $block->mAddress ),
$msg['change-blocklink'],
array(), array(), 'known' );