From 8da9d1c7bce11bf998dd61ae577c283cf413897c Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Mon, 19 Aug 2024 14:46:17 +0800 Subject: [PATCH] 1 --- webapp/controller/BaseAuthedController.class.php | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/webapp/controller/BaseAuthedController.class.php b/webapp/controller/BaseAuthedController.class.php index e2531114..f454dd1d 100644 --- a/webapp/controller/BaseAuthedController.class.php +++ b/webapp/controller/BaseAuthedController.class.php @@ -89,16 +89,16 @@ class BaseAuthedController extends BaseController { // } // } // } + $this->accountId = getReqVal('account_id', ''); + $this->sessionId = getReqVal('session_id', ''); if (SERVER_ENV == _ONLINE) { - if (getReqVal('account_id', '') == '1_2006_email|6685c71f91fef8a46636a3cf') { - } else { + $sessionTime = $this->_getSessionTime(); + if ($sessionTime < 1724049880) { phpcommon\sendError(1001, 'session expiration'); die(); return; } } - $this->accountId = getReqVal('account_id', ''); - $this->sessionId = getReqVal('session_id', ''); if (SERVER_ENV != _DEBUG) { if (SERVER_ENV == _TEST) { if ($this->sessionId == "CzRXrGHxwQZJNCeXkTRA") { @@ -220,6 +220,12 @@ class BaseAuthedController extends BaseController { return $registertime; } + public function _getSessionTime() + { + $sessionTime = phpcommon\extractSessionTimeFromSessionId($this->sessionId); + return $sessionTime; + } + public function _getSelfMysql() { if (!$this->mysqlConn) {