This commit was generated by cvs2svn to compensate for changes in r8690,
[freeside.git] / rt / share / html / Admin / Tools / Configuration.html
1 %# BEGIN BPS TAGGED BLOCK {{{
2 %# 
3 %# COPYRIGHT:
4 %# 
5 %# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC
6 %#                                          <jesse@bestpractical.com>
7 %# 
8 %# (Except where explicitly superseded by other copyright notices)
9 %# 
10 %# 
11 %# LICENSE:
12 %# 
13 %# This work is made available to you under the terms of Version 2 of
14 %# the GNU General Public License. A copy of that license should have
15 %# been provided with this software, but in any event can be snarfed
16 %# from www.gnu.org.
17 %# 
18 %# This work is distributed in the hope that it will be useful, but
19 %# WITHOUT ANY WARRANTY; without even the implied warranty of
20 %# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
21 %# General Public License for more details.
22 %# 
23 %# You should have received a copy of the GNU General Public License
24 %# along with this program; if not, write to the Free Software
25 %# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
26 %# 02110-1301 or visit their web page on the internet at
27 %# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html.
28 %# 
29 %# 
30 %# CONTRIBUTION SUBMISSION POLICY:
31 %# 
32 %# (The following paragraph is not intended to limit the rights granted
33 %# to you to modify and distribute this software under the terms of
34 %# the GNU General Public License and is only of importance to you if
35 %# you choose to contribute your changes and enhancements to the
36 %# community by submitting them to Best Practical Solutions, LLC.)
37 %# 
38 %# By intentionally submitting any modifications, corrections or
39 %# derivatives to this work, or any other work intended for use with
40 %# Request Tracker, to Best Practical Solutions, LLC, you confirm that
41 %# you are the copyright holder for those contributions and you grant
42 %# Best Practical Solutions,  LLC a nonexclusive, worldwide, irrevocable,
43 %# royalty-free, perpetual, license to use, copy, create derivative
44 %# works based on those contributions, and sublicense and distribute
45 %# those contributions and any derivatives thereof.
46 %# 
47 %# END BPS TAGGED BLOCK }}}
48 <%init>
49 require  Module::Versions::Report;
50 my $title = loc('System Configuration');
51 unless ($session{'CurrentUser'}->HasRight( Object=> $RT::System, Right => 'SuperUser')) {
52  Abort(loc('This feature is only available to system administrators'));
53
54
55
56 </%init>
57 <& /Admin/Elements/Header, Title => $title &>
58 <& /Admin/Elements/ToolTabs, 
59     current_tab => 'Admin/Tools/Configuration.html',
60     current_subtab => 'Admin/Tools/Configuration.html', 
61     Title => $title &>
62
63
64
65 <h2><&|/l&>Loaded perl modules</&></h2>
66 % my $report = Module::Versions::Report::report();
67 % my @report = grep /v\d/, split("\n",$report);
68 <pre>
69 <% join('<br />', @report) |n %>
70 </pre>
71
72 <h2><&|/l&>RT Config</&></h2>
73 <table>
74 <%PERL>
75 foreach my $key ( RT->Config->Options( Overridable => undef, Sorted => 0 ) ) {
76     my $val = RT->Config->Get( $key );
77     next unless defined $val;
78
79     my $meta = RT->Config->Meta( $key );
80     my $description = '';
81     if ( $meta->{'Source'}{'Extension'} && $meta->{'Source'}{'SiteConfig'} ) {
82         $description = loc("[_1] site config", $meta->{'Source'}{'Extension'});
83     }
84     elsif ( $meta->{'Source'}{'Extension'} ) {
85         $description = loc("[_1] core config", $meta->{'Source'}{'Extension'});
86     }
87     elsif ( $meta->{'Source'}{'SiteConfig'} ) {
88         $description = loc("site config");
89     }
90     else {
91         $description = loc("core config");
92     }
93 </%PERL>
94 <tr><th><% $key %></th>
95 <td rowspan="2">\
96 % if ( $key =~ /Password(?!Length)/i ) { 
97 <em>Password not printed</em>\
98 % } elsif ( !ref $val ) {
99 <% "$val" %>\
100 % } elsif ( ref $val eq 'ARRAY' ) {
101 <% join ', ', @$val %>\
102 % } elsif ( ref $val eq 'HASH' ) {
103 <% join ', ', %$val %>\
104 % } else {
105 <% ref $val %>\
106 % }
107 </td></tr>
108 <tr><td><% $description %></td></tr>
109 % }
110 </table>
111
112 <h2><&|/l&>RT Variables</&></h2>
113 <table>
114 % { no strict qw/refs/;
115 % my %config_opt = map { $_ => 1 } RT->Config->Options( Overridable => undef );
116 % foreach my $key ( sort keys %{*RT::} ) {
117 % next if !${'RT::'.$key} || ref ${'RT::'.$key} || $config_opt{ $key };
118 <tr><th>RT::<% $key %></th>
119 <td>
120 % if ( $key =~ /Password(?!Length)/i ) { 
121 <em>Password not printed</em>
122 % } else {
123 <% ${'RT::'.$key} %>
124 % }
125 </td>
126 </tr>
127 % }
128 % }
129 </table>
130
131 <h2><&|/l&>RT Size</&></h2>
132 <table>
133 <%PERL>
134 for my $type (qw/Ticket Queue Transaction Group/) {
135     my $class = 'RT::' . $type . 's';
136     my $collection = $class->new($RT::SystemUser);
137     $collection->UnLimit;
138     my $count = $collection->CountAll;
139 </%PERL>
140 <tr><th><% $type %>s</th>
141 <td><% $count %></td></tr>
142 % }
143
144 <%PERL>
145 my $users = RT::Users->new($RT::SystemUser);
146 $users->UnLimit;
147 my $user_count = $users->CountAll;
148
149 $users->LimitToPrivileged;
150 my $privileged_count = $users->CountAll;
151 my $unprivileged_count = $user_count - $privileged_count;
152 </%PERL>
153 <tr><th>Privileged Users</th>
154 <td><% $privileged_count %></td></tr>
155 <tr><th>Unprivileged Users</th>
156 <td><% $unprivileged_count %></td></tr>
157 </table>
158
159 <h2><&|/l&>Perl configuration</&></h2>
160 % require Config;
161 <pre>
162 <% Config::myconfig() %>
163 </pre>
164
165 <h2><&|/l&>Perl Include Paths (@INC)</&></h2>
166 <pre>
167 % foreach my $inc (@INC) {
168 <% $inc %>
169 % }
170 </pre>