s/depreciated/deprecated/
[freeside.git] / httemplate / config / config.cgi
1 <!-- mason kludge -->
2 <%= header('Edit Configuration', menubar( 'Main Menu' => $p ) ) %>
3
4 <% my $conf = new FS::Conf; my @config_items = $conf->config_items; %>
5
6 <form action="config-process.cgi" METHOD="POST">
7
8 <% foreach my $section ( qw(required billing username password UI session
9                             shell mail radius apache BIND
10                            ),
11                          '', 'deprecated') { %>
12   <%= table("#cccccc", 2) %>
13   <tr>
14     <th colspan="2" bgcolor="#dcdcdc">
15       <%= ucfirst($section || 'unclassified') %> configuration options
16     </th>
17   </tr>
18   <% foreach my $i (grep $_->section eq $section, @config_items) { %>
19     <tr>
20       <td>
21         <% my $n = 0;
22            foreach my $type ( ref($i->type) ? @{$i->type} : $i->type ) {
23              #warn $i->key unless defined($type);
24         %>
25           <% if ( $type eq '' ) { %>
26             <font color="#ff0000">no type</font>
27           <% } elsif ( $type eq 'textarea' ) { %>
28             <textarea name="<%= $i->key. $n %>" rows=5><%= join("\n", $conf->config($i->key) ) %></textarea>
29           <% } elsif ( $type eq 'checkbox' ) { %>
30             <input name="<%= $i->key. $n %>" type="checkbox" value="1"<%= $conf->exists($i->key) ? ' CHECKED' : '' %>>
31           <% } elsif ( $type eq 'text' )  { %>
32             <input name="<%= $i->key. $n %>" type="<%= $type %>" value="<%= $conf->exists($i->key) ? $conf->config($i->key) : '' %>">
33           <% } elsif ( $type eq 'select' )  { %>
34             <select name="<%= $i->key. $n %>">
35               <% my %saw;
36                  foreach my $value ( "", @{$i->select_enum} ) {
37                     local($^W)=0; next if $saw{$value}++; %>
38                 <option value="<%= $value %>"<%= $value eq $conf->config($i->key) ? ' SELECTED' : '' %>><%= $value %>
39               <% } %>
40               <% if ( $conf->exists($i->key) && $conf->config($i->key) && ! grep { $conf->config($i->key) eq $_ } @{$i->select_enum}) { %>
41                 <option value=<%= $conf->config($i->key) %> SELECTED><%= conf->config($i->key) %>
42               <% } %>
43           <% } else { %>
44             <font color="#ff0000">unknown type <%= $type %></font>
45           <% } %>
46         <% $n++; } %>
47       </td>
48       <td><a name="<%= $i->key %>">
49         <b><%= $i->key %></b> - <%= $i->description %>
50       </a></td>
51     </tr>
52   <% } %>
53   </table><br><br>
54 <% } %>
55
56 You may need to restart Apache and/or freeside-queued for configuration
57 changes to take effect.<BR>
58
59 <input type="submit" value="Apply changes">
60 </form>
61
62 </body></html>