putting the C in ACL
[freeside.git] / httemplate / config / config-view.cgi
1 <% include("/elements/header.html",'View Configuration', menubar( 'Main Menu' => $p,
2                                      'Edit Configuration' => 'config.cgi' ) ) %>
3 % my $conf = new FS::Conf; my @config_items = $conf->config_items; 
4 % foreach my $section ( qw(required billing username password UI session
5 %                            shell BIND
6 %                           ),
7 %                         '', 'deprecated') { 
8
9   <A NAME="<% $section || 'unclassified' %>"></A>
10   <FONT SIZE="-2">
11 % foreach my $nav_section ( qw(required billing username password UI session
12 %                                  shell BIND
13 %                                 ),
14 %                               '', 'deprecated') { 
15 % if ( $section eq $nav_section ) { 
16
17       [<A NAME="not<% $nav_section || 'unclassified' %>" style="background-color: #cccccc"><% ucfirst($nav_section || 'unclassified') %></A>]
18 % } else { 
19
20       [<A HREF="#<% $nav_section || 'unclassified' %>"><% ucfirst($nav_section || 'unclassified') %></A>]
21 % } 
22 % } 
23
24   </FONT><BR>
25   <% table("#cccccc", 2) %>
26   <tr>
27     <th colspan="2" bgcolor="#dcdcdc">
28       <% ucfirst($section || 'unclassified') %> configuration options
29     </th>
30   </tr>
31 % foreach my $i (grep $_->section eq $section, @config_items) { 
32
33     <tr>
34       <td><a name="<% $i->key %>">
35         <b><% $i->key %></b>&nbsp;-&nbsp;<% $i->description %>
36       </a></td>
37       <td><table border=0>
38 % foreach my $type ( ref($i->type) ? @{$i->type} : $i->type ) {
39 %             my $n = 0; 
40 % if ( $type eq '' ) { 
41
42             <tr>
43               <td><font color="#ff0000">no type</font></td>
44             </tr>
45 % } elsif (   $type eq 'textarea'
46 %                      || $type eq 'editlist'
47 %                      || $type eq 'selectmultiple' ) { 
48
49             <tr>
50               <td bgcolor="#ffffff">
51 <pre>
52 <% encode_entities(join("\n", $conf->config($i->key) ) ) %>
53 </pre>
54               </td>
55             </tr>
56 % } elsif ( $type eq 'checkbox' ) { 
57
58             <tr>
59               <td bgcolor="#<% $conf->exists($i->key) ? '00ff00">YES' : 'ff0000">NO' %></td>
60             </tr>
61 % } elsif ( $type eq 'text' || $type eq 'select' )  { 
62
63             <tr>
64               <td bgcolor="#ffffff">
65                 <% $conf->exists($i->key) ? $conf->config($i->key) : '' %>
66               </td></tr>
67 % } elsif ( $type eq 'select-sub' ) { 
68
69             <tr>
70               <td bgcolor="#ffffff">
71                 <% $conf->config($i->key) %>: 
72                 <% &{ $i->option_sub }( $conf->config($i->key) ) %>
73               </td>
74             </tr>
75 % } else { 
76
77             <tr><td>
78               <font color="#ff0000">unknown type <% $type %></font>
79             </td></tr>
80 % } 
81 % $n++; } 
82
83       </table></td>
84     </tr>
85 % } 
86
87   </table><br><br>
88 % } 
89
90
91 </body></html>
92 <%init>
93 die "access denied"
94   unless $FS::CurrentUser::CurrentUser->access_right('Configuration');
95 </%init>