Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15412128
D20665.id49292.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
4 KB
Referenced Files
None
Subscribers
None
D20665.id49292.diff
View Options
diff --git a/src/applications/auth/controller/message/PhabricatorAuthMessageViewController.php b/src/applications/auth/controller/message/PhabricatorAuthMessageViewController.php
--- a/src/applications/auth/controller/message/PhabricatorAuthMessageViewController.php
+++ b/src/applications/auth/controller/message/PhabricatorAuthMessageViewController.php
@@ -97,20 +97,35 @@
private function buildPropertiesView(PhabricatorAuthMessage $message) {
$viewer = $this->getViewer();
+ $message_type = $message->getMessageType();
+
$view = id(new PHUIPropertyListView())
->setViewer($viewer);
- $view->addProperty(
- pht('Description'),
- $message->getMessageType()->getShortDescription());
+ $full_description = $message_type->getFullDescription();
+ if (strlen($full_description)) {
+ $view->addTextContent(new PHUIRemarkupView($viewer, $full_description));
+ } else {
+ $short_description = $message_type->getShortDescription();
+ $view->addProperty(pht('Description'), $short_description);
+ }
- if (strlen($message->getMessageText())) {
+ $message_text = $message->getMessageText();
+ if (strlen($message_text)) {
$view->addSectionHeader(
pht('Message Preview'),
PHUIPropertyListView::ICON_SUMMARY);
- $view->addTextContent(
- new PHUIRemarkupView($viewer, $message->getMessageText()));
+ $view->addTextContent(new PHUIRemarkupView($viewer, $message_text));
+ }
+
+ $default_text = $message_type->getDefaultMessageText();
+ if (strlen($default_text)) {
+ $view->addSectionHeader(
+ pht('Default Message'),
+ PHUIPropertyListView::ICON_SUMMARY);
+
+ $view->addTextContent(new PHUIRemarkupView($viewer, $default_text));
}
return $view;
diff --git a/src/applications/auth/message/PhabricatorAuthEmailLoginMessageType.php b/src/applications/auth/message/PhabricatorAuthEmailLoginMessageType.php
--- a/src/applications/auth/message/PhabricatorAuthEmailLoginMessageType.php
+++ b/src/applications/auth/message/PhabricatorAuthEmailLoginMessageType.php
@@ -15,4 +15,27 @@
'to access their account.');
}
+ public function getFullDescription() {
+ return pht(
+ 'Guidance included in the mail message body when users request an '.
+ 'email link to access their account.'.
+ "\n\n".
+ 'For installs with password authentication enabled, users access this '.
+ 'workflow by using the "Forgot your password?" link on the login '.
+ 'screen.'.
+ "\n\n".
+ 'For installs without password authentication enabled, users access '.
+ 'this workflow by using the "Send a login link to your email address." '.
+ 'link on the login screen. This workflow allows users to recover '.
+ 'access to their account if there is an issue with an external '.
+ 'login service.');
+ }
+
+ public function getDefaultMessageText() {
+ return pht(
+ 'You (or someone pretending to be you) recently requested an account '.
+ 'recovery link be sent to this email address. If you did not make '.
+ 'this request, you can ignore this message.');
+ }
+
}
diff --git a/src/applications/auth/message/PhabricatorAuthMessageType.php b/src/applications/auth/message/PhabricatorAuthMessageType.php
--- a/src/applications/auth/message/PhabricatorAuthMessageType.php
+++ b/src/applications/auth/message/PhabricatorAuthMessageType.php
@@ -30,4 +30,12 @@
abstract public function getDisplayName();
abstract public function getShortDescription();
+ public function getFullDescription() {
+ return null;
+ }
+
+ public function getDefaultMessageText() {
+ return null;
+ }
+
}
diff --git a/src/applications/auth/storage/PhabricatorAuthMessage.php b/src/applications/auth/storage/PhabricatorAuthMessage.php
--- a/src/applications/auth/storage/PhabricatorAuthMessage.php
+++ b/src/applications/auth/storage/PhabricatorAuthMessage.php
@@ -75,12 +75,16 @@
$message_key) {
$message = self::loadMessage($viewer, $message_key);
-
- if (!$message) {
- return null;
+ if ($message) {
+ $message_text = $message->getMessageText();
+ if (strlen($message_text)) {
+ return $message_text;
+ }
}
- return $message->getMessageText();
+ $message_type = PhabricatorAuthMessageType::newFromKey($message_key);
+
+ return $message_type->getDefaultMessageText();
}
diff --git a/src/applications/people/mail/PhabricatorPeopleMailEngine.php b/src/applications/people/mail/PhabricatorPeopleMailEngine.php
--- a/src/applications/people/mail/PhabricatorPeopleMailEngine.php
+++ b/src/applications/people/mail/PhabricatorPeopleMailEngine.php
@@ -90,7 +90,10 @@
->setConfig('uri.base', PhabricatorEnv::getProductionURI('/'))
->setMode(PhutilRemarkupEngine::MODE_TEXT);
- return $engine->markupText($text);
+ $rendered_text = $engine->markupText($text);
+ $rendered_text = rtrim($rendered_text, "\n");
+
+ return $rendered_text;
}
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Mar 20, 11:25 AM (1 d, 11 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7691836
Default Alt Text
D20665.id49292.diff (4 KB)
Attached To
Mode
D20665: Allow Auth messages to have detailed descriptions and default values, then give "Email Login" both
Attached
Detach File
Event Timeline
Log In to Comment