From c34e73e4a0f8ab38adc88829598207e219a86928 Mon Sep 17 00:00:00 2001 From: ivan Date: Tue, 30 Oct 2001 14:20:46 +0000 Subject: [PATCH] web config should workish now --- htetc/handler.pl | 1 + httemplate/config/config-view.cgi | 4 +++- httemplate/config/config.cgi | 48 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 52 insertions(+), 1 deletion(-) create mode 100644 httemplate/config/config.cgi diff --git a/htetc/handler.pl b/htetc/handler.pl index f01d3cd0b..d10ecc918 100644 --- a/htetc/handler.pl +++ b/htetc/handler.pl @@ -59,6 +59,7 @@ sub handler #use CGI::Carp qw(fatalsToBrowser); use Date::Format; use Date::Parse; + use HTML::Entities; use FS::UID qw(cgisuidsetup); use FS::Record qw(qsearch qsearchs fields); use FS::part_svc; diff --git a/httemplate/config/config-view.cgi b/httemplate/config/config-view.cgi index 09e535b2f..3c16c4815 100644 --- a/httemplate/config/config-view.cgi +++ b/httemplate/config/config-view.cgi @@ -25,7 +25,9 @@ no type <% } elsif ( $type eq 'textarea' ) { %> -
<%= join("\n", $conf->config($i->key) ) %>
+
+<%= encode_entities(join("\n", $conf->config($i->key) ) ) %>
+
<% } elsif ( $type eq 'checkbox' ) { %> YES' : 'ff0000">NO' %> diff --git a/httemplate/config/config.cgi b/httemplate/config/config.cgi new file mode 100644 index 000000000..32ddc043d --- /dev/null +++ b/httemplate/config/config.cgi @@ -0,0 +1,48 @@ +<%= header('Edit Configuration', menubar( 'Main Menu' => $p ) ) %> + +<% my $conf = new FS::Conf; my @config_items = $conf->config_items; %> + +
+ +<% foreach my $section ( qw(required billing username password UI session + apache BIND shell + ), + '', 'depreciated') { %> + <%= table("#cccccc", 2) %> + + + <%= ucfirst($section || 'unclassified') %> configuration options + + + <% foreach my $i (grep $_->section eq $section, @config_items) { %> + + + <% my $n = 0; + foreach my $type ( ref($i->type) ? @{$i->type} : $i->type ) { + #warn $i->key unless defined($type); + %> + <% if ( $type eq '' ) { %> + no type + <% } elsif ( $type eq 'textarea' ) { %> + + <% } elsif ( $type eq 'checkbox' ) { %> + exists($i->key) ? ' CHECKED' : '' %>> + <% } elsif ( $type eq 'text' ) { %> + + <% } else { %> + unknown type <%= $type %> + <% } %> + <% $n++; } %> + + + <%= $i->key %> - <%= $i->description %> + + + <% } %> +

+<% } %> + + +
+ + -- 2.11.0