--- loncom/html/adm/helper/newslot.helper 2011/12/20 22:47:56 1.29
+++ loncom/html/adm/helper/newslot.helper 2020/04/08 20:54:58 1.30.6.2
@@ -26,8 +26,32 @@
my $name=$helper->{VARS}{'origname'};
my %slot=&Apache::lonnet::get('slots', [$name], $cdom, $cnum);
if (!ref($slot{$name})) { return $default; }
- if (!exists($slot{$name}{$which})) { return $default; }
- return $slot{$name}{$which};
+ if (($which eq 'ipdeny') || ($which eq 'ipallow')) {
+ if (!exists($slot{$name}{'ip'})) { return $default; }
+ } else {
+ if (!exists($slot{$name}{$which})) { return $default; }
+ }
+ if (($which eq 'ipdeny') || ($which eq 'ipallow')) {
+ my @allows;
+ my @denies;
+ foreach my $item (split(',',$slot{$name}{'ip'})) {
+ $item =~ s/^\s*//;
+ $item =~ s/\s*$//;
+ if ($item =~ /^\!(.+)$/) {
+ push(@denies,$1);
+ } else {
+ push(@allows,$item);
+ }
+ }
+ if ($which eq 'ipdeny') {
+ return join(',',@denies);
+ }
+ if ($which eq 'ipallow') {
+ return join(',',@allows);
+ }
+ } else {
+ return $slot{$name}{$which};
+ }
}
Period of time when this slot can only be uniquely assigned:
Start:
+
+
End:
Proctored access:
@@ -229,14 +276,28 @@
IP restrictions:
+
IP restrictions -- allow from all except:
+
+
+
IP restrictions -- deny from all except:
-