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 ++++++++++++++++ httemplate/docs/config.html | 100 ++--------------------------------- httemplate/docs/install.html | 6 ++- httemplate/index.html | 27 +++++----- httemplate/search/svc_acct.cgi | 8 +-- 6 files changed, 119 insertions(+), 112 deletions(-) create mode 100644 httemplate/config/config-process.cgi create mode 100644 httemplate/config/config-view.cgi (limited to 'httemplate') 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 %> +
+ + <% } %> +

+<% } %> + + diff --git a/httemplate/docs/config.html b/httemplate/docs/config.html index 75d3070d1..656723781 100644 --- a/httemplate/docs/config.html +++ b/httemplate/docs/config.html @@ -26,100 +26,10 @@ DBI:Pg:host=localhost;dbname=freeside dbusername dbpassword - -All further configuration files and directories are located in -/usr/local/etc/freeside/conf.datasource, for example, -/usr/local/etc/freeside/conf.DBI:Pg:host=localhost;dbname=freeside (remember to backslash-escape the ; character when creating directories in the shell: mkdir /usr/local/etc/freeside/conf.DBI:Pg:host=localhost\;dbname=freeside). Files listed in red are requried. - - + diff --git a/httemplate/docs/install.html b/httemplate/docs/install.html index 6861a173e..c26c9a701 100644 --- a/httemplate/docs/install.html +++ b/httemplate/docs/install.html @@ -9,7 +9,11 @@ Before installing, you need:
  • mod_perl
  • SSH (OpenSSH is recommended. SSH Communications Security commercial SSH version 3 has been reported incompatible with Freeside.)
  • Perl Don't enable experimental features like threads or the PerlIO abstraction layer. -
  • A transactional database engine supported by Perl's DBI. PostgreSQL is recommended. MySQL's default MyISAM and ISAM table types are not supported. If you really want to use MySQL, you need to use one of the new transaction-safe table types such as BDB, and set it as the default table type using the --default-table-type=BDB mysqld command-line option or by setting default-table-type=DBD in the my.cnf option file. +
  • A transactional database engine supported by Perl's DBI. +
  • Perl modules (CPAN will query, download and build perl modules automatically) + +
    +