fixing bug for authorities zebraqueue reindexing
[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
19 use strict;
20 require Exporter;
21
22 use C4::Output;  # contains gettemplate
23 use C4::Auth;
24 use C4::Context;
25 use CGI;
26 use LWP::Simple;
27 use XML::Simple;
28
29 my $query = new CGI;
30 my ($template, $loggedinuser, $cookie)
31     = get_template_and_user({template_name => "about.tmpl",
32                              query => $query,
33                              type => "intranet",
34                              authnotrequired => 0,
35                              flagsrequired => {parameters => 1},
36                              debug => 1,
37                              });
38
39 my $kohaVersion = C4::Context->config("kohaversion");
40 my $osVersion = `uname -a`;
41 my $perlVersion = $];
42 my $mysqlVersion = `mysql -V`;
43 my $apacheVersion =  `httpd -v`;
44 $apacheVersion =  `httpd2 -v` unless $apacheVersion;
45 my $zebraVersion = `zebraidx -V`;
46 # $apacheVersion =  (`/usr/sbin/apache2 -V`)[0];
47
48 $template->param(
49                                         kohaVersion => $kohaVersion,
50                                         osVersion          => $osVersion,
51                                         perlVersion        => $perlVersion,
52                                         mysqlVersion       => $mysqlVersion,
53                                         apacheVersion      => $apacheVersion,
54                                         zebraVersion       => $zebraVersion,
55                 );
56
57 my @component_names =
58     qw/MARC::File::XML   MARC::Charset     Class::Accessor
59        LWP::Simple       XML::Simple       Net::Z3950
60        Event             Net::LDAP         PDF::API2
61        Mail::Sendmail    MARC::Record      Digest::MD5
62        HTML::Template    DBD::mysql        Date::Manip
63        DBI               Smart::Comments   Net::Z3950::ZOOM
64        Date::Calc
65       /;
66
67 my @components = ();
68
69 foreach my $component (sort @component_names) {
70     my $version;
71     if (eval "require $component") {
72         $version = $component->VERSION;
73         if ($version eq '' ) {
74             $version = 'unknown';
75         }
76     }
77     else {
78         $version = 'module is missing';
79     }
80
81     push (
82         @components,
83         {
84             name    => $component,
85             version => $version,
86         }
87     );
88 }
89
90 $template->param(
91     components => \@components
92 );
93
94 output_html_with_http_headers $query, $cookie, $template->output;