Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions lib/Listener/LoginMailListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,8 @@ private function getMail(SuspiciousLoginEvent $event, IUser $user): IMessage {
$additionalText = '';
// Add explanation for more information about the IP-address (if enabled)
if ($addButton) {
$additionalText = ' ' . $this->l->t('You can get more info by pressing the button which will open %s and show info about the suspicious IP-address.', 'https://iplookup.flagfox.net');
// TODO: deduplicate with \OCA\SuspiciousLogin\Notifications\Notifier::prepare
$additionalText = ' ' . $this->l->t('More info about the suspicious IP address available on %s', 'https://iplookup.flagfox.net');
}
$emailTemplate->addBodyText(
$this->l->t('A new login into your account was detected. The IP address %s was classified as suspicious. If this was you, you can ignore this message. Otherwise you should change your password.', $suspiciousIp) . $additionalText
Expand All @@ -98,7 +99,7 @@ private function getMail(SuspiciousLoginEvent $event, IUser $user): IMessage {
if ($addButton) {
$link = 'https://iplookup.flagfox.net/?ip=' . $suspiciousIp;
$emailTemplate->addBodyButton(
htmlspecialchars($this->l->t('More information ↗')),
htmlspecialchars($this->l->t('Open %s ↗', ['iplookup.flagfox.net'])),
$link,
false
);
Expand Down
5 changes: 3 additions & 2 deletions lib/Notifications/Notifier.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,14 +72,15 @@ public function prepare(INotification $notification, string $languageCode): INot
// Add button for more information about the IP-address
if ($this->config->getAppValue('suspicious_login', 'show_more_info_button', '1') === "1") {
$action = $notification->createAction();
$label = $l->t('More information ↗');
$label = $l->t('Open %s ↗', ['iplookup.flagfox.net']);
$link = 'https://iplookup.flagfox.net/?ip=' . $suspiciousIp;
$action->setLabel($label)
->setParsedLabel($label)
->setLink($link, IAction::TYPE_WEB)
->setPrimary(true);
$notification->addParsedAction($action);
$additionalText = ' ' . $l->t('You can get more info by pressing the button which will open %s and show info about the suspicious IP-address.', 'https://iplookup.flagfox.net');
// TODO: deduplicate with \OCA\SuspiciousLogin\Listener\LoginMailListener::getMail
$additionalText = ' ' . $l->t('More info about the suspicious IP address available on %s', 'https://iplookup.flagfox.net');
}

$notification->setParsedSubject(
Expand Down