forked from bbdoc/PoracleWeb
-
Notifications
You must be signed in to change notification settings - Fork 0
/
admin_tools.php
317 lines (223 loc) · 11 KB
/
admin_tools.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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
<?php
include "./header.php";
if (!isset($_SESSION['admin_id'])) {
header("Location: $redirect_url");
exit();
}
$num_dbs=0;
$dbnames = explode(",", $dbname);
foreach ($dbnames as &$db) {
$num_dbs=$num_dbs+1;
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="description" content="">
<meta name="author" content="">
<title><?php echo $title; ?> - Admin Tools</title>
<link rel="icon" type="image/x-icon" href="favicon.png" />
<!-- Custom fonts for this template-->
<link href="node_modules/@fortawesome/fontawesome-free/css/all.min.css" rel="stylesheet" type="text/css">
<link
href="https://fonts.googleapis.com/css?family=Nunito:200,200i,300,300i,400,400i,600,600i,700,700i,800,800i,900,900i"
rel="stylesheet">
<!-- Custom styles for this template-->
<link href="css/custom-bootstrap.css?v=<?=time();?>" rel="stylesheet">
<link href="https://cdn.jsdelivr.net/gh/gitbrent/[email protected]/css/bootstrap4-toggle.min.css"
rel="stylesheet">
<link rel="stylesheet" type="text/css" href="css/style.css?v=<?=time();?>">
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
</head>
<body id="page-top">
<!-- Page Wrapper -->
<div id="wrapper">
<!-- Content Wrapper -->
<div id="content-wrapper" class="d-flex flex-column">
<!-- Main Content -->
<div id="content">
<?php include "topbar.php" ?>
<!-- Begin Page Content -->
<div class="container-fluid col-lg-8 col-md-12">
<!-- Profile Settings Modal -->
<?php include "./modal/profile_settings_modal.php"; ?>
<!-- Title -->
<h4 class="modal-title m-2">
<center><?php echo i8ln("User & Channel Management"); ?></center>
</h4>
<hr>
<!-- BACK TO OWN ACCOUNT -->
<?php if ( isset($_SESSION['admin_id']) && $_SESSION['admin_id'] <> $_SESSION['id']) { ?>
<center>
<a href="admin_connect.php?id=<?php echo $_SESSION['admin_id']; ?>">
<button type="button" class="btn btn-success" style="width:300px;">
<?php echo i8ln("Back to own Account"); ?>
</button>
</a>
</center>
<hr>
<?php } ?>
<!-- User Access -->
<form action='./admin_connect.php' method='POST' class="row g-2 justify-content-center">
<div class="col-auto justify-center mb-1 mt-2">
<input type='text' autocomplete='off' class='form-control' id='id' name='id'
placeholder='<?php echo i8ln("Discord or Telegram ID") ?>'>
</div>
<div class="col-auto justify-center mb-1 mt-2">
<input class="btn btn-primary" type='submit' name='update'
value='<?php echo i8ln("Go"); ?>'>
</div>
</form>
<!-- Discord Users List -->
<?php
if (@$admin_disable_userlist <> "True" ) {
$dbnames = explode(",", $dbname);
foreach ($dbnames as &$db) {
$conn = new mysqli($dbhost.":".$dbport, $dbuser, $dbpass, $db);
$sql = "select id, name, type FROM humans WHERE type like '%:user' ORDER by type,name";
$result = $conn->query($sql);
?>
<?php if ($result->num_rows <> 0) { ?>
<hr>
<!-- Heading -->
<div class="row">
<div class="col">
<div class="alert alert-secondary text-center" role="alert">
<strong><?php echo i8ln("USERS LIST"); ?></strong>
<?php if ($num_dbs > 1) { echo "<br>".$db; } ?>
</div>
</div>
</div>
<div class='text-uppercase text-center'>
<?php while ($row = $result->fetch_assoc()) { ?>
<a href="admin_connect.php?id=<?php echo $row['id']; ?>"
class="btn btn-<?php if ($row['type']=='discord:user') { echo "primary"; } else { echo "info"; } ?> btn-icon-split m-1">
<span class="icon text-white-50">
<i class="fab fa-<?php echo rtrim($row['type'], ':user');?>"></i>
</span>
<span class="text" style="min-width: 130px;"><font size=1><?php echo $row['name']; ?></font></span>
</a>
<?php } ?>
</div>
<?php } ?>
<?php } ?>
<?php } ?>
<!-- Discord Channels -->
<?php
$dbnames = explode(",", $dbname);
foreach ($dbnames as &$db) {
$conn = new mysqli($dbhost.":".$dbport, $dbuser, $dbpass, $db);
$sql = "select id, name, type FROM humans WHERE type like 'discord:channel' ORDER by name";
$result = $conn->query($sql);
?>
<?php if ($result->num_rows <> 0) { ?>
<hr>
<!-- Heading -->
<div class="row">
<div class="col">
<div class="alert alert-secondary text-center" role="alert">
<strong><?php echo i8ln("DISCORD CHANNELS LIST"); ?></strong>
<?php if ($num_dbs > 1) { echo "<br>".$db; } ?>
</div>
</div>
</div>
<div id='discord' class='areasform text-uppercase text-center'>
<?php while ($row = $result->fetch_assoc()) { ?>
<a href="admin_connect.php?id=<?php echo $row['id']; ?>"
class="btn btn-primary btn-icon-split mr-2 mt-1">
<span class="icon text-white-50">
<i class="fab fa-discord"></i>
</span>
<span class="text" style="width:250px;"><?php echo $row['name']; ?></span>
</a>
<?php } ?>
</div>
<?php } ?>
<?php } ?>
<!-- Telegram Channels -->
<?php
$dbnames = explode(",", $dbname);
foreach ($dbnames as &$db) {
$conn = new mysqli($dbhost.":".$dbport, $dbuser, $dbpass, $db);
$sql = "select id, name, type FROM humans WHERE type like 'telegram:channel' ORDER by name";
$result = $conn->query($sql);
?>
<?php if ($result->num_rows <> 0) { ?>
<hr>
<!-- Heading -->
<div class="row">
<div class="col">
<div class="alert alert-secondary text-center" role="alert">
<strong><?php echo i8ln("TELEGRAM CHANNELS LIST"); ?></strong>
<?php if ($num_dbs > 1) { echo "<br>".$db; } ?>
</div>
</div>
</div>
<div id='discord' class='areasform text-uppercase text-center'>
<?php while ($row = $result->fetch_assoc()) { ?>
<a href="admin_connect.php?id=<?php echo $row['id']; ?>"
class="btn btn-info btn-icon-split mr-2 mt-1">
<span class="icon text-white-50">
<i class="fab fa-telegram"></i>
</span>
<span class="text" style="width:250px;"><?php echo $row['name']; ?></span>
</a>
<?php } ?>
</div>
<?php } ?>
<?php } ?>
<!-- Webhooks -->
<?php
$dbnames = explode(",", $dbname);
foreach ($dbnames as &$db) {
$conn = new mysqli($dbhost.":".$dbport, $dbuser, $dbpass, $db);
$sql = "select id, name, type FROM humans WHERE type like 'webhook' ORDER by name";
$result = $conn->query($sql);
?>
<?php if ($result->num_rows <> 0) { ?>
<hr>
<!-- Heading -->
<div class="row">
<div class="col">
<div class="alert alert-secondary text-center" role="alert">
<strong><?php echo i8ln("WEBHOOKS LIST"); ?></strong>
<?php if ($num_dbs > 1) { echo "<br>".$db; } ?>
</div>
</div>
</div>
<div id='discord' class='areasform text-uppercase text-center'>
<?php while ($row = $result->fetch_assoc()) { ?>
<a href="admin_connect.php?id=<?php echo $row['id']; ?>"
class="btn btn-secondary btn-icon-split mr-2 mt-1">
<span class="icon text-white-50">
<font size=1>WH</font>
</span>
<span class="text" style="width:250px;"><?php echo $row['name']; ?></span>
</a>
<?php } ?>
</div>
<?php } ?>
<?php } ?>
</div>
</div>
<!-- End of Main Content -->
</div>
<!-- End of Content Wrapper -->
</div>
<!-- End of Page Wrapper -->
<!-- Logout Modal-->
<?php include "./modal/logout_modal.php"; ?>
<!-- Bootstrap core JavaScript-->
<script src="node_modules/jquery/dist/jquery.min.js"></script>
<script src="node_modules/bootstrap/dist/js/bootstrap.bundle.min.js"></script>
<!-- Core plugin JavaScript-->
<script src="node_modules/jquery.easing/jquery.easing.min.js"></script>
<!-- Custom scripts for all pages-->
<script src="js/scripts.js"></script>
<script src="https://cdn.jsdelivr.net/gh/gitbrent/[email protected]/js/bootstrap4-toggle.min.js"></script>
<br>
</body>
</html>