mirror of
https://github.com/torrentpier/torrentpier
synced 2025-08-14 18:48:21 -07:00
Update User.php
This commit is contained in:
parent
736b3209bf
commit
8ea96c2224
1 changed files with 3 additions and 14 deletions
|
@ -178,6 +178,7 @@ class User
|
|||
WHERE session_id = '$session_id'
|
||||
LIMIT 1
|
||||
");
|
||||
// Update user_session_time
|
||||
}
|
||||
$this->set_session_cookies($this->data['user_id']);
|
||||
} else {
|
||||
|
@ -340,10 +341,10 @@ class User
|
|||
/**
|
||||
* Initialize sessiondata stored in cookies
|
||||
*
|
||||
* @param bool $update_lastvisit
|
||||
* @param bool $set_cookie
|
||||
* @throws Exception
|
||||
*/
|
||||
public function session_end(bool $update_lastvisit = false, bool $set_cookie = true)
|
||||
public function session_end(bool $set_cookie = true): void
|
||||
{
|
||||
Sessions::cache_rm_userdata($this->data);
|
||||
DB()->query("
|
||||
|
@ -352,18 +353,6 @@ class User
|
|||
");
|
||||
|
||||
if (!IS_GUEST) {
|
||||
if ($update_lastvisit) {
|
||||
DB()->query("
|
||||
UPDATE " . BB_USERS . " SET
|
||||
user_session_time = " . TIMENOW . ",
|
||||
user_lastvisit = " . TIMENOW . ",
|
||||
user_last_ip = '" . USER_IP . "',
|
||||
user_reg_ip = IF(user_reg_ip = '', '" . USER_IP . "', user_reg_ip)
|
||||
WHERE user_id = {$this->data['user_id']}
|
||||
LIMIT 1
|
||||
");
|
||||
}
|
||||
|
||||
if (isset($_REQUEST['reset_autologin'])) {
|
||||
$this->create_autologin_id($this->data, false);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue