Extension:LegalLogin

This extension is professionally maintained by the WikiTeq team.
WikiTeq provides official support for MediaWiki LTS releases only. It may work with other MediaWiki releases.
Category:Extensions by WikiTeq Category:GPL licensed extensions
MediaWiki extensions manual
LegalLogin
Release status: stableCategory:Stable extensions
Implementation User activity Category:User activity extensions
Description The LegalLogin extension requires acceptance of legal policies and correct answer on test questions during account creation and login.
Author(s) Pavel Astakhov (Pastakhovtalk)
Maintainer(s) WikiTeq team
Latest version 1.0 (Jan 2023)
Compatibility policy For every MediaWiki release that is a Long Term Support release there is a corresponding branch in the extension.Category:Extensions with long-term support release branches compatibility policy
MediaWiki 1.35, 1.39Category:Extensions with manual MediaWiki version
PHP 7.4.3+
Database changes Yes
Tables legallogin_accepted
legallogin_logged
License GNU General Public License 2.0 or later
Download Category:Extensions in Wikimedia version control
README
$wgLegalLoginPolicies, $wgLegalLoginQuestions, $wgLegalLoginExpiration, $wgLegalLoginInterval, $wgLegalLoginLogActions
Quarterly downloads 0
Translate the LegalLogin extension if it is available at translatewiki.net
Issues Open tasks · Report a bug
Category:All extensions

The LegalLogin extension requires acceptance of legal policies and correct answer on test questions during account creation and login.

This extension was created for WikiWorks.

Installation

  • Download and move the extracted LegalLogin folder to your extensions/ directory.
    Developers and code contributors should install the extension from Git instead, using:
    cd extensions/
    git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/LegalLogin
    
  • Add the following code at the bottom of your LocalSettings.php file:
    wfLoadExtension( 'LegalLogin' );
    
  • Yes Done – Navigate to Special:Version on your wiki to verify that the extension is successfully installed.

Configuration parameters

$wgLegalLoginPolicies
The list of legal policies that will require acceptance during account creation and login. Only pages in NS_MEDIAWIKI namespaces allowed as correct values.
$wgLegalLoginQuestions
The questions that users will need to answer correctly before login. Only pages in NS_MEDIAWIKI namespaces allowed as correct values.
$wgLegalLoginExpiration
Require acceptance of legal policies again after defined seconds.
$wgLegalLoginInterval
Require acceptance of legal policies again after defined number of logins.
$wgLegalLoginLogActions
Save LegalLogin actions like acceptance of the policies to Special:Log.

Example:

$wgLegalLoginPolicies = [
   'Terms and Conditions of Use' => [ // text from MediaWiki:Terms and Conditions of Use, title is the same
      'require scrolling' => true, // user must scroll it to down or open in popup windows before accept
   ],
   'Privacy policy' => [ // text from MediaWiki:Privacy policy
      'captionmsg' => 'privacy-policy-caption', // MediaWiki:Privacy-policy-caption // caption of the policy
   ],
];


$wgLegalLoginQuestions = [
   'I hate this site' => [
      'answer' => false,
      'help' => 'This is a hint',
   ],
   'I love this site' => [
      'answer' => true,
   ]
];

User rights

legallogin-view-log
Allow to view LegalLogin actions like acceptance of the policies in "Special:Log"
Category:All extensions Category:ApiBeforeMain extensions Category:AuthChangeFormFields extensions Category:BeforePageDisplay extensions Category:Extensions by WikiTeq Category:Extensions in Wikimedia version control Category:Extensions which add rights Category:Extensions with long-term support release branches compatibility policy Category:Extensions with manual MediaWiki version Category:GPL licensed extensions Category:LoadExtensionSchemaUpdates extensions Category:PageSaveComplete extensions Category:Stable extensions Category:User activity extensions