Project

General

Profile

Download (16.4 KB) Statistics
| Branch: | Tag: | Revision:
1 4c291f4c Renato Botelho
<?php
2 fab7ff44 Bill Marquette
/*
3 4c291f4c Renato Botelho
	$Id: system_groupmanager.php
4 d88c6a9f Scott Ullrich
	part of m0n0wall (http://m0n0.ch/wall)
5
6 6b07c15a Matthew Grooms
	Copyright (C) 2008 Shrew Soft Inc.
7 4c291f4c Renato Botelho
	All rights reserved.
8 6b07c15a Matthew Grooms
9 d88c6a9f Scott Ullrich
	Copyright (C) 2005 Paul Taylor <paultaylor@winn-dixie.com>.
10 4c291f4c Renato Botelho
	All rights reserved.
11 d88c6a9f Scott Ullrich
12
	Copyright (C) 2003-2005 Manuel Kasper <mk@neon1.net>.
13
	All rights reserved.
14 4c291f4c Renato Botelho
15 d88c6a9f Scott Ullrich
	Redistribution and use in source and binary forms, with or without
16
	modification, are permitted provided that the following conditions are met:
17 4c291f4c Renato Botelho
18 d88c6a9f Scott Ullrich
	1. Redistributions of source code must retain the above copyright notice,
19
	   this list of conditions and the following disclaimer.
20 4c291f4c Renato Botelho
21 d88c6a9f Scott Ullrich
	2. Redistributions in binary form must reproduce the above copyright
22
	   notice, this list of conditions and the following disclaimer in the
23
	   documentation and/or other materials provided with the distribution.
24 4c291f4c Renato Botelho
25 d88c6a9f Scott Ullrich
	THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
26
	INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
27
	AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
28
	AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
29
	OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
30
	SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
31
	INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
32
	CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
33
	ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
34
	POSSIBILITY OF SUCH DAMAGE.
35 fab7ff44 Bill Marquette
*/
36 1d333258 Scott Ullrich
/*
37
	pfSense_MODULE:	auth
38
*/
39 fab7ff44 Bill Marquette
40 6b07c15a Matthew Grooms
##|+PRIV
41
##|*IDENT=page-system-groupmanager
42
##|*NAME=System: Group manager page
43
##|*DESCR=Allow access to the 'System: Group manager' page.
44
##|*MATCH=system_groupmanager.php*
45
##|-PRIV
46 fab7ff44 Bill Marquette
47 3fa86ecd sullrich
require("guiconfig.inc");
48 d88c6a9f Scott Ullrich
49 bbf825ab Vinicius Coque
$pgtitle = array(gettext("System"), gettext("Group manager"));
50 fab7ff44 Bill Marquette
51 6b07c15a Matthew Grooms
if (!is_array($config['system']['group']))
52
	$config['system']['group'] = array();
53 d81c2ad1 Scott Ullrich
54 6b07c15a Matthew Grooms
$a_group = &$config['system']['group'];
55 d81c2ad1 Scott Ullrich
56 6b07c15a Matthew Grooms
$id = $_GET['id'];
57
if (isset($_POST['id']))
58
	$id = $_POST['id'];
