diff --git a/auth_login.php b/auth_login.php index c4275ef399..7b1c55211b 100644 --- a/auth_login.php +++ b/auth_login.php @@ -94,6 +94,13 @@ if ($action == 'login') { /* Locate user in database */ $user = db_fetch_row_prepared('SELECT * FROM user_auth WHERE username = ? AND realm = 2', array($username)); + if (!$user) { + cacti_log("AUTH LOGIN: User " . $username . " authenticated by web server but not found in Cacti database."); + $username = htmlspecialchars($username); + auth_display_custom_error_message("$username is not authorized to use Cacti."); + exit; + } + break; case '3': /* LDAP Auth */