#!/usr/local/bin/perl
# edit_unix.cgi
# Choose a user whose permissions will be used for logins that don't
# match any webmin user, but have unix accounts

require './acl-lib.pl';
$access{'unix'} && $access{'create'} && $access{'delete'} ||
	&error($text{'unix_ecannot'});
&header($text{'unix_title'}, "");
print "<hr>\n";

print "$text{'unix_desc'}<p>\n";
&get_miniserv_config(\%miniserv);

print "<form action=save_unix.cgi>\n";
printf "<input type=radio name=unix_def value=1 %s> %s<br>\n",
	$miniserv{'unixauth'} ? '' : 'checked', $text{'unix_def'};
printf "<input type=radio name=unix_def value=0 %s> %s\n",
	$miniserv{'unixauth'} ? 'checked' : '', $text{'unix_user'};
print "<select name=user>\n";
foreach $u (&list_users()) {
	printf "<option %s>%s\n",
		$miniserv{'unixauth'} eq $u->{'name'} ? 'selected' : '',
		$u->{'name'};
	}
print "</select><br>\n";
print "<input type=submit value='$text{'save'}'></form>\n";

print "<hr>\n";
&footer("", $text{'index_return'});

