[Bio] / SubsystemEditor / WebPage / ShowSubsystem.pm Repository:
ViewVC logotype

Diff of /SubsystemEditor/WebPage/ShowSubsystem.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.3, Thu Dec 13 17:46:23 2007 UTC revision 1.4, Thu Dec 13 21:17:21 2007 UTC
# Line 49  Line 49 
49    # look if someone is logged in and can write the subsystem #    # look if someone is logged in and can write the subsystem #
50    my $can_alter = 0;    my $can_alter = 0;
51    my $user = $self->application->session->user;    my $user = $self->application->session->user;
52    
53      my $dbmaster = DBMaster->new( -database => 'WebAppBackend' );
54      my $ppoapplication = $dbmaster->Backend->init( { name => 'SubsystemEditor' } );
55    
56      # get a seeduser #
57      my $seeduser = '';
58      if ( defined( $user ) && ref( $user ) ) {
59        my $preferences = $dbmaster->Preferences->get_objects( { user => $user,
60                                                                 name => 'SeedUser',
61                                                                 application => $ppoapplication } );
62        if ( defined( $preferences->[0] ) ) {
63          $seeduser = $preferences->[0]->value();
64        }
65      }
66    
67    if ( $user && $user->has_right( $self->application, 'edit', 'subsystem', $name ) ) {    if ( $user && $user->has_right( $self->application, 'edit', 'subsystem', $name ) ) {
68      $can_alter = 1;      $can_alter = 1;
69      $fig->set_user( $user->login );      $fig->set_user( $seeduser );
70    }    }
   
71    ######################    ######################
72    # Construct the menu #    # Construct the menu #
73    ######################    ######################
# Line 144  Line 158 
158    my $versionlink = '';    my $versionlink = '';
159  print STDERR $can_alter." CANALTER\n";  print STDERR $can_alter." CANALTER\n";
160    if ( $can_alter ) {    if ( $can_alter ) {
161      $versionlink = "<A HREF='".$self->application->url()."?page=ResetSubsystem&subsystem=$name'>Reset to Previous Timestamp</A>";      $versionlink = " -- <A HREF='".$self->application->url()."?page=ResetSubsystem&subsystem=$name'>Reset to Previous Timestamp</A>";
162      print STDERR $versionlink . " VL\n";      print STDERR $versionlink . " VL\n";
163    }    }
164    

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.4

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3