59 d81c2ad1 Scott Ullrich
60 6b07c15a Matthew Grooms
if ($_GET['act'] == "delgroup") {
61 31b53653 Scott Ullrich
62 6b07c15a Matthew Grooms
	if (!$a_group[$_GET['id']]) {
63
		pfSenseHeader("system_groupmanager.php");
64
		exit;
65
	}
66 31b53653 Scott Ullrich
67 920dbb26 Renato Botelho
	conf_mount_rw();
68 659fa7f2 Matthew Grooms
	local_group_del($a_group[$_GET['id']]);
69 920dbb26 Renato Botelho
	conf_mount_ro();
70 6b07c15a Matthew Grooms
	$groupdeleted = $a_group[$_GET['id']]['name'];
71
	unset($a_group[$_GET['id']]);
72
	write_config();
73
	$savemsg = gettext("Group")." {$groupdeleted} ".
74 8cd558b6 ayvis
				gettext("successfully deleted")."<br />";
75 fab7ff44 Bill Marquette
}
76 d88c6a9f Scott Ullrich
77 6b07c15a Matthew Grooms
if ($_GET['act'] == "delpriv") {
78 fab7ff44 Bill Marquette
79 6b07c15a Matthew Grooms
	if (!$a_group[$_GET['id']]) {
80
		pfSenseHeader("system_groupmanager.php");
81
		exit;
82
	}
83 fab7ff44 Bill Marquette
84 6b07c15a Matthew Grooms
	$privdeleted = $priv_list[$a_group[$id]['priv'][$_GET['privid']]]['name'];
85
	unset($a_group[$id]['priv'][$_GET['privid']]);
86
87 2ee08031 Erik Fonnesbeck
	if (is_array($a_group[$id]['member'])) {
88
		foreach ($a_group[$id]['member'] as $uid) {
89
			$user = getUserEntryByUID($uid);
90
			if ($user)
91
				local_user_set($user);
92
		}
93 d88c6a9f Scott Ullrich
	}
94 6b07c15a Matthew Grooms
95
	write_config();
96
	$_GET['act'] = "edit";
97
	$savemsg = gettext("Privilege")." {$privdeleted} ".
98 8cd558b6 ayvis
				gettext("successfully deleted")."<br />";
99 6b07c15a Matthew Grooms
}
100 45ee90ed Matthew Grooms
101
if($_GET['act']=="edit"){
102
	if (isset($id) && $a_group[$id]) {
103
		$pconfig['name'] = $a_group[$id]['name'];
104 6b07c15a Matthew Grooms
		$pconfig['gid'] = $a_group[$id]['gid'];
105
		$pconfig['gtype'] = $a_group[$id]['scope'];
106 45ee90ed Matthew Grooms
		$pconfig['description'] = $a_group[$id]['description'];
107 6b07c15a Matthew Grooms
		$pconfig['members'] = $a_group[$id]['member'];
108
		$pconfig['priv'] = $a_group[$id]['priv'];
109 45ee90ed Matthew Grooms
	}
110
}
111 6b07c15a Matthew Grooms
112 fab7ff44 Bill Marquette
if ($_POST) {
113
114 d88c6a9f Scott Ullrich
	unset($input_errors);
115
	$pconfig = $_POST;
116
117
	/* input validation */
118
	$reqdfields = explode(" ", "groupname");
119 b4fd804b Carlos Eduardo Ramos
	$reqdfieldsn = array(gettext("Group Name"));
120 4c291f4c Renato Botelho
121 1e9b4611 Renato Botelho
	do_input_validation($_POST, $reqdfields, $reqdfieldsn, $input_errors);
122 4c291f4c Renato Botelho
123 d88c6a9f Scott Ullrich
	if (preg_match("/[^a-zA-Z0-9\.\-_ ]/", $_POST['groupname']))
124 bbf825ab Vinicius Coque
		$input_errors[] = gettext("The group name contains invalid characters.");
125 4c291f4c Renato Botelho
126 3db408b3 PiBa-NL
	if (strlen($_POST['groupname']) > 16)
127
		$input_errors[] = gettext("The group name is longer than 16 characters.");
128 4c291f4c Renato Botelho
129 d88c6a9f Scott Ullrich
	if (!$input_errors && !(isset($id) && $a_group[$id])) {
130
		/* make sure there are no dupes */
131
		foreach ($a_group as $group) {
132
			if ($group['name'] == $_POST['groupname']) {
133 bbf825ab Vinicius Coque
				$input_errors[] = gettext("Another entry with the same group name already exists.");
134 d88c6a9f Scott Ullrich
				break;
135
			}
136
		}
137
	}
138 4c291f4c Renato Botelho
139 d88c6a9f Scott Ullrich
	if (!$input_errors) {
140 45ee90ed Matthew Grooms
		$group = array();
141 d88c6a9f Scott Ullrich
		if (isset($id) && $a_group[$id])
142
			$group = $a_group[$id];
143 4c291f4c Renato Botelho
144 d88c6a9f Scott Ullrich
		$group['name'] = $_POST['groupname'];
145
		$group['description'] = $_POST['description'];
146 45ee90ed Matthew Grooms
147 70d6b5c4 Ermal
		if (empty($_POST['members']))
148
			unset($group['member']);
149
		else if ($group['gid'] != 1998) // all group
150 6b07c15a Matthew Grooms
			$group['member'] = $_POST['members'];
151 45ee90ed Matthew Grooms
152 d88c6a9f Scott Ullrich
		if (isset($id) && $a_group[$id])
153
			$a_group[$id] = $group;
154 45ee90ed Matthew Grooms
		else {
155
			$group['gid'] = $config['system']['nextgid']++;
156 d88c6a9f Scott Ullrich
			$a_group[] = $group;
157 45ee90ed Matthew Grooms
		}
158
159 920dbb26 Renato Botelho
		conf_mount_rw();
160 659fa7f2 Matthew Grooms
		local_group_set($group);
161 920dbb26 Renato Botelho
		conf_mount_ro();
162 2a0e8512 jim-p
163
		/* Refresh users in this group since their privileges may have changed. */
164 5709072a jim-p
		if (is_array($group['member'])) {
165
			$a_user = &$config['system']['user'];
166
			foreach ($a_user as & $user) {
167
				if (in_array($user['uid'], $group['member']))
168
					local_user_set($user);
169
			}
170 2a0e8512 jim-p
		}
171
172 d88c6a9f Scott Ullrich
		write_config();
173 4c291f4c Renato Botelho
174 d88c6a9f Scott Ullrich
		header("Location: system_groupmanager.php");
175
		exit;
176
	}
177 fab7ff44 Bill Marquette
}
178
179
include("head.inc");
180
181
?>
182 45ee90ed Matthew Grooms
183
<body link="#000000" vlink="#000000" alink="#000000" onload="<?= $jsevents["body"]["onload"] ?>">
184 6b07c15a Matthew Grooms
<?php include("fbegin.inc"); ?>
185 9dfaf533 Colin Fleming
<script type="text/javascript">
186
//<![CDATA[
187 6b07c15a Matthew Grooms
188
function setall_selected(id) {
189
	selbox = document.getElementById(id);
190
	count = selbox.options.length;
191
	for (index = 0; index<count; index++)
192
		selbox.options[index].selected = true;
193
}
194
195
function clear_selected(id) {
196
	selbox = document.getElementById(id);
197
	count = selbox.options.length;
198
	for (index = 0; index<count; index++)
199
		selbox.options[index].selected = false;
200
}
201
202
function remove_selected(id) {
203
	selbox = document.getElementById(id);
204
	index = selbox.options.length - 1;
205
	for (; index >= 0; index--)
206
		if (selbox.options[index].selected)
207
			selbox.remove(index);
208
}
209
210
function copy_selected(srcid, dstid) {
211
	src_selbox = document.getElementById(srcid);
212
	dst_selbox = document.getElementById(dstid);
213 4c4c59b9 Renato Botelho
	count = dst_selbox.options.length;
214
	for (index = count - 1; index >= 0; index--) {
215
		if (dst_selbox.options[index].value == '') {
216
			dst_selbox.remove(index);
217
		}
218
	}
219 6b07c15a Matthew Grooms
	count = src_selbox.options.length;
220
	for (index = 0; index < count; index++) {
221
		if (src_selbox.options[index].selected) {
222
			option = document.createElement('option');
223
			option.text = src_selbox.options[index].text;
224
			option.value = src_selbox.options[index].value;
225
			dst_selbox.add(option, null);
226
		}
227
	}
228
}
229
230
function move_selected(srcid, dstid) {
231
	copy_selected(srcid, dstid);
232
	remove_selected(srcid);
233
}
234
235
function presubmit() {
236
	clear_selected('notmembers');
237
	setall_selected('members');
238
}
239
240 9dfaf533 Colin Fleming
//]]>
241 6b07c15a Matthew Grooms
</script>
242 fab7ff44 Bill Marquette
<?php
243 45ee90ed Matthew Grooms
	if ($input_errors)
