Page MenuHomePhabricator

noipblock-2.diff

Authored By
bzimport
Nov 21 2014, 8:52 PM
Size
2 KB
Referenced Files
None
Subscribers
None

noipblock-2.diff

DefaultSettings.php | 2 ++
Defines.php | 2 +-
User.php | 10 ++++++++--
3 files changed, 11 insertions(+), 3 deletions(-)
diff -Naur phase3.orig/includes/DefaultSettings.php phase3/includes/DefaultSettings.php
--- phase3.orig/includes/DefaultSettings.php 2005-10-13 22:59:57.000000000 -0300
+++ phase3/includes/DefaultSettings.php 2005-10-14 09:24:04.282477778 -0300
@@ -758,6 +758,8 @@
$wgGroupPermissions['bureaucrat']['userrights'] = true;
+$wgGroupPermissions['noipblock']['noipblock'] = true;
+
/**
* The developer group is deprecated, but can be activated if need be
* to use the 'lockdb' and 'unlockdb' special pages. Those require
diff -Naur phase3.orig/includes/Defines.php phase3/includes/Defines.php
--- phase3.orig/includes/Defines.php 2005-09-27 16:48:54.000000000 -0300
+++ phase3/includes/Defines.php 2005-10-14 09:24:04.297474098 -0300
@@ -78,7 +78,7 @@
$wgAvailableRights = array('read', 'edit', 'move', 'delete', 'undelete',
'protect', 'block', 'userrights', 'createaccount', 'upload',
'rollback', 'patrol', 'editinterface', 'siteadmin', 'bot', 'validate',
-'import', 'importupload' );
+'import', 'importupload', 'noipblock' );
/**#@+
* Cache type
diff -Naur phase3.orig/includes/User.php phase3/includes/User.php
--- phase3.orig/includes/User.php 2005-10-13 23:00:03.000000000 -0300
+++ phase3/includes/User.php 2005-10-14 09:26:54.668677128 -0300
@@ -380,6 +380,12 @@
$this->mBlockedby = 0;
$ip = wfGetIP();
+ # IP block exemption
+ $noipblock = $this->isAllowed( 'noipblock' );
+ if ($noipblock) {
+ $ip = '';
+ }
+
# User/IP blocking
$block = new Block();
$block->forUpdate( $bFromSlave );
@@ -395,7 +401,7 @@
}
# Range blocking
- if ( !$this->mBlockedby ) {
+ if ( !$noipblock && !$this->mBlockedby ) {
# Check first against slave, and optionally from master.
wfDebug( "$fname: Checking range blocks\n" );
$block = $wgBlockCache->get( $ip, true );
@@ -412,7 +418,7 @@
}
# Proxy blocking
- if ( !$this->isSysop() && !in_array( $ip, $wgProxyWhitelist ) ) {
+ if ( !$noipblock && !$this->isSysop() && !in_array( $ip, $wgProxyWhitelist ) ) {
# Local list
if ( array_key_exists( $ip, $wgProxyList ) ) {

File Metadata

Mime Type
text/x-diff
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1968
Default Alt Text
noipblock-2.diff (2 KB)

Event Timeline