Commit cc65688b authored by hellkat's avatar hellkat
Browse files

Merged revisions 3845-3876 and 3879-3918 from stable branch.

parent 63527811
...@@ -1024,7 +1024,7 @@ class installer_dist extends installer_base { ...@@ -1024,7 +1024,7 @@ class installer_dist extends installer_base {
//copy('tpl/apache_ispconfig.vhost.master', "$vhost_conf_dir/ispconfig.vhost"); //copy('tpl/apache_ispconfig.vhost.master', "$vhost_conf_dir/ispconfig.vhost");
//* and create the symlink //* and create the symlink
if($this->is_update == false) { //if($this->is_update == false) {
if(@is_link("$vhost_conf_enabled_dir/ispconfig.vhost")) unlink("$vhost_conf_enabled_dir/ispconfig.vhost"); if(@is_link("$vhost_conf_enabled_dir/ispconfig.vhost")) unlink("$vhost_conf_enabled_dir/ispconfig.vhost");
if(!@is_link("$vhost_conf_enabled_dir/000-ispconfig.vhost")) { if(!@is_link("$vhost_conf_enabled_dir/000-ispconfig.vhost")) {
exec("ln -s $vhost_conf_dir/ispconfig.vhost $vhost_conf_enabled_dir/000-ispconfig.vhost"); exec("ln -s $vhost_conf_dir/ispconfig.vhost $vhost_conf_enabled_dir/000-ispconfig.vhost");
...@@ -1039,17 +1039,17 @@ class installer_dist extends installer_base { ...@@ -1039,17 +1039,17 @@ class installer_dist extends installer_base {
replaceLine('/var/www/php-fcgi-scripts/ispconfig/.php-fcgi-starter','PHPRC=','PHPRC=/etc/',0,0); replaceLine('/var/www/php-fcgi-scripts/ispconfig/.php-fcgi-starter','PHPRC=','PHPRC=/etc/',0,0);
*/ */
if(!is_file('/var/www/php-fcgi-scripts/ispconfig/.php-fcgi-starter')) { //if(!is_file('/var/www/php-fcgi-scripts/ispconfig/.php-fcgi-starter')) {
$content = rf('tpl/apache_ispconfig_fcgi_starter.master'); $content = rf('tpl/apache_ispconfig_fcgi_starter.master');
$content = str_replace('{fastcgi_bin}', $conf['fastcgi']['fastcgi_bin'], $content); $content = str_replace('{fastcgi_bin}', $conf['fastcgi']['fastcgi_bin'], $content);
$content = str_replace('{fastcgi_phpini_path}', $conf['fastcgi']['fastcgi_phpini_path'], $content); $content = str_replace('{fastcgi_phpini_path}', $conf['fastcgi']['fastcgi_phpini_path'], $content);
exec('mkdir -p /var/www/php-fcgi-scripts/ispconfig'); if(!is_dir('/var/www/php-fcgi-scripts/ispconfig')) exec('mkdir -p /var/www/php-fcgi-scripts/ispconfig');
wf('/var/www/php-fcgi-scripts/ispconfig/.php-fcgi-starter', $content); wf('/var/www/php-fcgi-scripts/ispconfig/.php-fcgi-starter', $content);
exec('chmod +x /var/www/php-fcgi-scripts/ispconfig/.php-fcgi-starter'); exec('chmod +x /var/www/php-fcgi-scripts/ispconfig/.php-fcgi-starter');
exec('ln -s /usr/local/ispconfig/interface/web /var/www/ispconfig'); if(!is_link('/var/www/ispconfig')) exec('ln -s /usr/local/ispconfig/interface/web /var/www/ispconfig');
exec('chown -R ispconfig:ispconfig /var/www/php-fcgi-scripts/ispconfig'); exec('chown -R ispconfig:ispconfig /var/www/php-fcgi-scripts/ispconfig');
} //}
} //}
} }
if($conf['nginx']['installed'] == true && $this->install_ispconfig_interface == true){ if($conf['nginx']['installed'] == true && $this->install_ispconfig_interface == true){
...@@ -1228,7 +1228,7 @@ class installer_dist extends installer_base { ...@@ -1228,7 +1228,7 @@ class installer_dist extends installer_base {
$existing_cron_jobs = file('crontab.txt'); $existing_cron_jobs = file('crontab.txt');
$cron_jobs = array( $cron_jobs = array(
'*/5 * * * * /usr/local/bin/run-getmail.sh > /dev/null 2>> /var/log/ispconfig/cron.log' '*/5 * * * * /usr/local/bin/run-getmail.sh > /dev/null 2>> /dev/null'
); );
// remove existing ispconfig cronjobs, in case the syntax has changed // remove existing ispconfig cronjobs, in case the syntax has changed
...@@ -1247,7 +1247,7 @@ class installer_dist extends installer_base { ...@@ -1247,7 +1247,7 @@ class installer_dist extends installer_base {
} }
exec('touch /var/log/ispconfig/cron.log'); exec('touch /var/log/ispconfig/cron.log');
exec('chmod 666 /var/log/ispconfig/cron.log'); exec('chmod 660 /var/log/ispconfig/cron.log');
} }
} }
......
...@@ -610,8 +610,8 @@ class installer extends installer_base ...@@ -610,8 +610,8 @@ class installer extends installer_base
$this->write_config_file("$vhost_conf_dir/apps.vhost", $content); $this->write_config_file("$vhost_conf_dir/apps.vhost", $content);
if ( !is_file($conf['web']['website_basedir'].'/php-fcgi-scripts/apps/.php-fcgi-starter') ) //if ( !is_file($conf['web']['website_basedir'].'/php-fcgi-scripts/apps/.php-fcgi-starter') )
{ //{
$content = rf('tpl/apache_apps_fcgi_starter.master'); $content = rf('tpl/apache_apps_fcgi_starter.master');
$content = str_replace('{fastcgi_bin}', $conf['fastcgi']['fastcgi_bin'], $content); $content = str_replace('{fastcgi_bin}', $conf['fastcgi']['fastcgi_bin'], $content);
$content = str_replace('{fastcgi_phpini_path}', $conf['fastcgi']['fastcgi_phpini_path'], $content); $content = str_replace('{fastcgi_phpini_path}', $conf['fastcgi']['fastcgi_phpini_path'], $content);
...@@ -621,7 +621,7 @@ class installer extends installer_base ...@@ -621,7 +621,7 @@ class installer extends installer_base
exec('chmod +x '.$conf['web']['website_basedir'].'/php-fcgi-scripts/apps/.php-fcgi-starter'); exec('chmod +x '.$conf['web']['website_basedir'].'/php-fcgi-scripts/apps/.php-fcgi-starter');
exec('chown -R ispapps:ispapps '.$conf['web']['website_basedir'].'/php-fcgi-scripts/apps'); exec('chown -R ispapps:ispapps '.$conf['web']['website_basedir'].'/php-fcgi-scripts/apps');
} //}
} }
if($conf['nginx']['installed'] == true){ if($conf['nginx']['installed'] == true){
$apps_vhost_user = escapeshellcmd($conf['web']['apps_vhost_user']); $apps_vhost_user = escapeshellcmd($conf['web']['apps_vhost_user']);
...@@ -946,11 +946,11 @@ class installer extends installer_base ...@@ -946,11 +946,11 @@ class installer extends installer_base
$content = rf('tpl/apache_ispconfig_fcgi_starter.master'); $content = rf('tpl/apache_ispconfig_fcgi_starter.master');
$content = str_replace('{fastcgi_bin}', $conf['fastcgi']['fastcgi_bin'], $content); $content = str_replace('{fastcgi_bin}', $conf['fastcgi']['fastcgi_bin'], $content);
$content = str_replace('{fastcgi_phpini_path}', $conf['fastcgi']['fastcgi_phpini_path'], $content); $content = str_replace('{fastcgi_phpini_path}', $conf['fastcgi']['fastcgi_phpini_path'], $content);
mkdir('/var/www/php-fcgi-scripts/ispconfig', 0755, true); @mkdir('/var/www/php-fcgi-scripts/ispconfig', 0755, true);
wf('/var/www/php-fcgi-scripts/ispconfig/.php-fcgi-starter', $content); wf('/var/www/php-fcgi-scripts/ispconfig/.php-fcgi-starter', $content);
exec('chmod +x /var/www/php-fcgi-scripts/ispconfig/.php-fcgi-starter'); exec('chmod +x /var/www/php-fcgi-scripts/ispconfig/.php-fcgi-starter');
chmod('/var/www/php-fcgi-scripts/ispconfig/.php-fcgi-starter', 0755); chmod('/var/www/php-fcgi-scripts/ispconfig/.php-fcgi-starter', 0755);
symlink($install_dir.'/interface/web','/var/www/ispconfig'); @symlink($install_dir.'/interface/web','/var/www/ispconfig');
exec('chown -R ispconfig:ispconfig /var/www/php-fcgi-scripts/ispconfig'); exec('chown -R ispconfig:ispconfig /var/www/php-fcgi-scripts/ispconfig');
} }
} }
......
...@@ -1078,7 +1078,7 @@ class installer_dist extends installer_base { ...@@ -1078,7 +1078,7 @@ class installer_dist extends installer_base {
wf("$vhost_conf_dir/ispconfig.vhost", $content); wf("$vhost_conf_dir/ispconfig.vhost", $content);
if(!is_file('/srv/www/php-fcgi-scripts/ispconfig/.php-fcgi-starter')) { //if(!is_file('/srv/www/php-fcgi-scripts/ispconfig/.php-fcgi-starter')) {
$content = rf('tpl/apache_ispconfig_fcgi_starter.master'); $content = rf('tpl/apache_ispconfig_fcgi_starter.master');
$content = str_replace('{fastcgi_bin}', $conf['fastcgi']['fastcgi_bin'], $content); $content = str_replace('{fastcgi_bin}', $conf['fastcgi']['fastcgi_bin'], $content);
$content = str_replace('{fastcgi_phpini_path}', $conf['fastcgi']['fastcgi_phpini_path'], $content); $content = str_replace('{fastcgi_phpini_path}', $conf['fastcgi']['fastcgi_phpini_path'], $content);
...@@ -1088,7 +1088,7 @@ class installer_dist extends installer_base { ...@@ -1088,7 +1088,7 @@ class installer_dist extends installer_base {
exec('ln -s /usr/local/ispconfig/interface/web /srv/www/ispconfig'); exec('ln -s /usr/local/ispconfig/interface/web /srv/www/ispconfig');
exec('chown -R ispconfig:ispconfig /srv/www/php-fcgi-scripts/ispconfig'); exec('chown -R ispconfig:ispconfig /srv/www/php-fcgi-scripts/ispconfig');
} //}
//copy('tpl/apache_ispconfig.vhost.master', "$vhost_conf_dir/ispconfig.vhost"); //copy('tpl/apache_ispconfig.vhost.master', "$vhost_conf_dir/ispconfig.vhost");
//* and create the symlink //* and create the symlink
...@@ -1280,7 +1280,7 @@ class installer_dist extends installer_base { ...@@ -1280,7 +1280,7 @@ class installer_dist extends installer_base {
$existing_cron_jobs = file('crontab.txt'); $existing_cron_jobs = file('crontab.txt');
$cron_jobs = array( $cron_jobs = array(
'*/5 * * * * /usr/local/bin/run-getmail.sh > /dev/null 2>> /var/log/ispconfig/cron.log' '*/5 * * * * /usr/local/bin/run-getmail.sh > /dev/null 2>> /dev/null'
); );
// remove existing ispconfig cronjobs, in case the syntax has changed // remove existing ispconfig cronjobs, in case the syntax has changed
...@@ -1299,7 +1299,7 @@ class installer_dist extends installer_base { ...@@ -1299,7 +1299,7 @@ class installer_dist extends installer_base {
} }
exec('touch /var/log/ispconfig/cron.log'); exec('touch /var/log/ispconfig/cron.log');
exec('chmod 666 /var/log/ispconfig/cron.log'); exec('chmod 660 /var/log/ispconfig/cron.log');
} }
} }
......
...@@ -568,23 +568,6 @@ class installer_base { ...@@ -568,23 +568,6 @@ class installer_base {
} }
} }
$config_dir = $conf['mailman']['config_dir'].'/';
$full_file_name = $config_dir.'virtual_to_transport.sh';
//* Backup exiting virtual_to_transport.sh script
if(is_file($full_file_name)) {
copy($full_file_name, $config_dir.'virtual_to_transport.sh~');
}
copy('tpl/mailman-virtual_to_transport.sh',$full_file_name);
chgrp($full_file_name,'list');
chmod($full_file_name,0750);
if(!is_file('/var/lib/mailman/data/transport-mailman')) touch('/var/lib/mailman/data/transport-mailman');
exec('/usr/sbin/postmap /var/lib/mailman/data/transport-mailman');
exec('/usr/lib/mailman/bin/genaliases 2>/dev/null');
$virtual_domains = ''; $virtual_domains = '';
if($status == 'update') if($status == 'update')
{ {
...@@ -610,6 +593,25 @@ class installer_base { ...@@ -610,6 +593,25 @@ class installer_base {
$content = str_replace('{virtual_domains}', $virtual_domains, $content); $content = str_replace('{virtual_domains}', $virtual_domains, $content);
wf($full_file_name, $content); wf($full_file_name, $content);
//* Write virtual_to_transport.sh script
$config_dir = $conf['mailman']['config_dir'].'/';
$full_file_name = $config_dir.'virtual_to_transport.sh';
//* Backup exiting virtual_to_transport.sh script
if(is_file($full_file_name)) {
copy($full_file_name, $config_dir.'virtual_to_transport.sh~');
}
if(is_dir('/etc/mailman')) {
copy('tpl/mailman-virtual_to_transport.sh',$full_file_name);
chgrp($full_file_name,'list');
chmod($full_file_name,0750);
}
//* Create aliasaes
exec('/usr/lib/mailman/bin/genaliases 2>/dev/null');
} }
public function configure_postfix($options = '') { public function configure_postfix($options = '') {
...@@ -732,11 +734,13 @@ class installer_base { ...@@ -732,11 +734,13 @@ class installer_base {
touch($config_dir.'/body_checks'); touch($config_dir.'/body_checks');
//* Create the mailman files //* Create the mailman files
exec('mkdir -p /var/lib/mailman/data'); if(!is_dir('/var/lib/mailman/data')) exec('mkdir -p /var/lib/mailman/data');
if(!is_file('/var/lib/mailman/data/aliases')) touch('/var/lib/mailman/data/aliases'); if(!is_file('/var/lib/mailman/data/aliases')) touch('/var/lib/mailman/data/aliases');
exec('postalias /var/lib/mailman/data/aliases'); exec('postalias /var/lib/mailman/data/aliases');
if(!is_file('/var/lib/mailman/data/virtual-mailman')) touch('/var/lib/mailman/data/virtual-mailman'); if(!is_file('/var/lib/mailman/data/virtual-mailman')) touch('/var/lib/mailman/data/virtual-mailman');
exec('postmap /var/lib/mailman/data/virtual-mailman'); exec('postmap /var/lib/mailman/data/virtual-mailman');
if(!is_file('/var/lib/mailman/data/transport-mailman')) touch('/var/lib/mailman/data/transport-mailman');
exec('/usr/sbin/postmap /var/lib/mailman/data/transport-mailman');
//* Make a backup copy of the main.cf file //* Make a backup copy of the main.cf file
copy($config_dir.'/main.cf', $config_dir.'/main.cf~'); copy($config_dir.'/main.cf', $config_dir.'/main.cf~');
...@@ -1921,16 +1925,16 @@ class installer_base { ...@@ -1921,16 +1925,16 @@ class installer_base {
symlink($vhost_conf_dir.'/ispconfig.vhost',$vhost_conf_enabled_dir.'/000-ispconfig.vhost'); symlink($vhost_conf_dir.'/ispconfig.vhost',$vhost_conf_enabled_dir.'/000-ispconfig.vhost');
} }
} }
if(!is_file('/var/www/php-fcgi-scripts/ispconfig/.php-fcgi-starter')) { //if(!is_file('/var/www/php-fcgi-scripts/ispconfig/.php-fcgi-starter')) {
$content = rf('tpl/apache_ispconfig_fcgi_starter.master'); $content = rf('tpl/apache_ispconfig_fcgi_starter.master');
$content = str_replace('{fastcgi_bin}', $conf['fastcgi']['fastcgi_bin'], $content); $content = str_replace('{fastcgi_bin}', $conf['fastcgi']['fastcgi_bin'], $content);
$content = str_replace('{fastcgi_phpini_path}', $conf['fastcgi']['fastcgi_phpini_path'], $content); $content = str_replace('{fastcgi_phpini_path}', $conf['fastcgi']['fastcgi_phpini_path'], $content);
mkdir('/var/www/php-fcgi-scripts/ispconfig', 0755, true); @mkdir('/var/www/php-fcgi-scripts/ispconfig', 0755, true);
wf('/var/www/php-fcgi-scripts/ispconfig/.php-fcgi-starter', $content); wf('/var/www/php-fcgi-scripts/ispconfig/.php-fcgi-starter', $content);
exec('chmod +x /var/www/php-fcgi-scripts/ispconfig/.php-fcgi-starter'); exec('chmod +x /var/www/php-fcgi-scripts/ispconfig/.php-fcgi-starter');
symlink($install_dir.'/interface/web','/var/www/ispconfig'); @symlink($install_dir.'/interface/web','/var/www/ispconfig');
exec('chown -R ispconfig:ispconfig /var/www/php-fcgi-scripts/ispconfig'); exec('chown -R ispconfig:ispconfig /var/www/php-fcgi-scripts/ispconfig');
} //}
} }
if($conf['nginx']['installed'] == true && $this->install_ispconfig_interface == true){ if($conf['nginx']['installed'] == true && $this->install_ispconfig_interface == true){
...@@ -2116,7 +2120,7 @@ class installer_base { ...@@ -2116,7 +2120,7 @@ class installer_base {
$existing_cron_jobs = file('crontab.txt'); $existing_cron_jobs = file('crontab.txt');
$cron_jobs = array( $cron_jobs = array(
'*/5 * * * * /usr/local/bin/run-getmail.sh > /dev/null 2>> '.$conf['ispconfig_log_dir'].'/cron.log' '*/5 * * * * /usr/local/bin/run-getmail.sh > /dev/null 2>> /dev/null'
); );
// remove existing ispconfig cronjobs, in case the syntax has changed // remove existing ispconfig cronjobs, in case the syntax has changed
...@@ -2135,7 +2139,7 @@ class installer_base { ...@@ -2135,7 +2139,7 @@ class installer_base {
} }
touch($conf['ispconfig_log_dir'].'/cron.log'); touch($conf['ispconfig_log_dir'].'/cron.log');
chmod($conf['ispconfig_log_dir'].'/cron.log', 0666); chmod($conf['ispconfig_log_dir'].'/cron.log', 0660);
} }
......
...@@ -20,6 +20,6 @@ INSERT INTO `sys_theme` (`var_id`, `tpl_name`, `username`, `logo_url`) VALUES (N ...@@ -20,6 +20,6 @@ INSERT INTO `sys_theme` (`var_id`, `tpl_name`, `username`, `logo_url`) VALUES (N
-- -------------------------------------------------------- -- --------------------------------------------------------
ALTER TABLE `web_domain` ADD `ssl_key` MEDIUMTEXT NOT NULL AFTER `ssl_bundle`; ALTER TABLE `web_domain` ADD `ssl_key` MEDIUMTEXT NOT NULL AFTER `ssl_bundle`;
ALTER TABLE `mail_user` ADD `disabledoveadm` enum('n','y') NOT NULL default 'n' AFTER `disablelda` ALTER TABLE `mail_user` ADD `disabledoveadm` enum('n','y') NOT NULL default 'n' AFTER `disablelda`;
...@@ -296,7 +296,7 @@ CREATE TABLE `client_template` ( ...@@ -296,7 +296,7 @@ CREATE TABLE `client_template` (
`limit_shell_user` int(11) NOT NULL default '0', `limit_shell_user` int(11) NOT NULL default '0',
`ssh_chroot` varchar(255) NOT NULL DEFAULT 'no', `ssh_chroot` varchar(255) NOT NULL DEFAULT 'no',
`limit_webdav_user` int(11) NOT NULL default '0', `limit_webdav_user` int(11) NOT NULL default '0',
`limit_aps` int(11) NOT NULL DEFAULT '0', `limit_aps` int(11) NOT NULL DEFAULT '-1',
`limit_dns_zone` int(11) NOT NULL default '-1', `limit_dns_zone` int(11) NOT NULL default '-1',
`limit_dns_slave_zone` int(11) NOT NULL default '-1', `limit_dns_slave_zone` int(11) NOT NULL default '-1',
`limit_dns_record` int(11) NOT NULL default '-1', `limit_dns_record` int(11) NOT NULL default '-1',
...@@ -2169,6 +2169,6 @@ INSERT INTO `sys_user` (`userid`, `sys_userid`, `sys_groupid`, `sys_perm_user`, ...@@ -2169,6 +2169,6 @@ INSERT INTO `sys_user` (`userid`, `sys_userid`, `sys_groupid`, `sys_perm_user`,
-- Dumping data for table `sys_config` -- Dumping data for table `sys_config`
-- --
INSERT INTO sys_config VALUES ('1','db','db_version','3.0.5'); INSERT INTO sys_config VALUES ('1','db','db_version','3.0.5.1');
SET FOREIGN_KEY_CHECKS = 1; SET FOREIGN_KEY_CHECKS = 1;
\ No newline at end of file
...@@ -50,3 +50,5 @@ CustomLog "| /usr/local/ispconfig/server/scripts/vlogger -s access.log -t \"%Y%m ...@@ -50,3 +50,5 @@ CustomLog "| /usr/local/ispconfig/server/scripts/vlogger -s access.log -t \"%Y%m
Alias /awstats-icon "/usr/share/awstats/icon" Alias /awstats-icon "/usr/share/awstats/icon"
NameVirtualHost *:80
NameVirtualHost *:443
\ No newline at end of file
...@@ -28,18 +28,19 @@ NameVirtualHost *:{vhost_port} ...@@ -28,18 +28,19 @@ NameVirtualHost *:{vhost_port}
IPCCommTimeout 7200 IPCCommTimeout 7200
</IfModule> </IfModule>
# <IfModule mod_php5.c> <IfModule mpm_itk_module>
# DocumentRoot /usr/local/ispconfig/interface/web/ DocumentRoot /usr/local/ispconfig/interface/web/
# AddType application/x-httpd-php .php AssignUserId ispconfig ispconfig
# <Directory /usr/local/ispconfig/interface/web> AddType application/x-httpd-php .php
# # php_admin_value open_basedir "/usr/local/ispconfig/interface:/usr/share:/tmp" <Directory /usr/local/ispconfig/interface/web>
# Options FollowSymLinks # php_admin_value open_basedir "/usr/local/ispconfig/interface:/usr/share:/tmp"
# AllowOverride None Options FollowSymLinks
# Order allow,deny AllowOverride None
# Allow from all Order allow,deny
# php_value magic_quotes_gpc 0 Allow from all
# </Directory> php_value magic_quotes_gpc 0
# </IfModule> </Directory>
</IfModule>
# ErrorLog /var/log/apache2/error.log # ErrorLog /var/log/apache2/error.log
# CustomLog /var/log/apache2/access.log combined # CustomLog /var/log/apache2/access.log combined
......
<?php <?php
/* /*
Copyright (c) 2007 - 2012, Till Brehm, projektfarm Gmbh Copyright (c) 2007 - 2013, Till Brehm, projektfarm Gmbh
All rights reserved. All rights reserved.
Redistribution and use in source and binary forms, with or without modification, Redistribution and use in source and binary forms, with or without modification,
...@@ -56,7 +56,7 @@ $revision = str_replace(array('Revision:','$',' '), '', $svn_revision); ...@@ -56,7 +56,7 @@ $revision = str_replace(array('Revision:','$',' '), '', $svn_revision);
//** Application //** Application
define('ISPC_APP_TITLE', 'ISPConfig'); define('ISPC_APP_TITLE', 'ISPConfig');
define('ISPC_APP_VERSION', '3.0.5'); define('ISPC_APP_VERSION', '3.0.5.1');
define('DEVSYSTEM', 0); define('DEVSYSTEM', 0);
......
...@@ -46,7 +46,7 @@ server { ...@@ -46,7 +46,7 @@ server {
fastcgi_pass unix:{fpm_socket}; fastcgi_pass unix:{fpm_socket};
fastcgi_index index.php; fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_script_name; #fastcgi_param PATH_INFO $fastcgi_script_name;
fastcgi_buffer_size 128k; fastcgi_buffer_size 128k;
fastcgi_buffers 256 4k; fastcgi_buffers 256 4k;
fastcgi_busy_buffers_size 256k; fastcgi_busy_buffers_size 256k;
......
...@@ -28,7 +28,7 @@ server { ...@@ -28,7 +28,7 @@ server {
fastcgi_pass unix:{fpm_socket}; fastcgi_pass unix:{fpm_socket};
fastcgi_index index.php; fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_script_name; #fastcgi_param PATH_INFO $fastcgi_script_name;
fastcgi_buffer_size 128k; fastcgi_buffer_size 128k;
fastcgi_buffers 256 4k; fastcgi_buffers 256 4k;
fastcgi_busy_buffers_size 256k; fastcgi_busy_buffers_size 256k;
......
...@@ -129,7 +129,7 @@ $do_backup = $inst->simple_query('Shall the script create a ISPConfig backup in ...@@ -129,7 +129,7 @@ $do_backup = $inst->simple_query('Shall the script create a ISPConfig backup in
if($do_backup == 'yes') { if($do_backup == 'yes') {
//* Create the backup directory //* Create the backup directory
$backup_path = '/var/backup/ispconfig_'.date('Y-m-d_H-i'); $backup_path = '/var/backup/ispconfig_'.@date('Y-m-d_H-i');
$conf['backup_path'] = $backup_path; $conf['backup_path'] = $backup_path;
exec("mkdir -p $backup_path"); exec("mkdir -p $backup_path");
exec("chown root:root $backup_path"); exec("chown root:root $backup_path");
......
...@@ -728,6 +728,9 @@ class ApsGUIController extends ApsBase ...@@ -728,6 +728,9 @@ class ApsGUIController extends ApsBase
// Using parse_url() to filter malformed URLs // Using parse_url() to filter malformed URLs
$path = dirname(parse_url($_SERVER['PHP_SELF'], PHP_URL_PATH)).'/'. $path = dirname(parse_url($_SERVER['PHP_SELF'], PHP_URL_PATH)).'/'.
basename($this->interface_pkg_dir).'/'.$pkg['path'].'/'.basename((string)$icon); basename($this->interface_pkg_dir).'/'.$pkg['path'].'/'.basename((string)$icon);
// nginx: if $_SERVER['PHP_SELF'] is doubled, remove /sites/aps_packagedetails_show.php from beginning of path
$path = preg_replace('@^/sites/aps_packagedetails_show.php(.*)@', '$1', $path);
$pkg['Icon'] = $path; $pkg['Icon'] = $path;
} }
else $pkg['Icon'] = ''; else $pkg['Icon'] = '';
...@@ -741,6 +744,8 @@ class ApsGUIController extends ApsBase ...@@ -741,6 +744,8 @@ class ApsGUIController extends ApsBase
// Using parse_url() to filter malformed URLs // Using parse_url() to filter malformed URLs
$path = dirname(parse_url($_SERVER['PHP_SELF'], PHP_URL_PATH)).'/'. $path = dirname(parse_url($_SERVER['PHP_SELF'], PHP_URL_PATH)).'/'.
basename($this->interface_pkg_dir).'/'.$pkg['path'].'/'.basename((string)$screen['path']); basename($this->interface_pkg_dir).'/'.$pkg['path'].'/'.basename((string)$screen['path']);
// nginx: if $_SERVER['PHP_SELF'] is doubled, remove /sites/aps_packagedetails_show.php from beginning of path
$path = preg_replace('@^/sites/aps_packagedetails_show.php(.*)@', '$1', $path);
$pkg['Screenshots'][] = array('ScreenPath' => $path, $pkg['Screenshots'][] = array('ScreenPath' => $path,
'ScreenDescription' => htmlspecialchars(trim((string)$screen->description))); 'ScreenDescription' => htmlspecialchars(trim((string)$screen->description)));
......
...@@ -44,7 +44,7 @@ class db extends mysqli ...@@ -44,7 +44,7 @@ class db extends mysqli
private $errorNumber = 0; // last error number private $errorNumber = 0; // last error number
public $errorMessage = ''; // last error message public $errorMessage = ''; // last error message
private $errorLocation = '';// last error location private $errorLocation = '';// last error location
public $show_error_messages = true; // false in server, true in interface public $show_error_messages = false; // false in server, true in interface
private $isConnected = false; // needed to know if we have a valid mysqli object from the constructor private $isConnected = false; // needed to know if we have a valid mysqli object from the constructor
// constructor // constructor
...@@ -60,7 +60,8 @@ class db extends mysqli ...@@ -60,7 +60,8 @@ class db extends mysqli
$this->dbClientFlags = $conf[$prefix.'db_client_flags']; $this->dbClientFlags = $conf[$prefix.'db_client_flags'];
parent::__construct($conf[$prefix.'db_host'], $conf[$prefix.'db_user'],$conf[$prefix.'db_password'],$conf[$prefix.'db_database']); parent::__construct($conf[$prefix.'db_host'], $conf[$prefix.'db_user'],$conf[$prefix.'db_password'],$conf[$prefix.'db_database']);
$try = 0; $try = 0;
while(!is_null($this->connect_error) && $try < 5) { //while(!is_null($this->connect_error) && $try < 5) {
while(mysqli_connect_error() && $try < 5) {
if($try > 0) sleep(1); if($try > 0) sleep(1);
$try++; $try++;
...@@ -69,7 +70,9 @@ class db extends mysqli ...@@ -69,7 +70,9 @@ class db extends mysqli
parent::__construct($conf[$prefix.'db_host'], $conf[$prefix.'db_user'],$conf[$prefix.'db_password'],$conf[$prefix.'db_database']); parent::__construct($conf[$prefix.'db_host'], $conf[$prefix.'db_user'],$conf[$prefix.'db_password'],$conf[$prefix.'db_database']);
} }
if(is_null($this->connect_error)) $this->isConnected = true; //if(is_null($this->connect_error)) $this->isConnected = true;
//else return false;
if(!mysqli_connect_error()) $this->isConnected = true;
else return false; else return false;
$this->setCharacterEncoding(); $this->setCharacterEncoding();
...@@ -81,8 +84,9 @@ class db extends mysqli ...@@ -81,8 +84,9 @@ class db extends mysqli
// error handler // error handler
public function updateError($location) { public function updateError($location) {
global $app; global $app, $conf;
/*
if(!is_null($this->connect_error)) { if(!is_null($this->connect_error)) {
$this->errorNumber = $this->connect_errno; $this->errorNumber = $this->connect_errno;
$this->errorMessage = $this->connect_error; $this->errorMessage = $this->connect_error;
...@@ -90,12 +94,21 @@ class db extends mysqli ...@@ -90,12 +94,21 @@ class db extends mysqli
$this->errorNumber = $this->errno; $this->errorNumber = $this->errno;
$this->errorMessage = $this->error; $this->errorMessage = $this->error;
} }
*/
if(mysqli_connect_error()) {
$this->errorNumber = mysqli_connect_errno();
$this->errorMessage = mysqli_connect_error();
} else {
$this->errorNumber = mysqli_errno($this);
$this->errorMessage = mysqli_error($this);
}
$this->errorLocation = $location;