--- loncom/html/adm/helper/newslot.helper 2020/04/08 20:54:58 1.30.6.2 +++ loncom/html/adm/helper/newslot.helper 2015/09/23 23:05:04 1.31 @@ -26,32 +26,8 @@ my $name=$helper->{VARS}{'origname'}; my %slot=&Apache::lonnet::get('slots', [$name], $cdom, $cnum); if (!ref($slot{$name})) { return $default; } - 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}; - } + if (!exists($slot{$name}{$which})) { return $default; } + return $slot{$name}{$which}; } @@ -208,34 +184,11 @@ delete($helper->{'VARS'}{'startreserve'}); delete($helper->{'VARS'}{'endreserve'}); delete($helper->{'VARS'}{'maxspace'}); + delete($helper->{'VARS'}{'startunique'}); + delete($helper->{'VARS'}{'endunique'}); - -

Period of time when this slot can only be uniquely assigned:
   Start: - - - - my $default=&{$helper->{DATA}{origslot}}('uniqueperiod','anytime'); - if ($default eq 'anytime') { return 'anytime' }; - if (ref($default)) { return $default->[0]; } - return 'anytime'; - - -
   End:
- - - my $default=&{$helper->{DATA}{origslot}}('uniqueperiod','anytime'); - if ($default eq 'anytime') { return 'anytime' }; - if (ref($default)) { return $default->[1]; } - return 'anytime'; - - - if (defined($val) && $val < $helper->{'VARS'}{'startunique'}) { - return 'End time must be later than the start time.'; - } - return undef; - - +

Proctored access: @@ -267,37 +220,31 @@ usable for any resource. + restricted to resources in a specific folder/composite page. restricted to a specific resource. my $default=&{$helper->{DATA}{origslot}}('symb'); - if ($default) { return 'resource'; } - return 'any'; + if ($default) { + if ($default =~ /\.(page|sequence)$/) { + return 'map'; + } else { + return 'resource'; + } + } else { + return 'any'; + } -

IP restrictions -- allow from all except:
    +

IP restrictions:
    - - - - return undef; - - - return &{$helper->{DATA}{origslot}}('ipdeny'); - - - - -

IP restrictions -- deny from all except:
    - - - + return undef; - return &{$helper->{DATA}{origslot}}('ipallow'); + return &{$helper->{DATA}{origslot}}('ip');

@@ -317,6 +264,18 @@ + + + PROCTOR + + + return $res->is_map() + return $res->symb() + + return &{$helper->{DATA}{origslot}}('symb'); + + + @@ -387,32 +346,12 @@ $slot{$which} = $helper->{'VARS'}{$which}; } - foreach my $which ('description','maxspace','secret','symb') { + foreach my $which ('ip','description','maxspace','secret','symb') { if ( $helper->{'VARS'}{$which} =~/\S/ ) { $slot{$which} = $helper->{'VARS'}{$which}; } } - if ($helper->{'VARS'}{'ipdeny'} =~/\S/ ) { - foreach my $item (split(',',$helper->{'VARS'}{'ipdeny'})) { - $item =~ s/^\s*//; - $item =~ s/\s*$//; - $slot{'ip'} .= '!'.$item.','; - } - } - - if ($helper->{'VARS'}{'ipallow'} =~/\S/ ) { - foreach my $item (split(',',$helper->{'VARS'}{'ipallow'})) { - $item =~ s/^\s*//; - $item =~ s/\s*$//; - $slot{'ip'} .= $item.','; - } - } - - if ($slot{'ip'} ne '') { - $slot{'ip'} =~s /,$//; - } - if ($helper->{'VARS'}{'type'} eq 'schedulable_student') { if (($helper->{'VARS'}{'reservationmsg'} eq 'only_student') || ($helper->{'VARS'}{'reservationmsg'} eq 'student_and_user_notes_screen')) {