Beim Login wird jetzt ein Check durchgeführt, ob alle benötigten Perl-Module installi...
[kivitendo-erp.git] / bin / mozilla / installationcheck.pl
1 use SL::InstallationCheck;
2
3 sub verify_installation {
4   my $script = $0;
5   $script =~ s|.*/||;
6
7   return unless ($form{"action"} && ($script eq "login.pl"));
8
9   my @missing_modules = SL::InstallationCheck::test_all_modules();
10   return if (scalar(@missing_modules) == 0);
11
12   use SL::Locale;
13   my $locale = new Locale($language, "installationcheck");
14
15   print(qq|content-type: text/html
16
17 <html>
18  <head>
19   <link rel="stylesheet" href="css/lx-office-erp.css" type="text/css"
20         title="Lx-Office stylesheet">
21   <title>| . $locale->text("One or more Perl modules missing") . qq|</title>
22  </head>
23  <body>
24
25   <h1>| . $locale->text("One or more Perl modules missing") . qq|</h1>
26
27   <p>| . $locale->text("At least one Perl module that Lx-Office ERP " .
28                        "requires for running is not installed on your " .
29                        "system.") .
30         " " .
31         $locale->text("Please install the below listed modules or ask your " .
32                       "system administrator to.") .
33         " " .
34         $locale->text("You cannot continue before all required modules are " .
35                       "installed.") . qq|</p>
36
37   <p>
38    <table>
39     <tr>
40      <th class="listheading">| . $locale->text("Module name") . qq|</th>
41      <th class="listheading">| . $locale->text("Module home page") . qq|</th>
42     </tr>
43
44 |);
45
46   my $odd = 1;
47   foreach my $module (@missing_modules) {
48     print(qq|
49      <tr class="listrow${odd}">
50       <td><code>$module->{name}</code></td>
51       <td><a href="$module->{url}">$module->{url}</a></td>
52      </tr>|);
53     $odd = 1 - $odd;
54   }
55
56   print(qq|
57    </table>
58   </p>
59
60   <p>| . $locale->text("There are usually three ways to install " .
61                        "Perl modules.") .
62         " " .
63         $locale->text("The preferred one is to install packages provided by " .
64                       "your operating system distribution (e.g. Debian or " .
65                       "RPM packages).") . qq|</p>
66
67   <p>| . $locale->text("The second way is to use Perl's CPAN module and let " .
68                        "it download and install the module for you.") .
69         " " .
70         $locale->text("Here's an example command line:") . qq|</p>
71
72   <p><code>perl -MCPAN -e &quot;install CGI::Ajax&quot;</code></p>
73
74   <p>| . $locale->text("The third way is to download the module from the " .
75                        "above mentioned URL and to install the module " .
76                        "manually following the installations instructions " .
77                        "contained in the source archive.") . qq|</p>
78
79  </body>
80 </html>
81 |);
82   exit(0);
83 }
84
85 1;