| 1 | #!/usr/bin/perl |
|---|
| 2 | |
|---|
| 3 | # ISPCP(tm) - Virtual Hosting Control System |
|---|
| 4 | # Copyright (c) 2001-2004 by moleSoftware GmbH |
|---|
| 5 | # http://www.molesoftware.com |
|---|
| 6 | # |
|---|
| 7 | # |
|---|
| 8 | # License: |
|---|
| 9 | # This program is free software; you can redistribute it and/or |
|---|
| 10 | # modify it under the terms of the MPL Mozilla Public License |
|---|
| 11 | # as published by the Free Software Foundation; either version 1.1 |
|---|
| 12 | # of the License, or (at your option) any later version. |
|---|
| 13 | # |
|---|
| 14 | # This program is distributed in the hope that it will be useful, |
|---|
| 15 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
|---|
| 16 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|---|
| 17 | # MPL Mozilla Public License for more details. |
|---|
| 18 | # |
|---|
| 19 | # You may have received a copy of the MPL Mozilla Public License |
|---|
| 20 | # along with this program. |
|---|
| 21 | # |
|---|
| 22 | # An on-line copy of the MPL Mozilla Public License can be found |
|---|
| 23 | # http://www.mozilla.org/MPL/MPL-1.1.html |
|---|
| 24 | # |
|---|
| 25 | # |
|---|
| 26 | # The ISPCP Home Page is at: |
|---|
| 27 | # |
|---|
| 28 | # http://www.isp-control.net |
|---|
| 29 | |
|---|
| 30 | |
|---|
| 31 | |
|---|
| 32 | my @needed = (strict, warnings, IO::Socket, DBI, DBD::mysql, Mail::Address, MIME::Entity, |
|---|
| 33 | MIME::Parser, Crypt::CBC, Crypt::Blowfish, MIME::Base64, |
|---|
| 34 | Term::ReadPassword); |
|---|
| 35 | |
|---|
| 36 | my ($mod, $mod_err, $mod_missing) = ('', '_off_', ''); |
|---|
| 37 | |
|---|
| 38 | for $mod (@needed) { |
|---|
| 39 | |
|---|
| 40 | print STDERR "Checking for '$mod'...\t"; |
|---|
| 41 | |
|---|
| 42 | if (eval "require $mod") { |
|---|
| 43 | |
|---|
| 44 | $mod -> import(); |
|---|
| 45 | |
|---|
| 46 | printf " Ok.\n"; |
|---|
| 47 | |
|---|
| 48 | } else { |
|---|
| 49 | |
|---|
| 50 | print STDERR "CRITICAL ERROR: Module '$mod' WAS NOT FOUND !\n" ; |
|---|
| 51 | |
|---|
| 52 | $mod_err = '_on_'; |
|---|
| 53 | |
|---|
| 54 | if ($mod_missing eq '') { |
|---|
| 55 | |
|---|
| 56 | $mod_missing .= $mod; |
|---|
| 57 | |
|---|
| 58 | } else { |
|---|
| 59 | |
|---|
| 60 | $mod_missing .= ", $mod"; |
|---|
| 61 | |
|---|
| 62 | } |
|---|
| 63 | } |
|---|
| 64 | |
|---|
| 65 | } |
|---|
| 66 | |
|---|
| 67 | if ($mod_err eq '_on_') { |
|---|
| 68 | |
|---|
| 69 | print STDERR "\nModules [$mod_missing] WAS NOT FOUND in your |
|---|
| 70 | system...\n"; |
|---|
| 71 | |
|---|
| 72 | print STDERR "\nPlease INSTALL them before using ISPCP software !\n"; |
|---|
| 73 | |
|---|
| 74 | exit 1; |
|---|
| 75 | |
|---|
| 76 | } else { |
|---|
| 77 | |
|---|
| 78 | $| = 1; |
|---|
| 79 | |
|---|
| 80 | } |
|---|