Conver at module to new library

This commit is contained in:
Jamie Cameron
2009-02-27 21:44:44 +00:00
parent 593c18982c
commit bca0820b89
3 changed files with 9 additions and 11 deletions

View File

@@ -1,9 +1,9 @@
# at-lib.pl
# Functions for listing and creating at jobs
do '../web-lib.pl';
BEGIN { push(@INC, ".."); };
use WebminCore;
&init_config();
do '../ui-lib.pl';
%access = &get_module_acl();
do "$config{'at_style'}-lib.pl";
@@ -84,8 +84,8 @@ sub save_allowed
if (@_) {
local($_);
&open_tempfile(ALLOW, ">$config{allow_file}");
foreach (@_) {
&print_tempfile(ALLOW, $_,"\n");
foreach my $u (@_) {
&print_tempfile(ALLOW, $u,"\n");
}
&close_tempfile(ALLOW);
chmod(0444, $config{allow_file});
@@ -102,11 +102,10 @@ else {
sub save_denied
{
&lock_file($config{deny_file});
if (@_) {
local($_);
&open_tempfile(DENY, "> $config{deny_file}");
foreach (@_) {
&print_tempfile(DENY, $_,"\n");
if (@_ || !-r $config{'allow_file'}) {
&open_tempfile(DENY, ">$config{deny_file}");
foreach my $u (@_) {
&print_tempfile(DENY, $u,"\n");
}
&close_tempfile(DENY);
chmod(0444, $config{deny_file});

View File

@@ -1,4 +1,3 @@
line2=System configuration,11
at_style=At system type,1,linux-Linux,solaris-Solaris,freebsd-FreeBSD,irix-Irix,macos-MacOS X,openserver-OpenServer
at_dir=At jobs directory,0
allow_file=Allow At users file,3,None

View File

@@ -7259,7 +7259,7 @@ successful. The handle must have been one passed to open_tempfile.
sub close_tempfile
{
my $file;
my $fh = &callers_package($fh);
my $fh = &callers_package($_[0]);
if (defined($file = $main::open_temphandles{$fh})) {
# Closing a handle