allow simple authentication checks wihtout logout

This commit is contained in:
Sebastian Grewe 2013-09-09 07:45:55 +02:00
parent 3c7bb41f81
commit 5c11c74974

View File

@ -651,14 +651,14 @@ class User {
* @param none * @param none
* @return bool * @return bool
**/ **/
public function isAuthenticated() { public function isAuthenticated($logout=true) {
$this->debug->append("STA " . __METHOD__, 4); $this->debug->append("STA " . __METHOD__, 4);
if (@$_SESSION['AUTHENTICATED'] == true && if (@$_SESSION['AUTHENTICATED'] == true &&
!$this->isLocked($_SESSION['USERDATA']['id']) && !$this->isLocked($_SESSION['USERDATA']['id']) &&
$this->getUserIp($_SESSION['USERDATA']['id']) == $_SERVER['REMOTE_ADDR'] $this->getUserIp($_SESSION['USERDATA']['id']) == $_SERVER['REMOTE_ADDR']
) return true; ) return true;
// Catchall // Catchall
$this->logoutUser(); if ($logout == true) $this->logoutUser();
return false; return false;
} }
} }