User:Lysander/UploadPermissionsError: Difference between revisions
From BoyWiki
No edit summary |
m Etenne moved page User:Leucosticte/UploadPermissionsError to User:Lysander/UploadPermissionsError: Automatically moved page while renaming the user "Leucosticte" to "Lysander" |
(No difference)
|
Revision as of 19:53, 7 March 2015
UploadPermissionsError is a MediaWiki extension that implements a new error message when unauthorized users attempt to upload files via Special:Upload: "You do not have permission to upload this file, for the following reason: The action you have requested is limited to users in one of the groups: Users, Administrators. To request a file be added to the wiki, please add a new entry at Project:Requests for file uploads."
Installation
- Download and place the file(s) in a directory called
UploadPermissionsError
in yourextensions/
folder. - Add the following code at the bottom of your LocalSettings.php:
require_once "$IP/extensions/UploadPermissionsError/UploadPermissionsError.php";
- Hack
specials/SpecialUpload.php
by changing:
if ( $permissionRequired !== true ) { throw new PermissionsError( $permissionRequired ); }
to:
if ( $permissionRequired !== true ) { Hooks::run( 'UploadForm:permissionRequired', array( &$permissionRequired ) ); throw new PermissionsError( $permissionRequired ); }
- Done! Navigate to "Special:Version" on your wiki to verify that the extension is successfully installed.