From: Tim Düsterhus Date: Fri, 8 Jan 2021 15:08:56 +0000 (+0100) Subject: Stop accessing wcf1_acp_session in ACP session log X-Git-Tag: 5.4.0_Alpha_1~417^2~1 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=cc18a8219c6a89c7bfabf4bbeecdd264d63ad91b;p=GitHub%2FWoltLab%2FWCF.git Stop accessing wcf1_acp_session in ACP session log This access was only used to full the `active` property which is unused. --- diff --git a/wcfsetup/install/files/lib/data/acp/session/log/ACPSessionLog.class.php b/wcfsetup/install/files/lib/data/acp/session/log/ACPSessionLog.class.php index 1b94481a15..4214ddba99 100644 --- a/wcfsetup/install/files/lib/data/acp/session/log/ACPSessionLog.class.php +++ b/wcfsetup/install/files/lib/data/acp/session/log/ACPSessionLog.class.php @@ -34,10 +34,8 @@ class ACPSessionLog extends DatabaseObject { */ public function __construct($id, array $row = null, DatabaseObject $object = null) { if ($id !== null) { - $sql = "SELECT acp_session_log.*, user_table.username, acp_session.sessionID AS active + $sql = "SELECT acp_session_log.*, user_table.username, 0 AS active FROM wcf".WCF_N."_acp_session_log acp_session_log - LEFT JOIN wcf".WCF_N."_acp_session acp_session - ON (acp_session.sessionID = acp_session_log.sessionID) LEFT JOIN wcf".WCF_N."_user user_table ON (user_table.userID = acp_session_log.userID) WHERE acp_session_log.sessionLogID = ?"; @@ -53,25 +51,17 @@ class ACPSessionLog extends DatabaseObject { } /** - * Returns true if this session is active. - * - * @return bool + * @deprecated 5.4 - This method always returns false. */ public function isActive() { - return $this->active ? true : false; + return false; } /** - * Returns true if this session is the active user session. - * - * @return bool + * @deprecated 5.4 - This method always returns false. */ public function isActiveUserSession() { - if ($this->isActive() && $this->sessionID == WCF::getSession()->sessionID) { - return 1; - } - - return 0; + return false; } /** diff --git a/wcfsetup/install/files/lib/data/acp/session/log/ACPSessionLogList.class.php b/wcfsetup/install/files/lib/data/acp/session/log/ACPSessionLogList.class.php index 32fa53c5e0..ca06a7cae5 100644 --- a/wcfsetup/install/files/lib/data/acp/session/log/ACPSessionLogList.class.php +++ b/wcfsetup/install/files/lib/data/acp/session/log/ACPSessionLogList.class.php @@ -26,11 +26,11 @@ class ACPSessionLogList extends DatabaseObjectList { */ public function readObjects() { if (!empty($this->sqlSelects)) $this->sqlSelects .= ','; - $this->sqlSelects .= " user_table.username, acp_session.sessionID AS active, + $this->sqlSelects .= " user_table.username, + 0 AS active, (SELECT COUNT(*) FROM wcf".WCF_N."_acp_session_access_log WHERE sessionLogID = ".$this->getDatabaseTableAlias().".sessionLogID) AS accesses"; - $this->sqlJoins .= " LEFT JOIN wcf".WCF_N."_user user_table ON (user_table.userID = ".$this->getDatabaseTableAlias().".userID) - LEFT JOIN wcf".WCF_N."_acp_session acp_session ON (acp_session.sessionID = ".$this->getDatabaseTableAlias().".sessionID)"; + $this->sqlJoins .= " LEFT JOIN wcf".WCF_N."_user user_table ON (user_table.userID = ".$this->getDatabaseTableAlias().".userID)"; parent::readObjects(); }