log denied clients
This commit is contained in:
parent
c556c18617
commit
66e40c7222
|
@ -49,11 +49,13 @@ function startSecureSession() {
|
||||||
// check session id
|
// check session id
|
||||||
if (! isset($_SESSION["sec_session_id"]) || ($_SESSION["sec_session_id"] != session_id())) {
|
if (! isset($_SESSION["sec_session_id"]) || ($_SESSION["sec_session_id"] != session_id())) {
|
||||||
// session id is invalid
|
// session id is invalid
|
||||||
|
logNewMessage(LOG_WARNING, "Invalid session ID, access denied (" . $_SERVER['REMOTE_ADDR'] . ")");
|
||||||
die();
|
die();
|
||||||
}
|
}
|
||||||
// check if client IP has not changed
|
// check if client IP has not changed
|
||||||
if (!isset($_SESSION["sec_client_ip"]) || ($_SESSION["sec_client_ip"] != $_SERVER['REMOTE_ADDR'])) {
|
if (!isset($_SESSION["sec_client_ip"]) || ($_SESSION["sec_client_ip"] != $_SERVER['REMOTE_ADDR'])) {
|
||||||
// IP is invalid
|
// IP is invalid
|
||||||
|
logNewMessage(LOG_WARNING, "Client IP changed, access denied (" . $_SERVER['REMOTE_ADDR'] . ")");
|
||||||
die();
|
die();
|
||||||
}
|
}
|
||||||
// check if session time has not expired
|
// check if session time has not expired
|
||||||
|
@ -93,7 +95,10 @@ function checkClientIP() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// stop script is client may not access LAM
|
// stop script is client may not access LAM
|
||||||
if (!$grantAccess) die();
|
if (!$grantAccess) {
|
||||||
|
logNewMessage(LOG_WARNING, "Invalid client IP, access denied (" . $_SERVER['REMOTE_ADDR'] . ")");
|
||||||
|
die();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue