version 1.24, 2001/05/03 17:54:12
|
version 1.26, 2001/06/02 16:14:40
|
Line 9
|
Line 9
|
# 12/08,12/28, |
# 12/08,12/28, |
# 01/15/01 Gerd Kortemeyer |
# 01/15/01 Gerd Kortemeyer |
# 02/27/01 Scott Harrison |
# 02/27/01 Scott Harrison |
# 03/02,05/03 Gerd Kortemeyer |
# 03/02,05/03,05/25,05/30,06/01 Gerd Kortemeyer |
|
|
package Apache::lonroles; |
package Apache::lonroles; |
|
|
Line 18 use Apache::lonnet();
|
Line 18 use Apache::lonnet();
|
use Apache::lonuserstate(); |
use Apache::lonuserstate(); |
use Apache::Constants qw(:common); |
use Apache::Constants qw(:common); |
use Apache::File(); |
use Apache::File(); |
|
use Apache::lonmenu; |
|
|
sub handler { |
sub handler { |
|
|
Line 58 sub handler {
|
Line 59 sub handler {
|
my ($cdom,$cnum,$csec)=split(/\//,$where); |
my ($cdom,$cnum,$csec)=split(/\//,$where); |
&Apache::lonnet::appenv('request.role' => $trolecode, |
&Apache::lonnet::appenv('request.role' => $trolecode, |
'request.course.sec' => $csec); |
'request.course.sec' => $csec); |
if ($cnum) { |
if (($cnum) && ($role ne 'ca')) { |
my ($furl,$ferr)= |
my ($furl,$ferr)= |
&Apache::lonuserstate::readmap($cdom.'/'.$cnum); |
&Apache::lonuserstate::readmap($cdom.'/'.$cnum); |
if (($ENV{'form.orgurl'}) && |
if (($ENV{'form.orgurl'}) && |
Line 68 sub handler {
|
Line 69 sub handler {
|
} else { |
} else { |
$r->content_type('text/html'); |
$r->content_type('text/html'); |
$r->send_http_header; |
$r->send_http_header; |
|
my $swinfo=&Apache::lonmenu::rawconfig; |
print (<<ENDREDIR); |
print (<<ENDREDIR); |
<head><title>Entering Course</title> |
<head><title>Entering Course</title> |
<meta HTTP-EQUIV="Refresh" CONTENT="1; url=$furl"> |
<meta HTTP-EQUIV="Refresh" CONTENT="1; url=$furl"> |
</head> |
</head> |
<html> |
<html> |
<body bgcolor="#FFFFFF"> |
<body bgcolor="#FFFFFF"> |
|
<script> |
|
$swinfo |
|
</script> |
Entering course ... |
Entering course ... |
</body> |
</body> |
</html> |
</html> |
Line 94 ENDREDIR
|
Line 99 ENDREDIR
|
$r->send_http_header; |
$r->send_http_header; |
return OK if $r->header_only; |
return OK if $r->header_only; |
|
|
|
my $swinfo=&Apache::lonmenu::rawconfig; |
|
|
$r->print(<<ENDHEADER); |
$r->print(<<ENDHEADER); |
<html> |
<html> |
<head> |
<head> |
<title>LON-CAPA User Roles</title> |
<title>LON-CAPA User Roles</title> |
</head><body bgcolor="#FFFFFF"> |
</head><body bgcolor="#FFFFFF"> |
<script>window.focus();</script> |
<script> |
|
$swinfo |
|
window.focus(); |
|
</script> |
ENDHEADER |
ENDHEADER |
|
|
# ------------------------------------------ Get Error Message from Environment |
# ------------------------------------------ Get Error Message from Environment |
Line 130 ENDHEADER
|
Line 140 ENDHEADER
|
$r->print("Action : $msg\n</pre><hr>"); |
$r->print("Action : $msg\n</pre><hr>"); |
} else { |
} else { |
$r->print("<h1>LON-CAPA User Roles</h1>"); |
$r->print("<h1>LON-CAPA User Roles</h1>"); |
|
if ($ENV{'user.error.msg'}) { |
|
$r->print( |
|
'<h3><font color=red>You need to choose another user role or '. |
|
'enter a specific course for this function</font></h3>'); |
|
} |
} |
} |
# -------------------------------------------------------- Choice or no choice? |
# -------------------------------------------------------- Choice or no choice? |
if ($nochoose) { |
if ($nochoose) { |