[Astpp-commit] SF.net SVN: astpp: [2141] trunk
Brought to you by:
darrenkw
|
From: <dar...@us...> - 2007-11-02 02:31:38
|
Revision: 2141
http://astpp.svn.sourceforge.net/astpp/?rev=2141&view=rev
Author: darrenkw
Date: 2007-11-01 19:24:30 -0700 (Thu, 01 Nov 2007)
Log Message:
-----------
Patch Regarding: [ 1820671 ] HTML::TEmplate die_on_bad_params => 0
Modified Paths:
--------------
trunk/astpp-admin.cgi
trunk/astpp-users.cgi
trunk/sql/astpp-2007-10-31.sql
Modified: trunk/astpp-admin.cgi
===================================================================
--- trunk/astpp-admin.cgi 2007-11-01 06:15:04 UTC (rev 2140)
+++ trunk/astpp-admin.cgi 2007-11-02 02:24:30 UTC (rev 2141)
@@ -1470,7 +1470,7 @@
sub build_homepage() {
my $template =
- HTML::Template->new( filename => '/var/lib/astpp/templates/home.tpl' );
+ HTML::Template->new( filename => '/var/lib/astpp/templates/home.tpl', die_on_bad_params => '$config->{template_die_on_bad_params' );
if ( $params->{logintype} == 1
|| $params->{logintype} == 5
@@ -1560,7 +1560,7 @@
);
my $template =
HTML::Template->new(
- filename => '/var/lib/astpp/templates/account-info.tpl' );
+ filename => '/var/lib/astpp/templates/account-info.tpl', die_on_bad_params => '$config->{template_die_on_bad_params' );
return gettext("Cannot view account until database is configured")
unless $astpp_db;
if ( $params->{logintype} == 1 || $params->{logintype} == 5 ) {
@@ -2039,7 +2039,7 @@
my ( $body, $total, $count, $reseller, @accountdetaillist );
my $template =
HTML::Template->new(
- filename => '/var/lib/astpp/templates/account-list.tpl' );
+ filename => '/var/lib/astpp/templates/account-list.tpl', die_on_bad_params => '$config->{template_die_on_bad_params' );
my $yes = gettext("YES");
my $no = gettext("NO");
return gettext("Cannot view account until database is configured")
@@ -2216,7 +2216,7 @@
my ( @pricelists, $status, $body );
my $template =
HTML::Template->new(
- filename => '/var/lib/astpp/templates/account-create.tpl' );
+ filename => '/var/lib/astpp/templates/account-create.tpl', die_on_bad_params => '$config->{template_die_on_bad_params' );
return gettext("Database is NOT configured!") . " \n"
unless $astpp_db;
if ( $params->{logintype} == 1 || $params->{logintype} == 5 ) {
@@ -5442,7 +5442,7 @@
$accountinfo );
my $template =
HTML::Template->new(
- filename => '/var/lib/astpp/templates/account-remove.tpl' );
+ filename => '/var/lib/astpp/templates/account-remove.tpl', die_on_bad_params => '$config->{template_die_on_bad_params' );
if ( $params->{action} eq gettext("Deactivate...") ) {
if ( $params->{number} ne "" ) {
$number = $params->{number};
@@ -5501,7 +5501,7 @@
my ( $status, $body, $number, $reseller );
my $template =
HTML::Template->new(
- filename => '/var/lib/astpp/templates/account-process-payment.tpl' );
+ filename => '/var/lib/astpp/templates/account-process-payment.tpl', die_on_bad_params => '$config->{template_die_on_bad_params' );
return gettext("Database not configured!") unless $astpp_db;
if ( $params->{logintype} == 1 || $params->{logintype} == 5 ) {
$reseller = $params->{username};
@@ -7904,7 +7904,7 @@
my (@counter_list);
my $template =
HTML::Template->new(
- filename => '/var/lib/astpp/templates/counters-list.tpl' );
+ filename => '/var/lib/astpp/templates/counters-list.tpl', die_on_bad_params => '$config->{template_die_on_bad_params' );
my $results_per_page = $config->{results_per_page};
if ( $results_per_page eq "" || $results_per_page < 2 ) {
$results_per_page = 25;
@@ -9484,7 +9484,7 @@
my ( $tmp, $template, @configuration_list );
$template =
HTML::Template->new(
- filename => '/var/lib/astpp/templates/configuration-list.tpl' );
+ filename => '/var/lib/astpp/templates/configuration-list.tpl', die_on_bad_params => '$config->{template_die_on_bad_params' );
if ( $params->{logintype} == 2 ) {
$tmp = "SELECT * FROM system";
}
@@ -10754,7 +10754,7 @@
sub build_add_callshop() {
my $template =
HTML::Template->new(
- filename => '/var/lib/astpp/templates/callshop-create.tpl' );
+ filename => '/var/lib/astpp/templates/callshop-create.tpl', die_on_bad_params => '$config->{template_die_on_bad_params' );
if ( $params->{action} eq gettext("Add...") ) {
if ( $params->{logintype} == 1 || $params->{logintype} == 5 ) {
$params->{pricelist} = $params->{username};
@@ -10812,7 +10812,7 @@
sub build_remove_callshop() {
my $template =
HTML::Template->new(
- filename => '/var/lib/astpp/templates/callshop-remove.tpl' );
+ filename => '/var/lib/astpp/templates/callshop-remove.tpl', die_on_bad_params => '$config->{template_die_on_bad_params' );
my ( @callshops, $tmp );
if ( $params->{logintype} == 1 ) {
@callshops = &list_callshops_reseller( $astpp_db, $params->{username} );
@@ -10867,7 +10867,7 @@
my ( $template, $currency, $pricelist, $language, $status );
$template =
HTML::Template->new(
- filename => '/var/lib/astpp/templates/booth-create.tpl' );
+ filename => '/var/lib/astpp/templates/booth-create.tpl', die_on_bad_params => '$config->{template_die_on_bad_params' );
$params->{reseller} = $params->{username};
$currency = popup_menu(
-name => "currency",
@@ -11045,7 +11045,7 @@
sub build_remove_booth() {
my $template =
HTML::Template->new(
- filename => '/var/lib/astpp/templates/booth-remove.tpl' );
+ filename => '/var/lib/astpp/templates/booth-remove.tpl', die_on_bad_params => '$config->{template_die_on_bad_params' );
my ( @booth_list, $accountinfo );
########
# Decide which booth name to use. The one in the box has priority over the selected list one.
@@ -11292,7 +11292,7 @@
my $template =
HTML::Template::Expr->new(
- filename => '/var/lib/astpp/templates/booths-list.tpl' );
+ filename => '/var/lib/astpp/templates/booths-list.tpl', die_on_bad_params => '$config->{template_die_on_bad_params' );
$template->param( booth_list => \@booths );
return $template->output;
}
@@ -11442,7 +11442,7 @@
}
my $template =
HTML::Template->new(
- filename => '/var/lib/astpp/templates/booth-view.tpl' );
+ filename => '/var/lib/astpp/templates/booth-view.tpl', die_on_bad_params => '$config->{template_die_on_bad_params' );
$template->param( booth_name => $params->{booth_name} );
my $balance = &accountbalance( $astpp_db, $params->{booth_name} ) / 10000;
my $unrated = &count_unrated_cdrs_account( $cdr_db, $accountinfo->{number},
@@ -11462,7 +11462,7 @@
###################Start of Application ###################
&initialize();
my $template =
- HTML::Template->new( filename => '/var/lib/astpp/templates/main.tpl' );
+ HTML::Template->new( filename => '/var/lib/astpp/templates/main.tpl', die_on_bad_params => '$config->{template_die_on_bad_params' );
foreach my $param ( param() ) {
$params->{$param} = param($param);
print STDERR "$param $params->{$param}\n" if $config->{debug} == 1;
Modified: trunk/astpp-users.cgi
===================================================================
--- trunk/astpp-users.cgi 2007-11-01 06:15:04 UTC (rev 2140)
+++ trunk/astpp-users.cgi 2007-11-02 02:24:30 UTC (rev 2141)
@@ -226,7 +226,7 @@
$cost, $pagesrequired, $record, $debit,
$credit, $pageno, $credit_limit
);
- my $template = HTML::Template->new(filename => '/var/lib/astpp/templates/users-account-info.tpl');
+ my $template = HTML::Template->new(filename => '/var/lib/astpp/templates/users-account-info.tpl', die_on_bad_params => '$config->{template_die_on_bad_params');
return gettext("Cannot view account until database is configured")
unless $astpp_db;
if ( $params->{limit} < 1 ) { $params->{limit} = 0 }
@@ -421,7 +421,7 @@
$cardstat, $cardinfo, $count, $sql, $value,
$used, $pageno, $pagesrequired);
my (@cdr_list, @card_list);
- my $template = HTML::Template->new(filename => '/var/lib/astpp/templates/users-list-callingcards.tpl');
+ my $template = HTML::Template->new(filename => '/var/lib/astpp/templates/users-list-callingcards.tpl', die_on_bad_params => '$config->{template_die_on_bad_params');
my $no = gettext("NO");
my $yes = gettext("YES");
my $active = gettext("ACTIVE");
@@ -587,7 +587,7 @@
sub build_dids() {
my ( $total, $body, $status, $description, $pricelist, $pageno, $pagesrequired );
- my $template = HTML::Template->new(filename => '/var/lib/astpp/templates/users-dids.tpl');
+ my $template = HTML::Template->new(filename => '/var/lib/astpp/templates/users-dids.tpl', die_on_bad_params => '$config->{template_die_on_bad_params');
return gettext("Cannot view DIDs until database is configured")
unless $astpp_db;
if ( $params->{limit} < 1 ) { $params->{limit} = 0 }
@@ -783,7 +783,7 @@
sub build_ani_map() {
my ( @ani_list,$total, $body, $status, $description, $pricelist, $pageno,
$pagesrequired );
- my $template = HTML::Template->new(filename => '/var/lib/astpp/templates/users-map-ani.tpl');
+ my $template = HTML::Template->new(filename => '/var/lib/astpp/templates/users-map-ani.tpl', die_on_bad_params => '$config->{template_die_on_bad_params');
return gettext("Not available until database is configured")
unless $astpp_db;
if ( $params->{limit} < 1 ) { $params->{limit} = 0 }
@@ -881,7 +881,7 @@
$ENV{LANGUAGE} = $cardinfo->{language};
print STDERR gettext("Interface language is set to:") . " $ENV{LANGUAGE}\n" if $config->{debug} == 1;
-my $template = HTML::Template->new(filename => '/var/lib/astpp/templates/users-main.tpl');
+my $template = HTML::Template->new(filename => '/var/lib/astpp/templates/users-main.tpl', die_on_bad_params => '$config->{template_die_on_bad_params');
my ($body, $menu);
if ( $loginstat == 1 && $params->{mode} ne gettext("Download")) {
$params->{mode} = gettext("Home")
Modified: trunk/sql/astpp-2007-10-31.sql
===================================================================
--- trunk/sql/astpp-2007-10-31.sql 2007-11-01 06:15:04 UTC (rev 2140)
+++ trunk/sql/astpp-2007-10-31.sql 2007-11-02 02:24:30 UTC (rev 2141)
@@ -555,6 +555,9 @@
INSERT INTO system (name, value, comment, timestamp) VALUES (
'callingcards_max_length','9000','What is the maximum length (in ms) of a callingcard call?','');
+
+INSERT INTO system (name,value,comment,timestamp) VALUES (
+'template_die_on_bad_params','0','Should HTML::Template die on bad parameters?','');
--
-- This is where the old "enh-config" settings start
--
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|