244
		print_input_errors($input_errors);
245
	if ($savemsg)
246
		print_info_box($savemsg);
247 fab7ff44 Bill Marquette
?>
248 9dfaf533 Colin Fleming
<table width="100%" border="0" cellpadding="0" cellspacing="0" summary="group manager">
249 45ee90ed Matthew Grooms
	<tr>
250 e30001cf Matthew Grooms
		<td>
251 4c291f4c Renato Botelho
<?php
252
			$tab_array = array();
253
			$tab_array[] = array(gettext("Users"), false, "system_usermanager.php");
254
			$tab_array[] = array(gettext("Groups"), true, "system_groupmanager.php");
255
			$tab_array[] = array(gettext("Settings"), false, "system_usermanager_settings.php");
256
			$tab_array[] = array(gettext("Servers"), false, "system_authservers.php");
257
			display_top_tabs($tab_array);
258
?>
259 45ee90ed Matthew Grooms
		</td>
260 4c291f4c Renato Botelho
	</tr>
261 45ee90ed Matthew Grooms
	<tr>
262 e30001cf Matthew Grooms
		<td id="mainarea">
263
			<div class="tabcont">
264
265 4c291f4c Renato Botelho
<?php
266
			if($_GET['act']=="new" || $_GET['act']=="edit"):
