Jump to content

Manual:protect.php

From mediawiki.org

Details

[edit]

protect.php file is a maintenance script that handles protecting and unprotecting a page.

Options/Arguments

[edit]

This script takes the title of the page as the first argument.

Tip: Spaces inside a title must be replaced with underscores ( _ ), or use double quotation marks like "Foo Bar"


This script accepts these options:

Option Required Default value
--unprotect Removes protection Optional
--semiprotect Adds semi-protection Optional
--cascade Add cascading protection Optional
--user Username to protect with Optional
--reason Reason for un/protection Optional

Usage

[edit]
php maintenance/protect.php title [ --unprotect| --semiprotect| --cascade| --user| --reason ]

Allowing only autoconfirmed users to edit the page

[edit]
Terminal

Allowing only sysop users to edit the page

[edit]
Terminal


Removing protection from a page

[edit]
Terminal

Protecting a page as username "Foo"

[edit]

If you don't pass the --user option to the script, it will perform the action with user User:Maintenance script.

Terminal

See also

[edit]