--- loncom/auth/lonroles.pm 2014/02/23 20:50:37 1.297
+++ loncom/auth/lonroles.pm 2014/05/04 21:49:05 1.302
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# User Roles Screen
#
-# $Id: lonroles.pm,v 1.297 2014/02/23 20:50:37 raeburn Exp $
+# $Id: lonroles.pm,v 1.302 2014/05/04 21:49:05 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -664,11 +664,22 @@ ENDENTERKEY
}
}
}
-# Are we allowed to look at the first resource?
- if ($furl !~ m|^/adm/|) {
-# Guess not ...
- $furl=&Apache::lonpageflip::first_accessible_resource();
- }
+ # Are we allowed to look at the first resource?
+ if ($furl =~ m{^(/adm/wrapper|)/ext/}) {
+ # If it's an external resource,
+ # strip off the symb argument and possible query
+ my ($exturl,$symb) = ($furl =~ m{^(.+)(?:\?|\&)symb=(.+)$});
+ # Unencode $symb
+ $symb = &unescape($symb);
+ # Then check for permission
+ if (!&Apache::lonnet::allowed('bre',$exturl,$symb)) {
+ $furl = &Apache::lonpageflip::first_accessible_resource();
+ }
+ # For other resources just check for permission
+ } elsif (!&Apache::lonnet::allowed('bre',$furl)) {
+ $furl = &Apache::lonpageflip::first_accessible_resource();
+ }
+
$msg = &mt('Entering [_1] ...',
$env{'course.'.$cdom.'_'.$cnum.'.description'});
&redirect_user($r, &mt('Entering [_1]',
@@ -735,7 +746,12 @@ ENDENTERKEY
my $swinfo=&Apache::lonmenu::rawconfig();
my $start_page=&Apache::loncommon::start_page($pagetitle,undef,{bread_crumbs=>$brcrum});
- my $funcs = &get_roles_functions($showcount);
+ my %domdefs=&Apache::lonnet::get_domain_defaults($env{'user.domain'});
+ my $cattype = 'std';
+ if ($domdefs{'catauth'}) {
+ $cattype = $domdefs{'catauth'};
+ }
+ my $funcs = &get_roles_functions($showcount,$cattype);
$standby=~s/\n/\\n/g;
my $noscript='
'.&mt('Use of LON-CAPA requires Javascript to be enabled in your web browser.').'
'.&mt('As this is not the case, most functionality in the system will be unavailable.').'
';
@@ -878,7 +894,7 @@ ENDHEADER
\%sortrole,\%roleclass,\%futureroles,\%timezones,$loncaparev);
$refresh = $now;
&Apache::lonnet::appenv({'user.refresh.time' => $refresh});
- unless ($env{'user.adv'}) {
+ if ((($cattype eq 'std') || ($cattype eq 'domonly')) && (!$env{'user.adv'})) {
if ($countactive > 0) {
my $domdesc = &Apache::lonnet::domain($env{'user.domain'},'description');
my $esc_dom = &HTML::Entities::encode($env{'user.domain'},'"<>&');
@@ -907,8 +923,7 @@ ENDHEADER
} else {
$r->print('
'.&mt('The [_1]Course/Community Catalog[_2] provides information about all [_3] classes for which LON-CAPA courses have been created, as well as any communities in the domain.','','',$domdesc).'
');
- $r->print(&mt('You can search for courses and communities which permit self-enrollment, if you would like to enroll in one.').'
'.&mt('The [_1]Course/Community Catalog[_2] provides information about all [_3] classes for which LON-CAPA courses have been created, as well as any communities in the domain.','','',$domdesc).'
');
+ $r->print(&mt('You can search for courses and communities which permit self-enrollment, if you would like to enroll in one.').'