Go to the documentation of this file.
34 parent::__construct(
'Confirmemail',
'editmyprivateinfo' );
60 if ( !$this->
getUser()->isAllowed(
'viewmyprivateinfo' ) ) {
66 if ( Sanitizer::validateEmail( $this->
getUser()->getEmail() ) ) {
69 $this->
getOutput()->addWikiMsg(
'confirmemail_noemail' );
72 $old = $trxProfiler->setSilenced(
true );
74 $trxProfiler->setSilenced( $old );
85 if ( !
$user->isEmailConfirmed() ) {
87 if (
$user->isEmailConfirmationPending() ) {
92 'default' =>
"<div class=\"error mw-confirmemail-pending\">\n" .
93 $this->
msg(
'confirmemail_pending' )->escaped() .
99 $out->addWikiMsg(
'confirmemail_text' );
102 ->setMethod(
'post' )
104 ->setSubmitTextMsg(
'confirmemail_send' )
105 ->setSubmitCallback( [ $this,
'submitSend' ] );
111 $out->addWikiMsg(
'confirmemail_sent' );
120 $emailAuthenticated =
$user->getEmailAuthenticationTimestamp();
122 $d =
$lang->userDate( $emailAuthenticated,
$user );
124 $out->addWikiMsg(
'emailauthenticated',
$time, $d,
$t );
139 $status->getWikiText(
'confirmemail_sendfailed' )
152 if ( !is_object(
$user ) ) {
153 $this->
getOutput()->addWikiMsg(
'confirmemail_invalid' );
158 $user->confirmEmail();
159 $user->saveSettings();
160 $message = $this->
getUser()->isLoggedIn() ?
'confirmemail_loggedin' :
'confirmemail_success';
161 $this->
getOutput()->addWikiMsg( $message );
163 if ( !$this->
getUser()->isLoggedIn() ) {
getPageTitle( $subpage=false)
Get a self-referential title object.
getOutput()
Get the OutputPage being used for this instance.
static instance()
Singleton.
if(!isset( $args[0])) $lang
Shortcut to construct a special page which is unlisted by default.
design txt This is a brief overview of the new design More thorough and up to date information is available on the documentation wiki at etc Handles the details of getting and saving to the user table of the and dealing with sessions and cookies OutputPage Encapsulates the entire HTML page that will be sent in response to any server request It is used by calling its functions to add text
this hook is for auditing only RecentChangesLinked and Watchlist RecentChangesLinked and Watchlist Do not use this to implement individual filters if they are compatible with the ChangesListFilter and ChangesListFilterGroup structure use sub classes of those in conjunction with the ChangesListSpecialPageStructuredFilters hook This hook can be used to implement filters that do not implement that or custom behavior that is not an individual filter e g Watchlist and Watchlist you will want to construct new ChangesListBooleanFilter or ChangesListStringOptionsFilter objects When constructing you specify which group they belong to You can reuse existing or create your you must register them with $special registerFilterGroup removed from all revisions and log entries to which it was applied This gives extensions a chance to take it off their books as the deletion has already been partly carried out by this point or something similar the user will be unable to create the tag set $status
please add to it if you re going to add events to the MediaWiki code where normally authentication against an external auth plugin would be creating a account $user
checkPermissions()
Checks if userCanExecute, and if not throws a PermissionsError.
static newFatal( $message)
Factory function for fatal errors.
showRequestForm()
Show a nice form for the user to request a confirmation mail.
static getTitleFor( $name, $subpage=false, $fragment='')
Get a localised Title object for a specified special page name If you don't need a full Title object,...
execute( $code)
Main execution point.
Show an error when a user tries to do something they do not have the necessary permissions for.
getLanguage()
Shortcut to get user's language.
injection txt This is an overview of how MediaWiki makes use of dependency injection The design described here grew from the discussion of RFC T384 The term dependency this means that anything an object needs to operate should be injected from the the object itself should only know narrow no concrete implementation of the logic it relies on The requirement to inject everything typically results in an architecture that based on two main types of and essentially stateless service objects that use other service objects to operate on the value objects As of the beginning MediaWiki is only starting to use the DI approach Much of the code still relies on global state or direct resulting in a highly cyclical dependency which acts as the top level factory for services in MediaWiki which can be used to gain access to default instances of various services MediaWikiServices however also allows new services to be defined and default services to be redefined Services are defined or redefined by providing a callback the instantiator that will return a new instance of the service When it will create an instance of MediaWikiServices and populate it with the services defined in the files listed by thereby bootstrapping the DI framework Per $wgServiceWiringFiles lists includes ServiceWiring php
Generic operation result class Has warning/error list, boolean status and arbitrary value.
namespace and then decline to actually register it file or subcat img or subcat $title
attemptConfirm( $code)
Attempt to confirm the user's email address and show success or failure as needed; if successful,...
setHeaders()
Sets headers - this should be called from the execute() method of all derived classes!
getUser()
Shortcut to get the User executing this instance.
see documentation in includes Linker php for Linker::makeImageLink & $time
getContext()
Gets the context this SpecialPage is executed in.
requireLogin( $reasonMsg='exception-nologin-text', $titleMsg='exception-nologin')
If the user is not logged in, throws UserNotLoggedIn error.
msg()
Wrapper around wfMessage that sets the current context.
static newGood( $value=null)
Factory function for good results.
please add to it if you re going to add events to the MediaWiki code where normally authentication against an external auth plugin would be creating a account incomplete not yet checked for validity & $retval
doesWrites()
Indicates whether this special page may perform database writes.
this hook is for auditing only or null if authentication failed before getting that far or null if we can t even determine that probably a stub it is not rendered in wiki pages or galleries in category pages allow injecting custom HTML after the section Any uses of the hook need to handle escaping see BaseTemplate::getToolbox and BaseTemplate::makeListItem for details on the format of individual items inside of this array or by returning and letting standard HTTP rendering take place modifiable or by returning false and taking over the output modifiable & $code
Special page allows users to request email confirmation message, and handles processing of the confir...
submitSend()
Callback for HTMLForm send confirmation mail.
checkReadOnly()
If the wiki is currently in readonly mode, throws a ReadOnlyError.
static newFromConfirmationCode( $code, $flags=0)
Factory method to fetch whichever user has a given email confirmation code.
this hook is for auditing only or null if authentication failed before getting that far or null if we can t even determine that probably a stub it is not rendered in wiki pages or galleries in category pages allow injecting custom HTML after the section Any uses of the hook need to handle escaping see BaseTemplate::getToolbox and BaseTemplate::makeListItem for details on the format of individual items inside of this array or by returning and letting standard HTTP rendering take place modifiable or by returning false and taking over the output $out