-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
69 lines (43 loc) · 1.5 KB
/
index.php
File metadata and controls
69 lines (43 loc) · 1.5 KB
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
<!-- place me in /var/www/html/login.php -->
<html>
<head>
<!--
<?php
$debug = false;
$mapping['http://schemas_microsoft_com/ws/2008/06/identity/claims/role']['match']='admins';
$mapping['http://schemas_microsoft_com/ws/2008/06/identity/claims/role']['sql']="INSERT INTO icingaweb_group_membership (group_id, username) VALUES ('1', '".$_SERVER['MELLON_NAME_ID']."')";
$servername = "127.0.0.1";
$username = "root";
$password = "";
$dbname = "icingaweb2";
if ($debug == true) {
foreach($_SERVER as $key=>$value) {
if(substr($key, 0, 7) == 'MELLON_') {
echo($key . '=' . $value . "\r\n");
}
}
}
foreach($_SERVER as $key => $value) {
if(substr($key, 0, 7) == 'MELLON_' && isset($mapping[substr($key,7)])) {
$mellon_variable = substr($key,7);
echo($mellon_variable."\n");
if (isset($mapping[$mellon_variable])) {
if ($mapping[$mellon_variable]['match']==$value) {
echo 'matched:'.$mellon_variable."\n ==".$value;
$sql = $mapping[$mellon_variable]['sql'];
$conn = new mysqli($servername, $username, $password, $dbname);
if ($conn->query($sql) === TRUE) {
if ($debug == true) { echo "New record created successfully"; }
} else {
if ($debug == true) { echo "Error: " . $sql . "<br>" . $conn->error; }
}
}
}
}
}
?>-->
</head>
<body>
You are now logged in and should be automatically redirected to: <a href="/icingaweb2/">Icingaweb2</a>
</body>
</html>