[LON-CAPA-cvs] cvs: loncom /auth lonauth.pm lonroles.pm /interface lonmenu.pm

matthew lon-capa-cvs@mail.lon-capa.org
Mon, 06 May 2002 14:20:27 -0000


matthew		Mon May  6 10:20:27 2002 EDT

  Modified files:              
    /loncom/interface	lonmenu.pm 
    /loncom/auth	lonauth.pm lonroles.pm 
  Log:
  Changes to lonmenu::rawconfig() to not display the 'cstr' button if you do
  not have privleges on the current server.
  
  
Index: loncom/interface/lonmenu.pm
diff -u loncom/interface/lonmenu.pm:1.18 loncom/interface/lonmenu.pm:1.19
--- loncom/interface/lonmenu.pm:1.18	Thu Mar 21 12:53:27 2002
+++ loncom/interface/lonmenu.pm	Mon May  6 10:20:27 2002
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Routines to control the menu
 #
-# $Id: lonmenu.pm,v 1.18 2002/03/21 17:53:27 www Exp $
+# $Id: lonmenu.pm,v 1.19 2002/05/06 14:20:27 matthew Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -106,6 +106,7 @@
 }
 
 sub rawconfig {
+    my $r = shift;
     my $output="swmenu=".&openmenu();
     my $uname=$ENV{'user.name'};
     my $udom=$ENV{'user.domain'};
@@ -149,13 +150,22 @@
         } elsif ($pro eq 'author') {
             if ($author) {
                 if (($prt eq 'rca') && ($ENV{'request.role'}=~/^ca/)) {
+                    # Check that we are on the correct machine
 		    my ($cadom,$caname)=
                                ($ENV{'request.role'}=~/(\w+)\/(\w+)$/);
-                    $output.=switch($caname,$cadom,
-                                    $row,$col,$img,$top,$bot,$act);
+                    my $home = &Apache::lonnet::homeserver($caname,$cadom);
+                    if ($home eq $r->dir_config('lonHostID')) {
+                        $output.=switch($caname,$cadom,
+                                        $row,$col,$img,$top,$bot,$act);
+                    }
                 } elsif ($prt eq 'any') {
-                    $output.=switch($ENV{'user.name'},$ENV{'user.domain'},
-				    $row,$col,$img,$top,$bot,$act);
+                    my $home = &Apache::lonnet::homeserver
+                        ($ENV{'user.name'},$ENV{'user.domain'});
+                    if ($home eq $r->dir_config('lonHostID')) {
+                        $output.=switch
+                            ($ENV{'user.name'},$ENV{'user.domain'},
+                             $row,$col,$img,$top,$bot,$act);
+                    }
                 }
             }
         }
Index: loncom/auth/lonauth.pm
diff -u loncom/auth/lonauth.pm:1.28 loncom/auth/lonauth.pm:1.29
--- loncom/auth/lonauth.pm:1.28	Thu Mar 21 13:54:47 2002
+++ loncom/auth/lonauth.pm	Mon May  6 10:20:27 2002
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # User Authentication Module
 #
-# $Id: lonauth.pm,v 1.28 2002/03/21 18:54:47 www Exp $
+# $Id: lonauth.pm,v 1.29 2002/05/06 14:20:27 matthew Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -164,7 +164,7 @@
 # -------------------------------------------------------- Menu script and info
     my $windowinfo=&Apache::lonmenu::open();
 # ------------------------------------------------------------- Info for Remote
-    my $configmenu=&Apache::lonmenu::rawconfig();
+    my $configmenu=&Apache::lonmenu::rawconfig($r);
 # ------------------------------------------------- Output for successful login
 
     $r->send_cgi_header(<<ENDHEADER);
Index: loncom/auth/lonroles.pm
diff -u loncom/auth/lonroles.pm:1.35 loncom/auth/lonroles.pm:1.36
--- loncom/auth/lonroles.pm:1.35	Fri May  3 22:30:00 2002
+++ loncom/auth/lonroles.pm	Mon May  6 10:20:27 2002
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # User Roles Screen
 #
-# $Id: lonroles.pm,v 1.35 2002/05/04 02:30:00 matthew Exp $
+# $Id: lonroles.pm,v 1.36 2002/05/06 14:20:27 matthew Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -115,7 +115,7 @@
 	                 $r->content_type('text/html');
                          &Apache::loncommon::no_cache($r);
                          $r->send_http_header;
-                         my $swinfo=&Apache::lonmenu::rawconfig;
+                         my $swinfo=&Apache::lonmenu::rawconfig($r);
                          print (<<ENDREDIR);
 <head><title>Entering Course</title>
 <meta HTTP-EQUIV="Refresh" CONTENT="1; url=$furl">
@@ -146,7 +146,7 @@
     $r->send_http_header;
     return OK if $r->header_only;
 
-    my $swinfo=&Apache::lonmenu::rawconfig;
+    my $swinfo=&Apache::lonmenu::rawconfig($r);
     $r->print(<<ENDHEADER);
 <html>
 <head>