This repository has been archived by the owner on Dec 24, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathadmin_users.php
82 lines (70 loc) · 1.55 KB
/
admin_users.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
<?php
/*
UserNougat
https://github.com/Etuldan/UserNougat
*/
require_once("models/config.php");
if (!securePage($_SERVER['PHP_SELF'])){die();}
//Forms posted
if(!empty($_POST))
{
$deletions = $_POST['delete'];
if ($deletion_count = deleteUsers($deletions)){
$successes[] = lang("ACCOUNT_DELETIONS_SUCCESSFUL", array($deletion_count));
}
else {
$errors[] = lang("SQL_ERROR");
}
}
$userData = fetchAllUsers(); //Fetch information for all users
require_once("models/header.php");
echo "
<body>
<div id='wrapper'>
<div id='top'><div id='logo'></div></div>
<div id='content'>
<h1>UserNougat</h1>
<h2>Admin Users</h2>
<div id='left-nav'>";
include("left-nav.php");
echo "
</div>
<div id='main'>";
echo resultBlock($errors,$successes);
echo "
<form name='adminUsers' action='".$_SERVER['PHP_SELF']."' method='post'>
<table class='admin'>
<tr>
<th>Delete</th><th>Username</th><th>Display Name</th><th>Title</th><th>Last Sign In</th>
</tr>";
//Cycle through users
foreach ($userData as $v1) {
echo "
<tr>
<td><input type='checkbox' name='delete[".$v1['id']."]' id='delete[".$v1['id']."]' value='".$v1['id']."'></td>
<td><a href='admin_user.php?id=".$v1['id']."'>".$v1['user_name']."</a></td>
<td>".$v1['display_name']."</td>
<td>".$v1['title']."</td>
<td>
";
//Interprety last login
if ($v1['last_sign_in_stamp'] == '0'){
echo "Never";
}
else {
echo date("j M, Y", $v1['last_sign_in_stamp']);
}
echo "
</td>
</tr>";
}
echo "
</table>
<input type='submit' name='Submit' value='Delete' />
</form>
</div>
<div id='bottom'></div>
</div>
</body>
</html>";
?>