mirror of
https://github.com/ZoneMinder/zoneminder.git
synced 2025-12-23 22:37:53 -05:00
Handle user being undefined when not logged in
This commit is contained in:
@@ -92,12 +92,14 @@ class AppController extends Controller {
|
||||
if ( $stateful ) {
|
||||
zm_session_start();
|
||||
$_SESSION['remoteAddr'] = $_SERVER['REMOTE_ADDR']; // To help prevent session hijacking
|
||||
$_SESSION['username'] = $user->Username();
|
||||
if ( ZM_AUTH_RELAY == 'plain' ) {
|
||||
// Need to save this in session, can't use the value in User because it is hashed
|
||||
$_SESSION['password'] = $_REQUEST['password'];
|
||||
if ($user) {
|
||||
$_SESSION['username'] = $user->Username();
|
||||
if ( ZM_AUTH_RELAY == 'plain' ) {
|
||||
// Need to save this in session, can't use the value in User because it is hashed
|
||||
$_SESSION['password'] = $_REQUEST['password'];
|
||||
}
|
||||
generateAuthHash(ZM_AUTH_HASH_IPS);
|
||||
}
|
||||
generateAuthHash(ZM_AUTH_HASH_IPS);
|
||||
session_write_close();
|
||||
} else if ( isset($_COOKIE['ZMSESSID']) and !$user ) {
|
||||
# Have a cookie set, try to load user by session
|
||||
|
||||
Reference in New Issue
Block a user