1
|
#!/usr/bin/perl
|
2
|
# list_users.cgi
|
3
|
# Display MON users
|
4
|
|
5
|
require './mon-lib.pl';
|
6
|
&ui_print_header(undef, $text{'users_title'}, "");
|
7
|
|
8
|
$conf = &get_mon_config();
|
9
|
$authtype = &find_value("authtype", $conf);
|
10
|
if ($authtype ne 'userfile') {
|
11
|
print "<p>",&text('users_etype', 'edit_global.cgi'),"<p>\n";
|
12
|
}
|
13
|
else {
|
14
|
@users = &list_users();
|
15
|
$uf = &mon_users_file();
|
16
|
if (@users) {
|
17
|
print "<table border width=100%>\n";
|
18
|
print "<tr $tb> <td><b>",&text('users_header', "<tt>$uf</tt>"),
|
19
|
"</b></td> </tr>\n";
|
20
|
print "<tr $cb> <td><table width=100%>\n";
|
21
|
for($i=0; $i<@users; $i++) {
|
22
|
print "<tr>\n" if ($i%4 == 0);
|
23
|
print "<td width=25%><a href=\"edit_user.cgi?",
|
24
|
"index=$i\">$users[$i]->{'user'}</a></td>\n";
|
25
|
print "</tr>\n" if ($i%4 == 3);
|
26
|
}
|
27
|
while($i++%4) { print "<td width=25%></td>\n"; }
|
28
|
print "</table></td></tr></table>\n";
|
29
|
}
|
30
|
else {
|
31
|
print "<b>",&text('users_nousers', "<tt>$uf</tt>"),"</b> <p>\n";
|
32
|
}
|
33
|
print "<a href=\"edit_user.cgi?new=1\">$text{'users_add'}</a><p>\n";
|
34
|
}
|
35
|
|
36
|
&ui_print_footer("", $text{'index_return'});
|
37
|
|