Extension:Login At Edit

From MediaWiki.org

Jump to: navigation, search
Manual on MediaWiki Extensions
List of MediaWiki Extensions
Login At Edit

Release status: unknown

Implementation User identity, Page action
Description Integrates Edit and Login forms.
Version 0.1 (2006-05-10)
MediaWiki 1.6
Download Extension:Login At Edit/LoginAtEdit.php

This extension is a COMPLETE AND UTTER HACK that integrates the Login and Edit forms. Instead of asking for a login before you can edit, it will show an Edit form with fields for Username and Password below the text field. I find it to be much more user-friendly than a separate login sequence that doesn't even redirect you to the page you were trying to edit.

Anyway, this extension has SEVERE limitations:

  • Incompatible with AuthPlugins that use domains;
  • Incompatible with wikis that allow anonymous editing;
  • Does not allow you to "Remember me"
  • It may or not break the edit process when two people edit the same document at the same time. It is UNTESTED in this respect. I don't know. Don't hate me.

I am giving you all of this warning because the extension sends the user name and password in fields that MediaWiki reads in but doesn't actually use (as far as I can tell): "editintro" and "wpTextbox2". Actually, it uses the second one, but only after you have already attempted to save, in which case you will have been logged in when you actually need that one. ANYWAY, without further caution:

1. Save Extension:Login At Edit/LoginAtEdit.php into extensions/LoginAtEdit.php

2. Make sure your "anonymous editor" permissions are something like this in LocalSettings.php:

$wgGroupPermissions['*'    ]['edit']            = true;
$wgGroupPermissions['*'    ]['createaccount']   = false;
$wgGroupPermissions['*'    ]['createpage']      = true;
$wgGroupPermissions['*'    ]['createtalk']      = true;
$wgGroupPermissions['*'    ]['minoredit']      = true;

We enable all this stuff so that anonymous editors will actually see the Edit form, but the extension won't let anyone save the page until their login credentials have checked out. Make sense? Then,

3. Add this near the end of LocalSettings.php:

require_once( "extensions/LoginAtEdit.php" );

That's it. Now you'll see an Edit form without logging in, but you'll have to supply valid credentials to actually save the page. It'll give you appropriate errors if authentication fails (empty user name, invalid password, etc.).

Personal tools