root/trunk/keys/rpl.pl

Revision 1028, 2.1 kB (checked in by rats, 6 months ago)

Maybe fixed #946; ispcp-setup mysql password error

  • Property svn:executable set to *
Line 
1 #!/usr/bin/perl
2
3 # ispCP ω (OMEGA) a Virtual Hosting Control Panel
4 # Copyright (c) 2001-2006 by moleSoftware GmbH
5 # http://www.molesoftware.com
6 # Copyright (c) 2006-2008 by isp Control Panel
7 # http://isp-control.net
8 #
9 #
10 # License:
11 #    This program is free software; you can redistribute it and/or
12 #    modify it under the terms of the MPL Mozilla Public License
13 #    as published by the Free Software Foundation; either version 1.1
14 #    of the License, or (at your option) any later version.
15 #
16 #    This program is distributed in the hope that it will be useful,
17 #    but WITHOUT ANY WARRANTY; without even the implied warranty of
18 #    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19 #    MPL Mozilla Public License for more details.
20 #
21 #    You may have received a copy of the MPL Mozilla Public License
22 #    along with this program.
23 #
24 #    An on-line copy of the MPL Mozilla Public License can be found
25 #    http://www.mozilla.org/MPL/MPL-1.1.html
26 #
27 #
28 # The ispCP ω Home Page is at:
29 #
30 #    http://isp-control.net
31 #
32
33 use FindBin;
34
35 use lib "$FindBin::Bin/../engine";
36 require 'ispcp_common_methods.pl';
37
38 use strict;
39 use warnings;
40 $SIG{'INT'} = 'IGNORE';
41
42 die ("Undefined Input Data!") if (!defined($ARGV[0]) || !defined($ARGV[1]) || !defined($ARGV[2]));
43
44 my ($php_fname, $perl_fname, $perl_fname2) = ($ARGV[0], $ARGV[1], $ARGV[2]);
45
46 my $key = gen_sys_rand_num(32);
47 my $iv  = gen_sys_rand_num(8);
48
49 $key =~ s/'/\\'/gi;
50 $iv =~ s/'/\\'/gi;
51
52 # remove \n at the end of lines;
53
54 chop($key);
55 chop($iv);
56
57 my ($rs, $php_file, $perl_file) = (undef, undef, undef);
58
59 my %tag_hash = (
60                     '{KEY}' => $key,
61                     '{IV}'  => $iv
62                 );
63
64 # php lib;
65
66 $php_file = get_file($php_fname);
67
68 ($rs, $php_file) = prep_tpl(\%tag_hash, $php_file);
69
70 return $rs if ($rs != 0);
71
72 $rs = save_file($php_fname, $php_file);
73
74 return $rs if ($rs != 0);
75
76 # perl lib;
77
78 $perl_file = get_file($perl_fname);
79
80 ($rs, $perl_file) = prep_tpl(\%tag_hash, $perl_file);
81
82 return $rs if ($rs != 0);
83
84 $rs = save_file($perl_fname, $perl_file);
85
86 return $rs if ($rs != 0);
87
88
89 # perl lib for autoresponder;
90
91 $rs = save_file($perl_fname2, $perl_file);
92
93 return $rs if ($rs != 0);
Note: See TracBrowser for help on using the browser.