Page Menu
Home
Miraheze
Search
Configure Global Search
Log In
Paste
P195
(An Untitled Masterwork)
Active
Public
Actions
Authored by
Paladox
on Apr 27 2019, 22:12.
Edit Paste
Archive Paste
View Raw File
Subscribe
Mute Notifications
Flag For Later
Award Token
Tags
None
Referenced Files
F941078: raw.txt
Apr 27 2019, 22:12
2019-04-27 22:12:31 (UTC+0)
Subscribers
None
<?php
$IP
=
getenv
(
'MW_INSTALL_PATH'
);
if
(
$IP
===
false
)
{
$IP
=
__DIR__
.
'/../../..'
;
}
require_once
"$IP/maintenance/Maintenance.php"
;
class
ManageWikiQuickHackScript
extends
Maintenance
{
public
function
__construct
()
{
parent
::
__construct
();
}
function
execute
()
{
global
$wgCreateWikiDatabase
,
$wgDBname
,
$wmgPrivateWiki
;
if
(
ManageWiki
::
checkSetup
(
'permissions'
)
&&
$wmgPrivateWiki
)
{
$dbw
=
wfGetDB
(
DB_MASTER
,
[],
$wgCreateWikiDatabase
);
$publicGroups
=
[
'*'
,
'user'
];
foreach
(
$publicGroups
as
$group
)
{
$meta
=
ManageWikiPermissions
::
groupPermissions
(
$group
);
$perms
=
$meta
[
'permissions'
];
$newperms
=
array_diff
(
$perms
,
[
'read'
]
);
$dbw
->
update
(
'mw_permissions'
,
[
'perm_permissions'
=>
json_encode
(
$newperms
)
],
[
'perm_dbname'
=>
$dbname
,
'perm_group'
=>
$group
],
__METHOD__
);
}
$this
->
output
(
'removed read from wiki '
$wgDBname
);
ManageWikiCDB
::
changes
(
'permissions'
);
}
}
}
$maintClass
=
'ManageWikiQuickHackScript'
;
require_once
RUN_MAINTENANCE_IF_MAIN
;
Event Timeline
Paladox
created this paste.
Apr 27 2019, 22:12
2019-04-27 22:12:31 (UTC+0)
Log In to Comment