From e6b57805f6b3e76448ab9b6d280f2c53bc1410f3 Mon Sep 17 00:00:00 2001 From: ivan Date: Wed, 24 Oct 2001 15:29:31 +0000 Subject: preliminary web config editor new config files: username-ampersand, passwordmax fs-setup updates get rid of old and crufty and unused registries/ config foo documentation updates --- httemplate/config/config-process.cgi | 44 ++++++++++++++++++++++++++++++++++ httemplate/config/config-view.cgi | 46 ++++++++++++++++++++++++++++++++++++ 2 files changed, 90 insertions(+) create mode 100644 httemplate/config/config-process.cgi create mode 100644 httemplate/config/config-view.cgi (limited to 'httemplate/config') diff --git a/httemplate/config/config-process.cgi b/httemplate/config/config-process.cgi new file mode 100644 index 000000000..2dc4647ee --- /dev/null +++ b/httemplate/config/config-process.cgi @@ -0,0 +1,44 @@ +<% + my $conf = new FS::Conf; + $FS::Conf::DEBUG = 1; + my @config_items = $conf->config_items; + + foreach my $i ( @config_items ) { + my @touch = (); + my @delete = (); + my $n = 0; + foreach my $type ( ref($i->type) ? @{$i->type} : $i->type ) { + if ( $type eq '' ) { + } elsif ( $type eq 'textarea' ) { + if ( $cgi->param($i->key. $n) ) { + $conf->set($i->key, $cgi->param($i->key. $n)); + } else { + $conf->delete($i->key); + } + } elsif ( $type eq 'checkbox' ) { +# if ( defined($cgi->param($i->key. $n)) && $cgi->param($i->key. $n) ) { + if ( defined $cgi->param($i->key. $n) ) { + #$conf->touch($i->key); + push @touch, $i->key; + } else { + #$conf->delete($i->key); + push @delete, $i->key; + } + } elsif ( $type eq 'text' ) { + if ( $cgi->param($i->key. $n) ) { + $conf->set($i->key, $cgi->param($i->key. $n)); + } else { + $conf->delete($i->key); + } + } else { + } + $n++; + } + # warn @touch; + $conf->touch($_) foreach @touch; + $conf->delete($_) foreach @delete; + } + +%> +<%= $cgi->redirect("config-view.cgi") %> + diff --git a/httemplate/config/config-view.cgi b/httemplate/config/config-view.cgi new file mode 100644 index 000000000..09e535b2f --- /dev/null +++ b/httemplate/config/config-view.cgi @@ -0,0 +1,46 @@ +<%= header('View Configuration', menubar( 'Main Menu' => $p, + 'Edit Configuration' => 'config.cgi' ) ) %> + +<% 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) { %> + + + <%= $i->key %> - <%= $i->description %> + + + <% foreach my $type ( ref($i->type) ? @{$i->type} : $i->type ) { + my $n = 0; %> + <% if ( $type eq '' ) { %> + + <% } elsif ( $type eq 'textarea' ) { %> + + <% } elsif ( $type eq 'checkbox' ) { %> + + <% } elsif ( $type eq 'text' ) { %> + + <% } else { %> + + <% } %> + <% $n++; } %> +
no type
+
<%= join("\n", $conf->config($i->key) ) %>
+
YES' : 'ff0000">NO' %>
<%= $conf->exists($i->key) ? $conf->config($i->key) : '' %>
+ unknown type <%= $type %> +
+ + <% } %> +

+<% } %> + + -- cgit v1.2.1 From 4308bf79cf9f31b6ec471788c34cde9b92a3c29b Mon Sep 17 00:00:00 2001 From: ivan Date: Wed, 24 Oct 2001 15:45:29 +0000 Subject: correct for browser munching --- httemplate/config/config-process.cgi | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'httemplate/config') diff --git a/httemplate/config/config-process.cgi b/httemplate/config/config-process.cgi index 2dc4647ee..99957ebd9 100644 --- a/httemplate/config/config-process.cgi +++ b/httemplate/config/config-process.cgi @@ -11,7 +11,9 @@ if ( $type eq '' ) { } elsif ( $type eq 'textarea' ) { if ( $cgi->param($i->key. $n) ) { - $conf->set($i->key, $cgi->param($i->key. $n)); + my $value = $cgi->param($i->key. $n); + $value =~ s/\r\n/\n/g; #browsers? + $conf->set($i->key, $value); } else { $conf->delete($i->key); } -- cgit v1.2.1 From 1904d44bb20adf403e21513db7470153f751d605 Mon Sep 17 00:00:00 2001 From: ivan Date: Fri, 26 Oct 2001 09:50:21 +0000 Subject: otherwise people will have problems with `0' zero --- httemplate/config/config-process.cgi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'httemplate/config') diff --git a/httemplate/config/config-process.cgi b/httemplate/config/config-process.cgi index 99957ebd9..690512977 100644 --- a/httemplate/config/config-process.cgi +++ b/httemplate/config/config-process.cgi @@ -10,7 +10,7 @@ foreach my $type ( ref($i->type) ? @{$i->type} : $i->type ) { if ( $type eq '' ) { } elsif ( $type eq 'textarea' ) { - if ( $cgi->param($i->key. $n) ) { + if ( $cgi->param($i->key. $n) ne '' ) { my $value = $cgi->param($i->key. $n); $value =~ s/\r\n/\n/g; #browsers? $conf->set($i->key, $value); @@ -27,7 +27,7 @@ push @delete, $i->key; } } elsif ( $type eq 'text' ) { - if ( $cgi->param($i->key. $n) ) { + if ( $cgi->param($i->key. $n) ne '' ) { $conf->set($i->key, $cgi->param($i->key. $n)); } else { $conf->delete($i->key); -- cgit v1.2.1 From c34e73e4a0f8ab38adc88829598207e219a86928 Mon Sep 17 00:00:00 2001 From: ivan Date: Tue, 30 Oct 2001 14:20:46 +0000 Subject: web config should workish now --- httemplate/config/config-view.cgi | 4 +++- httemplate/config/config.cgi | 48 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 51 insertions(+), 1 deletion(-) create mode 100644 httemplate/config/config.cgi (limited to 'httemplate/config') 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 %> + + + <% } %> +

+<% } %> + + +
+ + -- cgit v1.2.1 From da6df9f67f3db20a41ad9244db3f829600f678fd Mon Sep 17 00:00:00 2001 From: ivan Date: Fri, 2 Nov 2001 04:55:49 +0000 Subject: config web GUI updates. almost usable now. --- httemplate/config/config-view.cgi | 2 +- httemplate/config/config.cgi | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'httemplate/config') diff --git a/httemplate/config/config-view.cgi b/httemplate/config/config-view.cgi index 3c16c4815..4b6684980 100644 --- a/httemplate/config/config-view.cgi +++ b/httemplate/config/config-view.cgi @@ -4,7 +4,7 @@ <% my $conf = new FS::Conf; my @config_items = $conf->config_items; %> <% foreach my $section ( qw(required billing username password UI session - apache BIND shell + shell mail radius apache BIND ), '', 'depreciated') { %> <%= table("#cccccc", 2) %> diff --git a/httemplate/config/config.cgi b/httemplate/config/config.cgi index 32ddc043d..972ec06a4 100644 --- a/httemplate/config/config.cgi +++ b/httemplate/config/config.cgi @@ -5,7 +5,7 @@
<% foreach my $section ( qw(required billing username password UI session - apache BIND shell + shell mail radius apache BIND ), '', 'depreciated') { %> <%= table("#cccccc", 2) %> -- cgit v1.2.1 From 762cb807561ae9805a3eac0616442012eced93b0 Mon Sep 17 00:00:00 2001 From: ivan Date: Fri, 2 Nov 2001 05:28:33 +0000 Subject: note config changes need apache/freeside-queued restart to take effect --- httemplate/config/config.cgi | 3 +++ 1 file changed, 3 insertions(+) (limited to 'httemplate/config') diff --git a/httemplate/config/config.cgi b/httemplate/config/config.cgi index 972ec06a4..f9d7297ec 100644 --- a/httemplate/config/config.cgi +++ b/httemplate/config/config.cgi @@ -42,6 +42,9 @@

<% } %> +You may need to restart Apache and/or freeside-queued for configuration +changes to take effect.
+ -- cgit v1.2.1 From b6724f3cf6c4b77ab66d259920042f12e46cf924 Mon Sep 17 00:00:00 2001 From: ivan Date: Sat, 8 Dec 2001 10:08:50 +0000 Subject: need a POST here; browsers (especially IE) are unhappy with the default GET --- httemplate/config/config.cgi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'httemplate/config') diff --git a/httemplate/config/config.cgi b/httemplate/config/config.cgi index f9d7297ec..56da0698a 100644 --- a/httemplate/config/config.cgi +++ b/httemplate/config/config.cgi @@ -2,7 +2,7 @@ <% my $conf = new FS::Conf; my @config_items = $conf->config_items; %> -
+ <% foreach my $section ( qw(required billing username password UI session shell mail radius apache BIND -- cgit v1.2.1 From a4c96748eb6eab29a70f3a944c6520283a635c78 Mon Sep 17 00:00:00 2001 From: ivan Date: Sun, 10 Feb 2002 16:05:22 +0000 Subject: *finally* seems to be working under Mason. sheesh. *finally* seems to be working under Mason. sheesh. *finally* seems to be working under Mason. sheesh. *finally* seems to be working under Mason. sheesh. *finally* seems to be working under Mason. sheesh. *finally* seems to be working under Mason. sheesh. *finally* seems to be working under Mason. sheesh. *finally* seems to be working under Mason. sheesh. --- httemplate/config/config-process.cgi | 1 - httemplate/config/config-view.cgi | 1 + httemplate/config/config.cgi | 1 + 3 files changed, 2 insertions(+), 1 deletion(-) (limited to 'httemplate/config') diff --git a/httemplate/config/config-process.cgi b/httemplate/config/config-process.cgi index 690512977..50f0d34ff 100644 --- a/httemplate/config/config-process.cgi +++ b/httemplate/config/config-process.cgi @@ -43,4 +43,3 @@ %> <%= $cgi->redirect("config-view.cgi") %> - diff --git a/httemplate/config/config-view.cgi b/httemplate/config/config-view.cgi index 4b6684980..b041adaed 100644 --- a/httemplate/config/config-view.cgi +++ b/httemplate/config/config-view.cgi @@ -1,3 +1,4 @@ + <%= header('View Configuration', menubar( 'Main Menu' => $p, 'Edit Configuration' => 'config.cgi' ) ) %> diff --git a/httemplate/config/config.cgi b/httemplate/config/config.cgi index 56da0698a..b9e84a8d5 100644 --- a/httemplate/config/config.cgi +++ b/httemplate/config/config.cgi @@ -1,3 +1,4 @@ + <%= header('Edit Configuration', menubar( 'Main Menu' => $p ) ) %> <% my $conf = new FS::Conf; my @config_items = $conf->config_items; %> -- cgit v1.2.1 From ae23f6fe1ca915c995cfbf29bb39e7ed5e1cce2c Mon Sep 17 00:00:00 2001 From: ivan Date: Tue, 12 Feb 2002 02:11:07 +0000 Subject: add username_policy "@append domain" add "select" config type, mmm --- httemplate/config/config.cgi | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'httemplate/config') diff --git a/httemplate/config/config.cgi b/httemplate/config/config.cgi index b9e84a8d5..f640d0b5e 100644 --- a/httemplate/config/config.cgi +++ b/httemplate/config/config.cgi @@ -30,6 +30,16 @@ exists($i->key) ? ' CHECKED' : '' %>> <% } elsif ( $type eq 'text' ) { %> + <% } elsif ( $type eq 'select' ) { %> + configuration editing, fixes Bug#350 --- httemplate/config/config-process.cgi | 2 +- httemplate/config/config-view.cgi | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'httemplate/config') diff --git a/httemplate/config/config-process.cgi b/httemplate/config/config-process.cgi index 50f0d34ff..a296abfe4 100644 --- a/httemplate/config/config-process.cgi +++ b/httemplate/config/config-process.cgi @@ -26,7 +26,7 @@ #$conf->delete($i->key); push @delete, $i->key; } - } elsif ( $type eq 'text' ) { + } elsif ( $type eq 'text' || $type eq 'select' ) { if ( $cgi->param($i->key. $n) ne '' ) { $conf->set($i->key, $cgi->param($i->key. $n)); } else { diff --git a/httemplate/config/config-view.cgi b/httemplate/config/config-view.cgi index b041adaed..225c29507 100644 --- a/httemplate/config/config-view.cgi +++ b/httemplate/config/config-view.cgi @@ -32,7 +32,7 @@ <% } elsif ( $type eq 'checkbox' ) { %> YES' : 'ff0000">NO' %> - <% } elsif ( $type eq 'text' ) { %> + <% } elsif ( $type eq 'text' || $type eq 'select' ) { %> <%= $conf->exists($i->key) ? $conf->config($i->key) : '' %> <% } else { %> -- cgit v1.2.1 From e8dc13cd1af07846cd3015986f3a3fd34cdcdaea Mon Sep 17 00:00:00 2001 From: ivan Date: Thu, 28 Feb 2002 22:05:31 +0000 Subject: s/depreciated/deprecated/ --- httemplate/config/config-view.cgi | 2 +- httemplate/config/config.cgi | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'httemplate/config') diff --git a/httemplate/config/config-view.cgi b/httemplate/config/config-view.cgi index 225c29507..138ec4737 100644 --- a/httemplate/config/config-view.cgi +++ b/httemplate/config/config-view.cgi @@ -7,7 +7,7 @@ <% foreach my $section ( qw(required billing username password UI session shell mail radius apache BIND ), - '', 'depreciated') { %> + '', 'deprecated') { %> <%= table("#cccccc", 2) %> diff --git a/httemplate/config/config.cgi b/httemplate/config/config.cgi index f640d0b5e..19775c7aa 100644 --- a/httemplate/config/config.cgi +++ b/httemplate/config/config.cgi @@ -8,7 +8,7 @@ <% foreach my $section ( qw(required billing username password UI session shell mail radius apache BIND ), - '', 'depreciated') { %> + '', 'deprecated') { %> <%= table("#cccccc", 2) %> -- cgit v1.2.1 From 697dfd9ac2dfa36aa244e6d2d9f2e8f8a364a120 Mon Sep 17 00:00:00 2001 From: ivan Date: Sun, 17 Mar 2002 08:33:39 +0000 Subject: new domain record editing foo --- httemplate/config/config-view.cgi | 15 ++++++- httemplate/config/config.cgi | 95 ++++++++++++++++++++++++++++++++++++++- 2 files changed, 108 insertions(+), 2 deletions(-) (limited to 'httemplate/config') diff --git a/httemplate/config/config-view.cgi b/httemplate/config/config-view.cgi index 138ec4737..917cc7316 100644 --- a/httemplate/config/config-view.cgi +++ b/httemplate/config/config-view.cgi @@ -8,6 +8,19 @@ shell mail radius apache BIND ), '', 'deprecated') { %> + + <% foreach my $nav_section ( qw(required billing username password UI session + shell mail radius apache BIND + ), + '', 'deprecated') { %> + <% if ( $section eq $nav_section ) { %> + [<%= ucfirst($nav_section || 'unclassified') %>] + <% } else { %> + [<%= ucfirst($nav_section || 'unclassified') %>] + <% } %> + <% } %> +
+ <%= table("#cccccc", 2) %> @@ -24,7 +37,7 @@ my $n = 0; %> <% if ( $type eq '' ) { %> no type - <% } elsif ( $type eq 'textarea' ) { %> + <% } elsif ( $type eq 'textarea' || $type eq 'editlist' ) { %>
 <%= encode_entities(join("\n", $conf->config($i->key) ) ) %>
diff --git a/httemplate/config/config.cgi b/httemplate/config/config.cgi
index 19775c7aa..155dcfdbc 100644
--- a/httemplate/config/config.cgi
+++ b/httemplate/config/config.cgi
@@ -1,14 +1,39 @@
 
 <%= 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
                             shell mail radius apache BIND
                            ),
                          '', 'deprecated') { %>
+  
+  <% foreach my $nav_section ( qw(required billing username password UI session
+                                  shell mail radius apache BIND
+                                 ),
+                               '', 'deprecated') { %>
+    <% if ( $section eq $nav_section ) { %>
+      [<%= ucfirst($nav_section || 'unclassified') %>]
+    <% } else { %>
+      [<%= ucfirst($nav_section || 'unclassified') %>]
+    <% } %>
+  <% } %>
+  
+ <%= table("#cccccc", 2) %> @@ -40,6 +65,74 @@ <% if ( $conf->exists($i->key) && $conf->config($i->key) && ! grep { $conf->config($i->key) eq $_ } @{$i->select_enum}) { %>