function execute( $code ) {
// Ignore things like master queries/connections on GET requests.
// It's very convenient to just allow formless link usage.
function execute( $code ) {
// Ignore things like master queries/connections on GET requests.
// It's very convenient to just allow formless link usage.
// This could also let someone check the current email address, so
// require both permissions.
if ( !$this->getUser()->isAllowed( 'viewmyprivateinfo' ) ) {
// This could also let someone check the current email address, so
// require both permissions.
if ( !$this->getUser()->isAllowed( 'viewmyprivateinfo' ) ) {
if ( Sanitizer::validateEmail( $this->getUser()->getEmail() ) ) {
$this->showRequestForm();
} else {
$this->getOutput()->addWikiMsg( 'confirmemail_noemail' );
}
} else {
if ( Sanitizer::validateEmail( $this->getUser()->getEmail() ) ) {
$this->showRequestForm();
} else {
$this->getOutput()->addWikiMsg( 'confirmemail_noemail' );
}
} else {
'type' => 'info',
'raw' => true,
'default' => "<div class=\"error mw-confirmemail-pending\">\n" .
$this->msg( 'confirmemail_pending' )->escaped() .
"\n</div>",
'type' => 'info',
'raw' => true,
'default' => "<div class=\"error mw-confirmemail-pending\">\n" .
$this->msg( 'confirmemail_pending' )->escaped() .
"\n</div>",
$user = User::newFromConfirmationCode( $code, User::READ_LATEST );
if ( !is_object( $user ) ) {
$this->getOutput()->addWikiMsg( 'confirmemail_invalid' );
$user = User::newFromConfirmationCode( $code, User::READ_LATEST );
if ( !is_object( $user ) ) {
$this->getOutput()->addWikiMsg( 'confirmemail_invalid' );