Manuel:Protect.php
Appearance
Fichier MediaWiki : protect.php | |
---|---|
Emplacement : | maintenance/ |
Code source : | master • 1.42.3 • 1.41.4 • 1.39.10 |
Classes : | Protect |
Détails
Le fichier protect.php est un script de maintenance qui gère la (non)protection des pages.
Options et arguments
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 | Obligatoire | Valeur par défaut | |
---|---|---|---|
--unprotect | Removes protection | optionnel | |
--semiprotect | Adds semi-protection | optionnel | |
--cascade | Add cascading protection | optionnel | |
--user | Username to protect with | optionnel | |
--reason | Reason for un/protection | optionnel |
Utilisation
php maintenance/protect.php title [ --unprotect| --semiprotect| --cascade| --user| --reason ]
Allowing only autoconfirmed users to edit the page
Terminal
$ php maintenance/protect.php "Lorem" --semiprotect --reason "Allowing only autoconfirmed users to edit" Updating protection status... done
Allowing only sysop users to edit the page
Terminal
$ php maintenance/protect.php "Lorem" --cascade --reason "Allowing only sysop users to edit" Updating protection status... done
Removing protection from a page
Terminal
$ php maintenance/protect.php "Lorem" --unprotect --reason "Removing protection" Updating protection status... done
Protecting a page as username "Foo"
If you don't pass the --user option to the script, it will perform the action with user User:Maintenance script.
Terminal
$ php maintenance/protect.php "Lorem" --cascade --user "Foo" --reason "Allowing only sysop users to edit" Updating protection status... done