version 1.2, 2001/02/17 22:25:19
|
version 1.3, 2001/02/17 23:15:35
|
Line 25 use Apache::lonnet;
|
Line 25 use Apache::lonnet;
|
sub phase_one { |
sub phase_one { |
my $r=shift; |
my $r=shift; |
|
|
|
my $defdom=$ENV{'user.domain'}; |
$r->print(<<ENDDOCUMENT); |
$r->print(<<ENDDOCUMENT); |
<html> |
<html> |
<head> |
<head> |
Line 35 sub phase_one {
|
Line 36 sub phase_one {
|
<h1>Create a new Course</h1> |
<h1>Create a new Course</h1> |
<form action=/adm/createcourse method=post> |
<form action=/adm/createcourse method=post> |
<h3>Course Title</h3> |
<h3>Course Title</h3> |
<input type=text size=40 name=title> |
<input type=text size=50 name=title> |
<h3>Top-level Map</h3> |
<h3>Top-level Map</h3> |
<input type=text size=40 name=topmap> |
<input type=text size=50 name=topmap> |
<h3>Course Cooordinator</h3> |
<h3>Course Cooordinator</h3> |
Username: <input type=text size=15 name=ccuname><br> |
Username: <input type=text size=15 name=ccuname><br> |
Domain: <input type=text size=15 name=ccdomain> |
Domain: <input type=text size=15 name=ccdomain value=$defdom> |
<input type=hidden name=phase value=two><p> |
<input type=hidden name=phase value=two><p> |
<input type=submit value="Open Course"> |
<input type=submit value="Open Course"> |
</form> |
</form> |
Line 73 ENDENHEAD
|
Line 74 ENDENHEAD
|
# Verify data |
# Verify data |
# |
# |
if (&Apache::lonnet::homeserver($ccuname,$ccdomain) eq 'no_host') { |
if (&Apache::lonnet::homeserver($ccuname,$ccdomain) eq 'no_host') { |
$r->print('No such user '.$ccuname.' at '.$ccdomain); |
$r->print('No such user '.$ccuname.' at '.$ccdomain.'</body></html>'); |
return; |
return; |
} |
} |
|
|
Line 95 ENDENHEAD
|
Line 96 ENDENHEAD
|
# |
# |
$r->print('Assigning role of course coordinator to '. |
$r->print('Assigning role of course coordinator to '. |
$ccuname.' at '.$ccdomain.': '. |
$ccuname.' at '.$ccdomain.': '. |
&Apache::lonnet::assignrole($ccdomain,$ccuname,$courseid,'cc').'<br>'); |
&Apache::lonnet::assignrole($ccdomain,$ccuname,$courseid,'cc').'<p>'); |
$r->print('</body></html>'); |
$r->print('Roles will be active at next login.</body></html>'); |
} |
} |
|
|
# ===================================================================== Handler |
# ===================================================================== Handler |