fixed health check

master
Alexander Graf 3 years ago
parent e7e283663d
commit b3d48cc20f
No known key found for this signature in database
GPG Key ID: B8A9DC143E075629

@ -18,6 +18,13 @@ class mailu extends rcube_plugin
$args['action'] = 'login'; $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; return $args;
} }
@ -59,13 +66,7 @@ class mailu extends rcube_plugin
function login_failed($args) 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'); header('Location: sso.php');
}
exit(); exit();
} }

Loading…
Cancel
Save