<%doc> # # $Id: sec-adv.html,v 1.2 2002/01/28 15:43:27 adulau Exp $ # # Sec-advisory.html is page to manage security advisor and their source # Authors : Alexandre Dulaunoy # Copyright (C) 2001 Conostix S.A. Luxembourg - Tycho Fruru # Copyright (C) 2001, 2002 Alexandre Dulaunoy # This program is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by the # Free Software Foundation; either version 2 of the License, or (at your # option) any later version. See . # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License # for more details. # <%args> $session $action=>"none" $source_id=>"" $source_url=>"" $source_remark=>"" $agent_id=>"0" $ticket=>"" $subject=>"" $description=>"" <%perl> if ($action eq "add-new") { my $query ="INSERT INTO source (source_url, source_remark) VALUES ('$source_url','$source_remark')"; $session->{'lastaction'}="security advisory $source_id added"; my @resultsupdate = $m->comp('../internal/sql-query-adv.ipfc',query=>$query); } elsif ($action eq "update") { my $query = "UPDATE source SET source_url = '".$source_url."', source_remark = '".$source_remark."' WHERE source_id =".$source_id.""; my @resultsupdate = $m->comp('../internal/sql-query-adv.ipfc',query=>$query); $session->{'lastaction'}="security advisory $source_id updated"; } elsif ($action eq "delete") { my $query ="DELETE FROM source WHERE source_id = $source_id"; my @resultsupdate = $m->comp('../internal/sql-query-adv.ipfc',query=>$query); $session->{'lastaction'}="security advisory $source_id deleted"; } elsif ($action eq "none") { $session->{'lastaction'}="none"; } $session->{query} = "select source_id, source_url, source_creation, source_remark from source order by source_id"; my @results = $m->comp('../internal/sql-query-adv.ipfc',query=>$session->{query}); if ($ticket eq "generate ticket") { #print "yopùlkooiezrzeiproizep"; $session->{'tickettype'} = "secadvisory"; $session->{'ticketsubject'} = $subject; $session->{'ticketdescription'} = $description; } <%perl> my $return = $m->comp('../internal/head-page.html',title=>'Security Advisory Management',session=>$session);
Manage source of Security Advisory :
% foreach my $current_line (@results) { % my $cpt=0; % foreach my $entry (@{$current_line}) { %if ($cpt==0) { % my $source_id = $entry; %} %elsif ($cpt==1) %{ %} %elsif ($cpt==2) %{ %} %elsif ($cpt==3) %{ %} %else %{ %} %$cpt++; %} %} <%doc>
source-id url creation date comment action
<% $entry %> %my @data = split(/\./,$entry); <% $data[0] %>
fixed
fixed
Latest Security Advisory :
<%perl> my $query = "select advisory_id, advisory_text, advisory_id_src from advisory order by advisory_modified desc limit 50 "; my @resultoutput = $m->comp('../internal/sql-query-adv.ipfc',query=>$query); % foreach my $current_line (@resultoutput) { % my $cpt=0; % foreach my $entry (@{$current_line}) { %if ($cpt == 0) { %} %elsif ($cpt == 1) { %} %elsif ($cpt == 2) { %} %else { %} % $cpt++; %} %}
advisory ID advisory_text advisory source id action
<% $entry %> % $session->{'advid'} = $entry; <% $entry %> % $session->{'advcomment'} = $entry; <% $entry %> % $session->{'advsourceid'} = $entry; <%doc>
% $session->{'tickettype'} = "secadvisory";
<%perl> my $endbody = $m->comp('../internal/end-page.html');