| 1 |
#!/usr/bin/perl |
|---|
| 2 |
|
|---|
| 3 |
# ispCP ω (OMEGA) a Virtual Hosting Control Panel |
|---|
| 4 |
# Copyright (c) 2006-2007 by isp Control Panel |
|---|
| 5 |
# http://isp-control.net |
|---|
| 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://isp-control.net |
|---|
| 29 |
# |
|---|
| 30 |
|
|---|
| 31 |
|
|---|
| 32 |
|
|---|
| 33 |
my @needed = (strict, warnings, IO::Socket, DBI, DBD::mysql, Mail::Address, MIME::Entity, |
|---|
| 34 |
MIME::Parser, Crypt::CBC, Crypt::Blowfish, MIME::Base64, |
|---|
| 35 |
Term::ReadPassword, Net::LibIDN); |
|---|
| 36 |
|
|---|
| 37 |
my ($mod, $mod_err, $mod_missing) = ('', '_off_', ''); |
|---|
| 38 |
|
|---|
| 39 |
for $mod (@needed) { |
|---|
| 40 |
|
|---|
| 41 |
print STDERR "Checking for '$mod'...\t"; |
|---|
| 42 |
|
|---|
| 43 |
if (eval "require $mod") { |
|---|
| 44 |
|
|---|
| 45 |
$mod -> import(); |
|---|
| 46 |
|
|---|
| 47 |
printf " Ok.\n"; |
|---|
| 48 |
|
|---|
| 49 |
} else { |
|---|
| 50 |
|
|---|
| 51 |
print STDERR "CRITICAL ERROR: Module '$mod' WAS NOT FOUND !\n" ; |
|---|
| 52 |
|
|---|
| 53 |
$mod_err = '_on_'; |
|---|
| 54 |
|
|---|
| 55 |
if ($mod_missing eq '') { |
|---|
| 56 |
|
|---|
| 57 |
$mod_missing .= $mod; |
|---|
| 58 |
|
|---|
| 59 |
} else { |
|---|
| 60 |
|
|---|
| 61 |
$mod_missing .= ", $mod"; |
|---|
| 62 |
|
|---|
| 63 |
} |
|---|
| 64 |
} |
|---|
| 65 |
|
|---|
| 66 |
} |
|---|
| 67 |
|
|---|
| 68 |
if ($mod_err eq '_on_') { |
|---|
| 69 |
|
|---|
| 70 |
print STDERR "\nModules [$mod_missing] WERE NOT FOUND in your |
|---|
| 71 |
system...\n"; |
|---|
| 72 |
|
|---|
| 73 |
print STDERR "\nPlease INSTALL them before using isCP Omega !\n"; |
|---|
| 74 |
|
|---|
| 75 |
exit 1; |
|---|
| 76 |
|
|---|
| 77 |
} else { |
|---|
| 78 |
|
|---|
| 79 |
$| = 1; |
|---|
| 80 |
|
|---|
| 81 |
} |
|---|
| 82 |
|
|---|
| 83 |
return 0; |
|---|
| 84 |
|
|---|
| 85 |
# hack for dh_perl |
|---|
| 86 |
|
|---|
| 87 |
require IO::Socket; |
|---|
| 88 |
require DBI; |
|---|
| 89 |
require DBD::mysql; |
|---|
| 90 |
require Mail::Address; |
|---|
| 91 |
require MIME::Entity; |
|---|
| 92 |
require MIME::Parser; |
|---|
| 93 |
require Crypt::CBC; |
|---|
| 94 |
require Crypt::Blowfish; |
|---|
| 95 |
require MIME::Base64; |
|---|
| 96 |
require Term::ReadPassword; |
|---|
| 97 |
require Net::LibIDN; |
|---|