Extension:UserAgreement
UserAgreement Release status: stable |
|
---|---|
Implementation | User interface, API , Database |
Description | Render a user agreement before granting access to a Wiki. |
Author(s) | |
Latest version | 2.0.0 (2023-06-26) |
Compatibility policy | Master maintains backward compatibility. |
MediaWiki | 1.39+ |
Database changes | Yes |
License | MIT License |
Download | |
Expand | |
Expand | |
Expand | |
Quarterly downloads | Lua error in Module:Extension at line 172: bad argument #1 to 'inNamespace' (unrecognized namespace name 'skin'). |
Public wikis using | Lua error in Module:Extension at line 172: bad argument #1 to 'inNamespace' (unrecognized namespace name 'skin'). |
Translate the UserAgreement extension if it is available at translatewiki.net | |
Issues | Open tasks · Report a bug |
Introduction
UserAgreement adds the ability for administrators to specify a user agreement message and have it rendered to users for acknowledgement before granting access to a wiki's contents. This only applies to users who are logged in.
Users who have not yet acknowledged the current version of the user agreement will be presented with the agreement upon visiting any wiki page and will be unable to view any wiki content until they've acknowledged the user agreement. Users need only acknowledge the current version of the user agreement once to gain access to a wiki's content.
UserAgreement does not depend upon any other extension.
Installation
- <translate> [[<tvar name=2>Special:ExtensionDistributor/UserAgreement</tvar>|Download]] and move the extracted <tvar name=name>
UserAgreement
</tvar> folder to your <tvar name=ext>extensions/
</tvar> directory.</translate>
<translate> Developers and code contributors should install the extension [[<tvar name=git>Special:MyLanguage/Download from Git</tvar>|from Git]] instead, using:</translate>cd extensions/
git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/UserAgreement - <translate> Add the following code at the bottom of your <tvar name=1>LocalSettings.php </tvar> file:</translate>
wfLoadExtension( 'UserAgreement' );
- <translate> Run the [[<tvar name=update>Special:MyLanguage/Manual:Update.php</tvar>|update script]] which will automatically create the necessary database tables that this extension needs.</translate>
- Configure as required.
- File:OOjs UI icon check-constructive.svg <translate> Done</translate> – <translate> Navigate to <tvar name=special>Special:Version</tvar> on your wiki to verify that the extension is successfully installed.</translate>
Configuration
Flag | Default | Description |
---|---|---|
$wgUserAgreement_DaysToReaccept
|
0
|
The number of days after which the user needs to re-accept the agreement even if it has not changed. A value of 0 means that the user does not need to re-accept the agreement unless it has changed. A value of 365 means that the user needs to re-accept the agreement every year even if it has not changed. |
Usage
To specify a user agreement message for users to acknowledge, simply edit the page Mediawiki:Useragreement
(watch your capitalization) to contain exactly the message you would like presented to users in wikitext format.
Each time the Mediawiki:Useragreement
page is updated, all users will be required to acknowledge the updated user agreement before being able to continue accessing the wiki's content.
By default, the user agreement message is left blank and thus, no message is presented to users and they are not required to acknowledge anything before viewing a wiki's content.
Implementation Details
UserAgreement adds a new database table called useragreement
with columns ua_user
and ua_user_accepted_timestamp
.
This table is used to record the timestamps corresponding to the last time each user acknowledged some version of the user agreement.
The logic governing user agreement display is simple.
If a user's ua_user_accepted_timestamp
value is greater than the revision timestamp of the Mediawiki:Useragreement
page's current revision (meaning the user accepted some version of the user agreement after the current version of the agreement was last edited), then that user is not required to view and acknowledge the current version of the user agreement before accessing the wiki's content.
Otherwise, the user will be presented with the current version of the user agreement upon visiting any wiki page and will not be granted access to any of the wiki's content until they have acknowledged the current version of the user agreement, which will then update the ua_user_accepted_timestamp
column for that user.
Version History
- Version 2.0.0
- added
$wgUserAgreement_DaysToReaccept
- code cleanup
- Version 1.0.1
- Added documentation url link on Special:Version page.
- Version 1.0.0
- Initial version
- Pages with script errors
- Pages with broken file links
- Stable extensions
- Extensions without an image
- User interface extensions
- API extensions
- Database extensions
- Extensions with master compatibility policy
- Extensions with manual MediaWiki version
- MIT licensed extensions
- Extensions in Wikimedia version control
- BeforePageDisplay extensions
- LoadExtensionSchemaUpdates extensions
- All extensions
- Extensions by MITRE