Skip to content

Commit bfcdef6

Browse files
committed
Merged revisions 3596-3670 from 3.0.5 stable branch.
1 parent bf49ff3 commit bfcdef6

File tree

1,110 files changed

+16307
-9372
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,110 files changed

+16307
-9372
lines changed

install/dist/lib/fedora.lib.php

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -875,8 +875,15 @@ public function install_ispconfig()
875875
exec("chmod -R 770 $install_dir/server/aps_packages");
876876

877877
//* make sure that the server config file (not the interface one) is only readable by the root user
878-
exec("chmod 600 $install_dir/server/lib/$configfile");
879-
exec("chown root:root $install_dir/server/lib/$configfile");
878+
chmod($install_dir.'/server/lib/config.inc.php', 0600);
879+
chown($install_dir.'/server/lib/config.inc.php', 'root');
880+
chgrp($install_dir.'/server/lib/config.inc.php', 'root');
881+
882+
//* Make sure thet the interface config file is readable by user ispconfig only
883+
chmod($install_dir.'/interface/lib/config.inc.php', 0600);
884+
chown($install_dir.'/interface/lib/config.inc.php', 'ispconfig');
885+
chgrp($install_dir.'/interface/lib/config.inc.php', 'ispconfig');
886+
880887
if(@is_file("$install_dir/server/lib/mysql_clientdb.conf")) {
881888
exec("chmod 600 $install_dir/server/lib/mysql_clientdb.conf");
882889
exec("chown root:root $install_dir/server/lib/mysql_clientdb.conf");

install/dist/lib/gentoo.lib.php

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -864,9 +864,14 @@ public function install_ispconfig()
864864
exec("chmod -R 770 $install_dir/server/aps_packages");
865865

866866
//* make sure that the server config file (not the interface one) is only readable by the root user
867-
chmod($install_dir.'/server/lib/'.$configfile, 0600);
868-
chown($install_dir.'/server/lib/'.$configfile, 'root');
869-
chgrp($install_dir.'/server/lib/'.$configfile, 'root');
867+
chmod($install_dir.'/server/lib/config.inc.php', 0600);
868+
chown($install_dir.'/server/lib/config.inc.php', 'root');
869+
chgrp($install_dir.'/server/lib/config.inc.php', 'root');
870+
871+
//* Make sure thet the interface config file is readable by user ispconfig only
872+
chmod($install_dir.'/interface/lib/config.inc.php', 0600);
873+
chown($install_dir.'/interface/lib/config.inc.php', 'ispconfig');
874+
chgrp($install_dir.'/interface/lib/config.inc.php', 'ispconfig');
870875

871876
chmod($install_dir.'/server/lib/remote_action.inc.php', 0600);
872877
chown($install_dir.'/server/lib/remote_action.inc.php', 'root');

install/dist/lib/opensuse.lib.php

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -914,8 +914,15 @@ public function install_ispconfig()
914914
exec("chmod -R 770 $install_dir/server/aps_packages");
915915

916916
//* make sure that the server config file (not the interface one) is only readable by the root user
917-
exec("chmod 600 $install_dir/server/lib/$configfile");
918-
exec("chown root:root $install_dir/server/lib/$configfile");
917+
chmod($install_dir.'/server/lib/config.inc.php', 0600);
918+
chown($install_dir.'/server/lib/config.inc.php', 'root');
919+
chgrp($install_dir.'/server/lib/config.inc.php', 'root');
920+
921+
//* Make sure thet the interface config file is readable by user ispconfig only
922+
chmod($install_dir.'/interface/lib/config.inc.php', 0600);
923+
chown($install_dir.'/interface/lib/config.inc.php', 'ispconfig');
924+
chgrp($install_dir.'/interface/lib/config.inc.php', 'ispconfig');
925+
919926
if(@is_file("$install_dir/server/lib/mysql_clientdb.conf")) {
920927
exec("chmod 600 $install_dir/server/lib/mysql_clientdb.conf");
921928
exec("chown root:root $install_dir/server/lib/mysql_clientdb.conf");

install/lib/install.lib.php

Lines changed: 23 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -757,18 +757,19 @@ function is_ispconfig_ssl_enabled() {
757757
function find_hash_file($hash, $dir, $basedir = '') {
758758
$res = opendir($dir);
759759
if(!$res) return false;
760-
760+
761+
if(substr($basedir, -1) === '/') $basedir = substr($basedir, 0, strlen($basedir) - 1);
761762
if(substr($dir, -1) === '/') $dir = substr($dir, 0, strlen($dir) - 1);
762763
if($basedir === '') $basedir = $dir;
763-
764+
764765
while($cur = readdir($res)) {
765766
if($cur == '.' || $cur == '..') continue;
766767
$entry = $dir.'/'.$cur;
767768
if(is_dir($entry)) {
768769
$result = find_hash_file($hash, $entry, $basedir);
769770
if($result !== false) return $result;
770771
} elseif(md5_file($entry) === $hash) {
771-
$entry = substr($entry, strlen($basedir));
772+
$entry = substr($entry, strlen($basedir) + 1);
772773
if(substr($entry, 0, 7) === '/posix/') $entry = substr($entry, 7);
773774
return $entry;
774775
}
@@ -782,23 +783,28 @@ function find_hash_file($hash, $dir, $basedir = '') {
782783
(c) 2012 Marius Cramer, pixcept KG, m.cramer@pixcept.de
783784
*/
784785
function get_system_timezone() {
785-
if(is_link('/etc/localtime')) {
786-
$timezone = readlink('/etc/localtime');
787-
$timezone = str_replace('/usr/share/zoneinfo/', '', $timezone);
788-
if(substr($timezone, 0, 6) === 'posix/') $timezone = substr($timezone, 6);
789-
} else {
790-
$hash = md5_file('/etc/localtime');
791-
$timezone = find_hash_file($hash, '/usr/share/zoneinfo');
792-
}
786+
$timezone = false;
787+
if(file_exists('/etc/timezone') && is_readable('/etc/timezone')) {
788+
$timezone = trim(file_get_contents('/etc/timezone'));
789+
if(file_exists('/usr/share/zoneinfo/' . $timezone) == false) $timezone = false;
790+
}
791+
792+
if(!$timezone && is_link('/etc/localtime')) {
793+
$timezone = readlink('/etc/localtime');
794+
$timezone = str_replace('/usr/share/zoneinfo/', '', $timezone);
795+
if(substr($timezone, 0, 6) === 'posix/') $timezone = substr($timezone, 6);
796+
} elseif(!$timezone) {
797+
$hash = md5_file('/etc/localtime');
798+
$timezone = find_hash_file($hash, '/usr/share/zoneinfo');
799+
}
793800

794-
if(!$timezone) {
795-
exec('date +%Z', $tzinfo);
796-
$timezone = $tzinfo[0];
797-
}
801+
if(!$timezone) {
802+
exec('date +%Z', $tzinfo);
803+
$timezone = $tzinfo[0];
804+
}
798805

799-
return $timezone;
806+
return $timezone;
800807
}
801808

802809

803-
804810
?>

install/lib/installer_base.lib.php

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -423,7 +423,7 @@ public function grant_master_database_rights($verbose = false) {
423423
$this->warning('Unable to set rights of user in master database: '.$value['db']."\n Query: ".$query."\n Error: ".$this->dbmaster->errorMessage);
424424
}
425425

426-
$query = "GRANT SELECT, UPDATE (`ssl_request`, `ssl_cert`, `ssl_action`) ON ".$value['db'].".`web_domain` TO '".$value['user']."'@'".$host."' ";
426+
$query = "GRANT SELECT, UPDATE (`ssl_request`, `ssl_cert`, `ssl_action`, `ssl_key`) ON ".$value['db'].".`web_domain` TO '".$value['user']."'@'".$host."' ";
427427
if ($verbose){
428428
echo $query ."\n";
429429
}
@@ -1816,9 +1816,14 @@ public function install_ispconfig() {
18161816
exec("chmod -R 770 $install_dir/server/aps_packages");
18171817

18181818
//* make sure that the server config file (not the interface one) is only readable by the root user
1819-
chmod($install_dir.'/server/lib/'.$configfile, 0600);
1820-
chown($install_dir.'/server/lib/'.$configfile, 'root');
1821-
chgrp($install_dir.'/server/lib/'.$configfile, 'root');
1819+
chmod($install_dir.'/server/lib/config.inc.php', 0600);
1820+
chown($install_dir.'/server/lib/config.inc.php', 'root');
1821+
chgrp($install_dir.'/server/lib/config.inc.php', 'root');
1822+
1823+
//* Make sure thet the interface config file is readable by user ispconfig only
1824+
chmod($install_dir.'/interface/lib/config.inc.php', 0600);
1825+
chown($install_dir.'/interface/lib/config.inc.php', 'ispconfig');
1826+
chgrp($install_dir.'/interface/lib/config.inc.php', 'ispconfig');
18221827

18231828
chmod($install_dir.'/server/lib/remote_action.inc.php', 0600);
18241829
chown($install_dir.'/server/lib/remote_action.inc.php', 'root');
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
ALTER TABLE `client` ADD `paypal_email` VARCHAR( 255 ) NULL DEFAULT NULL AFTER `bank_account_swift` ;
2+
ALTER TABLE `web_domain` ADD `proxy_directives` MEDIUMTEXT NULL DEFAULT NULL ;
3+
4+

install/sql/ispconfig3.sql

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,7 @@ CREATE TABLE `client` (
166166
`bank_name` varchar(255) DEFAULT NULL,
167167
`bank_account_iban` varchar(255) DEFAULT NULL,
168168
`bank_account_swift` varchar(255) DEFAULT NULL,
169+
`paypal_email` varchar(255) DEFAULT NULL,
169170
`default_mailserver` int(11) unsigned NOT NULL DEFAULT '1',
170171
`limit_maildomain` int(11) NOT NULL DEFAULT '-1',
171172
`limit_mailbox` int(11) NOT NULL DEFAULT '-1',
@@ -1750,6 +1751,7 @@ CREATE TABLE `web_domain` (
17501751
`active` enum('n','y') NOT NULL default 'y',
17511752
`traffic_quota_lock` enum('n','y') NOT NULL default 'n',
17521753
`fastcgi_php_version` varchar(255) DEFAULT NULL,
1754+
`proxy_directives` mediumtext,
17531755
PRIMARY KEY (`domain_id`)
17541756
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
17551757

install/tpl/apache_ispconfig.vhost.master

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ NameVirtualHost *:{vhost_port}
1010
<VirtualHost _default_:{vhost_port}>
1111
ServerAdmin webmaster@localhost
1212

13+
<FilesMatch "\.ph(p3?|tml)$">
14+
SetHandler None
15+
</FilesMatch>
16+
1317
<IfModule mod_fcgid.c>
1418
DocumentRoot /var/www/ispconfig/
1519
SuexecUserGroup ispconfig ispconfig
@@ -23,18 +27,18 @@ NameVirtualHost *:{vhost_port}
2327
</Directory>
2428
</IfModule>
2529

26-
<IfModule mod_php5.c>
27-
DocumentRoot /usr/local/ispconfig/interface/web/
28-
AddType application/x-httpd-php .php
29-
<Directory /usr/local/ispconfig/interface/web>
30-
# php_admin_value open_basedir "/usr/local/ispconfig/interface:/usr/share:/tmp"
31-
Options FollowSymLinks
32-
AllowOverride None
33-
Order allow,deny
34-
Allow from all
35-
php_value magic_quotes_gpc 0
36-
</Directory>
37-
</IfModule>
30+
# <IfModule mod_php5.c>
31+
# DocumentRoot /usr/local/ispconfig/interface/web/
32+
# AddType application/x-httpd-php .php
33+
# <Directory /usr/local/ispconfig/interface/web>
34+
# # php_admin_value open_basedir "/usr/local/ispconfig/interface:/usr/share:/tmp"
35+
# Options FollowSymLinks
36+
# AllowOverride None
37+
# Order allow,deny
38+
# Allow from all
39+
# php_value magic_quotes_gpc 0
40+
# </Directory>
41+
# </IfModule>
3842

3943
# ErrorLog /var/log/apache2/error.log
4044
# CustomLog /var/log/apache2/access.log combined

install/tpl/debian6_dovecot-sql.conf.master

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,8 @@ connect = host={mysql_server_host} dbname={mysql_server_database} user={mysql_se
1414
default_pass_scheme = CRYPT
1515

1616
password_query = SELECT password FROM mail_user WHERE login = '%u' AND disable%Ls = 'n'
17-
# user_query = SELECT email AS user, maildir AS home, CONCAT('*:storage=', quota , 'B') AS quota_rule FROM mail_user WHERE login = '%u' AND disable%Ls = 'n'
1817
user_query = SELECT email as user, maildir as home, CONCAT('maildir:', maildir, '/Maildir') as mail, uid, gid, CONCAT('*:storage=', quota, 'B') AS quota_rule, CONCAT(maildir, '/.sieve') as sieve FROM mail_user WHERE (login = '%u' OR email = '%u') AND disable%Ls = 'n'
18+
19+
# The iterate_query is required for the doveadm command only and works only on dovecot 2 servers.
20+
# Do not enable it on Dovecot 1.x servers
21+
# iterate_query = SELECT email as user FROM mail_user

install/tpl/debian_dovecot-sql.conf.master

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,9 @@ connect = host={mysql_server_host} dbname={mysql_server_database} user={mysql_se
121121
default_pass_scheme = CRYPT
122122

123123
password_query = SELECT password FROM mail_user WHERE login = '%u' AND disable%Ls = 'n'
124-
# user_query = SELECT email as user, maildir as home, CONCAT('maildir:', maildir, '/Maildir') as mail, uid, gid, CONCAT('maildir:storage=', floor(quota/1024)) AS quota, CONCAT(maildir, '/.sieve') as sieve FROM mail_user WHERE login = '%u' AND disable%Ls = 'n'
125124
user_query = SELECT email as user, maildir as home, CONCAT('maildir:', maildir, '/Maildir') as mail, uid, gid, CONCAT('*:storage=', quota, 'B') AS quota_rule, CONCAT(maildir, '/.sieve') as sieve FROM mail_user WHERE (login = '%u' OR email = '%u') AND disable%Ls = 'n'
126125

126+
# The iterate_query is required for the doveadm command only and works only on dovecot 2 servers.
127+
# Do not enable it on Dovecot 1.x servers
128+
# iterate_query = SELECT email as user FROM mail_user
127129

0 commit comments

Comments
 (0)