[LON-CAPA-cvs] cvs: loncom /auth lonroles.pm
raeburn
raeburn at source.lon-capa.org
Mon Apr 13 14:32:43 EDT 2015
raeburn Mon Apr 13 18:32:43 2015 EDT
Modified files:
/loncom/auth lonroles.pm
Log:
- When entering a course in which the first resource is subject to content
blocking, display Contents page (Uncompleted "Homework") instead.
Index: loncom/auth/lonroles.pm
diff -u loncom/auth/lonroles.pm:1.310 loncom/auth/lonroles.pm:1.311
--- loncom/auth/lonroles.pm:1.310 Sun Mar 1 22:21:00 2015
+++ loncom/auth/lonroles.pm Mon Apr 13 18:32:43 2015
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# User Roles Screen
#
-# $Id: lonroles.pm,v 1.310 2015/03/01 22:21:00 raeburn Exp $
+# $Id: lonroles.pm,v 1.311 2015/04/13 18:32:43 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -657,6 +657,7 @@
}
}
# Are we allowed to look at the first resource?
+ my $access;
if ($furl =~ m{^(/adm/wrapper|)/ext/}) {
# If it's an external resource,
# strip off the symb argument and possible query
@@ -664,14 +665,16 @@
# Unencode $symb
$symb = &unescape($symb);
# Then check for permission
- if (!&Apache::lonnet::allowed('bre',$exturl,$symb)) {
- $furl = &Apache::lonpageflip::first_accessible_resource();
- }
+ $access = &Apache::lonnet::allowed('bre',$exturl,$symb);
# For other resources just check for permission
- } elsif (!&Apache::lonnet::allowed('bre',$furl)) {
+ } else {
+ $access = &Apache::lonnet::allowed('bre',$furl);
+ }
+ if (!$access) {
$furl = &Apache::lonpageflip::first_accessible_resource();
+ } elsif ($access eq 'B') {
+ $furl = '/adm/navmaps?showOnlyHomework=1';
}
-
$msg = &mt('Entering [_1] ...',
$env{'course.'.$cdom.'_'.$cnum.'.description'});
&redirect_user($r, &mt('Entering [_1]',
More information about the LON-CAPA-cvs
mailing list