User: Now the User's page can be marked as Deceased. And now the user can be Incognito (at least, admins)

To mark the page as Deceased, type  in  field in Database. To be Incognito, type  in  field.

Specially for deceased drbream
This commit is contained in:
root 2021-09-11 01:33:45 +03:00
parent 348a4d127a
commit 7f1a5f2354
5 changed files with 33 additions and 3 deletions

View file

@ -683,6 +683,28 @@ class User extends RowModel
return FALSE; return FALSE;
} }
/**
* 0 - Default status
* 1 - Incognito online status
* 2 - Page of a dead person
*/
function onlineStatus(): int
{
switch ($this->getRecord()->online) {
case 1:
return 1;
break;
case 2:
return 2;
break;
default:
return 0;
break;
}
}
use Traits\TSubscribable; use Traits\TSubscribable;
} }

View file

@ -196,10 +196,13 @@ abstract class OpenVKPresenter extends SimplePresenter
exit; exit;
} }
if ($this->user->identity->onlineStatus() == 0) {
$this->user->identity->setOnline(time()); $this->user->identity->setOnline(time());
$this->user->identity->save(); $this->user->identity->save();
} }
}
setlocale(LC_TIME, ...(explode(";", tr("__locale")))); setlocale(LC_TIME, ...(explode(";", tr("__locale"))));
parent::onStartup(); parent::onStartup();

View file

@ -40,6 +40,9 @@
<span>{_was_online} {$user->getOnline()}</span> <span>{_was_online} {$user->getOnline()}</span>
{/if} {/if}
</div> </div>
<div n:if="$user->onlineStatus() == 2" style="float:right;">
<span><b>{_deceased_person}</b></span>
</div>
{/block} {/block}
{block content} {block content}

View file

@ -36,13 +36,14 @@
"online" = "Online"; "online" = "Online";
"was_online" = "was online"; "was_online" = "was online";
"was_online_m" = "was online"; "was_online_m" = "was online";
%{ For male and femail %} %{ For male and female %}
"was_online_f" = "was online"; "was_online_f" = "was online";
"all_title" = "All"; "all_title" = "All";
"information" = "Information"; "information" = "Information";
"status" = "Status"; "status" = "Status";
"no_information_provided" = "No information provided."; "no_information_provided" = "No information provided.";
"deceased_person" = "Deceased person";
"relationship" = "Relationship"; "relationship" = "Relationship";

View file

@ -42,6 +42,7 @@
"information" = "Информация"; "information" = "Информация";
"status" = "Статус"; "status" = "Статус";
"no_information_provided" = "Информация отсутствует."; "no_information_provided" = "Информация отсутствует.";
"deceased_person" = "Страница покойного человека";
"relationship" = "Семейное положение"; "relationship" = "Семейное положение";