Jump to content

Extension:PasswordProtectPages: Difference between revisions

From mediawiki.org
Content deleted Content added
PSt (talk | contribs)
PSt (talk | contribs)
Line 50: Line 50:
require_once("$IP/extensions/PasswordProtectPages/PPP.php");
require_once("$IP/extensions/PasswordProtectPages/PPP.php");
</source>
</source>

You also have to create new table to store passwords: execute this code to your database (add in front of protect_pages your prefix):
<pre>
CREATE TABLE `protect_pages` (
`pageid` int(3) NOT NULL,
`password` blob NOT NULL
)
</pre>


== Problems ==
== Problems ==

Revision as of 12:43, 10 February 2009

MediaWiki extensions manual
PasswordProtectPages
Release status: experimental
Implementation User rights , Page action
Description This allows page protection using password
Author(s) Piotr Stawinski (PSttalk)
Latest version 0.01 (2009-02-10)
MediaWiki 1.13
$wgProtectedPagesNamespaces
Licence No licence specified
Download download

What can this extension do?

This is a pretty simple implementation of per page protection. It allows to protect each page with separate password from reading and editing. It uses userCan hook with all advantages and disadvantages.


Usage

This is very experimental version! Do not use it to protect critical data.

On my wiki I've created special namespace:

define("NS_PROTECT", 100);
define("NS_PROTECT_TALK", 101);
$wgExtraNamespaces[NS_PROTECT] = "Protect";
$wgExtraNamespaces[NS_PROTECT_TALK] = "Protect_talk";
$wgProtectedPagesNamespaces = array(NS_PROTECT, NS_PROTECT_TALK);

that is protected. However, You can protect whichever namespace You like. Protected articles displays new personalUrl "protect". After creating page You should click protect (in personal url), then You'd be redirected to set up the page password. After doing this anyone wanting to see/edit this page have to unlock it using password.

Sysops can see every page as it was not protected. Protected pages are visible only for logged users.

Installation

To install this extension, download all files to extensions/PasswordProtectPages and add the following to LocalSettings.php:

$wgProtectedPagesNamespaces = array(NS_PROTECT, NS_PROTECT_TALK);
require_once("$IP/extensions/PasswordProtectPages/PPP.php");

You also have to create new table to store passwords: execute this code to your database (add in front of protect_pages your prefix):

CREATE TABLE `protect_pages` (
  `pageid` int(3) NOT NULL,
  `password` blob NOT NULL
)

Problems

This is per page protection with all it's consequencies. I would recommend setting: $wgFeed = false; for better protection.

Protected pages are still searchable! But their source is hopefully not displayed, so this lack of security is not critical.

I'm gonna test this extension intensively next days.

See also

Extension:PasswordProtected - I tried to use this extension but it was not satisfying so I've created this one