Commit bfcdef6b authored by tbrehm's avatar tbrehm

Merged revisions 3596-3670 from 3.0.5 stable branch.

parent bf49ff3a

Too many changes to show.

To preserve performance only 1000 of 1000+ files are displayed.

......@@ -875,8 +875,15 @@ class installer_dist extends installer_base {
exec("chmod -R 770 $install_dir/server/aps_packages");
//* make sure that the server config file (not the interface one) is only readable by the root user
exec("chmod 600 $install_dir/server/lib/$configfile");
exec("chown root:root $install_dir/server/lib/$configfile");
chmod($install_dir.'/server/lib/config.inc.php', 0600);
chown($install_dir.'/server/lib/config.inc.php', 'root');
chgrp($install_dir.'/server/lib/config.inc.php', 'root');
//* Make sure thet the interface config file is readable by user ispconfig only
chmod($install_dir.'/interface/lib/config.inc.php', 0600);
chown($install_dir.'/interface/lib/config.inc.php', 'ispconfig');
chgrp($install_dir.'/interface/lib/config.inc.php', 'ispconfig');
if(@is_file("$install_dir/server/lib/mysql_clientdb.conf")) {
exec("chmod 600 $install_dir/server/lib/mysql_clientdb.conf");
exec("chown root:root $install_dir/server/lib/mysql_clientdb.conf");
......
......@@ -864,9 +864,14 @@ class installer extends installer_base
exec("chmod -R 770 $install_dir/server/aps_packages");
//* make sure that the server config file (not the interface one) is only readable by the root user
chmod($install_dir.'/server/lib/'.$configfile, 0600);
chown($install_dir.'/server/lib/'.$configfile, 'root');
chgrp($install_dir.'/server/lib/'.$configfile, 'root');
chmod($install_dir.'/server/lib/config.inc.php', 0600);
chown($install_dir.'/server/lib/config.inc.php', 'root');
chgrp($install_dir.'/server/lib/config.inc.php', 'root');
//* Make sure thet the interface config file is readable by user ispconfig only
chmod($install_dir.'/interface/lib/config.inc.php', 0600);
chown($install_dir.'/interface/lib/config.inc.php', 'ispconfig');
chgrp($install_dir.'/interface/lib/config.inc.php', 'ispconfig');
chmod($install_dir.'/server/lib/remote_action.inc.php', 0600);
chown($install_dir.'/server/lib/remote_action.inc.php', 'root');
......
......@@ -914,8 +914,15 @@ class installer_dist extends installer_base {
exec("chmod -R 770 $install_dir/server/aps_packages");
//* make sure that the server config file (not the interface one) is only readable by the root user
exec("chmod 600 $install_dir/server/lib/$configfile");
exec("chown root:root $install_dir/server/lib/$configfile");
chmod($install_dir.'/server/lib/config.inc.php', 0600);
chown($install_dir.'/server/lib/config.inc.php', 'root');
chgrp($install_dir.'/server/lib/config.inc.php', 'root');
//* Make sure thet the interface config file is readable by user ispconfig only
chmod($install_dir.'/interface/lib/config.inc.php', 0600);
chown($install_dir.'/interface/lib/config.inc.php', 'ispconfig');
chgrp($install_dir.'/interface/lib/config.inc.php', 'ispconfig');
if(@is_file("$install_dir/server/lib/mysql_clientdb.conf")) {
exec("chmod 600 $install_dir/server/lib/mysql_clientdb.conf");
exec("chown root:root $install_dir/server/lib/mysql_clientdb.conf");
......
......@@ -757,10 +757,11 @@ function is_ispconfig_ssl_enabled() {
function find_hash_file($hash, $dir, $basedir = '') {
$res = opendir($dir);
if(!$res) return false;
if(substr($basedir, -1) === '/') $basedir = substr($basedir, 0, strlen($basedir) - 1);
if(substr($dir, -1) === '/') $dir = substr($dir, 0, strlen($dir) - 1);
if($basedir === '') $basedir = $dir;
while($cur = readdir($res)) {
if($cur == '.' || $cur == '..') continue;
$entry = $dir.'/'.$cur;
......@@ -768,7 +769,7 @@ function find_hash_file($hash, $dir, $basedir = '') {
$result = find_hash_file($hash, $entry, $basedir);
if($result !== false) return $result;
} elseif(md5_file($entry) === $hash) {
$entry = substr($entry, strlen($basedir));
$entry = substr($entry, strlen($basedir) + 1);
if(substr($entry, 0, 7) === '/posix/') $entry = substr($entry, 7);
return $entry;
}
......@@ -782,23 +783,28 @@ function find_hash_file($hash, $dir, $basedir = '') {
(c) 2012 Marius Cramer, pixcept KG, m.cramer@pixcept.de
*/
function get_system_timezone() {
if(is_link('/etc/localtime')) {
$timezone = readlink('/etc/localtime');
$timezone = str_replace('/usr/share/zoneinfo/', '', $timezone);
if(substr($timezone, 0, 6) === 'posix/') $timezone = substr($timezone, 6);
} else {
$hash = md5_file('/etc/localtime');
$timezone = find_hash_file($hash, '/usr/share/zoneinfo');
}
$timezone = false;
if(file_exists('/etc/timezone') && is_readable('/etc/timezone')) {
$timezone = trim(file_get_contents('/etc/timezone'));
if(file_exists('/usr/share/zoneinfo/' . $timezone) == false) $timezone = false;
}
if(!$timezone && is_link('/etc/localtime')) {
$timezone = readlink('/etc/localtime');
$timezone = str_replace('/usr/share/zoneinfo/', '', $timezone);
if(substr($timezone, 0, 6) === 'posix/') $timezone = substr($timezone, 6);
} elseif(!$timezone) {
$hash = md5_file('/etc/localtime');
$timezone = find_hash_file($hash, '/usr/share/zoneinfo');
}
if(!$timezone) {
exec('date +%Z', $tzinfo);
$timezone = $tzinfo[0];
}
if(!$timezone) {
exec('date +%Z', $tzinfo);
$timezone = $tzinfo[0];
}
return $timezone;
return $timezone;
}
?>
......@@ -423,7 +423,7 @@ class installer_base {
$this->warning('Unable to set rights of user in master database: '.$value['db']."\n Query: ".$query."\n Error: ".$this->dbmaster->errorMessage);
}
$query = "GRANT SELECT, UPDATE (`ssl_request`, `ssl_cert`, `ssl_action`) ON ".$value['db'].".`web_domain` TO '".$value['user']."'@'".$host."' ";
$query = "GRANT SELECT, UPDATE (`ssl_request`, `ssl_cert`, `ssl_action`, `ssl_key`) ON ".$value['db'].".`web_domain` TO '".$value['user']."'@'".$host."' ";
if ($verbose){
echo $query ."\n";
}
......@@ -1816,9 +1816,14 @@ class installer_base {
exec("chmod -R 770 $install_dir/server/aps_packages");
//* make sure that the server config file (not the interface one) is only readable by the root user
chmod($install_dir.'/server/lib/'.$configfile, 0600);
chown($install_dir.'/server/lib/'.$configfile, 'root');
chgrp($install_dir.'/server/lib/'.$configfile, 'root');
chmod($install_dir.'/server/lib/config.inc.php', 0600);
chown($install_dir.'/server/lib/config.inc.php', 'root');
chgrp($install_dir.'/server/lib/config.inc.php', 'root');
//* Make sure thet the interface config file is readable by user ispconfig only
chmod($install_dir.'/interface/lib/config.inc.php', 0600);
chown($install_dir.'/interface/lib/config.inc.php', 'ispconfig');
chgrp($install_dir.'/interface/lib/config.inc.php', 'ispconfig');
chmod($install_dir.'/server/lib/remote_action.inc.php', 0600);
chown($install_dir.'/server/lib/remote_action.inc.php', 'root');
......
ALTER TABLE `client` ADD `paypal_email` VARCHAR( 255 ) NULL DEFAULT NULL AFTER `bank_account_swift` ;
ALTER TABLE `web_domain` ADD `proxy_directives` MEDIUMTEXT NULL DEFAULT NULL ;
......@@ -166,6 +166,7 @@ CREATE TABLE `client` (
`bank_name` varchar(255) DEFAULT NULL,
`bank_account_iban` varchar(255) DEFAULT NULL,
`bank_account_swift` varchar(255) DEFAULT NULL,
`paypal_email` varchar(255) DEFAULT NULL,
`default_mailserver` int(11) unsigned NOT NULL DEFAULT '1',
`limit_maildomain` int(11) NOT NULL DEFAULT '-1',
`limit_mailbox` int(11) NOT NULL DEFAULT '-1',
......@@ -1750,6 +1751,7 @@ CREATE TABLE `web_domain` (
`active` enum('n','y') NOT NULL default 'y',
`traffic_quota_lock` enum('n','y') NOT NULL default 'n',
`fastcgi_php_version` varchar(255) DEFAULT NULL,
`proxy_directives` mediumtext,
PRIMARY KEY (`domain_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
......
......@@ -10,6 +10,10 @@ NameVirtualHost *:{vhost_port}
<VirtualHost _default_:{vhost_port}>
ServerAdmin webmaster@localhost
<FilesMatch "\.ph(p3?|tml)$">
SetHandler None
</FilesMatch>
<IfModule mod_fcgid.c>
DocumentRoot /var/www/ispconfig/
SuexecUserGroup ispconfig ispconfig
......@@ -23,18 +27,18 @@ NameVirtualHost *:{vhost_port}
</Directory>
</IfModule>
<IfModule mod_php5.c>
DocumentRoot /usr/local/ispconfig/interface/web/
AddType application/x-httpd-php .php
<Directory /usr/local/ispconfig/interface/web>
# php_admin_value open_basedir "/usr/local/ispconfig/interface:/usr/share:/tmp"
Options FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
php_value magic_quotes_gpc 0
</Directory>
</IfModule>
# <IfModule mod_php5.c>
# DocumentRoot /usr/local/ispconfig/interface/web/
# AddType application/x-httpd-php .php
# <Directory /usr/local/ispconfig/interface/web>
# # php_admin_value open_basedir "/usr/local/ispconfig/interface:/usr/share:/tmp"
# Options FollowSymLinks
# AllowOverride None
# Order allow,deny
# Allow from all
# php_value magic_quotes_gpc 0
# </Directory>
# </IfModule>
# ErrorLog /var/log/apache2/error.log
# CustomLog /var/log/apache2/access.log combined
......
......@@ -14,5 +14,8 @@ connect = host={mysql_server_host} dbname={mysql_server_database} user={mysql_se