Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EICNET-2703: Add Archived user status option in the user form #1961

Draft
wants to merge 2 commits into
base: develop
Choose a base branch
from
Draft
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
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,13 @@ final class SmedUserStatuses {
*/
const USER_UNSUBSCRIBED = 'user_unsubscribed';

/**
* User archived.
*
* @var string
*/
const USER_ARCHIVED = 'user_archived';

/**
* Returns a list of possible statuses with their labels.
*
Expand All @@ -92,6 +99,7 @@ public static function getUserStatuses() {
self::USER_NOT_BOOTSTRAPPED => t('User not boostrapped', [], ['context' => 'eic_user_login']),
self::USER_BLOCKED => t('User blocked', [], ['context' => 'eic_user_login']),
self::USER_UNSUBSCRIBED => t('User unsubscribed', [], ['context' => 'eic_user_login']),
self::USER_ARCHIVED => t('User archived', [], ['context' => 'eic_user_login']),
self::USER_UNKNOWN => t('User unknown', [], ['context' => 'eic_user_login']),
];
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ public function updateUserInformation(UserInterface $account, array $data = [])
case SmedUserStatuses::USER_NOT_BOOTSTRAPPED:
case SmedUserStatuses::USER_BLOCKED:
case SmedUserStatuses::USER_UNSUBSCRIBED:
case SmedUserStatuses::USER_ARCHIVED:
case SmedUserStatuses::USER_UNKNOWN:
$account->block();
break;
Expand Down Expand Up @@ -170,6 +171,13 @@ public function getLoginMessage(UserInterface $account): TranslatableMarkup {
':contact_form_url' => Url::fromRoute('contact.site_page')->toString(),
]);
break;

case SmedUserStatuses::USER_ARCHIVED:
$message = $this->t('Your account has been archived and is no longer active. If you think this is a mistake, please contact us via the <a href=":contact_form_url">contact form</a>.', [
':contact_form_url' => Url::fromRoute('contact.site_page')->toString(),
]);
break;

case SmedUserStatuses::USER_UNKNOWN:
$message = $this->t('<p>It looks like you are not a member yet. Interested? </p> Please <span class="register_button"><a class="ecl-link ecl-link--cta" href=":smed_url" target="_blank">register</a></span> <p>If you have any questions <a href=":contact_form_url">contact us</a>.</p>', [
':smed_url' => $smed_url,
Expand Down