[LON-CAPA-cvs] cvs: loncom(version_2_11_X) /interface lonmenu.pm

raeburn raeburn at source.lon-capa.org
Fri Dec 28 12:26:15 EST 2012


raeburn		Fri Dec 28 17:26:15 2012 EDT

  Modified files:              (Branch: version_2_11_X)
    /loncom/interface	lonmenu.pm 
  Log:
  - For 2.11
    - Backport 1.404, 1.405.
  
  
Index: loncom/interface/lonmenu.pm
diff -u loncom/interface/lonmenu.pm:1.369.2.30 loncom/interface/lonmenu.pm:1.369.2.31
--- loncom/interface/lonmenu.pm:1.369.2.30	Thu Dec 27 05:52:00 2012
+++ loncom/interface/lonmenu.pm	Fri Dec 28 17:26:15 2012
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Routines to control the menu
 #
-# $Id: lonmenu.pm,v 1.369.2.30 2012/12/27 05:52:00 raeburn Exp $
+# $Id: lonmenu.pm,v 1.369.2.31 2012/12/28 17:26:15 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -346,6 +346,15 @@
     my $canmgr        = &Apache::lonnet::allowed('mgr', $crs_sec);
     my $author        = &getauthor();
 
+    my ($canmodifycoauthor);
+    if ($env{'request.role'} eq "au./$env{'user.domain'}/") {
+        my $extent = "$env{'user.domain'}/$env{'user.name'}";
+        if ((&Apache::lonnet::allowed('cca',$extent)) ||
+            (&Apache::lonnet::allowed('caa',$extent))) {
+            $canmodifycoauthor = 1;
+        }
+    }
+
     my %groups = &Apache::lonnet::get_active_groups(
                      $env{'user.domain'}, $env{'user.name'},
                      $env{'course.' . $env{'request.course.id'} . '.domain'},
@@ -357,7 +366,7 @@
         # evaluate conditions 
         next if    ref($menuitem)  ne 'ARRAY';
         next if    $$menuitem[4]   ne 'always'
-                && $$menuitem[4]   ne 'author'
+                && ($$menuitem[4]  ne 'author' && $$menuitem[4] ne 'cca')
                 && !$env{'request.course.id'};
         next if    $$menuitem[4]   =~ /^mdc/
                 && !$canedit;
@@ -385,6 +394,8 @@
                 && ($canviewgrps || !%groups);
         next if    $$menuitem[4]    eq 'author'
                 && !$author;
+        next if    $$menuitem[4]    eq 'cca'
+                && !$canmodifycoauthor;
 
         my $title = $menuitem->[3];
         if (defined($secondary_submenu{$title})) {
@@ -1291,7 +1302,8 @@
                                               $forceedit,$forceview,$forcereg,
                                               $env{'form.title'},$env{'form.suppurl'});
             }
-        } elsif ($resurl !~ m{^/?adm/($match_domain)/($match_username)/aboutme$}) {
+        } elsif (($resurl !~ m{^/?adm/($match_domain)/($match_username)/aboutme$}) &&
+                 ($resurl ne '/cgi-bin/printout.pl')) {
             if ($env{'request.filename'}) {
                 my $file=&Apache::lonnet::declutter($env{'request.filename'});
                 ($cfile,$home,$switchserver,$forceedit,$forceview) =




More information about the LON-CAPA-cvs mailing list