# directory name unguessable, or use .htaccess to protect it.
$wgWhitelistRead = false;
+/**
+ * Should editors be required to have a validated e-mail
+ * address before being allowed to edit?
+ */
+$wgEmailConfirmToEdit=false;
+
/**
* Permission keys given to users in each group.
* All users are implicitly in the '*' group including anonymous visitors;
* the newly-edited page.
*/
function edit() {
- global $wgOut, $wgUser, $wgRequest, $wgTitle;
+ global $wgOut, $wgUser, $wgRequest, $wgTitle,
+ $wgEmailConfirmToEdit;
if ( ! wfRunHooks( 'AlternateEdit', array( &$this ) ) )
return;
return;
}
}
+ if ($wgEmailConfirmToEdit && !$wgUser->isEmailConfirmed()) {
+ wfDebug("$fname: user must confirm e-mail address\n");
+ $this->userNotConfirmedPage();
+ wfProfileOut($fname);
+ return;
+ }
if ( !$this->mTitle->userCan( 'create' ) && !$this->mTitle->exists() ) {
wfDebug( "$fname: no create permission\n" );
$this->noCreatePermission();
$wgOut->returnToMain( false );
}
+ function userNotConfirmedPage() {
+
+ global $wgOut;
+
+ $wgOut->setPageTitle( wfMsg( 'confirmedittitle' ) );
+ $wgOut->setRobotpolicy( 'noindex,nofollow' );
+ $wgOut->setArticleRelated( false );
+ $wgOut->addWikiText( wfMsg( 'confirmedittext' ) );
+ $wgOut->returnToMain( false );
+ }
+
/**
* @todo document
*/
'whitelistreadtext' => 'You have to [[Special:Userlogin|login]] to read pages.',
'whitelistacctitle' => 'You are not allowed to create an account',
'whitelistacctext' => 'To be allowed to create accounts in this Wiki you have to [[Special:Userlogin|log]] in and have the appropriate permissions.',
+'confirmedittitle' => 'E-mail confirmation required to edit',
+'confirmedittext' => 'You must confirm your e-mail address before editing pages. Please set and validate your e-mail address through your [[Special:Preferences|user preferences]].',
'loginreqtitle' => 'Login Required',
'loginreqlink' => 'login',
'loginreqpagetext' => 'You must $1 to view other pages.',