Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
*********************************sched_history.cgi********************************************************************<TMPL_INCLUDE NAME="./icon_top.tmpl"> <!--webbot bot="Include" endspan i-checksum="28680" --> <p class="page-header">Distribution Schedule Audit Log</p> <hr class="header-line"> <br> <form name=schedhistform method=POST action="/gdr/cgi-bin/user_detail. +cgi"> <input type=hidden name=user_id value="<tmpl_var name=user_id>"> <input type=hidden name=sched_effective_dt> <table class="data-table"> <caption class="info-table-caption">Distribution ID: <TMPL_VAR NAME=US +ER_ID></caption> <tr class="info-table-header"> <td>Effective Date</td> <td>Status</td> <td>Updated By</td> <td>Description</td> </tr> <TMPL_LOOP NAME=sched_history_list> <tr class="<tmpl_if name=__ODD__>shaded<tmpl_else>unshaded</tmpl_if>" +> <td><TMPL_VAR NAME=SCHED_EFFECTIVE_DT></td> <td><TMPL_VAR NAME=STATUS_CD></td> <td><TMPL_VAR NAME=SCHED_UPD_USER_ID></td> <td><TMPL_VAR NAME=DESC></td> </tr> </TMPL_LOOP> </table> </form> <TMPL_INCLUDE NAME="./icon_bottom.tmpl">
use HTML::Template; use Provider::CGI; use strict; use Apache::DBI; use DBI; use coplib; use Provider::LogAgent; use Provider::Constants; my $cgi = Provider::CGI->new(); # Store the user information in the session object my %session; getSession( \%session ); print $cgi->header( -charset => q{utf-8} ); my $user_id=$cgi->param( "user_id" ); ## Common Log my $logger = new Provider::LogAgent(\%session); my $event = $Provider::Constants::ADMIN_INFO; my $entity = "$user_id"; my $entityType = "distribution_id"; my $additional = {"action"=>$Provider::Constants::COMMON_LOG_ACCESS}; $logger->store_message($event, $entity, $entityType, %$additional); $user_id =~ s/^\s+//; $user_id =~ s/\s+$//; $user_id = uc($user_id); my $dbh = cpDBConnect( \%session ); my $row_data; my $sql_stmt; my $template = new_template( "sched_history.tmpl", "Distribution Sched +ule History", \%session); $sql_stmt = "SELECT to_char( DSD.EFF_DT, 'DD-MON-YYYY HH24:MI:SS') AS +SCHED_EFFECTIVE_DT, " . "DSD.LAST_UPD_USER_ID AS SCHED_UPD_USER_ID, " . "DSD.STAT_CD AS STATUS_CD, " . "DSD.DESC_TXT AS DESC_TXT " . "FROM DIST_SCHED_DETAIL DSD , DIST_SCHED DS " . "WHERE DSD.USER_ID=? AND DS.USER_ID = DSD.USER_ID "; my $sth = $dbh->prepare($sql_stmt); $sth->execute( $user_id ); my @loop_data; while ( $row_data = $sth->fetchrow_hashref ) { push(@loop_data, $row_data); } $sth->finish; $template->param( sched_history_list => \@loop_data); $template->param( USER_ID => $user_id ); #$dbh->disconnect; print $template->output; END { untie %session; undef %session; }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Need help figure out CSRF vulnerability on this cgi code
by Corion (Patriarch) on Mar 31, 2012 at 18:45 UTC | |
by tinita (Parson) on Mar 31, 2012 at 20:51 UTC | |
by Anonymous Monk on Mar 31, 2012 at 20:38 UTC | |
by Anonymous Monk on Apr 01, 2012 at 02:35 UTC |