removing faulty /TMPL_IF from header
[koha.git] / about.pl
1 #!/usr/bin/perl
2  
3 # This file is part of Koha.
4 #
5 # Koha is free software; you can redistribute it and/or modify it under the
6 # terms of the GNU General Public License as published by the Free Software
7 # Foundation; either version 2 of the License, or (at your option) any later
8 # version.
9 #
10 # Koha is distributed in the hope that it will be useful, but WITHOUT ANY
11 # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
12 # A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
13 #
14 # You should have received a copy of the GNU General Public License along with
15 # Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
16 # Suite 330, Boston, MA  02111-1307 USA
17
18 use strict;
19 require Exporter;
20
21 use C4::Output;    # contains gettemplate
22 use C4::Auth;
23 use C4::Context;
24 use CGI;
25 use LWP::Simple;
26 use XML::Simple;
27
28 my $query = new CGI;
29 my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
30     {
31         template_name   => "about.tmpl",
32         query           => $query,
33         type            => "intranet",
34         authnotrequired => 0,
35         flagsrequired   => { parameters => 1 },
36         debug           => 1,
37     }
38 );
39
40 my $kohaVersion   = C4::Context::KOHAVERSION;
41 my $osVersion     = `uname -a`;
42 my $perlVersion   = $];
43 my $mysqlVersion  = `mysql -V`;
44 my $apacheVersion = `httpd -v`;
45 $apacheVersion = `httpd2 -v` unless $apacheVersion;
46 my $zebraVersion = `zebraidx -V`;
47
48 # $apacheVersion =  (`/usr/sbin/apache2 -V`)[0];
49
50 $template->param(
51     kohaVersion   => $kohaVersion,
52     osVersion     => $osVersion,
53     perlVersion   => $perlVersion,
54     mysqlVersion  => $mysqlVersion,
55     apacheVersion => $apacheVersion,
56     zebraVersion  => $zebraVersion,
57 );
58 my @component_names =
59     qw/CGI
60 CGI::Carp
61 CGI::Session
62 Class::Factory::Util
63 Class::Accessor
64 DBD::mysql
65 DBI
66 Data::Dumper
67 Date::Calc
68 Date::Manip
69 Digest::MD5
70 File::Temp
71 GD::Barcode::UPCE
72 Getopt::Long
73 Getopt::Std
74 HTML::Template::Pro
75 HTTP::Cookies
76 HTTP::Request::Common
77 LWP::Simple
78 LWP::UserAgent
79 Lingua::Stem
80 List::Util
81 Locale::Language
82 MARC::Crosswalk::DublinCore
83 MARC::Charset
84 MARC::File::XML
85 MARC::Record
86 MIME::Base64
87 MIME::QuotedPrint
88 Mail::Sendmail
89 Net::Z3950::ZOOM
90 PDF::API2
91 PDF::API2::Page
92 PDF::API2::Util
93 PDF::Reuse
94 PDF::Reuse::Barcode
95 POSIX
96 Schedule::At
97 Term::ANSIColor
98 Test
99 Test::Harness
100 Test::More
101 Text::CSV
102 Text::Wrap
103 Time::HiRes
104 Time::localtime
105 Unicode::Normalize
106 XML::Dumper
107 XML::LibXML
108 XML::LibXSLT
109 XML::SAX::ParserFactory
110 XML::Simple
111 XML::RSS
112       /;
113
114 my @components = ();
115
116 my $counter=0;
117 foreach my $component ( sort @component_names ) {
118     my $version;
119     if ( eval "require $component" ) {
120         $version = $component->VERSION;
121         if ( $version eq '' ) {
122             $version = 'unknown';
123         }
124     }
125     else {
126         $version = 'module is missing';
127     }
128     $counter++;
129     $counter=0 if $counter >3;
130     push(
131         @components,
132         {
133             name    => $component,
134             version => $version,
135             counter => $counter,
136         }
137     );
138 }
139
140 $template->param( components => \@components );
141
142 output_html_with_http_headers $query, $cookie, $template->output;