267
?>
268 e30001cf Matthew Grooms
				<form action="system_groupmanager.php" method="post" name="iform" id="iform" onsubmit="presubmit()">
269 9dfaf533 Colin Fleming
					<table width="100%" border="0" cellpadding="6" cellspacing="0" summary="main area">
270 4c291f4c Renato Botelho
<?php
271
						$ro = "";
272
						if ($pconfig['gtype'] == "system")
273
							$ro = "readonly=\"readonly\"";
274
?>
275 e30001cf Matthew Grooms
						<tr>
276
							<td width="22%" valign="top" class="vncell"><?=gettext("Defined by");?></td>
277
							<td width="78%" class="vtable">
278
								<strong><?=strtoupper($pconfig['gtype']);?></strong>
279 dd5bf424 Scott Ullrich
								<input name="gtype" type="hidden" value="<?=htmlspecialchars($pconfig['gtype'])?>"/>
280 e30001cf Matthew Grooms
							</td>
281
						</tr>
282 4c291f4c Renato Botelho
						<tr>
283 bbf825ab Vinicius Coque
							<td width="22%" valign="top" class="vncellreq"><?=gettext("Group name");?></td>
284 4c291f4c Renato Botelho
							<td width="78%" class="vtable">
285 3db408b3 PiBa-NL
								<input name="groupname" type="text" class="formfld group" id="groupname" size="20" maxlength="16" value="<?=htmlspecialchars($pconfig['name']);?>" <?=$ro;?> />
286 e30001cf Matthew Grooms
							</td>
287
						</tr>
288 4c291f4c Renato Botelho
						<tr>
289 bbf825ab Vinicius Coque
							<td width="22%" valign="top" class="vncell"><?=gettext("Description");?></td>
290 4c291f4c Renato Botelho
							<td width="78%" class="vtable">
291 9dfaf533 Colin Fleming
								<input name="description" type="text" class="formfld unknown" id="description" size="20" value="<?=htmlspecialchars($pconfig['description']);?>" />
292 8cd558b6 ayvis
								<br />
293 bbf825ab Vinicius Coque
								<?=gettext("Group description, for your own information only");?>
294 e30001cf Matthew Grooms
							</td>
295
						</tr>
296 4c291f4c Renato Botelho
<?php
297
					if ($pconfig['gid'] != 1998): // all users group
298
?>
299 e30001cf Matthew Grooms
						<tr>
300
							<td width="22%" valign="top" class="vncell"><?=gettext("Group Memberships");?></td>
301
							<td width="78%" class="vtable" align="center">
