37 private bool $shouldRedirect =
true;
44 parent::__construct(
'Mytalk' );
46 $this->tempUserConfig = $tempUserConfig;
47 $this->tempUserCreator = $tempUserCreator;
48 $this->authManager = $authManager;
53 if ( $this->tempUserConfig->isEnabled() && $this->getUser()->isAnon() ) {
54 $this->shouldRedirect =
false;
55 $block = $this->
getUser()->getBlock();
56 if ( $block && $block->isUsertalkEditAllowed() ) {
60 $form = $this->getUserTalkAppealForm();
61 $status = $form->show();
62 if ( $status && $status->isOK() ) {
65 $this->authManager->setRequestContextUserFromSessionUser();
67 if ( $status instanceof
Status ) {
68 $this->
getOutput()->addWikiMsg( $status->getMessage() );
78 parent::execute( $subpage );
84 private function getUserTalkAppealForm() {
85 $form = HTMLForm::factory(
'ooui', [], $this->
getContext() );
86 $form->setMethod(
'post' )
87 ->setSubmitTextMsg(
'mytalk-appeal-submit' )
88 ->setSubmitCallback( $this->
onSubmit( ... ) );
98 return $this->tempUserCreator->create(
101 [ ChangeTags::TAG_IPBLOCK_APPEAL ]
107 if ( !$this->shouldRedirect ) {
108 return $this->
msg(
'mytalk-appeal' );
114 if ( $this->tempUserConfig->isEnabled() && $this->getUser()->isAnon() ) {
118 if ( $subpage ===
null || $subpage ===
'' ) {
139class_alias( SpecialMytalk::class,
'SpecialMytalk' );
Helper for any RedirectSpecialPage which redirects the user to a particular article (as opposed to us...
setHeaders()
Sets headers - this should be called from the execute() method of all derived classes!
getUser()
Shortcut to get the User executing this instance.
getContext()
Gets the context this SpecialPage is executed in.
getRequest()
Get the WebRequest being used for this instance.
msg( $key,... $params)
Wrapper around wfMessage that sets the current context.
getOutput()
Get the OutputPage being used for this instance.
requireLogin( $reasonMsg='exception-nologin-text', $titleMsg='exception-nologin')
If the user is not logged in, throws UserNotLoggedIn error.
outputHeader( $summaryMessageKey='')
Outputs a summary message on top of special pages By default the message key is the canonical name of...
getName()
Get the canonical, unlocalized name of this special page without namespace.