-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathadmin_users.php
More file actions
67 lines (66 loc) · 2.05 KB
/
Copy pathadmin_users.php
File metadata and controls
67 lines (66 loc) · 2.05 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
<?php
include 'core/init.php';
protect_page();
// Small section to allow users to update their tutorial flag
if ( ! empty($_GET['action']) && ! empty($_GET['user_id'])) {
switch ($_GET['action']) {
case 'tutorial_end':
if ($_GET['user_id'] != $_SESSION['user_id']) {
echo json_encode("error");
exit;
}
update_user($_GET['user_id'], array('viewed_tutorial' => 1));
echo json_encode("success");
exit;
break;
}
}
admin_page();
include 'includes/overall/overall_header.php';
$users = get_user_list();
?>
<link rel="stylesheet" type="text/css" href="/javascript/datatables/media/css/jquery.dataTables.css">
<script type="text/javascript" charset="utf8" src="/javascript/datatables/media/js/jquery.dataTables.js"></script>
<h1><a href="admin.php">Administration</a> - Manage Users</h1>
<div>
<ul>
<li>Search all users</li>
<li>To edit a user, click on the username</li>
</ul>
<table id="users-table" class="hover stripe" style="cursor: pointer;">
<thead>
<tr>
<th>Username</th>
<th>Full Name</th>
<th>Email</th>
<th>Active</th>
<!-- <th>Type</th> -->
<!-- <th>Can Email?</th> -->
<th>Beta?</th>
<!-- <th>Active Project</th> -->
</tr>
</thead>
<tbody>
<?php foreach ($users as $user) : ?>
<tr>
<td><a href="admin_edit_user.php?user_id=<?php echo $user['user_id'];?>"><?php echo $user['username'];?></a></td>
<td><?php echo $user['first_name'] . ' ' . $user['last_name'];?></td>
<td><?php echo $user['email'];?></td>
<td><?php echo ($user['active']) ? 'Yes' : 'No';?></td>
<!-- <td><?php echo ($user['type']) ? 'Admin' : 'Normal';?></td> -->
<!-- <td><?php echo ($user['allow_email']) ? 'Yes' : 'No';?></td> -->
<td><?php echo ($user['beta']) ? 'Yes' : 'No';?></td>
<!-- <td><?php echo $user['active_project'];?></td> -->
</tr>
<?php endforeach; ?>
</tbody>
</table>
</div>
<script type="text/javascript">
$(document).ready( function () {
$('#users-table').DataTable({
"order": [[ 0, "asc" ]]
});
} );
</script>
<?php include 'includes/overall/overall_footer.php';