* @subpackage SpecialPage
*/
+/** @todo document */
function wfSpecialConfirmemail( $code ) {
$form = new ConfirmationForm();
$form->show( $code );
}
+/** @package MediaWiki */
class ConfirmationForm {
+ /** */
function show( $code ) {
if( empty( $code ) ) {
$this->showEmpty( $this->checkAndSend() );
$this->showCode( $code );
}
}
-
+
+ /** */
function showCode( $code ) {
$user = User::newFromConfirmationCode( $code );
if( is_null( $user ) ) {
$this->confirmAndShow( $user );
}
}
-
-
+
+ /** */
function confirmAndShow( $user ) {
if( $user->confirmEmail() ) {
$this->showSuccess();
$this->showError();
}
}
-
+
+ /** */
function checkAndSend() {
global $wgUser, $wgRequest;
if( $wgRequest->wasPosted() &&
return '';
}
}
-
+
+ /** */
function showEmpty( $err ) {
require_once( 'templates/Confirmemail.php' );
global $wgOut, $wgUser;
$wgOut->addTemplate( $tpl );
}
-
+
+ /** */
function showInvalidCode() {
global $wgOut;
$wgOut->addWikiText( wfMsg( 'confirmemail_invalid' ) );
}
-
+
+ /** */
function showError() {
global $wgOut;
$wgOut->addWikiText( wfMsg( 'confirmemail_error' ) );
}
-
+
+ /** */
function showSuccess() {
global $wgOut, $wgRequest, $wgUser;