Conver at module to new library
authorJamie Cameron <jcameron@webmin.com>
Fri, 27 Feb 2009 21:44:44 +0000 (21:44 +0000)
committerJamie Cameron <jcameron@webmin.com>
Fri, 27 Feb 2009 21:44:44 +0000 (21:44 +0000)
at/at-lib.pl
at/config.info
web-lib-funcs.pl

index 2a69d07..0ba1aa7 100644 (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});
index 4f8c3ab..2b5edbc 100644 (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
index ea97186..5363f9b 100755 (executable)
@@ -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