302 9dfaf533 Colin Fleming
								<table class="tabcont" width="100%" border="0" cellpadding="0" cellspacing="0" summary="membership">
303 e30001cf Matthew Grooms
									<tr>
304
										<td align="center" width="50%">
305 8cd558b6 ayvis
											<strong><?=gettext("Not Members");?></strong><br />
306
											<br />
307 9dfaf533 Colin Fleming
												<select size="10" style="width: 75%" name="notmembers[]" class="formselect" id="notmembers" onchange="clear_selected('members')" multiple="multiple">
308 4c291f4c Renato Botelho
<?php
309
											$rowIndex = 0;
310
											foreach ($config['system']['user'] as $user):
311
												if (is_array($pconfig['members']) && in_array($user['uid'],$pconfig['members']))
312
													continue;
313
												$rowIndex++;
314
?>
315 e30001cf Matthew Grooms
												<option value="<?=$user['uid'];?>" <?=$selected;?>>
316
													<?=htmlspecialchars($user['name']);?>
317
												</option>
318 4c291f4c Renato Botelho
<?php
319
											endforeach;
320
											if ($rowIndex == 0)
321
												echo "<option></option>";
322
?>
323 e30001cf Matthew Grooms
											</select>
324 8cd558b6 ayvis
											<br />
325 e30001cf Matthew Grooms
										</td>
326
										<td>
327 8cd558b6 ayvis
											<br />
328 e30001cf Matthew Grooms
											<a href="javascript:move_selected('notmembers','members')">
329 bbf825ab Vinicius Coque
												<img src="/themes/<?= $g['theme'];?>/images/icons/icon_right.gif" title="<?=gettext("Add Members");?>" alt="<?=gettext("Add Members");?>" width="17" height="17" border="0" />
330 e30001cf Matthew Grooms
											</a>
331 8cd558b6 ayvis
											<br /><br />
332 e30001cf Matthew Grooms
											<a href="javascript:move_selected('members','notmembers')">
333 bbf825ab Vinicius Coque
												<img src="/themes/<?= $g['theme'];?>/images/icons/icon_left.gif" title="<?=gettext("Remove Members");?>" alt="<?=gettext("Remove Members");?>" width="17" height="17" border="0" />
334 e30001cf Matthew Grooms
											</a>
335
										</td>
336
										<td align="center" width="50%">
337 8cd558b6 ayvis
											<strong><?=gettext("Members");?></strong><br />
338
											<br />
339 9dfaf533 Colin Fleming
											<select size="10" style="width: 75%" name="members[]" class="formselect" id="members" onchange="clear_selected('notmembers')" multiple="multiple">
340 4c291f4c Renato Botelho
<?php
341
											$rowIndex = 0;
342
											foreach ($config['system']['user'] as $user):
343
												if (!(is_array($pconfig['members']) && in_array($user['uid'],$pconfig['members'])))
344
													continue;
345
												$rowIndex++;
346
?>
347 e30001cf Matthew Grooms
												<option value="<?=$user['uid'];?>">
348
													<?=htmlspecialchars($user['name']);?>
349
												</option>
350 4c291f4c Renato Botelho
<?php
351
											endforeach;
352
											if ($rowIndex == 0)
353
												echo "<option></option>";
354
?>
355 e30001cf Matthew Grooms
											</select>
356 8cd558b6 ayvis
											<br />
357 e30001cf Matthew Grooms
										</td>
358
									</tr>
359
								</table>
360
								<?=gettext("Hold down CTRL (pc)/COMMAND (mac) key to select multiple items");?>
361
							</td>
362
						</tr>
363 4c291f4c Renato Botelho
<?php
364
					endif;
365
					if($_GET['act'] != "new"):
366
?>
367 e30001cf Matthew Grooms
						<tr>
368
							<td width="22%" valign="top" class="vncell"><?=gettext("Assigned Privileges");?></td>
369
							<td width="78%" class="vtable">
370 9dfaf533 Colin Fleming
								<table class="tabcont" width="100%" border="0" cellpadding="0" cellspacing="0" summary="privileges">
