Extension:Email authentication before editing

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:

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

$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 login to edit pages.', 'noemailauthtitle' => 'Email Authentication Required', 'noemailauthtext' => 'You have to confirm your email address to edit pages.',
 * 1) Add for email auth before editing ###############