User:Lysander/UploadPermissionsError: Difference between revisions

From BoyWiki
No edit summary
No edit summary
Line 1: Line 1:
==Installation==
==Installation==
[https://github.com/lInclumedia/UploadPermissionsError/archive/master.zip Download] and place the file(s) in a directory called <code>UploadPermissionsError</code> in your <code>extensions/</code> folder.
*[https://github.com/lInclumedia/UploadPermissionsError/archive/master.zip Download] and place the file(s) in a directory called <code>UploadPermissionsError</code> in your <code>extensions/</code> folder.
Add the following code at the bottom of your LocalSettings.php:
*Add the following code at the bottom of your LocalSettings.php:
<pre>require_once "$IP/extensions/UploadPermissionsError/UploadPermissionsError.php";</pre>
<pre>require_once "$IP/extensions/UploadPermissionsError/UploadPermissionsError.php";</pre>
Hack <code>specials/SpecialUpload.php</code> by changing:
*Hack <code>specials/SpecialUpload.php</code> by changing:
<pre> if ( $permissionRequired !== true ) {
<pre> if ( $permissionRequired !== true ) {
throw new PermissionsError( $permissionRequired );
throw new PermissionsError( $permissionRequired );
Line 13: Line 13:
throw new PermissionsError( $permissionRequired );
throw new PermissionsError( $permissionRequired );
}</pre>
}</pre>
Done! Navigate to "Special:Version" on your wiki to verify that the extension is successfully installed.
*Done! Navigate to "Special:Version" on your wiki to verify that the extension is successfully installed.

Revision as of 19:53, 3 March 2015

Installation

  • Download and place the file(s) in a directory called UploadPermissionsError in your extensions/ 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.