version 1.54, 2003/06/04 19:48:19
|
version 1.55, 2003/06/19 21:46:38
|
Line 762 END
|
Line 762 END
|
if ($_=~/^form\.act\_([^\_]+)\_([^\_]+)\_([^\_]+)$/) { |
if ($_=~/^form\.act\_([^\_]+)\_([^\_]+)\_([^\_]+)$/) { |
# Activate roles for sections with 3 id numbers |
# Activate roles for sections with 3 id numbers |
# set start, end times, and the url for the class |
# set start, end times, and the url for the class |
my $start = ( $ENV{'form.start_'.$1.'_'.$2} ? |
|
$ENV{'form.start_'.$1.'_'.$2} : |
my $start = ( $ENV{'form.start_'.$1.'_'.$2.'_'.$3} ? |
|
$ENV{'form.start_'.$1.'_'.$2.'_'.$3} : |
$now ); |
$now ); |
my $end = ( $ENV{'form.end_'.$1.'_'.$2} ? |
my $end = ( $ENV{'form.end_'.$1.'_'.$2.'_'.$3} ? |
$ENV{'form.end_'.$1.'_'.$2} : |
$ENV{'form.end_'.$1.'_'.$2.'_'.$3} : |
0 ); |
0 ); |
my $url='/'.$1.'/'.$2; |
my $url='/'.$1.'/'.$2; |
if ($ENV{'form.sec_'.$1.'_'.$2.'_'.$3}) { |
if ($ENV{'form.sec_'.$1.'_'.$2.'_'.$3}) { |
$url.='/'.$ENV{'form.sec_'.$1.'_'.$2.'_'.$3}; |
$url.='/'.$ENV{'form.sec_'.$1.'_'.$2.'_'.$3}; |
} |
} |
# Assign the role and report it |
# Assign the role and report it |
$r->print('Assigning: '.$3.' in '.$url.': '. |
$r->print('Assigning: '.$3.' in '.$url. |
|
($start?', starting '.localtime($start):''). |
|
($end?', ending '.localtime($end):'').': '. |
&Apache::lonnet::assignrole( |
&Apache::lonnet::assignrole( |
$ENV{'form.ccdomain'},$ENV{'form.ccuname'}, |
$ENV{'form.ccdomain'},$ENV{'form.ccuname'}, |
$url,$3,$end,$start). |
$url,$3,$end,$start). |