forked from ChristianBeer/ProFTPd-Admin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
groups.php
99 lines (93 loc) · 3.64 KB
/
groups.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
<?php
/**
* This file is part of ProFTPd Admin
*
* @package ProFTPd-Admin
* @license http://www.gnu.org/licenses/gpl-2.0.txt GNU General Public License v2
*
* @copyright Lex Brugman <[email protected]>
* @copyright Christian Beer <[email protected]>
* @copyright Ricardo Padilha <[email protected]>
*
*/
include_once ("configs/config.php");
include_once ("includes/AdminClass.php");
global $cfg;
$ac = new AdminClass($cfg);
$groups = $ac->get_groups();
include ("includes/header.php");
?>
<?php include ("includes/messages.php"); ?>
<?php if(empty($groups)) { ?>
<div class="col-sm-12">
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">Groups</h3>
</div>
<div class="panel-body">
<div class="row">
<div class="col-sm-12">
<div class="form-group">
<p>Currently there are no groups available.</p>
</div>
<!-- Actions -->
<div class="form-group">
<a class="btn btn-primary pull-right" href="add_group.php" role="button">Add group »</a>
</div>
</div>
</div>
</div>
</div>
</div>
<?php } else { ?>
<div class="col-sm-12">
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">Groups</h3>
</div>
<div class="panel-body">
<div class="row">
<div class="col-sm-12 col-md-10 col-lg-8 center">
<!-- Group table -->
<div class="form-group">
<table class="table table-striped table-condensed sortable">
<thead>
<th>GID</th>
<th>Group</th>
<th class="hidden-sm hidden-md hidden-lg">Users</th>
<th class="hidden-xs">Main users</th>
<th class="hidden-xs">Additional users</th>
<th data-defaultsort="disabled"></th>
</thead>
<tbody>
<?php while (list($g_gid, $g_group) = each($groups)) {
$n_main = $ac->get_user_count_by_gid($g_gid);
$n_add = $ac->get_user_add_count_by_gid($g_gid); ?>
<tr>
<td class="pull-middle"><?php echo $g_gid; ?></td>
<td class="pull-middle"><a href="edit_group.php?action=show&<?php echo $cfg['field_gid']; ?>=<?php echo $g_gid; ?>"><?php echo $g_group; ?></a></td>
<td class="pull-middle hidden-sm hidden-md hidden-lg"><?php echo ($n_main + $n_add); ?></td>
<td class="pull-middle hidden-xs"><?php echo $n_main; ?></td>
<td class="pull-middle hidden-xs"><?php echo $n_add; ?></td>
<td class="pull-middle">
<div class="btn-toolbar pull-right" role="toolbar">
<a class="btn-group" role="group" href="edit_group.php?action=show&<?php echo $cfg['field_gid']; ?>=<?php echo $g_gid; ?>"><span class="glyphicon glyphicon-pencil" aria-hidden="true"></span></a>
<a class="btn-group" role="group" href="remove_group.php?action=remove&<?php echo $cfg['field_gid']; ?>=<?php echo $g_gid; ?>"><span class="glyphicon glyphicon-trash" aria-hidden="true"></span></a>
</div>
</td>
</tr>
<?php } ?>
</tbody>
</table>
</div>
<!-- Actions -->
<div class="form-group">
<a class="btn btn-primary pull-right" href="add_group.php" role="button">Add group »</a>
</div>
</div>
</div>
</div>
</div>
</div>
<?php } ?>
<?php include ("includes/footer.php"); ?>