--- loncom/lonnet/perl/lonnet.pm 2012/12/13 19:32:52 1.1172.2.13 +++ loncom/lonnet/perl/lonnet.pm 2013/01/03 19:59:47 1.1172.2.16 @@ -1,7 +1,7 @@ # The LearningOnline Network # TCP networking package # -# $Id: lonnet.pm,v 1.1172.2.13 2012/12/13 19:32:52 raeburn Exp $ +# $Id: lonnet.pm,v 1.1172.2.16 2013/01/03 19:59:47 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -2708,10 +2708,14 @@ sub can_edit_resource { return; } } else { + if ($resurl =~ m{^/?adm/viewclasslist$}) { + unless (&Apache::lonnet::allowed('opa',$env{'request.course.id'})) { + return; + } + } elsif (!$crsedit) { # # No edit allowed where CC has switched to student role. # - unless ($crsedit) { return; } } @@ -2758,6 +2762,14 @@ sub can_edit_resource { $forceedit = 1; } $cfile = $resurl; + } elsif ($resurl =~ m{^/?adm/viewclasslist$}) { + $incourse = 1; + if ($env{'form.forceedit'}) { + $forceview = 1; + } else { + $forceedit = 1; + } + $cfile = ($resurl =~ m{^/} ? $resurl : "/$resurl"); } } elsif ($resurl eq '/res/lib/templates/simpleproblem.problem/smpedit') { my $template = '/res/lib/templates/simpleproblem.problem'; @@ -2790,7 +2802,7 @@ sub can_edit_resource { } if ($uploaded || $incourse) { $home=&homeserver($cnum,$cdom); - } else { + } elsif ($file !~ m{/$}) { $file=~s{^(priv/$match_domain/$match_username)}{/$1}; $file=~s{^($match_domain/$match_username)}{/priv/$1}; # Check that the user has permission to edit this resource @@ -6839,7 +6851,7 @@ sub constructaccess { if (($allowed eq 'F') || ($allowed eq 'U')) { # Grant temporary access my $then=$env{'user.login.time'}; - my $update==$env{'user.update.time'}; + my $update=$env{'user.update.time'}; if (!$update) { $update = $then; } my $refresh=$env{'user.refresh.time'}; if (!$refresh) { $refresh = $update; }