[LON-CAPA-cvs] cvs: loncom(version_2_10_X) /auth lonroles.pm
raeburn
raeburn@source.lon-capa.org
Thu, 12 Aug 2010 23:40:49 -0000
raeburn Thu Aug 12 23:40:49 2010 EDT
Modified files: (Branch: version_2_10_X)
/loncom/auth lonroles.pm
Log:
- For 2.10 reverse changes in 1.245 and 1.246.
- Remote Control still retained for 2.10.
Index: loncom/auth/lonroles.pm
diff -u loncom/auth/lonroles.pm:1.256 loncom/auth/lonroles.pm:1.256.2.1
--- loncom/auth/lonroles.pm:1.256 Sun Aug 1 18:34:19 2010
+++ loncom/auth/lonroles.pm Thu Aug 12 23:40:49 2010
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# User Roles Screen
#
-# $Id: lonroles.pm,v 1.256 2010/08/01 18:34:19 raeburn Exp $
+# $Id: lonroles.pm,v 1.256.2.1 2010/08/12 23:40:49 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -57,7 +57,8 @@
handler determines via C<lonnet>'s C<&allowed> function that a certain
action is not allowed, C<lonroles> is used as error handler. This
allows the user to select another role which may have permission to do
-what they were trying to do.
+what they were trying to do. C<lonroles> can also be accessed via the
+B<CRS> button in the Remote Control.
=begin latex
@@ -144,11 +145,19 @@
sub redirect_user {
- my ($r,$title,$url,$msg) = @_;
+ my ($r,$title,$url,$msg,$launch_nav) = @_;
$msg = $title if (! defined($msg));
&Apache::loncommon::content_type($r,'text/html');
&Apache::loncommon::no_cache($r);
$r->send_http_header;
+ my $swinfo=&Apache::lonmenu::rawconfig();
+ my $navwindow;
+ if ($launch_nav eq 'on') {
+ $navwindow.=&Apache::lonnavdisplay::launch_win('now',undef,undef,
+ ($url =~ m-^/adm/whatsnew-));
+ } else {
+ $navwindow.=&Apache::lonnavmaps::close();
+ }
# Breadcrumbs
my $brcrum = [{'href' => $url,
@@ -163,6 +172,12 @@
$url=~s/ /\%20/g;
$r->print(<<ENDREDIR);
$start_page
+<script type="text/javascript">
+// <![CDATA[
+$swinfo
+// ]]>
+</script>
+$navwindow
<p>$msg</p>
$end_page
ENDREDIR
@@ -542,7 +557,8 @@
}
&redirect_user($r, &mt('Entering [_1]',
$env{'course.'.$courseid.'.description'}),
- $dest, $msg);
+ $dest, $msg,
+ $env{'environment.remotenavmap'});
return OK;
}
if (&Apache::lonnet::allowed('whn',
@@ -555,8 +571,9 @@
unless ($startpage eq 'firstres') {
$msg = &mt('Entering [_1] ...',
$env{'course.'.$courseid.'.description'});
- &redirect_user($r, &mt('New in course'),
- '/adm/whatsnew?refpage=start', $msg);
+ &redirect_user($r,&mt('New in course'),
+ '/adm/whatsnew?refpage=start',$msg,
+ $env{'environment.remotenavmap'});
return OK;
}
}
@@ -568,9 +585,10 @@
}
$msg = &mt('Entering [_1] ...',
$env{'course.'.$courseid.'.description'});
- &redirect_user($r, &mt('Entering [_1]',
- $env{'course.'.$courseid.'.description'}),
- $furl, $msg);
+ &redirect_user($r,&mt('Entering [_1]',
+ $env{'course.'.$courseid.'.description'}),
+ $furl,$msg,
+ $env{'environment.remotenavmap'});
}
return OK;
}
@@ -1814,7 +1832,8 @@
handler determines via C<lonnet>'s C<&allowed> function that a certain
action is not allowed, C<lonroles> is used as error handler. This
allows the user to select another role which may have permission to do
-what they were trying to do.
+what they were trying to do. C<lonroles> can also be accessed via the
+B<CRS> button in the Remote Control.
=begin latex