1
0
mirror of https://github.com/Mailu/Mailu.git synced 2025-07-15 01:24:34 +02:00

fixed health check

This commit is contained in:
Alexander Graf
2021-12-18 16:43:18 +01:00
parent e7e283663d
commit b3d48cc20f

View File

@ -18,6 +18,13 @@ class mailu extends rcube_plugin
$args['action'] = 'login';
}
$ua = $_SERVER['HTTP_USER_AGENT'];
$ra = $_SERVER['REMOTE_ADDR'];
if ($ua == 'health' and ($ra == '127.0.0.1' or $ra == '::1')) {
print('OK');
exit();
}
return $args;
}
@ -59,13 +66,7 @@ class mailu extends rcube_plugin
function login_failed($args)
{
$ua = $_SERVER['HTTP_USER_AGENT'];
$ra = $_SERVER['REMOTE_ADDR'];
if ($ua == 'health' and ($ra == '127.0.0.1' or $ra == '::1')) {
print('OK');
} else {
header('Location: sso.php');
}
exit();
}