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

raeburn raeburn at source.lon-capa.org
Sun Feb 23 17:36:17 EST 2014


raeburn		Sun Feb 23 22:36:17 2014 EDT

  Modified files:              (Branch: version_2_11_X)
    /loncom/interface	lonmenu.pm 
  Log:
  - For 2.11
    - Backport 1.427.
  
  
Index: loncom/interface/lonmenu.pm
diff -u loncom/interface/lonmenu.pm:1.369.2.50 loncom/interface/lonmenu.pm:1.369.2.51
--- loncom/interface/lonmenu.pm:1.369.2.50	Mon Jan  6 17:32:58 2014
+++ loncom/interface/lonmenu.pm	Sun Feb 23 22:36:16 2014
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Routines to control the menu
 #
-# $Id: lonmenu.pm,v 1.369.2.50 2014/01/06 17:32:58 raeburn Exp $
+# $Id: lonmenu.pm,v 1.369.2.51 2014/02/23 22:36:16 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1712,7 +1712,10 @@
     my $pub=($env{'request.state'} eq 'published');
     my $con=($env{'request.state'} eq 'construct');
     my $rol=$env{'request.role'};
-    my $requested_domain = $env{'request.role.domain'};
+    my $requested_domain;
+    if ($rol) {
+       $requested_domain = $env{'request.role.domain'};
+    }
     foreach my $line (@desklines) {
         my ($row,$col,$pro,$prt,$img,$top,$bot,$act,$desc,$cat)=split(/\:/,$line);
         $prt=~s/\$uname/$uname/g;
@@ -1726,7 +1729,13 @@
             next if ($crstype ne 'Community');
             $prt=~s/\$cmty/$crs/g;
         }
-        $prt=~s/\$requested_domain/$requested_domain/g;
+        if ($prt =~ m/\$requested_domain/) {
+            if ((!$requested_domain) && ($pro eq 'pbre') && ($env{'user.adv'})) {
+                $prt=~s/\$requested_domain/$env{'user.domain'}/g;
+            } else {
+                $prt=~s/\$requested_domain/$requested_domain/g;
+            }
+        }
         if ($category_names{$cat}!~/\w/) { $cat='oth'; }
         if ($pro eq 'clear') {
 	    $output.=&clear($row,$col);
@@ -1762,8 +1771,9 @@
                     next;
                 }
             }
-	    if (&Apache::lonnet::allowed($priv,$prt)) {
-               $output.=&switch($uname,$udom,$row,$col,$img,$top,$bot,$act,$desc,$cat);
+            if ((($priv eq 'bre') && (&Apache::lonnet::allowed($priv,$prt) eq 'F')) ||
+                (($priv ne 'bre') && (&Apache::lonnet::allowed($priv,$prt)))) {
+                $output.=&switch($uname,$udom,$row,$col,$img,$top,$bot,$act,$desc,$cat);
             }
         } elsif ($pro eq 'course')  {
             if (($env{'request.course.fn'}) && ($crstype ne 'Community')) {




More information about the LON-CAPA-cvs mailing list