diff --git a/website/app-templates/smarty/blocks/user_finder_list.tpl b/website/app-templates/smarty/blocks/user_finder_list.tpl index 9d7bd9a40c..08a2a35038 100644 --- a/website/app-templates/smarty/blocks/user_finder_list.tpl +++ b/website/app-templates/smarty/blocks/user_finder_list.tpl @@ -13,6 +13,7 @@ Join date Last login Email valid + Status Actions @@ -25,6 +26,7 @@ {if !is_null($user->joined_on_datetime)}{$user->joined_on_datetime|print_date nofilter}{/if} {if !is_null($user->last_login_datetime)}{$user->last_login_datetime|print_date nofilter}{/if} {if $user->email_invalid}{t}false{/t}{else}{t}true{/t}{/if} + {$user->status_text()} {block user_actions}{/block} diff --git a/website/app/GeoKrety/Model/User.php b/website/app/GeoKrety/Model/User.php index 5f8da040cb..897f33d5ab 100644 --- a/website/app/GeoKrety/Model/User.php +++ b/website/app/GeoKrety/Model/User.php @@ -48,6 +48,12 @@ class User extends Base implements \JsonSerializable { public const USER_ACCOUNT_VALID = 1; public const USER_ACCOUNT_IMPORTED = 2; + public const ACCOUNT_STATUS_TEXT = [ + self::USER_ACCOUNT_INVALID => 'Non-Activated', + self::USER_ACCOUNT_VALID => 'Fully activated', + self::USER_ACCOUNT_IMPORTED => 'Imported', + ]; + public const USER_ACCOUNT_STATUS_INVALID = [ self::USER_ACCOUNT_INVALID, self::USER_ACCOUNT_IMPORTED, @@ -303,6 +309,10 @@ public function isAccountImported(): bool { return $this->account_valid === self::USER_ACCOUNT_IMPORTED; } + public function status_text(): string { + return self::ACCOUNT_STATUS_TEXT[$this->account_valid]; + } + public function hasEmail(): bool { return !is_null($this->_email_hash); }