Skip to content

Commit

Permalink
Error if no user id was saved in cookie #630
Browse files Browse the repository at this point in the history
  • Loading branch information
Fasse committed Jun 26, 2017
1 parent fbd6192 commit 14fc8cb
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions adm_program/system/classes/session.php
Original file line number Diff line number Diff line change
Expand Up @@ -298,14 +298,17 @@ public function refreshAutoLogin()
$autoLoginParts = explode(':', $_COOKIE[$this->cookieAutoLoginId]);
$userId = $autoLoginParts[0];

$sql = 'UPDATE '.TBL_AUTO_LOGIN.' SET atl_number_invalid = atl_number_invalid + 1
WHERE atl_usr_id = '.$userId;
$this->db->query($sql);

$sql = 'DELETE FROM '.TBL_AUTO_LOGIN.'
WHERE atl_usr_id = '.$userId.'
AND atl_number_invalid > 3 ';
$this->db->query($sql);
if($userId > 0)
{
$sql = 'UPDATE '.TBL_AUTO_LOGIN.' SET atl_number_invalid = atl_number_invalid + 1
WHERE atl_usr_id = '.$userId;
$this->db->query($sql);

$sql = 'DELETE FROM '.TBL_AUTO_LOGIN.'
WHERE atl_usr_id = '.$userId.'
AND atl_number_invalid > 3 ';
$this->db->query($sql);
}
}
}
}
Expand Down

0 comments on commit 14fc8cb

Please sign in to comment.