371 e30001cf Matthew Grooms
									<tr>
372
										<td width="40%" class="listhdrr"><?=gettext("Name");?></td>
373
										<td width="60%" class="listhdrr"><?=gettext("Description");?></td>
374
										<td class="list"></td>
375
									</tr>
376 4c291f4c Renato Botelho
<?php
377
							if(is_array($pconfig['priv'])):
378
								$i = 0;
379
								foreach ($pconfig['priv'] as $priv):
380
?>
381 e30001cf Matthew Grooms
									<tr>
382
										<td class="listr">
383
											<?=htmlspecialchars($priv_list[$priv]['name']);?>
384
										</td>
385
										<td class="listbg">
386 33300c73 Scott Ullrich
											<?=htmlspecialchars($priv_list[$priv]['descr']);?>
387 e30001cf Matthew Grooms
										</td>
388 9dfaf533 Colin Fleming
										<td valign="middle" class="list nowrap">
389
											<a href="system_groupmanager.php?act=delpriv&amp;id=<?=htmlspecialchars($id)?>&amp;privid=<?=$i;?>" onclick="return confirm('<?=gettext("Do you really want to delete this privilege?");?>')">
390
												<img src="/themes/<?= $g['theme']; ?>/images/icons/icon_x.gif" width="17" height="17" border="0" alt="delete" />
391 e30001cf Matthew Grooms
											</a>
392
										</td>
393
									</tr>
394 4c291f4c Renato Botelho
<?php
395
									$i++;
396
								endforeach;
397
							endif;
398
?>
399 e30001cf Matthew Grooms
									<tr>
400
										<td class="list" colspan="2"></td>
401
										<td class="list">
402 dd5bf424 Scott Ullrich
											<a href="system_groupmanager_addprivs.php?groupid=<?=htmlspecialchars($id)?>">
403 9dfaf533 Colin Fleming
												<img src="/themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" width="17" height="17" border="0" alt="add" />
404 e30001cf Matthew Grooms
											</a>
405 4d86a13d Scott Ullrich
406 e30001cf Matthew Grooms
										</td>
407
									</tr>
408 4d86a13d Scott Ullrich
409 e30001cf Matthew Grooms
								</table>
410
							</td>
411
						</tr>
412 4c291f4c Renato Botelho
<?php
413
					endif;
414
?>
415
						<tr>
416 e30001cf Matthew Grooms
							<td width="22%" valign="top">&nbsp;</td>
417 4c291f4c Renato Botelho
							<td width="78%">
418 9dfaf533 Colin Fleming
								<input name="save" type="submit" class="formbtn" value="<?=gettext("Save");?>" />
419 e30001cf Matthew Grooms
								<?php if (isset($id) && $a_group[$id]): ?>
420 9dfaf533 Colin Fleming
								<input name="id" type="hidden" value="<?=htmlspecialchars($id);?>" />
421
								<input name="gid" type="hidden" value="<?=htmlspecialchars($pconfig['gid']);?>" />
422 e30001cf Matthew Grooms
								<?php endif; ?>
423
							</td>
424
						</tr>
425
					</table>
426
				</form>
427 4c291f4c Renato Botelho
<?php
428
			else:
429
?>
430 9dfaf533 Colin Fleming
				<table class="sortable" width="100%" border="0" cellpadding="0" cellspacing="0" summary="">
431 5b42a459 bcyrill
					<thead>
432
						<tr>
433
							<th width="25%" class="listhdrr"><?=gettext("Group name");?></th>
434
							<th width="25%" class="listhdrr"><?=gettext("Description");?></th>
435
							<th width="30%" class="listhdrr"><?=gettext("Member Count");?></th>
436
							<th width="10%" class="list"></th>
437
						</tr>
438
					</thead>
439 9dfaf533 Colin Fleming
					<tfoot>
440 4c291f4c Renato Botelho
						<tr>
441 9dfaf533 Colin Fleming
							<td class="list" colspan="3"></td>
442
							<td class="list">
