--- loncom/interface/lonmenu.pm 2004/06/27 16:03:57 1.108 +++ loncom/interface/lonmenu.pm 2004/07/02 07:58:01 1.109 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Routines to control the menu # -# $Id: lonmenu.pm,v 1.108 2004/06/27 16:03:57 www Exp $ +# $Id: lonmenu.pm,v 1.109 2004/07/02 07:58:01 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -310,9 +310,11 @@ sub innerregister { } # Check that we are on the correct machine my $home = &Apache::lonnet::homeserver($caname,$cadom); - if ($home eq $Apache::lonnet::perlvar{'lonHostID'}) { - $editbutton=&switch - ('','',6,1,$top,,$bottom,$action,$desc); + my $allowed=0; + my @ids=&Apache::lonnet::current_machine_ids(); + foreach my $id (@ids) { if ($id eq $home) { $allowed=1; } } + if (!$allowed) { + $editbutton=&switch('','',6,1,$top,,$bottom,$action,$desc); } } ## @@ -324,16 +326,20 @@ sub innerregister { if ($ENV{'request.filename'}) { my $file=&Apache::lonnet::declutter($ENV{'request.filename'}); $file=~s/^(\w+)\/(\w+)/\/priv\/$2/; - # Chech that the user has permission to edit this resource + # Check that the user has permission to edit this resource ($cfuname,$cfudom)=&Apache::loncacc::constructaccess($file,$1); if (defined($cfudom)) { - if (&Apache::lonnet::homeserver($cfuname,$cfudom) - eq $Apache::lonnet::perlvar{'lonHostID'}) { + my $home=&Apache::lonnet::homeserver($cfuname,$cfudom); + my $allowed=0; + my @ids=&Apache::lonnet::current_machine_ids(); + foreach my $id (@ids) { if ($id eq $home) { $allowed=1; } } + if ($allowed) { $cfile=$file; } } } # Finally, turn the button on or off + &Apache::lonnet::logthis("cfile is $cfile"); if ($cfile) { $editbutton=&switch ('','',6,1,'cstr.gif','edit[_1]','resource[_2]', @@ -810,7 +816,10 @@ sub rawconfig { } $act =~ s/\$caname/$caname/g; my $home = &Apache::lonnet::homeserver($caname,$cadom); - if ($home eq $Apache::lonnet::perlvar{'lonHostID'}) { + my $allowed=0; + my @ids=&Apache::lonnet::current_machine_ids(); + foreach my $id (@ids) { if ($id eq $home) { $allowed=1; } } + if ($allowed) { $output.=switch($caname,$cadom, $row,$col,$img,$top,$bot,$act,$desc); }