This repository has been archived by the owner on May 20, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 93
/
credentials.php
86 lines (85 loc) · 3.04 KB
/
credentials.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
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
<?php
// include files
require_once("includes/check-authorize.php");
require_once("includes/functions.php");
$empire_credentials = "";
$arr_result = get_credentials($sess_ip, $sess_port, $sess_token);
if(array_key_exists("error", $arr_result))
{
$empire_credentials = "<div class='alert alert-danger'><span class='glyphicon glyphicon-remove'></span> ".ucfirst(htmlentities($arr_result["error"]))."</div>";
}
else
{
if(is_array($arr_result))
{
if(!empty($arr_result))
{
$empire_credentials .= '<table class="table table-hover table-striped"><thead><tr>';
if(array_key_exists("creds",$arr_result))
{
if(sizeof($arr_result["creds"])>0)
{
foreach($arr_result["creds"][0] as $key => $value)
{
$empire_credentials .= '<th>'.htmlentities($key).'</th>';
}
for($i=0; $i<sizeof($arr_result["creds"]); $i++)
{
$empire_credentials .= "<tr>";
foreach($arr_result["creds"][$i] as $key => $value)
{
$value = htmlentities($value);
$empire_credentials .= "<td>$value</td>";
}
$empire_credentials .= "</tr>";
}
$empire_credentials .= '</tbody></table>';
}
else
{
$empire_credentials = "<div class='alert alert-danger'><span class='glyphicon glyphicon-remove'></span> No credentials found.</div>";
}
}
else
{
$empire_credentials = "<div class='alert alert-danger'><span class='glyphicon glyphicon-remove'></span> Unexpected response.</div>";
}
}
else
{
$empire_credentials = "<div class='alert alert-danger'><span class='glyphicon glyphicon-remove'></span> Unexpected response.</div>";
}
}
else
{
if(!empty($arr_result))
{
$empire_credentials = "<div class='alert alert-danger'><span class='glyphicon glyphicon-remove'></span> ".ucfirst(htmlentities($arr_result["error"]))."</div>";
}
else
{
$empire_credentials = "<div class='alert alert-danger'><span class='glyphicon glyphicon-remove'></span> Unexpected response.</div>";
}
}
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<title>Empire: Credentials</title>
<?php @require_once("includes/head-section.php"); ?>
</head>
<body>
<div class="container">
<?php @require_once("includes/navbar.php"); ?>
<br>
<div class="panel-group">
<div class="panel panel-primary">
<div class="panel-heading">Credentials</div>
<div class="panel-body"><?php echo $empire_credentials; ?></div>
</div>
</div><br>
</div>
<?php @require_once("includes/footer.php"); ?>
</body>
</html>