--- loncom/lonnet/perl/lonnet.pm 2012/12/05 17:40:59 1.1206 +++ loncom/lonnet/perl/lonnet.pm 2013/01/03 19:58:32 1.1209 @@ -1,7 +1,7 @@ # The LearningOnline Network # TCP networking package # -# $Id: lonnet.pm,v 1.1206 2012/12/05 17:40:59 raeburn Exp $ +# $Id: lonnet.pm,v 1.1209 2013/01/03 19:58:32 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -2716,10 +2716,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; } } @@ -2766,6 +2770,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'; @@ -2798,7 +2810,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 @@ -6881,7 +6893,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; }