Add optional parameter to show message if user is blocked.
If a user or IP address is blocked from sending emails, they will not be able to access the Contact form. For our purposes of account vanishing, this is problematic because the user will not see any further instructions on how to proceed with account vanishing, and would instead see instructions for appealing the block. This patch provides a simple mechanism for showing a message if the account or IP is blocked (instead of the default block template), which may contain other instructions for the user in specific cases like ours. Bug: T343536 Change-Id: I77b4b049b07f9f1e729a9a0ca6b63a6d15343848
这个提交包含在:
父节点
561aadc974
当前提交
56e540c606
|
@ -34,6 +34,7 @@
|
|||
"NameReadonly": false,
|
||||
"EmailReadonly": false,
|
||||
"SubjectReadonly": false,
|
||||
"UseCustomBlockMessage": false,
|
||||
"RLModules": [],
|
||||
"RLStyleModules": [],
|
||||
"AdditionalFields": {
|
||||
|
|
|
@ -158,9 +158,16 @@ class SpecialContact extends UnlistedSpecialPage {
|
|||
|
||||
// Blocked users cannot use the contact form if they're disabled from sending email.
|
||||
if ( $user->isBlockedFromEmailuser() ) {
|
||||
// If the user is blocked from emailing users then there is a block
|
||||
// @phan-suppress-next-line PhanTypeMismatchArgumentNullable
|
||||
throw new UserBlockedError( $this->getUser()->getBlock() );
|
||||
$useCustomBlockMessage = $config['UseCustomBlockMessage'] ?? false;
|
||||
if ( $useCustomBlockMessage ) {
|
||||
$this->getOutput()->showErrorPage( $this->getFormSpecificMessageKey( 'contactpage-title' ),
|
||||
$this->getFormSpecificMessageKey( 'contactpage-blocked-message' ) );
|
||||
return;
|
||||
} else {
|
||||
// If the user is blocked from emailing users then there is a block
|
||||
// @phan-suppress-next-line PhanTypeMismatchArgumentNullable
|
||||
throw new UserBlockedError( $this->getUser()->getBlock() );
|
||||
}
|
||||
}
|
||||
|
||||
$this->getOutput()->setPageTitleMsg(
|
||||
|
|
正在加载...
在新工单中引用