Extension:Email authentication before editing

From MediaWiki.org
Jump to: navigation, search
MediaWiki extensions manual - list
Crystal Clear app error.png
Email authentication before editing

Release status: unstable

Implementation User activity
Description Force users to confirm their email before editing
License No license specified
Download No link

Check usage (experimental)

If you are using 1.6, just add '$wgEmailConfirmToEdit = true;' to the end of your LocalSettings.php file.

This extension is still online for those wiki, which stay on version 1.5.x.

This extension for MW 1.5 makes your wiki require email authentication from new users before editing.

For those with 1.5, first add this code to includes/EditPage.php (~line 158):

....
        if ( !$wgUser->isAllowed('edit') ){
            if ( $wgUser->isAnon() ) {
                $this->userNotLoggedInPage();
                return;
            } else {
                $wgOut->readOnlyPage( $this->mArticle->getContent( true ), true );
                return;
            }
        }
        ## Add this for email authentication before editing#
        if ( !$wgUser->getEmailAuthenticationTimestamp() ) {
            $this->userHasNotAuthenticatedEmailPage();
            return;
        }
        #################################################
        if ( wfReadOnly() ) {
....


Put this code in the same file above the userNotLoggedInPage function on about line 858:

#### Add this function for Email Authentication before editing ###
    function userHasNotAuthenticatedEmailPage() {
        global $wgOut;

        $wgOut->setPageTitle( wfMsg( 'noemailauthtitle' ) );
        $wgOut->setRobotpolicy( 'noindex,nofollow' );
        $wgOut->setArticleRelated( false );

        $wgOut->addWikiText( wfMsg( 'noemailauthtext' ) );
        $wgOut->returnToMain( false );
    }
###################################################################
   function userNotLoggedInPage() {
....

Add this to languages/Language.php line 692: (for 1.6 seems like context is in languages/Messages.php (-- added edit)


'whitelistedittitle' => 'Login required to edit',
'whitelistedittext' => 'You have to [[Special:Userlogin|login]] to edit pages.',
###### Add for email auth before editing ###############
'noemailauthtitle' => 'Email Authentication Required',
'noemailauthtext' => 'You have to [[Special:Confirmemail|confirm]] your email address to edit pages.',
########################################################

Personal tools
Namespaces
Variants
Actions
Site
Support
Download
Development
Communication
Print/export
Toolbox