[- # # simple print page # # pass mid, s(ection) and f(ield) # BEGIN { unshift(@INC, $ENV{SW_PERLDIR}); } use SW::Site::rcm; use SW::DB::rcm; use Data::Dumper; # break any cache $http_headers_out{'Expires'} = "Fri, 30 Oct 1998 14:19:41 GMT"; $http_headers_out{'Cache-Control'} = "max-age=1, must-revalidate"; # # create site object and connect to db # my $site = SW::Site::rcm->new( $ENV{SW_CONFIG} ); $site->{show_top} = 0; $site->{extra_head} .= < function ApplicationReminder() { return confirm('This action is irreversible!. Do you still want to continue?'); } EOTEXT my $db = SW::DB::rcm->new( $ENV{SW_CONFIG} ); if ( $db->connect() ) { } else { print OUT $site->showContent( "sorry can't connect to db" ); exit; } $site->{db} = $db; $site->{extra_head} .= $site->readFile( $site->includeFile( 'htmlarea' )); # get login_id from md5 cookie my %cookies = $site->getCookies(); my $login_id = $db->md52login( $cookies{lid} ); my $login_ref = $db->getLoginAccount( $login_id ); my $login_id = $login_ref->{login_id}; # my $access_level = $db->getAccessLevel( $login_id ); my $manual_id = $db->login2manual( $login_id ); $fdat{mid} = $manual_id; $db->lastAccessManual( $manual_id ); if ( ! $login_id ) { print OUT $site->showContent( $cookies{lid}.'Invalid session id. Please login again.' ); exit; } my $out = < EOTEXT my $ref = $db->getSection( $fdat{s} ); #$out .= Dumper( $ref ); $out .= $ref->{ $fdat{f} }; $out .= < EOTEXT print OUT $out; -]