From 0e6da344ba58877c97a33a3b7c504c476de74b74 Mon Sep 17 00:00:00 2001 From: "Michael Kaufmann (d00p)" Date: Thu, 12 Dec 2013 09:09:57 +0100 Subject: [PATCH 1/3] don't use -b for 'du' command as FreeBSD does not know it, fixes #1320 Signed-off-by: Michael Kaufmann (d00p) --- scripts/jobs/cron_mailboxsize.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/scripts/jobs/cron_mailboxsize.php b/scripts/jobs/cron_mailboxsize.php index cf3cbd41..553b40c9 100644 --- a/scripts/jobs/cron_mailboxsize.php +++ b/scripts/jobs/cron_mailboxsize.php @@ -35,11 +35,16 @@ while ($maildir = $maildirs_stmt->fetch(PDO::FETCH_ASSOC)) { if (file_exists($_maildir) && is_dir($_maildir) ) { - $back = safe_exec('du -sb ' . escapeshellarg($_maildir) . ''); + $back = safe_exec('du -sk ' . escapeshellarg($_maildir) . ''); foreach ($back as $backrow) { $emailusage = explode(' ', $backrow); } $emailusage = floatval($emailusage['0']); + + // as freebsd does not have the -b flag for 'du' which gives + // the size in bytes, we use "-sk" for all and calculate from KiB + $emailusage *= 1024; + unset($back); Database::pexecute($upd_stmt, array('size' => $emailusage, 'id' => $maildir['id'])); } else { From 73f5547a5e104cb1eb05b4617dc127b41347d19c Mon Sep 17 00:00:00 2001 From: "Michael Kaufmann (d00p)" Date: Thu, 12 Dec 2013 10:44:32 +0100 Subject: [PATCH 2/3] add php-config for froxlor-vhost and set it as default for froxlor's vhost when fcgid/fpm is used (and the current default is set, custom settings won't be overwritten) Signed-off-by: Michael Kaufmann (d00p) --- actions/admin/settings/135.fcgid.php | 2 +- actions/admin/settings/136.phpfpm.php | 2 +- install/froxlor.sql | 3 +- .../updates/froxlor/0.9/update_0.9.inc.php | 30 +++++++++++++++++++ lib/tables.inc.php | 2 +- 5 files changed, 35 insertions(+), 4 deletions(-) diff --git a/actions/admin/settings/135.fcgid.php b/actions/admin/settings/135.fcgid.php index 0659fe08..53b7ba9e 100644 --- a/actions/admin/settings/135.fcgid.php +++ b/actions/admin/settings/135.fcgid.php @@ -129,7 +129,7 @@ return array( 'settinggroup' => 'system', 'varname' => 'mod_fcgid_defaultini_ownvhost', 'type' => 'option', - 'default' => '1', + 'default' => '2', 'option_mode' => 'one', 'option_options_method' => 'getPhpConfigs', 'save_method' => 'storeSettingField', diff --git a/actions/admin/settings/136.phpfpm.php b/actions/admin/settings/136.phpfpm.php index 97527d9b..7edca760 100644 --- a/actions/admin/settings/136.phpfpm.php +++ b/actions/admin/settings/136.phpfpm.php @@ -69,7 +69,7 @@ return array( 'settinggroup' => 'phpfpm', 'varname' => 'vhost_defaultini', 'type' => 'option', - 'default' => '1', + 'default' => '2', 'option_mode' => 'one', 'option_options_method' => 'getPhpConfigs', 'save_method' => 'storeSettingField' diff --git a/install/froxlor.sql b/install/froxlor.sql index a08b3cd2..9b82d9cd 100644 --- a/install/froxlor.sql +++ b/install/froxlor.sql @@ -553,7 +553,7 @@ INSERT INTO `panel_settings` (`settinggroup`, `varname`, `value`) VALUES ('panel', 'phpconfigs_hidestdsubdomain', '0'), ('panel', 'allow_theme_change_admin', '1'), ('panel', 'allow_theme_change_customer', '1'), - ('panel', 'version', '0.9.31-rc2'); + ('panel', 'version', '0.9.31-rc3'); DROP TABLE IF EXISTS `panel_tasks`; @@ -764,6 +764,7 @@ CREATE TABLE `panel_phpconfigs` ( INSERT INTO `panel_phpconfigs` (`id`, `description`, `binary`, `file_extensions`, `mod_fcgid_starter`, `mod_fcgid_maxrequests`, `phpsettings`) VALUES (1, 'Default Config', '/usr/bin/php-cgi', 'php', '-1', '-1', 'allow_call_time_pass_reference = Off\r\nallow_url_fopen = Off\r\nasp_tags = Off\r\ndisable_classes =\r\ndisable_functions = curl_exec,curl_multi_exec,exec,parse_ini_file,passthru,popen,proc_close,proc_get_status,proc_nice,proc_open,proc_terminate,shell_exec,show_source,system\r\ndisplay_errors = Off\r\ndisplay_startup_errors = Off\r\nenable_dl = Off\r\nerror_reporting = E_ALL & ~E_NOTICE\r\nexpose_php = Off\r\nfile_uploads = On\r\ncgi.force_redirect = 1\r\ngpc_order = "GPC"\r\nhtml_errors = Off\r\nignore_repeated_errors = Off\r\nignore_repeated_source = Off\r\ninclude_path = ".:{PEAR_DIR}"\r\nlog_errors = On\r\nlog_errors_max_len = 1024\r\nmagic_quotes_gpc = Off\r\nmagic_quotes_runtime = Off\r\nmagic_quotes_sybase = Off\r\nmax_execution_time = 30\r\nmax_input_time = 60\r\nmemory_limit = 16M\r\n{OPEN_BASEDIR_C}open_basedir = "{OPEN_BASEDIR}"\r\noutput_buffering = 4096\r\npost_max_size = 16M\r\nprecision = 14\r\nregister_argc_argv = Off\r\nregister_globals = Off\r\nreport_memleaks = On\r\nsendmail_path = "/usr/sbin/sendmail -t -i -f {CUSTOMER_EMAIL}"\r\nsession.auto_start = 0\r\nsession.bug_compat_42 = 0\r\nsession.bug_compat_warn = 1\r\nsession.cache_expire = 180\r\nsession.cache_limiter = nocache\r\nsession.cookie_domain =\r\nsession.cookie_lifetime = 0\r\nsession.cookie_path = /\r\nsession.entropy_file = /dev/urandom\r\nsession.entropy_length = 16\r\nsession.gc_divisor = 1000\r\nsession.gc_maxlifetime = 1440\r\nsession.gc_probability = 1\r\nsession.name = PHPSESSID\r\nsession.referer_check =\r\nsession.save_handler = files\r\nsession.save_path = "{TMP_DIR}"\r\nsession.serialize_handler = php\r\nsession.use_cookies = 1\r\nsession.use_trans_sid = 0\r\nshort_open_tag = On\r\nsuhosin.mail.protect = 1\r\nsuhosin.simulation = Off\r\ntrack_errors = Off\r\nupload_max_filesize = 32M\r\nupload_tmp_dir = "{TMP_DIR}"\r\nvariables_order = "GPCS"\r\n'); +(2, 'Froxlor Vhost Config', '/usr/bin/php-cgi', 'php', '-1', '-1', 'allow_call_time_pass_reference = Off\r\nallow_url_fopen = On\r\nasp_tags = Off\r\ndisable_classes =\r\ndisable_functions = curl_multi_exec,exec,parse_ini_file,passthru,popen,proc_close,proc_get_status,proc_nice,proc_open,proc_terminate,shell_exec,show_source,system\r\ndisplay_errors = Off\r\ndisplay_startup_errors = Off\r\nenable_dl = Off\r\nerror_reporting = E_ALL & ~E_NOTICE\r\nexpose_php = Off\r\nfile_uploads = On\r\ncgi.force_redirect = 1\r\ngpc_order = "GPC"\r\nhtml_errors = Off\r\nignore_repeated_errors = Off\r\nignore_repeated_source = Off\r\ninclude_path = ".:{PEAR_DIR}"\r\nlog_errors = On\r\nlog_errors_max_len = 1024\r\nmagic_quotes_gpc = Off\r\nmagic_quotes_runtime = Off\r\nmagic_quotes_sybase = Off\r\nmax_execution_time = 60\r\nmax_input_time = 60\r\nmemory_limit = 16M\r\nnoutput_buffering = 4096\r\npost_max_size = 16M\r\nprecision = 14\r\nregister_argc_argv = Off\r\nregister_globals = Off\r\nreport_memleaks = On\r\nsendmail_path = "/usr/sbin/sendmail -t -i -f {CUSTOMER_EMAIL}"\r\nsession.auto_start = 0\r\nsession.bug_compat_42 = 0\r\nsession.bug_compat_warn = 1\r\nsession.cache_expire = 180\r\nsession.cache_limiter = nocache\r\nsession.cookie_domain =\r\nsession.cookie_lifetime = 0\r\nsession.cookie_path = /\r\nsession.entropy_file = /dev/urandom\r\nsession.entropy_length = 16\r\nsession.gc_divisor = 1000\r\nsession.gc_maxlifetime = 1440\r\nsession.gc_probability = 1\r\nsession.name = PHPSESSID\r\nsession.referer_check =\r\nsession.save_handler = files\r\nsession.save_path = "{TMP_DIR}"\r\nsession.serialize_handler = php\r\nsession.use_cookies = 1\r\nsession.use_trans_sid = 0\r\nshort_open_tag = On\r\nsuhosin.mail.protect = 1\r\nsuhosin.simulation = Off\r\ntrack_errors = Off\r\nupload_max_filesize = 32M\r\nupload_tmp_dir = "{TMP_DIR}"\r\nvariables_order = "GPCS"\r\n'); DROP TABLE IF EXISTS `aps_instances`; diff --git a/install/updates/froxlor/0.9/update_0.9.inc.php b/install/updates/froxlor/0.9/update_0.9.inc.php index 1e3b380e..5aa9e3af 100644 --- a/install/updates/froxlor/0.9/update_0.9.inc.php +++ b/install/updates/froxlor/0.9/update_0.9.inc.php @@ -2534,3 +2534,33 @@ if (isFroxlorVersion('0.9.31-rc1')) { updateToVersion('0.9.31-rc2'); } + +if (isFroxlorVersion('0.9.31-rc2')) { + showUpdateStep("Updating from 0.9.31-rc2 to 0.9.31-rc3"); + lastStepStatus(0); + + showUpdateStep("Adding new php-config for froxlor-vhost"); + Database::query(" + INSERT INTO `panel_phpconfigs` SET + `description` = 'Froxlor Vhost Config', `binary` = '/usr/bin/php-cgi', + `file_extensions` = 'php', `mod_fcgid_starter` = '-1', `mod_fcgid_maxrequests` = '-1', + `phpsettings` = 'allow_call_time_pass_reference = Off\r\nallow_url_fopen = On\r\nasp_tags = Off\r\ndisable_classes =\r\ndisable_functions = curl_multi_exec,exec,parse_ini_file,passthru,popen,proc_close,proc_get_status,proc_nice,proc_open,proc_terminate,shell_exec,show_source,system\r\ndisplay_errors = Off\r\ndisplay_startup_errors = Off\r\nenable_dl = Off\r\nerror_reporting = E_ALL & ~E_NOTICE\r\nexpose_php = Off\r\nfile_uploads = On\r\ncgi.force_redirect = 1\r\ngpc_order = \"GPC\"\r\nhtml_errors = Off\r\nignore_repeated_errors = Off\r\nignore_repeated_source = Off\r\ninclude_path = \".:{PEAR_DIR}\"\r\nlog_errors = On\r\nlog_errors_max_len = 1024\r\nmagic_quotes_gpc = Off\r\nmagic_quotes_runtime = Off\r\nmagic_quotes_sybase = Off\r\nmax_execution_time = 60\r\nmax_input_time = 60\r\nmemory_limit = 16M\r\nnoutput_buffering = 4096\r\npost_max_size = 16M\r\nprecision = 14\r\nregister_argc_argv = Off\r\nregister_globals = Off\r\nreport_memleaks = On\r\nsendmail_path = \"/usr/sbin/sendmail -t -i -f {CUSTOMER_EMAIL}\"\r\nsession.auto_start = 0\r\nsession.bug_compat_42 = 0\r\nsession.bug_compat_warn = 1\r\nsession.cache_expire = 180\r\nsession.cache_limiter = nocache\r\nsession.cookie_domain =\r\nsession.cookie_lifetime = 0\r\nsession.cookie_path = /\r\nsession.entropy_file = /dev/urandom\r\nsession.entropy_length = 16\r\nsession.gc_divisor = 1000\r\nsession.gc_maxlifetime = 1440\r\nsession.gc_probability = 1\r\nsession.name = PHPSESSID\r\nsession.referer_check =\r\nsession.save_handler = files\r\nsession.save_path = \"{TMP_DIR}\"\r\nsession.serialize_handler = php\r\nsession.use_cookies = 1\r\nsession.use_trans_sid = 0\r\nshort_open_tag = On\r\nsuhosin.mail.protect = 1\r\nsuhosin.simulation = Off\r\ntrack_errors = Off\r\nupload_max_filesize = 32M\r\nupload_tmp_dir = \"{TMP_DIR}\"\r\nvariables_order = \"GPCS\"\r\n' + "); + $frxvhostconfid = Database::lastInsertId(); + // update default vhosts-config for froxlor if they are on the system-default + if ($settings['system']['mod_fcgid_defaultini_ownvhost'] == '1') { + $upd_stmt = Database::prepare(" + UPDATE `".TABLE_PANEL_SETTINGS."` SET `value` = :value WHERE `settinggroup` = 'system' AND `varname` = 'mod_fcgid_defaultini_ownvhost' + "); + Database::pexecute($upd_stmt, array('value' => $frxvhostconfid)); + } + if ($settings['phpfpm']['vhost_defaultini'] == '1') { + $upd_stmt = Database::prepare(" + UPDATE `".TABLE_PANEL_SETTINGS."` SET `value` = :value WHERE `settinggroup` = 'phpfpm' AND `varname` = 'vhost_defaultini' + "); + Database::pexecute($upd_stmt, array('value' => $frxvhostconfid)); + } + lastStepStatus(0); + + updateToVersion('0.9.31-rc3'); +} diff --git a/lib/tables.inc.php b/lib/tables.inc.php index 7e6da0ce..b5c3ed7f 100644 --- a/lib/tables.inc.php +++ b/lib/tables.inc.php @@ -72,6 +72,6 @@ define('PACKAGE_LOCKED', 1); define('PACKAGE_ENABLED', 2); // VERSION INFO -$version = '0.9.31-rc2'; +$version = '0.9.31-rc3'; $dbversion = '2'; $branding = ''; From 8516cbb64da5be3997ab4b9a1d9ccaeca73f9208 Mon Sep 17 00:00:00 2001 From: "Michael Kaufmann (d00p)" Date: Thu, 12 Dec 2013 11:20:19 +0100 Subject: [PATCH 3/3] don't show 'there is a newer version of froxlor available' if a customzied (unknown) version is being checked Signed-off-by: Michael Kaufmann (d00p) --- admin_index.php | 7 ++++++- templates/Froxlor/admin/index/index.tpl | 2 +- templates/Sparkle/admin/index/index.tpl | 2 +- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/admin_index.php b/admin_index.php index 668edf90..85801d35 100644 --- a/admin_index.php +++ b/admin_index.php @@ -108,7 +108,12 @@ if ($page == 'overview') { $lookfornewversion_link = $_link; $lookfornewversion_addinfo = $_message; - if (version_compare2($version, $_version) == -1) { + // not numeric -> error-message + if (!is_numeric($_version)) { + // check for customized version to not output + // "There is a newer version of froxlor" besides the error-message + $isnewerversion = 2; + } elseif (version_compare2($version, $_version) == -1) { $isnewerversion = 1; } else { $isnewerversion = 0; diff --git a/templates/Froxlor/admin/index/index.tpl b/templates/Froxlor/admin/index/index.tpl index a75ce883..a3af5f6f 100644 --- a/templates/Froxlor/admin/index/index.tpl +++ b/templates/Froxlor/admin/index/index.tpl @@ -141,7 +141,7 @@ $header $lookfornewversion_lable - + {$lng['admin']['newerversionavailable']} diff --git a/templates/Sparkle/admin/index/index.tpl b/templates/Sparkle/admin/index/index.tpl index 2bb5453c..efc0344e 100644 --- a/templates/Sparkle/admin/index/index.tpl +++ b/templates/Sparkle/admin/index/index.tpl @@ -265,7 +265,7 @@ $header $lookfornewversion_lable - + {$lng['admin']['newerversionavailable']}