443
								<a href="system_groupmanager.php?act=new"><img src="./themes/<?=$g['theme'];?>/images/icons/icon_plus.gif" title="<?=gettext("add group");?>" width="17" height="17" border="0" alt="add" />
444
								</a>
445
							</td>
446
						</tr>
447
						<tr>
448
							<td colspan="3">
449
								<p>
450 4c291f4c Renato Botelho
									<?=gettext("Additional webConfigurator groups can be added here.
451 9dfaf533 Colin Fleming
									Group permissions can be assigned which are inherited by users who are members of the group.
452
									An icon that appears grey indicates that it is a system defined object.
453
									Some system object properties can be modified but they cannot be deleted.");?>
454
								</p>
455
							</td>
456
						</tr>
457
					</tfoot>
458 5b42a459 bcyrill
					<tbody>
459 4c291f4c Renato Botelho
<?php
460
					$i = 0;
461
					foreach($a_group as $group):
462
						if($group['scope'] == "system")
463
							$grpimg = "/themes/{$g['theme']}/images/icons/icon_system-group-grey.png";
464
						else
465
							$grpimg = "/themes/{$g['theme']}/images/icons/icon_system-group.png";
466
						$groupcount = count($group['member']);
467
						if ($group["name"] == "all")
468
							$groupcount = count($config['system']['user']);
469
?>
470 9dfaf533 Colin Fleming
						<tr ondblclick="document.location='system_groupmanager.php?act=edit&amp;id=<?=$i;?>'">
471 5b42a459 bcyrill
							<td class="listlr">
472 9dfaf533 Colin Fleming
								<table border="0" cellpadding="0" cellspacing="0" summary="">
473 5b42a459 bcyrill
									<tr>
474 9dfaf533 Colin Fleming
										<td align="left" valign="middle">
475 5b42a459 bcyrill
											<img src="<?=$grpimg;?>" alt="<?=gettext("User");?>" title="<?=gettext("User");?>" border="0" height="16" width="16" />
476
										</td>
477
										<td align="left" valign="middle">
478
											<?=htmlspecialchars($group['name']); ?>&nbsp;
479
										</td>
480
									</tr>
481
								</table>
482
							</td>
483
							<td class="listr">
484
								<?=htmlspecialchars($group['description']);?>&nbsp;
485
							</td>
486
							<td class="listbg">
487
								<?=$groupcount;?>
488
							</td>
489 9dfaf533 Colin Fleming
							<td valign="middle" class="list nowrap">
490
								<a href="system_groupmanager.php?act=edit&amp;id=<?=$i;?>">
491
									<img src="./themes/<?=$g['theme'];?>/images/icons/icon_e.gif" title="<?=gettext("edit group");?>" width="17" height="17" border="0" alt="edit" />
492 5b42a459 bcyrill
								</a>
493
								&nbsp;
494 4c291f4c Renato Botelho
<?php
495
							if($group['scope'] != "system"):
496
?>
497 9dfaf533 Colin Fleming
								<a href="system_groupmanager.php?act=delgroup&amp;id=<?=$i;?>" onclick="return confirm('<?=gettext("Do you really want to delete this group?"); ?>')">
498
									<img src="/themes/<?=$g['theme'];?>/images/icons/icon_x.gif" title="<?=gettext("delete group"); ?>" width="17" height="17" border="0" alt="delete" />
499 5b42a459 bcyrill
								</a>
500 4c291f4c Renato Botelho
<?php
501
							endif;
502
?>
503 5b42a459 bcyrill
							</td>
504
						</tr>
505 4c291f4c Renato Botelho
<?php
506
						$i++;
507
					endforeach;
508
?>
509 5b42a459 bcyrill
					</tbody>
510 45ee90ed Matthew Grooms
				</table>
511 4c291f4c Renato Botelho
<?php
512
			endif;
513
?>
514
			</div>
515 45ee90ed Matthew Grooms
		</td>
516
	</tr>
517
</table>
518 3e321df2 Ermal Luçi
<?php include("fend.inc"); ?>
519 9dfaf533 Colin Fleming
</body>
520
</html>