version 1.9, 2001/03/19 19:54:37
|
version 1.16, 2001/04/25 20:33:26
|
Line 16
|
Line 16
|
# |
# |
# 2/14 Gerd Kortemeyer) |
# 2/14 Gerd Kortemeyer) |
# |
# |
# 2/14,2/17,2/19,2/20,2/21,2/22,2/23,3/2,3/17 Gerd Kortemeyer |
# 2/14,2/17,2/19,2/20,2/21,2/22,2/23,3/2,3/17,3/24,04/12 Gerd Kortemeyer |
# |
# |
package Apache::loncreateuser; |
package Apache::loncreateuser; |
|
|
Line 108 ENDENHEAD
|
Line 108 ENDENHEAD
|
my $uhome=&Apache::lonnet::homeserver($ccuname,$ccdomain); |
my $uhome=&Apache::lonnet::homeserver($ccuname,$ccdomain); |
my %incdomains; |
my %incdomains; |
my %inccourses; |
my %inccourses; |
$incdomains{$ENV{'user.domain'}}=1; |
map { |
|
$incdomains{$_}=1; |
|
} values %Apache::lonnet::hostdom; |
map { |
map { |
if ($_=~/^user\.priv\.cm\.\/(\w+)\/(\w+)/) { |
if ($_=~/^user\.priv\.cm\.\/(\w+)\/(\w+)/) { |
$inccourses{$1.'_'.$2}=1; |
$inccourses{$1.'_'.$2}=1; |
Line 194 ENDNUSER
|
Line 196 ENDNUSER
|
$area=$carea; |
$area=$carea; |
} else { |
} else { |
if ($area=~/^\/(\w+)\//) { |
if ($area=~/^\/(\w+)\//) { |
$incdomains{$1}=1; |
|
if (&Apache::lonnet::allowed('c'.$trole,$1)) { |
if (&Apache::lonnet::allowed('c'.$trole,$1)) { |
$allows=1; |
$allows=1; |
} |
} |
Line 228 ENDNUSER
|
Line 229 ENDNUSER
|
$r->print('</table>'); |
$r->print('</table>'); |
} |
} |
} |
} |
$r->print('<hr><h3>Add Roles</h3><h4>System Level</h4>'); |
$r->print('<hr><h3>Add Roles</h3>'); |
# |
# |
# Domain level |
# Domain level |
# |
# |
Line 254 ENDNUSER
|
Line 255 ENDNUSER
|
</tr> |
</tr> |
ENDDROW |
ENDDROW |
} |
} |
} ('dc','cc','li','dg','au'); |
} ('dc','li','dg','au'); |
} sort keys %incdomains; |
} sort keys %incdomains; |
$r->print('</table>'); |
$r->print('</table>'); |
# |
# |
Line 265 ENDDROW
|
Line 266 ENDDROW
|
'<th>Group/Section</th><th>Start</th><th>End</th></tr>'); |
'<th>Group/Section</th><th>Start</th><th>End</th></tr>'); |
map { |
map { |
my $thiscourse=$_; |
my $thiscourse=$_; |
|
my $protectedcourse=$_; |
|
$thiscourse=~s:_:/:g; |
my %coursedata=&Apache::lonnet::coursedescription($thiscourse); |
my %coursedata=&Apache::lonnet::coursedescription($thiscourse); |
my $area=$coursedata{'description'}; |
my $area=$coursedata{'description'}; |
my $bgcol=$thiscourse; |
my $bgcol=$thiscourse; |
Line 273 ENDDROW
|
Line 276 ENDDROW
|
map { |
map { |
if (&Apache::lonnet::allowed('c'.$_,$thiscourse)) { |
if (&Apache::lonnet::allowed('c'.$_,$thiscourse)) { |
my $plrole=&Apache::lonnet::plaintext($_); |
my $plrole=&Apache::lonnet::plaintext($_); |
$r->print(<<ENDROW); |
$r->print(" |
<tr bgcolor=#$bgcol> |
<tr bgcolor=#$bgcol> |
<td><input type=checkbox name="act_$thiscourse\_$_"></td> |
<td><input type=checkbox name=\"act_$protectedcourse\_$_\"></td> |
<td>$plrole</td> |
<td>$plrole</td> |
<td>$area</td> |
<td>$area</td> |
<td><input type=text size=5 name="sec_$thiscourse\_$_"></td> |
<td>"); |
<td><input type=hidden name="start_$thiscourse\_$_" value=''> |
if ($_ ne 'cc') { |
|
$r->print("<input type=text size=5 name=\"sec_$protectedcourse\_$_\">"); |
|
} else { $r->print(" "); } |
|
$r->print(<<ENDROW); |
|
<td><input type=hidden name="start_$protectedcourse\_$_" value=''> |
<a href= |
<a href= |
"javascript:pjump('date_start','Start Date $plrole',document.cu.start_$thiscourse\_$_.value,'start_$thiscourse\_$_','cu.pres','dateset')">Set Start Date</a></td> |
"javascript:pjump('date_start','Start Date $plrole',document.cu.start_$protectedcourse\_$_.value,'start_$protectedcourse\_$_','cu.pres','dateset')">Set Start Date</a></td> |
<td><input type=hidden name="end_$thiscourse\_$_" value=''> |
<td><input type=hidden name="end_$protectedcourse\_$_" value=''> |
<a href= |
<a href= |
"javascript:pjump('date_end','End Date $plrole',document.cu.end_$thiscourse\_$_.value,'end_$thiscourse\_$_','cu.pres','dateset')">Set End Date</a></td> |
"javascript:pjump('date_end','End Date $plrole',document.cu.end_$protectedcourse\_$_.value,'end_$protectedcourse\_$_','cu.pres','dateset')">Set End Date</a></td> |
</tr> |
</tr> |
ENDROW |
ENDROW |
|
|
} |
} |
} ('st','ta','ep','ad','in'); |
} ('st','ta','ep','ad','in','cc'); |
} sort keys %inccourses; |
} sort keys %inccourses; |
$r->print('</table>'); |
$r->print('</table>'); |
$r->print('<input type=submit value="Modify User">'); |
$r->print('<input type=submit value="Modify User">'); |
Line 346 ENDTHREEHEAD
|
Line 352 ENDTHREEHEAD
|
$r->print('Revoking '.$2.' in '.$1.': '. |
$r->print('Revoking '.$2.' in '.$1.': '. |
&Apache::lonnet::assignrole($ENV{'form.cdomain'},$ENV{'form.cuname'}, |
&Apache::lonnet::assignrole($ENV{'form.cdomain'},$ENV{'form.cuname'}, |
$1,$2,$now).'<br>'); |
$1,$2,$now).'<br>'); |
|
if ($2 eq 'st') { |
|
$1=~/^\/(\w+)\/(\w+)/; |
|
my $cid=$1.'_'.$2; |
|
$r->print('Drop from classlist: '. |
|
&Apache::lonnet::critical('put:'.$ENV{'course.'.$cid.'.domain'}.':'. |
|
$ENV{'course.'.$cid.'.num'}.':classlist:'. |
|
&Apache::lonnet::escape($ENV{'form.cuname'}.':'. |
|
$ENV{'form.cdomain'}).'='. |
|
&Apache::lonnet::escape($now.':'), |
|
$ENV{'course.'.$cid.'.home'}).'<br>'); |
|
} |
} |
} |
} keys %ENV; |
} keys %ENV; |
map { |
map { |
Line 365 ENDTHREEHEAD
|
Line 382 ENDTHREEHEAD
|
$r->print('Assigning: '.$3.' in '.$url.': '. |
$r->print('Assigning: '.$3.' in '.$url.': '. |
&Apache::lonnet::assignrole($ENV{'form.cdomain'},$ENV{'form.cuname'}, |
&Apache::lonnet::assignrole($ENV{'form.cdomain'},$ENV{'form.cuname'}, |
$url,$3,$end,$start).'<br>'); |
$url,$3,$end,$start).'<br>'); |
|
if ($3 eq 'st') { |
|
$url=~/^\/(\w+)\/(\w+)/; |
|
my $cid=$1.'_'.$2; |
|
$r->print('Add to classlist: '. |
|
&Apache::lonnet::critical('put:'.$ENV{'course.'.$cid.'.domain'}.':'. |
|
$ENV{'course.'.$cid.'.num'}.':classlist:'. |
|
&Apache::lonnet::escape($ENV{'form.cuname'}.':'. |
|
$ENV{'form.cdomain'}).'='. |
|
&Apache::lonnet::escape($end.':'.$start), |
|
$ENV{'course.'.$cid.'.home'}).'<br>'); |
|
} |
} elsif (($_=~/^form\.act\_([^\_]+)\_([^\_]+)$/) && ($ENV{$_})) { |
} elsif (($_=~/^form\.act\_([^\_]+)\_([^\_]+)$/) && ($ENV{$_})) { |
my $url='/'.$1.'/'; |
my $url='/'.$1.'/'; |
my $start=$now; |
my $start=$now; |