Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F32197596
unblock.php
Urbanecm
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Authored By
Urbanecm
Aug 27 2020, 11:48 AM
2020-08-27 11:48:11 (UTC+0)
Size
958 B
Referenced Files
None
Subscribers
None
unblock.php
View Options
<?php
require_once
'/srv/mediawiki/php-1.36.0-wmf.6/maintenance'
.
'/Maintenance.php'
;
use
MediaWiki\Block\DatabaseBlock
;
class
Unblockusers
extends
Maintenance
{
public
function
execute
()
{
$performer
=
User
::
newSystemUser
(
'Maintenance script'
,
[
'steal'
=>
true
]
);
$targets
=
explode
(
"
\n
"
,
file_get_contents
(
'/home/urbanecm/targets.txt'
));
foreach
(
$targets
as
$target
)
{
$block
=
DatabaseBlock
::
newFromTarget
(
$target
);
if
(
$block
===
null
)
{
continue
;
}
$block
->
delete
();
$logEntry
=
new
ManualLogEntry
(
'block'
,
'unblock'
);
$logEntry
->
setPerformer
(
$performer
);
$logEntry
->
setComment
(
'Removing blocks exceeding $wgBlockCIDRLimit (T243980)'
);
$logEntry
->
setTarget
(
TitleValue
::
tryNew
(
NS_USER
,
$target
));
$logEntry
->
setRelations
([
'ipb_id'
=>
$block
->
getId
()]);
$logId
=
$logEntry
->
insert
();
$logEntry
->
publish
(
$logId
);
}
}
}
$maintClass
=
Unblockusers
::
class
;
require_once
RUN_MAINTENANCE_IF_MAIN
;
File Metadata
Details
Attached
Mime Type
text/x-php
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
8513824
Default Alt Text
unblock.php (958 B)
Attached To
Mode
T243980: Find rangeblocks exceeding $wgBlockCIDRLimit to review/lift them
Attached
Detach File
Event Timeline
Log In to Comment