2 # Display users in the .htpasswd file
4 require './htpasswd-file-lib.pl';
5 if ($access{'single'}) {
10 &ui_print_header(undef, $text{'index_title'}, "", undef, 1, 1);
12 # Check if file is set in config
13 if (!$config{'file'}) {
14 print &text('index_econfig',
15 "../config.cgi?$module_name"),"<p>\n";
16 &ui_print_footer("/", $text{'index'});
21 # Check if MD5 perl module is installed, and offer to install
22 &foreign_require("useradmin", "user-lib.pl");
23 if (!defined(&useradmin::check_md5)) {
24 print &text('index_eversion',
25 "../config.cgi?$module_name"),"<p>\n";
26 &ui_print_footer("/", $text{'index'});
29 elsif ($err = &useradmin::check_md5()) {
30 print &text('index_emd5',
31 "../config.cgi?$module_name",
33 "../cpan/download.cgi?source=3&cpan=Digest::MD5&mode=2&return=/$module_name/&returndesc=".&urlize($text{'index_return'})),"<p>\n";
34 &ui_print_footer("/", $text{'index'});
39 # Display list of users
40 print &ui_subheading(&text('index_file', "<tt>$config{'file'}</tt>"));
41 $users = &list_users();
43 print "<a href='edit.cgi?new=1'>$text{'index_add'}</a><br>\n"
44 if ($access{'create'});
45 print "<table border width=100%>\n";
46 print "<tr $tb> <td><b>$text{'index_header'}</b></td> </tr>\n";
47 print "<tr $cb> <td><table width=100%>\n";
48 for($i=0; $i<@$users; $i++) {
50 $link = "<a href='edit.cgi?idx=$u->{'index'}'>".
52 print "<tr>\n" if ($i%4 == 0);
53 if ($u->{'enabled'}) {
54 print "<td width=25%>$link</td>\n";
57 print "<td width=25%><i>$link</i></td>\n";
59 print "</tr>\n" if ($i%4 == 3);
62 while($i++%4) { print "<td width=25%></td>\n"; }
65 print "</table></td></tr></table>\n";
68 print "<b>$text{'index_none'}</b><p>\n";
70 print "<a href='edit.cgi?new=1'>$text{'index_add'}</a><p>\n"
71 if ($access{'create'});
73 if ($access{'sync'}) {
76 print &ui_subheading($text{'index_sync'});
77 print "<form action=save_sync.cgi>\n";
78 printf "<input type=checkbox name=create value=1 %s> %s<p>\n",
79 $config{'sync_create'} ? "checked" : "",
80 $text{'index_synccreate'};
81 printf "<input type=checkbox name=modify value=1 %s> %s<p>\n",
82 $config{'sync_modify'} ? "checked" : "",
83 $text{'index_syncmodify'};
84 printf "<input type=checkbox name=delete value=1 %s> %s<p>\n",
85 $config{'sync_delete'} ? "checked" : "",
86 $text{'index_syncdelete'};
87 print "<input type=submit value='$text{'index_ssave'}'></form>\n";
90 &ui_print_footer("/", $text{'index'});