--- loncom/auth/lonroles.pm 2003/08/12 19:46:04 1.66
+++ loncom/auth/lonroles.pm 2003/12/30 22:45:59 1.81
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# User Roles Screen
#
-# $Id: lonroles.pm,v 1.66 2003/08/12 19:46:04 www Exp $
+# $Id: lonroles.pm,v 1.81 2003/12/30 22:45:59 www Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -51,11 +51,12 @@ use Apache::File();
use Apache::lonmenu;
use Apache::loncommon;
use Apache::lonannounce;
+use Apache::lonlocal;
sub redirect_user {
my ($r,$title,$url,$msg) = @_;
$msg = $title if (! defined($msg));
- $r->content_type('text/html');
+ &Apache::loncommon::content_type($r,'text/html');
&Apache::loncommon::no_cache($r);
$r->send_http_header;
my $swinfo=&Apache::lonmenu::rawconfig();
@@ -76,6 +77,17 @@ ENDREDIR
return;
}
+sub authorbombs {
+ my ($uname,$udom)=@_;
+ my %bombs=&Apache::lonmsg::all_url_author_res_msg($uname,$udom);
+ foreach (keys %bombs) {
+ if ($_=~/^$udom\/$uname\//) {
+ return '';
+ }
+ }
+ return '';
+}
+
sub handler {
my $r = shift;
@@ -130,7 +142,7 @@ sub handler {
# student attempts to register a new key
} else {
# print form to enter a new key
- $r->content_type('text/html');
+ &Apache::loncommon::content_type($r,'text/html');
&Apache::loncommon::no_cache($r);
$r->send_http_header;
my $swinfo=&Apache::lonmenu::rawconfig();
@@ -164,14 +176,18 @@ ENDENTERKEY
'request.role.adv' => $tadv,
'request.role.domain' => $cdom,
'request.course.sec' => $csec);
- my $msg='Entering course ...';
+ my $msg=&mt('Entering course ...');
if (($cnum) && ($role ne 'ca')) {
my ($furl,$ferr)=
&Apache::lonuserstate::readmap($cdom.'/'.$cnum);
if (($ENV{'form.orgurl'}) &&
($ENV{'form.orgurl'}!~/^\/adm\/flip/)) {
- $r->internal_redirect($ENV{'form.orgurl'});
+ my $dest=$ENV{'form.orgurl'};
+ if ( &Apache::lonnet::mod_perl_version() == 2 ) {
+ &Apache::lonnet::cleanenv();
+ }
+ $r->internal_redirect($dest);
return OK;
} else {
unless ($ENV{'request.course.id'}) {
@@ -179,7 +195,9 @@ ENDENTERKEY
"request.course.id" => $cdom.'_'.$cnum);
$furl='/adm/roles?tryagain=1';
$msg=
- '