forked from ganglia/ganglia-web
-
Notifications
You must be signed in to change notification settings - Fork 3
/
login.php
29 lines (28 loc) · 1.03 KB
/
login.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<?php
require_once 'eval_conf.php';
if($conf['auth_system'] == 'enabled' && isSet($_SERVER['REMOTE_USER']) && !empty($_SERVER['REMOTE_USER']) ){
$auth = GangliaAuth::getInstance();
$auth->setAuthCookie($_SERVER['REMOTE_USER']);
$redirect_to = isSet( $_SERVER['HTTP_REFERER'] ) ? $_SERVER['HTTP_REFERER'] : 'index.php';
header("Location: $redirect_to");
die();
}
?>
<html>
<head>
<title>Authentication Failed</title>
</head>
<body>
<h1>We were unable to log you in.</h1>
<div>
<?php if( ! isSet($conf['auth_system'] ) ) { ?>
<code>$conf['auth_system']</code> is not defined.<br/> Please notify an administrator.
<?php } else if($conf['auth_system'] == 'disabled' || $conf['auth_system'] == 'readonly') { ?>
Authentication is disabled by Ganglia configuration.<br/>
<code>$conf['auth_system'] = '<?php echo $conf['auth_system']; ?>';</code>
<?php } else { ?>
Authentication is not configured correctly. The web server must provide an authenticated username.
<?php } ?>
</div>
</body>
</html>