Add X-OpenVK-User-Validated header

This commit is contained in:
celestora 2022-04-04 15:01:12 +03:00 committed by GitHub
parent e69b6d95e6
commit 0cd75a5a3d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -204,6 +204,7 @@ abstract class OpenVKPresenter extends SimplePresenter
$this->template->isXmas = intval(date('d')) >= 1 && date('m') == 12 || intval(date('d')) <= 15 && date('m') == 1 ? true : false;
$this->template->isTimezoned = Session::i()->get("_timezoneOffset");
$userValidated = 0;
if(!is_null($user)) {
$this->user = (object) [];
$this->user->raw = $user;
@ -261,6 +262,7 @@ abstract class OpenVKPresenter extends SimplePresenter
exit;
}
$userValidated = 1;
if ($this->user->identity->onlineStatus() == 0) {
$this->user->identity->setOnline(time());
$this->user->identity->save();
@ -271,6 +273,7 @@ abstract class OpenVKPresenter extends SimplePresenter
$this->template->helpdeskTicketNotAnsweredCount = (new Tickets)->getTicketCount(0);
}
header("X-OpenVK-User-Validated: $userValidated");
setlocale(LC_TIME, ...(explode(";", tr("__locale"))));
parent::onStartup();