Diff for /loncom/interface/lonmenu.pm between versions 1.108 and 1.109

version 1.108, 2004/06/27 16:03:57 version 1.109, 2004/07/02 07:58:01
Line 310  sub innerregister { Line 310  sub innerregister {
                 }                  }
                 # Check that we are on the correct machine                  # Check that we are on the correct machine
                 my $home = &Apache::lonnet::homeserver($caname,$cadom);                  my $home = &Apache::lonnet::homeserver($caname,$cadom);
                 if ($home eq $Apache::lonnet::perlvar{'lonHostID'}) {   my $allowed=0;
                     $editbutton=&switch   my @ids=&Apache::lonnet::current_machine_ids();
                         ('','',6,1,$top,,$bottom,$action,$desc);   foreach my $id (@ids) { if ($id eq $home) { $allowed=1; } }
    if (!$allowed) {
       $editbutton=&switch('','',6,1,$top,,$bottom,$action,$desc);
                 }                  }
             }              }
             ##              ##
Line 324  sub innerregister { Line 326  sub innerregister {
             if ($ENV{'request.filename'}) {              if ($ENV{'request.filename'}) {
                 my $file=&Apache::lonnet::declutter($ENV{'request.filename'});                  my $file=&Apache::lonnet::declutter($ENV{'request.filename'});
                 $file=~s/^(\w+)\/(\w+)/\/priv\/$2/;                  $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);                  ($cfuname,$cfudom)=&Apache::loncacc::constructaccess($file,$1);
                 if (defined($cfudom)) {                  if (defined($cfudom)) {
                     if (&Apache::lonnet::homeserver($cfuname,$cfudom)       my $home=&Apache::lonnet::homeserver($cfuname,$cfudom);
                         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) {
                         $cfile=$file;                          $cfile=$file;
                     }                      }
                 }                  }
             }                      }        
             # Finally, turn the button on or off              # Finally, turn the button on or off
       &Apache::lonnet::logthis("cfile is $cfile");
             if ($cfile) {              if ($cfile) {
                 $editbutton=&switch                  $editbutton=&switch
                     ('','',6,1,'cstr.gif','edit[_1]','resource[_2]',                      ('','',6,1,'cstr.gif','edit[_1]','resource[_2]',
Line 810  sub rawconfig { Line 816  sub rawconfig {
                     }                                             }                       
                     $act =~ s/\$caname/$caname/g;                      $act =~ s/\$caname/$caname/g;
                     my $home = &Apache::lonnet::homeserver($caname,$cadom);                      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,                          $output.=switch($caname,$cadom,
                                         $row,$col,$img,$top,$bot,$act,$desc);                                          $row,$col,$img,$top,$bot,$act,$desc);
                     }                      }

Removed from v.1.108  
changed lines
  Added in v.1.109


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>