version 1.30, 2013/07/24 18:21:46
|
version 1.30.4.1.4.2, 2023/07/07 04:18:18
|
Line 26
|
Line 26
|
my $name=$helper->{VARS}{'origname'}; |
my $name=$helper->{VARS}{'origname'}; |
my %slot=&Apache::lonnet::get('slots', [$name], $cdom, $cnum); |
my %slot=&Apache::lonnet::get('slots', [$name], $cdom, $cnum); |
if (!ref($slot{$name})) { return $default; } |
if (!ref($slot{$name})) { return $default; } |
if (!exists($slot{$name}{$which})) { return $default; } |
if (($which eq 'ipdeny') || ($which eq 'ipallow')) { |
return $slot{$name}{$which}; |
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}; |
|
} |
} |
} |
</exec> |
</exec> |
<message> |
<message> |
Line 184
|
Line 208
|
delete($helper->{'VARS'}{'startreserve'}); |
delete($helper->{'VARS'}{'startreserve'}); |
delete($helper->{'VARS'}{'endreserve'}); |
delete($helper->{'VARS'}{'endreserve'}); |
delete($helper->{'VARS'}{'maxspace'}); |
delete($helper->{'VARS'}{'maxspace'}); |
delete($helper->{'VARS'}{'startunique'}); |
|
delete($helper->{'VARS'}{'endunique'}); |
|
</exec> |
</exec> |
|
<message> |
|
</p><p>Period of time when this slot can only be uniquely assigned:<br /> Start: |
|
</message> |
|
<date variable="startunique" hoursminutes="1" anytime="1"> |
|
<defaultvalue> |
|
my $default=&{$helper->{DATA}{origslot}}('uniqueperiod','anytime'); |
|
if ($default eq 'anytime') { return 'anytime' }; |
|
if (ref($default)) { return $default->[0]; } |
|
return 'anytime'; |
|
</defaultvalue> |
|
</date> |
|
<message><br /> End: </message> |
|
<date variable="endunique" hoursminutes="1" anytime="1"> |
|
<defaultvalue> |
|
my $default=&{$helper->{DATA}{origslot}}('uniqueperiod','anytime'); |
|
if ($default eq 'anytime') { return 'anytime' }; |
|
if (ref($default)) { return $default->[1]; } |
|
return 'anytime'; |
|
</defaultvalue> |
|
<validator> |
|
if (defined($val) && $val < $helper->{'VARS'}{'startunique'}) { |
|
return 'End time must be later than the start time.'; |
|
} |
|
return undef; |
|
</validator> |
|
</date> |
</condition> |
</condition> |
|
|
<message> |
<message> |
</p><p>Proctored access: |
</p><p>Proctored access: |
</message> |
</message> |
Line 227
|
Line 274
|
return 'any'; |
return 'any'; |
</defaultvalue> |
</defaultvalue> |
</choices> |
</choices> |
|
|
<message> |
<message> |
</p><p>IP restrictions:<br /> |
</p><p>IP restrictions -- allow from all except: <br /> |
</message> |
</message> |
<string variable="ip" size="30"> |
|
|
<string variable="ipdeny" size="30"> |
<validator> |
<validator> |
return undef; |
return undef; |
</validator> |
</validator> |
<defaultvalue> |
<defaultvalue> |
return &{$helper->{DATA}{origslot}}('ip'); |
return &{$helper->{DATA}{origslot}}('ipdeny'); |
|
</defaultvalue> |
|
</string> |
|
|
|
<message> |
|
</p><p>IP restrictions -- deny from all except: <br /> |
|
</message> |
|
|
|
<string variable="ipallow" size="30"> |
|
<validator> |
|
return undef; |
|
</validator> |
|
<defaultvalue> |
|
return &{$helper->{DATA}{origslot}}('ipallow'); |
</defaultvalue> |
</defaultvalue> |
</string> |
</string> |
<message> </p> </message> |
<message> </p> </message> |
Line 248
|
Line 309
|
<nextstate>PROCTOR</nextstate> |
<nextstate>PROCTOR</nextstate> |
|
|
<resource variable="symb"> |
<resource variable="symb"> |
<filterfunc>return $res->is_problem()</filterfunc> |
<filterfunc>return $res->is_problem() || $res->is_tool()</filterfunc> |
<valuefunc>return $res->symb()</valuefunc> |
<valuefunc>return $res->symb()</valuefunc> |
<defaultvalue> |
<defaultvalue> |
return &{$helper->{DATA}{origslot}}('symb'); |
return &{$helper->{DATA}{origslot}}('symb'); |
Line 326
|
Line 387
|
$slot{$which} = $helper->{'VARS'}{$which}; |
$slot{$which} = $helper->{'VARS'}{$which}; |
} |
} |
|
|
foreach my $which ('ip','description','maxspace','secret','symb') { |
foreach my $which ('description','maxspace','secret','symb') { |
if ( $helper->{'VARS'}{$which} =~/\S/ ) { |
if ( $helper->{'VARS'}{$which} =~/\S/ ) { |
$slot{$which} = $helper->{'VARS'}{$which}; |
$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'}{'type'} eq 'schedulable_student') { |
if (($helper->{'VARS'}{'reservationmsg'} eq 'only_student') || |
if (($helper->{'VARS'}{'reservationmsg'} eq 'only_student') || |
($helper->{'VARS'}{'reservationmsg'} eq 'student_and_user_notes_screen')) { |
($helper->{'VARS'}{'reservationmsg'} eq 'student_and_user_notes_screen')) { |