-/** @package MediaWiki */
-class ConfirmationForm {
- /** */
- function show( $code ) {
- global $wgUser;
- if( !$wgUser->isLoggedIn() ) {
- $this->showNeedLogin();
- } elseif( empty( $code ) ) {
- $this->showEmpty( $this->checkAndSend() );
- } else {
- $this->showCode( $code );
- }
- }
-
- function showNeedLogin() {
- global $wgOut, $wgUser;
-
- $title = Title::makeTitle( NS_SPECIAL, 'Userlogin' );
- $self = Title::makeTitle( NS_SPECIAL, 'Confirmemail' );
- $skin = $wgUser->getSkin();
- $llink = $skin->makeKnownLinkObj( $title, wfMsgHtml( 'loginreqlink' ), 'returnto=' . $self->getPrefixedUrl() );
-
- $wgOut->setPageTitle( wfMsg( 'confirmemail' ) );
- $wgOut->addHtml( wfMsgWikiHtml( 'confirmemail_needlogin', $llink ) );
- return;
- }
-
- /** */
- function showCode( $code ) {
- $user = User::newFromConfirmationCode( $code );
- if( is_null( $user ) ) {
- $this->showInvalidCode();
+class EmailConfirmation extends SpecialPage {
+
+ function execute( $code ) {
+ global $wgUser, $wgOut;
+ #$this->setHeaders();
+ if( empty( $code ) ) {
+ if( $wgUser->isLoggedIn() ) {
+ $this->showRequestForm();
+ } else {
+ $title = Title::makeTitle( NS_SPECIAL, 'Userlogin' );
+ $self = Title::makeTitle( NS_SPECIAL, 'Confirmemail' );
+ $skin = $wgUser->getSkin();
+ $llink = $skin->makeKnownLinkObj( $title, wfMsgHtml( 'loginreqlink' ), 'returnto=' . $self->getPrefixedUrl() );
+ $wgOut->addHtml( wfMsgWikiHtml( 'confirmemail_needlogin', $llink ) );
+ }