1 %# BEGIN BPS TAGGED BLOCK {{{
5 %# This software is Copyright (c) 1996-2011 Best Practical Solutions, LLC
6 %# <sales@bestpractical.com>
8 %# (Except where explicitly superseded by other copyright notices)
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
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.
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.
30 %# CONTRIBUTION SUBMISSION POLICY:
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.)
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.
47 %# END BPS TAGGED BLOCK }}}
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'));
55 <& /Admin/Elements/Header, Title => $title &>
56 <& /Admin/Elements/ToolTabs,
57 current_tab => 'Admin/Tools/Configuration.html',
58 current_subtab => 'Admin/Tools/Configuration.html',
61 <&|/Widgets/TitleBox, title => loc("RT Configuration") &>
62 <table border="0" cellspacing="0" cellpadding="5" width="100%" class="collection">
63 <tr class="collection-as-table">
64 <th class="collection-as-table"><&|/l&>Option</&></th>
65 <th class="collection-as-table"><&|/l&>Value</&></th>
66 <th class="collection-as-table"><&|/l&>Source</&></th>
70 foreach my $key ( RT->Config->Options( Overridable => undef, Sorted => 0 ) ) {
71 my $val = RT->Config->Get( $key );
72 next unless defined $val;
74 my $meta = RT->Config->Meta( $key );
76 if ( $meta->{'Source'}{'Extension'} && $meta->{'Source'}{'SiteConfig'} ) {
77 $description = loc("[_1] site config", $meta->{'Source'}{'Extension'});
79 elsif ( $meta->{'Source'}{'Extension'} ) {
80 $description = loc("[_1] core config", $meta->{'Source'}{'Extension'});
82 elsif ( $meta->{'Source'}{'SiteConfig'} ) {
83 $description = loc("site config");
86 $description = loc("core config");
90 <tr class="<% $index_conf%2 ? 'oddline' : 'evenline'%>">
91 <td class="collection-as-table"><% $key %></td>
92 <td class="collection-as-table">
93 % if ( $key =~ /Password(?!Length)/i ) {
94 <em>Password not printed</em>\
95 % } elsif ( !ref $val ) {
97 % } elsif ( ref $val eq 'ARRAY' ) {
98 <% join ', ', @$val %>\
99 % } elsif ( ref $val eq 'HASH' ) {
100 <% join ', ', %$val %>\
105 <td class="collection-as-table" style="white-space: nowrap">
106 % if ( $description =~ /^.*site config$/ ) {
107 <span style="font-weight: bold"><% $description %></span>
118 <td valign="top" width="60%" class="boxcontainer">
119 <&|/Widgets/TitleBox, title=> loc("RT core variables") &>
120 <table border="0" cellspacing="0" cellpadding="5" width="100%" class="collection">
121 <tr class="collection-as-table">
122 <th class="collection-as-table"><&|/l&>Variable</&></th>
123 <th class="collection-as-table"><&|/l&>Value</&></th>
126 { no strict qw/refs/;
127 my %config_opt = map { $_ => 1 } RT->Config->Options( Overridable => undef );
129 foreach my $key ( sort keys %{*RT::} ) {
130 next if !${'RT::'.$key} || ref ${'RT::'.$key} || $config_opt{ $key };
133 <tr class="collection-as-table <% $index_var%2 ? 'oddline' : 'evenline'%>">
134 <td class="collection-as-table">RT::<% $key %></td>
135 <td class="collection-as-table">
136 % if ( $key =~ /Password(?!Length)/i ) {
137 <em>Password not printed</em>
148 <&|/Widgets/TitleBox, title => loc("RT Size") &>
149 <table border="0" cellspacing="0" cellpadding="5" width="100%" class="collection">
150 <tr class="collection-as-table">
151 <th class="collection-as-table"><&|/l&>Object</&></th>
152 <th class="collection-as-table"><&|/l&>Size</&></th>
155 my ($index_size, $user_count, $privileged_count);
156 for my $type (qw/Tickets Queues Transactions Groups PrivilegedUsers UnprivilegedUsers/) {
158 my $class = 'RT::' . $type;
159 $class =~ s/Privileged|Unprivileged//;
160 my $collection = $class->new($RT::SystemUser);
161 $collection->UnLimit;
162 if ($type =~ /PrivilegedUsers/) {
163 $user_count = $collection->CountAll;
164 $collection->LimitToPrivileged;
165 $count = $privileged_count = $collection->CountAll;
166 } elsif ($type =~ /UnprivilegedUsers/) {
167 $count = $user_count - $privileged_count;
169 $count = $collection->CountAll;
173 <tr class="<% $index_size%2 ? 'oddline' : 'evenline'%>">
174 <td class="collection-as-table"><% $type %></td>
175 <td class="collection-as-table"><% $count %></td>
181 <td valign="top" class="boxcontainer">
183 <&|/Widgets/TitleBox, title => loc("Mason template search order") &>
185 % foreach my $path ( map { $_->[1] } $m->interp->comp_root_array ) {
191 <&|/Widgets/TitleBox, title => loc("Perl library search order") &>
193 % foreach my $inc (@INC) {
202 <&|/Widgets/TitleBox, title => loc("Loaded perl modules")&>
203 <table border="0" cellspacing="0" cellpadding="5" width="100%" class="collection">
204 <tr class="collection-as-table">
205 <th class="collection-as-table"><&|/l&>Module</&></th>
206 <th class="collection-as-table"><&|/l&>Version</&></th>
207 <th class="collection-as-table"><&|/l&>Source</&></th>
212 my $report = Module::Versions::Report::report();
213 my @report = grep /v\d/, split("\n",$report);
214 shift @report; # throw away the perl version
215 my ($ver, $source, $distfile);
216 foreach my $item (@report) {
217 if ($item =~ /^\s*(.*?)\s*v(\S+);/) {
220 $distfile = $item.".pm";
221 $distfile =~ s|::|/|g;
224 <tr class="<% $i++ %2 ? 'oddline' : 'evenline'%>">
225 <td class="collection-as-table"><% $item %></td>
226 <td class="collection-as-table">
229 <td class="collection-as-table">
230 <% $INC{$distfile} %>
237 <&|/Widgets/TitleBox, title => loc("Perl configuration") &>
240 <% Config::myconfig() %>