[Web] Fix autodiscover triggering fail2ban implementation, fixes #1069
This commit is contained in:
parent
035b153445
commit
eb4dd632ae
@ -36,9 +36,8 @@ $opt = [
|
||||
$pdo = new PDO($dsn, $database_user, $database_pass, $opt);
|
||||
$login_user = strtolower(trim($_SERVER['PHP_AUTH_USER']));
|
||||
$login_pass = trim(htmlspecialchars_decode($_SERVER['PHP_AUTH_PW']));
|
||||
$login_role = check_login($login_user, $login_pass);
|
||||
|
||||
if (!isset($_SERVER['PHP_AUTH_USER']) OR $login_role !== "user") {
|
||||
if (empty($_SERVER['PHP_AUTH_USER']) || empty($_SERVER['PHP_AUTH_PW'])) {
|
||||
try {
|
||||
$json = json_encode(
|
||||
array(
|
||||
@ -62,9 +61,10 @@ if (!isset($_SERVER['PHP_AUTH_USER']) OR $login_role !== "user") {
|
||||
header('HTTP/1.0 401 Unauthorized');
|
||||
exit(0);
|
||||
}
|
||||
else {
|
||||
if (isset($_SERVER['PHP_AUTH_USER']) && isset($_SERVER['PHP_AUTH_PW'])) {
|
||||
if ($login_role === "user") {
|
||||
|
||||
$login_role = check_login($login_user, $login_pass);
|
||||
|
||||
if ($login_role === "user") {
|
||||
header("Content-Type: application/xml");
|
||||
echo '<?xml version="1.0" encoding="utf-8" ?>' . PHP_EOL;
|
||||
?>
|
||||
@ -214,7 +214,5 @@ else {
|
||||
?>
|
||||
</Autodiscover>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
Loading…
Reference in New Issue
Block a user