auto/share/dist/Nes/cgi-bin/plugin/forms.pl untested

filter: Statementstmt 0.0% 0 / 28 Branchbran 0.0% 0 / 6 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 3 Podpod n/a totaltotal 0.0% 0 / 37 CC 1 SCAR 6.9
CC
1
Cov
0%
BEGIN
2.0
BEGIN
2.0
BEGIN
2.0
CRAP 2.0
1 #!/usr/bin/perl
2  
3 # -----------------------------------------------------------------------------
4 #
5 # Nes by Skriptke
6 # Copyright 2009 - 2010 Enrique F. Castañón Barbero
7 # Licensed under the GNU GPL.
8 #
9 # CPAN:
10 # http://search.cpan.org/dist/Nes/
11 #
12 # Sample:
13 # http://nes.sourceforge.net/
14 #
15 # Repository:
16 # http://github.com/Skriptke/nes
17 #
18 # Version 1.03
19 #
20 # forms.pl
21 #
22 # -----------------------------------------------------------------------------
23  
24 use strict;
25 use Nes;
26 use forms_plugin;
27  
28 my $nes = Nes::Singleton->new();
29  
30 my $out = $nes->{'container'}->get_out_content();
31 my $forms = nes_forms_plugin->new($out);
32  
33 $nes->{'container'}->set_out_content( $forms->go() );
34  
35 my $nes_tags = {};
36 $nes_tags->{'this_plugin'} = 'forms_plugin';
37  
38 foreach my $name ( keys %{$forms->{'form'}} ) {
39 $forms->{'form'}{$name}->is_ok();
40 my $plugin = nes_plugin->get_obj('forms_plugin');
41 $plugin->add_env( 'forms_plugin', $name, 'is_ok', $forms->{'form'}{$name}->{'is_ok'} );
42 if ( $forms->{'form'}{$name}->{'fatal_error'} ) {
43 if ( $forms->{'form'}{$name}->{'location'} ne 'none' ) {
44 if ( $forms->{'form'}{$name}->{'location'} ) {
45 print "Location: $forms->{'form'}{$name}->{'location'}\n\n";
46 exit;
47 } else {
48 print "Location: http://$ENV{'SERVER_NAME'}$ENV{'PATH_INFO'}?error_forms=$forms->{'form'}{$name}->{'fatal_error'}\n\n";
49 exit;
50 }
51 }
52 }
53  
54 }
55  
56 $nes->{'container'}->add_tags(%$nes_tags);
57  
58 # don't forget to return a true value from the file
59 1;
60