mirror of
https://github.com/openvk/openvk
synced 2024-12-23 00:51:03 +03:00
Add X-Accel-Expires for non-authorized users
This commit is contained in:
parent
3281cd0c1b
commit
8b3917e863
2 changed files with 4 additions and 0 deletions
|
@ -205,6 +205,7 @@ abstract class OpenVKPresenter extends SimplePresenter
|
|||
$this->template->isTimezoned = Session::i()->get("_timezoneOffset");
|
||||
|
||||
$userValidated = 0;
|
||||
$cacheTime = OPENVK_ROOT_CONF["openvk"]["preferences"]["nginxCacheTime"] ?? 0;
|
||||
if(!is_null($user)) {
|
||||
$this->user = (object) [];
|
||||
$this->user->raw = $user;
|
||||
|
@ -263,6 +264,7 @@ abstract class OpenVKPresenter extends SimplePresenter
|
|||
}
|
||||
|
||||
$userValidated = 1;
|
||||
$cacheTime = 0; # Force no cache
|
||||
if ($this->user->identity->onlineStatus() == 0) {
|
||||
$this->user->identity->setOnline(time());
|
||||
$this->user->identity->save();
|
||||
|
@ -274,6 +276,7 @@ abstract class OpenVKPresenter extends SimplePresenter
|
|||
}
|
||||
|
||||
header("X-OpenVK-User-Validated: $userValidated");
|
||||
header("X-Accel-Expires: $cacheTime");
|
||||
setlocale(LC_TIME, ...(explode(";", tr("__locale"))));
|
||||
|
||||
parent::onStartup();
|
||||
|
|
|
@ -6,6 +6,7 @@ openvk:
|
|||
|
||||
preferences:
|
||||
femaleGenderPriority: true
|
||||
nginxCacheTime: null
|
||||
uploads:
|
||||
disableLargeUploads: false
|
||||
mode: "basic"
|
||||
|
|
Loading…
Reference in a new issue