Changeset 3871
- Timestamp:
- 06/25/11 11:27:27 (11 months ago)
- Location:
- trunk
- Files:
-
- 6 added
- 1 deleted
- 35 edited
- 1 copied
- 1 moved
-
CHANGELOG (modified) (1 diff)
-
configs/centos/postfix/master.cf (modified) (1 diff)
-
configs/common/database/spamassassin.sql (modified) (1 diff)
-
configs/debian/postfix/master.cf (modified) (1 diff)
-
configs/fedora/postfix/master.cf (modified) (1 diff)
-
configs/freebsd/postfix/master.cf (modified) (1 diff)
-
configs/gentoo/postfix/master.cf (modified) (1 diff)
-
configs/openbsd/postfix/master.cf (modified) (1 diff)
-
configs/opensuse/postfix/master.cf (modified) (1 diff)
-
configs/redhat/postfix/master.cf (modified) (1 diff)
-
configs/ubuntu/postfix/master.cf (modified) (1 diff)
-
docs/Debian/INSTALL (modified) (4 diffs)
-
docs/Debian/debian-packages-wheezy (copied) (copied from trunk/docs/Debian/debian-packages-squeeze) (1 diff)
-
engine/ispcp-als-mngr (modified) (2 diffs)
-
engine/ispcp_common_code.pl (modified) (2 diffs)
-
engine/ispcp_common_methods.pl (modified) (8 diffs)
-
engine/setup/ispcp-setup (modified) (1 diff)
-
engine/setup/ispcp-setup-methods.pl (modified) (4 diffs)
-
gui/admin/settings_ports.php (modified) (1 diff)
-
gui/client/dns_edit.php (modified) (1 diff)
-
gui/client/language.php (modified) (2 diffs)
-
gui/client/mail_accounts.php (modified) (5 diffs)
-
gui/client/protected_areas_add.php (modified) (1 diff)
-
gui/client/protected_user_assign.php (modified) (1 diff)
-
gui/include/Net (moved) (moved from trunk/gui/include/Net_DNS)
-
gui/include/Net/IDNA2 (added)
-
gui/include/Net/IDNA2.php (added)
-
gui/include/Net/IDNA2/Exception (added)
-
gui/include/Net/IDNA2/Exception.php (added)
-
gui/include/Net/IDNA2/Exception/Nameprep.php (added)
-
gui/include/admin-functions.php (modified) (5 diffs)
-
gui/include/functions.ticket_system.php (modified) (1 diff)
-
gui/include/ispCP/Database/ResultSet.php (modified) (5 diffs)
-
gui/include/ispCP/Exception/Writer/Browser.php (modified) (1 diff)
-
gui/include/ispCP/Initializer.php (modified) (5 diffs)
-
gui/include/ispCP/Update.php (modified) (1 diff)
-
gui/include/ispcp-functions.php (modified) (4 diffs)
-
gui/include/ispcp-lib.php (modified) (1 diff)
-
gui/include/login-functions.php (modified) (2 diffs)
-
gui/include/net_idna (deleted)
-
gui/lostpassword.php (modified) (1 diff)
-
gui/orderpanel/package_info.php (modified) (1 diff)
-
gui/reseller/language.php (modified) (2 diffs)
-
language-files/po/es_CO.po.edited (added)
Legend:
- Unmodified
- Added
- Removed
-
trunk/CHANGELOG
r3868 r3871 1 1 ispCP ω 1.1.0 ChangeLog 2 2 ~~~~~~~~~~~~~~~~~~~~~~~~~~ 3 4 2011-06-25 Benedikt Heintel 5 - DISTS: 6 * Added Debian Wheezy support 7 - ENGINE: 8 * Fixed Alias Manager copied file not longer available 9 * Replaced hard coded Autoreply Values in master.cf 10 - GUI: 11 * Added Exception if phptmp is not writable 12 * Added Method fetchAll() to ispCP_Database_ResultSet 13 * Improved l18n handling 14 * Refactored inlcudes 15 3 16 2011-06-22 Benedikt Heintel 4 17 - DISTS: -
trunk/configs/centos/postfix/master.cf
r3762 r3871 76 76 # ispCP autoresponder 77 77 ispcp-arpl unix - n n - - pipe 78 flags=O user= vmail argv=/var/www/ispcp/engine/messenger/ispcp-arpl-msgr78 flags=O user={ARPL_USER} argv={ARPL_PATH} 79 79 80 80 # TLS - Activate, if TLS is avaiable/used -
trunk/configs/common/database/spamassassin.sql
r3845 r3871 45 45 ) TYPE=InnoDB; 46 46 47 INSERT I NTO bayes_global_vars VALUES ('VERSION','3');47 INSERT IGNORE INTO bayes_global_vars VALUES ('VERSION','3'); 48 48 49 49 CREATE TABLE IF NOT EXISTS bayes_seen ( -
trunk/configs/debian/postfix/master.cf
r3762 r3871 76 76 # ispCP autoresponder 77 77 ispcp-arpl unix - n n - - pipe 78 flags=O user= vmail argv=/var/www/ispcp/engine/messenger/ispcp-arpl-msgr78 flags=O user={ARPL_USER}:{ARPL_GROUP} argv={ARPL_PATH} 79 79 80 80 # TLS - Activate, if TLS is avaiable/used -
trunk/configs/fedora/postfix/master.cf
r3762 r3871 76 76 # ispCP autoresponder 77 77 ispcp-arpl unix - n n - - pipe 78 flags=O user= vmail argv=/var/www/ispcp/engine/messenger/ispcp-arpl-msgr78 flags=O user={ARPL_USER}:{ARPL_GROUP} argv={ARPL_PATH} 79 79 80 80 # TLS - Activate, if TLS is avaiable/used -
trunk/configs/freebsd/postfix/master.cf
r3762 r3871 76 76 # ispCP autoresponder 77 77 ispcp-arpl unix - n n - - pipe 78 flags=O user= vmail argv=/usr/local/www/ispcp/engine/messenger/ispcp-arpl-msgr78 flags=O user={ARPL_USER}:{ARPL_GROUP} argv={ARPL_PATH} 79 79 80 80 # TLS - Activate, if TLS is avaiable/used -
trunk/configs/gentoo/postfix/master.cf
r3762 r3871 76 76 # ispCP autoresponder 77 77 ispcp-arpl unix - n n - - pipe 78 flags=O user= vmail argv=/var/www/ispcp/engine/messenger/ispcp-arpl-msgr78 flags=O user={ARPL_USER}:{ARPL_GROUP} argv={ARPL_PATH} 79 79 80 80 # TLS - Activate, if TLS is avaiable/used -
trunk/configs/openbsd/postfix/master.cf
r3762 r3871 76 76 # ISPCP autoresponder 77 77 ispcp-arpl unix - n n - - pipe 78 flags=O user= vmail argv=/var/www/ispcp/engine/messenger/ispcp-arpl-msgr78 flags=O user={ARPL_USER}:{ARPL_GROUP} argv={ARPL_PATH} 79 79 80 80 # TLS - Activate, if TLS is avaiable/used -
trunk/configs/opensuse/postfix/master.cf
r3762 r3871 121 121 122 122 ispcp-arpl unix - n n - - pipe 123 flags=O user= vmail argv=/srv/www/ispcp/engine/messenger/ispcp-arpl-msgr123 flags=O user={ARPL_USER}:{ARPL_GROUP} argv={ARPL_PATH} 124 124 125 125 # ==================================================================== -
trunk/configs/redhat/postfix/master.cf
r3762 r3871 76 76 # ispCP autoresponder 77 77 ispcp-arpl unix - n n - - pipe 78 flags=O user= vmail argv=/var/www/ispcp/engine/messenger/ispcp-arpl-msgr78 flags=O user={ARPL_USER}:{ARPL_GROUP} argv={ARPL_PATH} 79 79 80 80 # TLS - Activate, if TLS is avaiable/used -
trunk/configs/ubuntu/postfix/master.cf
r3762 r3871 76 76 # ispCP autoresponder 77 77 ispcp-arpl unix - n n - - pipe 78 flags=O user= vmail argv=/var/www/ispcp/engine/messenger/ispcp-arpl-msgr78 flags=O user={ARPL_USER}:{ARPL_GROUP} argv={ARPL_PATH} 79 79 80 80 # TLS - Activate, if TLS is avaiable/used -
trunk/docs/Debian/INSTALL
r3733 r3871 18 18 --------------- 19 19 ispCP ω Version: 1.1.0 20 INSTALL Script: 2. 820 INSTALL Script: 2.9 21 21 Maintainer: Benedikt Heintel 22 22 Homepage: http://www.isp-contol.net … … 35 35 All Lenny required packages are listed in ./docs/Debian/debian-packages-lenny 36 36 All Squeeze required packages are listed in ./docs/Debian/debian-packages-squeeze 37 All Wheezy required packages are listed in ./docs/Debian/debian-packages-wheezy 37 38 38 39 ================================================================================ … … 76 77 deb http://security.debian.org/ squeeze/updates main contrib non-free 77 78 79 Wheezy: 80 deb http://ftp.debian.org/debian/ wheezy main contrib non-free 81 deb http://security.debian.org/ wheezy/updates main contrib non-free 82 78 83 Install all required packages: 79 84 … … 143 148 deb http://ftp.debian.org/debian/ squeeze main contrib non-free 144 149 deb http://security.debian.org/ squeeze/updates main contrib non-free 150 151 Wheezy: 152 deb http://ftp.debian.org/debian/ wheezy main contrib non-free 153 deb http://security.debian.org/ wheezy/updates main contrib non-free 145 154 146 155 Install all required packages: -
trunk/docs/Debian/debian-packages-wheezy
r3279 r3871 45 45 libnet-netmask-perl 46 46 libnet-smtp-server-perl 47 libperl5.1 047 libperl5.12 48 48 libsasl2-2 49 49 libsasl2-modules -
trunk/engine/ispcp-als-mngr
r3762 r3871 1806 1806 1807 1807 $rs = sys_command("$main::cfg{'CMD_CP'} -p " . 1808 "$root_dir/gui/errordocs/inc/error_top.jpg $www_dir/$als_name/errors/inc/");1809 return $rs if ($rs != 0);1810 1811 $rs = sys_command("$main::cfg{'CMD_CP'} -p " .1812 1808 "$root_dir/gui/errordocs/inc/errordocs.js $www_dir/$als_name/errors/inc/"); 1813 1809 return $rs if ($rs != 0); … … 1815 1811 $rs = sys_command("$main::cfg{'CMD_CP'} -p " . 1816 1812 "$root_dir/gui/errordocs/inc/errordocs.css $www_dir/$als_name/errors/inc/"); 1817 return $rs if ($rs != 0);1818 1819 $rs = setfmode(1820 "$www_dir/$als_name/errors/inc/error_top.jpg",1821 $sys_user,1822 $sys_group,1823 06441824 );1825 1813 return $rs if ($rs != 0); 1826 1814 -
trunk/engine/ispcp_common_code.pl
r3845 r3871 45 45 File::Temp => 'qw(tempdir)', 46 46 File::Copy::Recursive => 'qw(rcopy)', 47 Net::LibIDN => 'qw /idn_to_ascii idn_to_unicode/'47 Net::LibIDN => 'qw(idn_to_ascii idn_to_unicode)' 48 48 ); 49 49 … … 126 126 127 127 map {s/'/\\'/g, chop} 128 my $db_pass_key = gen_sys_rand_num(32 ),129 my $db_pass_iv = gen_sys_rand_num(8 );128 my $db_pass_key = gen_sys_rand_num(32, ''), 129 my $db_pass_iv = gen_sys_rand_num(8, ''); 130 130 131 131 $main::db_pass_key = $db_pass_key; -
trunk/engine/ispcp_common_methods.pl
r3845 r3871 1 1 #!/usr/bin/perl 2 2 3 # ispCP ω (OMEGA) a Virtual Hosting Control Panel 4 # Copyright (C) 2001-2006 by moleSoftware GmbH - http://www.molesoftware.com 5 # Copyright (C) 2006-2011 by ispCP | http://ispcp.net 6 # 7 # Version: $Id$ 8 # 9 # The contents of this file are subject to the Mozilla Public License 10 # Version 1.1 (the "License"); you may not use this file except in 11 # compliance with the License. You may obtain a copy of the License at 12 # http://www.mozilla.org/MPL/ 13 # 14 # Software distributed under the License is distributed on an "AS IS" 15 # basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the 16 # License for the specific language governing rights and limitations 17 # under the License. 18 # 19 # The Original Code is "VHCS - Virtual Hosting Control System". 20 # 21 # The Initial Developer of the Original Code is moleSoftware GmbH. 22 # Portions created by Initial Developer are Copyright (C) 2001-2006 23 # by moleSoftware GmbH. All Rights Reserved. 24 # Portions created by the ispCP Team are Copyright (C) 2006-2011 by 25 # isp Control Panel. All Rights Reserved. 3 =head1 NAME 4 5 isPCP Common Methods 6 7 =head1 DESCRIPTION 8 9 This file contains common methods widely used in ispCP Engine files 10 11 =head1 COPYRIGHT 12 13 ispCP ω (OMEGA) a Virtual Hosting Control Panel 14 Copyright (C) 2001-2006 by moleSoftware GmbH - L<http://www.molesoftware.com> 15 Copyright (C) 2006-2011 by ispCP | L<http://ispcp.net> 16 17 =head1 VERSION 18 19 Version: $Id$ 20 21 =head1 LICENSE 22 23 The contents of this file are subject to the Mozilla Public License 24 Version 1.1 (the "License"); you may not use this file except in 25 compliance with the License. You may obtain a copy of the License at 26 L<http://www.mozilla.org/MPL/> 27 28 Software distributed under the License is distributed on an "AS IS" 29 basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the 30 License for the specific language governing rights and limitations 31 under the License. 32 33 The Original Code is "VHCS - Virtual Hosting Control System". 34 35 The Initial Developer of the Original Code is moleSoftware GmbH. 36 Portions created by Initial Developer are Copyright (C) 2001-2006 37 by moleSoftware GmbH. All Rights Reserved. 38 Portions created by the ispCP Team are Copyright (C) 2006-2011 by 39 isp Control Panel. All Rights Reserved. 40 41 =cut 26 42 27 43 # Hide the "used only once: possible typo" warnings … … 917 933 } 918 934 919 sub gen_sys_rand_num { 920 921 push_el(\@main::el, 'gen_sys_rand_num()', 'Starting...'); 922 923 my ($len) = @_; 935 =head2 generateRandomChars(length, exclude) 936 937 Generates a random string with specified length generated by the pseudo number generator. 938 939 =item length 940 941 Length of random string. 942 943 =item exclude 944 945 List of values to be excluded. 946 947 =cut 948 949 sub generateRandomChars { 950 951 push_el(\@main::el, 'generateRandomChars()', 'Starting...'); 952 953 my ($len, $exclude) = @_; 924 954 925 955 if (!defined $len || $len eq '') { 926 956 push_el( 927 \@main::el, 'gen _sys_rand_num()',957 \@main::el, 'generateRandomChars()', 928 958 "[ERROR] Undefined input data, len: |$len| !" 929 959 ); 930 960 931 961 return (-1, ''); 962 } 963 964 if (0 >= $len ) { 965 push_el( 966 \@main::el, 'generateRandomChars()', 967 "[ERROR] Input data length '$len' is zero or negative !" 968 ); 969 970 return (-1, ''); 971 } 972 973 if (!defined $exclude) { 974 $exclude = ''; 975 } else { 976 my @excludeList = split('', $exclude); 932 977 } 933 934 if (0 >= $len ) {935 push_el(936 \@main::el, 'gen_sys_rand_num()',937 "[ERROR] Input data length '$len' is zero or negative !"938 );939 940 return (-1, '');941 }942 978 943 979 my $pool_size = 0; … … 950 986 if ($pool_size <= ($len + 10)) { 951 987 push_el( 952 \@main::el, 'gen _sys_rand_num()',988 \@main::el, 'generateRandomChars()', 953 989 "[WARNING] entropy pool is $pool_size, but we require more or less $len" 954 990 ); … … 958 994 if (-e '/dev/urandom') { 959 995 push_el( 960 \@main::el, 'gen _sys_rand_num()',996 \@main::el, 'generateRandomChars()', 961 997 "[NOTICE] seeding the entropy pool (possible current size: $pool_size)" 962 998 ); … … 985 1021 986 1022 push_el( 987 \@main::el, 'gen _sys_rand_num()',1023 \@main::el, 'generateRandomChars()', 988 1024 "[NOTICE] new entropy pool size is $pool_size" 989 1025 ); … … 1001 1037 if (!defined $rs) { 1002 1038 push_el( 1003 \@main::el, 'gen _sys_rand_num()',1039 \@main::el, 'generateRandomChars()', 1004 1040 "[ERROR] Couldn't open the pseudo-random characters generator: $!" 1005 1041 ); … … 1009 1045 } 1010 1046 1011 my ($i, $rdata, $rc, $ rci) = (0, undef, undef, undef);1047 my ($i, $rdata, $rc, $asciiValue) = (0, undef, undef, undef); 1012 1048 1013 1049 while ($i <= $len) { 1014 1050 1015 1051 read(F, $rc, 1); 1016 $rci = ord($rc); 1017 1018 # Excludes all chars below Space (incl.) and bove }, 1019 # the escape char (\) and the ' 1020 next if ($rci <= 32 || $rci >= 126 || $rci == 92 || $rci == 39); 1052 $asciiValue = ord($rc); 1053 1054 # Test all chars from the $exclude list 1055 foreach (@excludeList) { 1056 if (ord($_) == ord($rc)) { 1057 # Set ASCII value to a disallowed value 1058 $asciiValue = 0; 1059 } 1060 } 1061 # Excludes all chars below Space (incl.) and above ~, the escape char (\) and the ' 1062 next if ($asciiValue <= 32 || $asciiValue >= 126 || $asciiValue == 92 || $asciiValue == 39); 1021 1063 1022 1064 $rdata .= $rc; … … 1027 1069 close(F); 1028 1070 1029 push_el(\@main::el, 'gen _sys_rand_num()', 'Ending...');1071 push_el(\@main::el, 'generateRandomChars()', 'Ending...'); 1030 1072 1031 1073 return (0, $rdata); -
trunk/engine/setup/ispcp-setup
r3845 r3871 226 226 } else { 227 227 $cmd = "$main::cfg{'CMD_USERADD'} -c vmail-user -g $gid -s " . 228 "/bin/false $fuid";228 "/bin/false -r $fuid"; 229 229 } 230 230 -
trunk/engine/setup/ispcp-setup-methods.pl
r3852 r3871 310 310 311 311 if (!defined $pass1 || $pass1 eq '') { 312 $dbPassword = gen_sys_rand_num(18); 313 $dbPassword =~ s/('|"|`|#|;)//g; 312 $dbPassword = generateRandomChars(18, '\'"`#; '); 314 313 $main::ua{'db_ftp_password'} = $dbPassword; 315 314 printNotice($dbPassword); … … 556 555 557 556 if (!defined $pass1 || $pass1 eq '') { 558 my $dbPassword = gen_sys_rand_num(18); 559 $dbPassword =~ s/('|"|`|#|;)//g; 557 my $dbPassword = generateRandomChars(18, '\'"`#; '); 560 558 $main::ua{'db_pma_password'} = $dbPassword; 561 559 printNotice($dbPassword); … … 2192 2190 # master.cf 2193 2191 2192 # Loading the template from /etc/ispcp/postfix/ 2193 ($rs, $cfgTpl) = get_file("$cfgDir/master.cf"); 2194 return $rs if ($rs != 0); 2195 2196 # Building the file 2197 ($rs, $$cfg) = prep_tpl( 2198 { 2199 '{ARPL_USER}' => $main::cfg{'MTA_MAILBOX_UID_NAME'}, 2200 '{ARPL_GROUP}' => $main::cfg{'MTA_MAILBOX_GID_NAME'}, 2201 '{ARPL_PATH}' => $main::cfg{'ROOT_DIR'}."/engine/messenger/ispcp-arpl-msgr", 2202 }, 2203 $cfgTpl 2204 ); 2205 return $rs if ($rs != 0); 2206 2194 2207 # Storing the new file in the working directory 2195 $rs = sys_command("$main::cfg{'CMD_CP'} -pf $cfgDir/master.cf $wrkDir/"); 2208 $rs = store_file( 2209 "$wrkDir/master.cf", $$cfg, $main::cfg{'ROOT_USER'}, 2210 $main::cfg{'ROOT_GROUP'}, 0644 2211 ); 2196 2212 return $rs if ($rs != 0); 2197 2213 … … 2955 2971 # Getting blowfish secret 2956 2972 if(!defined $blowfishSecret) { 2957 $blowfishSecret = gen _sys_rand_num(31);2973 $blowfishSecret = generateRandomChars(31, ''); 2958 2974 $blowfishSecret =~ s/'/\\'/gi; 2959 2975 } -
trunk/gui/admin/settings_ports.php
r3846 r3871 320 320 * @since 1.0.7 321 321 * @author Laurent declercq (nuxwin) <laurent.declercq@ispcp.net> 322 * @param ispCP_TemplateEngine $tpl Reference to a pTemplate instance322 * @param ispCP_TemplateEngine $tpl Reference to a template instance 323 323 * @return void; 324 324 */ -
trunk/gui/client/dns_edit.php
r3846 r3871 27 27 28 28 require_once '../include/ispcp-lib.php'; 29 require_once '../include/Net _DNS/DNS.php';29 require_once '../include/Net/DNS/DNS.php'; 30 30 31 31 check_login(__FILE__); -
trunk/gui/client/language.php
r3868 r3871 40 40 if (isset($_POST['uaction']) && $_POST['uaction'] === 'save_lang') { 41 41 $user_id = $_SESSION['user_id']; 42 $user_lang = $_POST['def_language'];42 $user_lang = clean_input($_POST['def_language']); 43 43 $query = " 44 44 UPDATE … … 51 51 52 52 exec_query($sql, $query, array($user_lang, $user_id)); 53 unset($_SESSION['user_def_lang']); 54 $_SESSION['user_def_lang'] = $user_lang; 53 54 if(!isset($_SESSION['logged_from_id'])) { 55 unset($_SESSION['user_def_lang']); 56 $_SESSION['user_def_lang'] = $user_lang; 57 } 58 55 59 set_page_message(tr('User language updated successfully!'), 'success'); 56 60 } -
trunk/gui/client/mail_accounts.php
r3852 r3871 106 106 * Must be documented 107 107 * 108 * @param ispCP_TemplateEngine $tpl pTemplate instance108 * @param ispCP_TemplateEngine $tpl template instance 109 109 * @param int $mail_id 110 110 * @param string $mail_type … … 165 165 * Must be documented 166 166 * 167 * @param ispCP_TemplateEngine $tpl reference to pTemplate object167 * @param ispCP_TemplateEngine $tpl reference to template object 168 168 * @param ispCP_Database $sql reference to ispcp_Database object 169 169 * @param int $dmn_id domain name id … … 376 376 * Must be documented 377 377 * 378 * @param ispCP_TemplateEngine $tpl reference to the pTemplate object378 * @param ispCP_TemplateEngine $tpl reference to the template object 379 379 * @param ispCP_Database $sql reference to the ispCP_Database object 380 380 * @param int $dmn_id domain name id … … 486 486 * Must be documented 487 487 * 488 * @param ispCP_TemplateEngine $tpl reference to pTemplate object488 * @param ispCP_TemplateEngine $tpl reference to template object 489 489 * @param ispCP_Database $sql reference to the ispCP_Database object 490 490 * @param int $dmn_id domain name id; … … 593 593 * Must be documented 594 594 * 595 * @param ispCP_TemplateEngine $tpl Reference to the pTemplate object595 * @param ispCP_TemplateEngine $tpl Reference to the template object 596 596 * @param ispCP_Database $sql Reference to the ispCP_Database object 597 597 * @param int $user_id Customer id -
trunk/gui/client/protected_areas_add.php
r3846 r3871 209 209 210 210 /** 211 * @param ispCP_ pTemplate $tpl211 * @param ispCP_TemplateEngine $tpl 212 212 * @param ispCP_Database $sql 213 213 * @param int $dmn_id -
trunk/gui/client/protected_user_assign.php
r3846 r3871 72 72 73 73 /** 74 * @param ispCP_ pTemplate $tpl74 * @param ispCP_TemplateEngine $tpl 75 75 * @param ispCP_Database $sql 76 76 * @param int $dmn_id -
trunk/gui/include/admin-functions.php
r3841 r3871 342 342 343 343 /** 344 * @param ispCP_ pTemplate $tpl344 * @param ispCP_TemplateEngine $tpl 345 345 * @param ispCP_Database $sql 346 346 * @return void … … 439 439 440 440 /** 441 * @param ispCP_ pTemplate $tpl441 * @param ispCP_TemplateEngine $tpl 442 442 * @param ispCP_Database $sql 443 443 */ … … 531 531 532 532 /** 533 * @param ispCP_ pTemplate $tpl533 * @param ispCP_TemplateEngine $tpl 534 534 * @param ispCP_Database $sql 535 535 */ … … 786 786 787 787 /** 788 * @param ispCP_ pTemplate $tpl788 * @param ispCP_TemplateEngine $tpl 789 789 * @param ispCP_Database $sql 790 790 */ … … 2436 2436 * @todo use template(s) instead of hardcoded (X)HTML 2437 2437 * @todo possible SESSION hijackin for $_SESSION['user_theme'] 2438 * @param ispCP_ pTemplate $tpl2438 * @param ispCP_TemplateEngine $tpl 2439 2439 * @param ispCP_Database $sql 2440 2440 * @param int $user_id -
trunk/gui/include/functions.ticket_system.php
r3841 r3871 167 167 168 168 if ($userLevel < 1 || $userLevel > 2) 169 throw new ispCP_Exception(" ERROR:User level is not valid!");169 throw new ispCP_Exception("User level is not valid!"); 170 170 171 171 $ticket_date = time(); -
trunk/gui/include/ispCP/Database/ResultSet.php
r3762 r3871 77 77 if(!($stmt instanceof PDOStatement)) { 78 78 throw new ispCP_Exception_Database( 79 ' Error:Argument passed to ' . __METHOD__ . '() must be a ' .79 'Argument passed to ' . __METHOD__ . '() must be a ' . 80 80 'PDOStatement object!' 81 81 ); … … 86 86 87 87 /** 88 * P hpoverloading89 * 90 * P hpoverloading method that allows to fetch the first row in the result88 * PHP overloading 89 * 90 * PHP overloading method that allows to fetch the first row in the result 91 91 * set or check if one row exist in the result set 92 92 * … … 115 115 } 116 116 117 throw new ispCP_Exception_Database(" Error:Unknown parameter: `$param`");117 throw new ispCP_Exception_Database("Unknown parameter: `$param`"); 118 118 } 119 119 … … 184 184 * how the row is returned. 185 185 * 186 * @param int $fetchStyle 186 * @param int $fetchStyle Controls how the next row will be returned to the 187 * caller. This value must be one of the PDO::FETCH_* constants 187 188 * @return mixed The return value of this function on success depends on the 188 189 * fetch style. In all cases, FALSE is returned on failure. … … 197 198 198 199 /** 200 * Fetches all rows from the current result set 201 * 202 * Fetches all rows from the result set. The fetch_style parameter 203 * determines how the rows are returned. 204 * 205 * @param int $fetchStyle Controls how the next row will be returned to the 206 * caller. This value must be one of the PDO::FETCH_* constants 207 * @return mixed The return value of this function on success depends on the 208 * fetch style. In all cases, FALSE is returned on failure. 209 * @todo Finish fetch style implementation 210 */ 211 public function fetchAll($fetchStyle = null) { 212 213 $fetchStyle = is_null($fetchStyle) ? $this->_fetchMode : $fetchStyle; 214 215 return $this->_stmt->fetchAll($fetchStyle); 216 } 217 218 /** 199 219 * Fetches the next row from the current result set 200 220 * -
trunk/gui/include/ispCP/Exception/Writer/Browser.php
r3825 r3871 44 44 * 45 45 * The given template should be a template file that can be treated by a 46 * pTemplate object.46 * template object. 47 47 * 48 48 * <b>Note:</b> Will be improved later. -
trunk/gui/include/ispCP/Initializer.php
r3857 r3871 39 39 * @author Laurent declercq <laurent.declercq@ispcp.net> 40 40 * @since 1.0.7 41 * @version 1.1. 241 * @version 1.1.3 42 42 */ 43 43 class ispCP_Initializer { … … 158 158 $this->_setIncludePath(); 159 159 160 // Create or restore the session161 $this->_initializeSession();162 163 160 // Establish the connection to the database 164 161 $this->_initializeDatabase(); … … 176 173 // Initialize output buffering 177 174 $this->_initializeOutputBuffering(); 175 176 // Create or restore the session 177 $this->_initializeSession(); 178 178 179 179 // Initialize internationalization libraries … … 354 354 */ 355 355 protected function _initializeSession() { 356 357 if (!is_writable($this->_config->GUI_ROOT_DIR . '/phptmp')) { 358 throw new ispCP_Exception('The directory '. $this->_config->GUI_ROOT_DIR . '/phptmp must be writable.'); 359 } 356 360 357 361 session_name('ispCP'); … … 558 562 * execution context are loaded. 559 563 * 560 * <b>Note:</b> Not used at this moment (testing in progress...)564 * <b>Note:</b> Not used at this moment 561 565 * 562 566 * @return void -
trunk/gui/include/ispCP/Update.php
r3762 r3871 198 198 $sql->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); 199 199 200 // Checks if a database updated previously failed 200 201 if(isset($dbConfig->FAILED_UPDATE)) { 201 202 list($failedUpdate, $queryNb) = $dbConfig->FAILED_UPDATE; 202 203 } else { 203 204 $failedUpdate = 'inexistent'; 205 $queryNb = -1; 204 206 } 205 207 206 try { 207 208 // We execute all SQL statements 209 foreach($queryArray as $index => $query) { 210 // Query was already applied with success ? 211 if($functionName == $failedUpdate && $index < $queryNb) { 212 continue; 208 // We execute all SQL statements 209 foreach($queryArray as $index => $query) { 210 211 // Query was already applied with success ? 212 if ($functionName == $failedUpdate && $index < $queryNb) { 213 continue; 214 } 215 216 try { 217 $sql->query($query); 218 unset($dbConfig->FAILED_UPDATE); 219 220 // Update revision 221 $dbConfig->set($this->_databaseVariableName, $newVersion); 222 223 } catch (PDOException $e) { 224 225 // Store the query number and function name that wraps it 226 $dbConfig->FAILED_UPDATE = "$functionName;$index"; 227 228 // Prepare error message 229 $errorMessage = sprintf($this->_errorMessage, $newVersion); 230 231 // Extended error message 232 if(PHP_SAPI != 'cli') { 233 $errorMessage .= ':<br /><br />' . $e->getMessage() . 234 '<br /><br />Query: ' . trim($query); 235 } else { 236 $errorMessage .= ":\n\n" . $e->getMessage() . 237 "\nQuery: " . trim($query); 213 238 } 214 239 215 $sql->query($query); 240 $this->_addErrorMessage($errorMessage); 241 242 // An error occurred, we stop here ! 243 return false; 216 244 } 217 218 unset($dbConfig->FAILED_UPDATE);219 220 // Update revision221 $dbConfig->set($this->_databaseVariableName, $newVersion);222 223 } catch (PDOException $e) {224 225 // Store the query number and function name that wraps it226 $dbConfig->FAILED_UPDATE = "$functionName;$index";227 228 // Prepare error message229 $errorMessage = sprintf($this->_errorMessage, $newVersion);230 231 // Extended error message232 if(PHP_SAPI != 'cli') {233 $errorMessage .= ':<br /><br />' . $e->getMessage() .234 '<br /><br />Query: ' . trim($query);235 } else {236 $errorMessage .= ":\n\n" . $e->getMessage() .237 "\nQuery: " . trim($query);238 }239 240 $this->_addErrorMessage($errorMessage);241 242 // An error occurred, we stop here !243 return false;244 245 } 245 246 -
trunk/gui/include/ispcp-functions.php
r3762 r3871 389 389 390 390 /** 391 * Should be documented391 * Decodes a String from IDNA format to UTF8 392 392 * 393 393 * @param $input … … 398 398 if (function_exists('idn_to_unicode')) { 399 399 return idn_to_utf8($input, IDNA_USE_STD3_RULES); 400 } 401 402 $IDN = new idna_convert(); 403 $output = $IDN->decode($input); 404 405 return ($output == false) ? $input : $output; 406 } 407 408 /** 409 * Should be documented 400 } else { 401 402 $IDNA = new Net_IDNA2(); 403 $output = $IDNA->decode($input); 404 405 return ($output == false) ? $input : $output; 406 } 407 } 408 409 /** 410 * Encodes a String from IDNA format ASCII 410 411 * 411 412 * @param $input … … 416 417 if (function_exists('idn_to_ascii')) { 417 418 return idn_to_ascii($input); 418 } 419 420 $IDN = new idna_convert(); 421 $output = $IDN->encode($input); 422 423 return $output; 424 } 425 426 /** 427 * Should be documented 419 } else { 420 421 $IDNA = new Net_IDNA2(); 422 $output = $IDNA->encode($input); 423 424 return $output; 425 } 426 } 427 428 /** 429 * Check wether a given String is a number or not. 428 430 * 429 431 * @param $integer Number to be checked … … 431 433 */ 432 434 function is_number($number) { 433 434 435 return (bool) preg_match('/^[0-9]+$/D', $number); 435 436 } -
trunk/gui/include/ispcp-lib.php
r3775 r3871 100 100 * Include ispCP common functions 101 101 */ 102 require_once ' net_idna/idna_convert.class.php';102 require_once 'Net/IDNA2.php'; 103 103 require_once INCLUDEPATH . '/ispcp-functions.php'; 104 104 -
trunk/gui/include/login-functions.php
r3762 r3871 365 365 366 366 deny_access(); 367 return true;367 return; 368 368 } 369 369 … … 571 571 572 572 deny_access(); 573 return; 573 574 } 574 575 -
trunk/gui/lostpassword.php
r3775 r3871 41 41 // check if GD library is available 42 42 if (!check_gd()) { 43 throw new ispCP_Exception(tr(" ERROR: php-extension 'gd' not loaded!"));43 throw new ispCP_Exception(tr("PHP Extension 'gd' not loaded!")); 44 44 } 45 45 46 46 // check if captch fonts exist 47 47 if (!captcha_fontfile_exists()) { 48 throw new ispCP_Exception(tr(" ERROR: captcha fontfile not found!"));48 throw new ispCP_Exception(tr("Captcha fontfile not found!")); 49 49 } 50 50 -
trunk/gui/orderpanel/package_info.php
r3841 r3871 63 63 64 64 /** 65 * @param ispCP_ pTemplate $tpl65 * @param ispCP_TemplateEngine $tpl 66 66 * @param ispCP_Database $sql 67 67 * @param int $user_id -
trunk/gui/reseller/language.php
r3868 r3871 47 47 $user_id = $_SESSION['user_id']; 48 48 49 $user_lang = $_POST['def_language'];49 $user_lang = clean_input($_POST['def_language']); 50 50 51 51 $query = " … … 60 60 exec_query($sql, $query, array($user_lang, $user_id)); 61 61 62 unset($_SESSION['user_def_lang']); 63 $_SESSION['user_def_lang'] = $user_lang; 62 if(!isset($_SESSION['logged_from_id'])) { 63 unset($_SESSION['user_def_lang']); 64 $_SESSION['user_def_lang'] = $user_lang; 65 } 64 66 set_page_message(tr('User language updated successfully!'), 'success'); 65 67 }
Note: See TracChangeset
for help on using the changeset viewer.
