diff options
author | ivan <ivan> | 2001-10-24 15:29:31 +0000 |
---|---|---|
committer | ivan <ivan> | 2001-10-24 15:29:31 +0000 |
commit | e6b57805f6b3e76448ab9b6d280f2c53bc1410f3 (patch) | |
tree | e05b4074ba546fa07a0da0587fb048b48ae21e23 /httemplate/config/config-process.cgi | |
parent | 40927c9cd9472719a3720270256f4300b81ebc98 (diff) |
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
Diffstat (limited to 'httemplate/config/config-process.cgi')
-rw-r--r-- | httemplate/config/config-process.cgi | 44 |
1 files changed, 44 insertions, 0 deletions
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") %> + |