GithubHelp home page GithubHelp logo

xhlgr / sourceprotection Goto Github PK

View Code? Open in Web Editor NEW

This project forked from wikibasesolutions/sourceprotection

0.0 0.0 0.0 25 KB

MediaWiki sourcepage protection

Home Page: https://www.mediawiki.org/wiki/Extension:SourceProtection

License: GNU General Public License v2.0

PHP 100.00%

sourceprotection's Introduction

This MediaWiki extension removes the ability to view the source code of a page if a user does not have edit rights. Documentation can also be found here: https://www.mediawiki.org/wiki/Extension:SourceProtection

SourceProtection

This Fixed deprecated methods for mediawiki 1.39.0

1.1.0 Removes View Source tab and (if pageForms is installed the edit-Form tab) & History tab from menu and disables action=edit function for users with no edit permissions. It will also block the viewing of the readonly form.

1.1.1 Added more actions for user without edit permissions to protect the source of a page more thoroughly.

1.1.2 Checked compatibility with 1.35+. No major changes, just typos or comments added

Compatibility

  • PHP 5.4+
  • MediaWiki 1.24+

Installation

(1) Extract the files in a directory called SourceProtection in your extensions/ folder.

(2a) MW1.22 or lower : Add the following code at the bottom of your "LocalSettings.php" file:

require_once "$IP/extensions/sourceProtection/SourceProtection.php";

(2b) MW1.22 + : Add the following code at the bottom of your "LocalSettings.php" file:

wfLoadExtension( 'SourceProtection' );

(3) Go to "Special:Version" on your wiki to verify that the extension is successfully installed.

(4) Done.

Configuration

There is no need for additional configuration, besides giving users an edit permission of false in the localsettings.

Note

It makes no sense to install this extension to hide the sourcecode of a page if you do not take various other actions as well. e.g. If you open the API with default edit rights, source content can still be read. Likewise for anonymous users. If they receive edit rights, the sourcecode of page can be viewed, edited, etc..

sourceprotection's People

Contributors

sen-sai avatar xhlgr avatar wsviktors avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.