X-Git-Url: http://Server1/repobrowser/?a=blobdiff_plain;f=cgi-files%2Fkiriwrite.cgi;h=e131756a7aeef44ee47a3921b335ccb78d65c3b4;hb=c50d1eaadbb17830fcaf3258dd39d7b25599ff3e;hp=85d6a2d921a18dfd0693d2bf1bdaec38e1371a03;hpb=1553f195cb1ca50f1409afec52b29002e03b4511;p=kiriwrite%2F.git diff --git a/cgi-files/kiriwrite.cgi b/cgi-files/kiriwrite.cgi index 85d6a2d..e131756 100755 --- a/cgi-files/kiriwrite.cgi +++ b/cgi-files/kiriwrite.cgi @@ -26,12 +26,15 @@ use warnings; # Write warnings to the HTTP Server Log file. use utf8; use CGI qw(header); -use CGI::Carp('fatalsToBrowser'); # Output errors to the browser. use Tie::IxHash; +# This is commented out because it uses a fair bit of CPU usage. + +#use CGI::Carp('fatalsToBrowser'); # Output errors to the browser. + # Declare global variables for Kiriwrite settings and languages. -my ($kiriwrite_config, %kiriwrite_config, $kiriwrite_lang, $kiriwrite_version, %kiriwrite_version, $kiriwrite_env, %kiriwrite_env, $kiriwrite_presmodule, $kiriwrite_dbmodule); +my ($kiriwrite_config, %kiriwrite_config, $kiriwrite_lang, $kiriwrite_version, %kiriwrite_version, $kiriwrite_env, %kiriwrite_env, $kiriwrite_presmodule, $kiriwrite_dbmodule, $xsl); # Setup the version information for Kiriwrite. @@ -75,6 +78,8 @@ sub BEGIN{ "script_filename" => $script_filename, ); + $ENV{XML_SIMPLE_PREFERRED_PARSER} = "XML::Parser"; + } ################################################################################# @@ -4649,7 +4654,7 @@ sub kiriwrite_page_list{ } else { my %database_info; - my %template_info; + my %page_info; my @database_pages; my $pagemultioptions = ""; my $db_name = ""; @@ -4665,7 +4670,7 @@ sub kiriwrite_page_list{ my $db_file_notblank = 0; tie(%database_info, 'Tie::IxHash'); - tie(%template_info, 'Tie::IxHash'); + tie(%page_info, 'Tie::IxHash'); # The database_file variable is not blank, so print out a list of pages from # the selected database. @@ -4792,7 +4797,7 @@ sub kiriwrite_page_list{ foreach $page_filename (@database_pages){ - %template_info = $kiriwrite_dbmodule->getpageinfo({ PageFilename => $page_filename }); + %page_info = $kiriwrite_dbmodule->getpageinfo({ PageFilename => $page_filename, Reduced => 1 }); # Check if any errors have occured. @@ -4813,10 +4818,10 @@ sub kiriwrite_page_list{ $page_count++; - $page_filename = $template_info{"PageFilename"}; - $page_name = $template_info{"PageName"}; - $page_description = $template_info{"PageDescription"}; - $page_modified = $template_info{"PageLastModified"}; + $page_filename = $page_info{"PageFilename"}; + $page_name = $page_info{"PageName"}; + $page_description = $page_info{"PageDescription"}; + $page_modified = $page_info{"PageLastModified"}; # Set the table cell style. @@ -10309,10 +10314,6 @@ sub kiriwrite_settings_edit{ my $confirm = $passedoptions->{"Confirm"}; - # Load the required Perl modules. - - my $xsl = XML::Simple->new(); - if (!$confirm){ # If the confirm value is blank, then set the confirm @@ -11300,7 +11301,7 @@ sub kiriwrite_settings_load{ # Load the required Perl modules. use XML::Simple qw(XMLin); - my $xsl = XML::Simple->new(); + $xsl = XML::Simple->new(); # Check if the Kiriwrite configuration file exists before using it and # return an critical error if it doesn't exist. @@ -13417,15 +13418,32 @@ sub kiriwrite_output_xml{ # Convert the password to make sure it can be read properly. - $settings_database_password =~ s/\0//g; - $settings_database_password =~ s//>/g; + if ($settings_database_password){ + + $settings_database_password =~ s/\0//g; + $settings_database_password =~ s//>/g; + + } # Convert the less than and greater than characters are there and # convert them. - $settings_imagesuri =~ s//>/g; + if ($settings_imagesuri){ + + $settings_imagesuri =~ s//>/g; + + } + + # Check if the database password value is undefined and if it is then + # set it blank. + + if (!$settings_database_password){ + + $settings_database_password = ""; + + } # Create the XML data layout.