From b762cce94dd3a75ccae9675cb85c8b119072857b Mon Sep 17 00:00:00 2001 From: "Michael Kaufmann (d00p)" Date: Fri, 6 Dec 2013 10:31:22 +0100 Subject: [PATCH 1/5] custom user-agent also for simplexml_load_file-method of reading news-feed Signed-off-by: Michael Kaufmann (d00p) --- lib/ajax.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/ajax.php b/lib/ajax.php index 39c962e0..eaa6597c 100644 --- a/lib/ajax.php +++ b/lib/ajax.php @@ -31,9 +31,10 @@ if ($action == "newsfeed") { die(); } + // get version + require './tables.inc.php'; + if (function_exists('curl_version')) { - // get version - require './tables.inc.php'; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $feed); curl_setopt($ch, CURLOPT_USERAGENT, 'Froxlor/'.$version); @@ -43,6 +44,7 @@ if ($action == "newsfeed") { $news = simplexml_load_string(trim($output)); } else { if (ini_get('allow_url_fopen')) { + ini_set('user_agent', 'Froxlor/'.$version); $news = simplexml_load_file($feed, null, LIBXML_NOCDATA); } else { $news = false; From 203573913168d5461f1b86dec8c59335fc2a5082 Mon Sep 17 00:00:00 2001 From: "Michael Kaufmann (d00p)" Date: Fri, 6 Dec 2013 14:37:27 +0100 Subject: [PATCH 2/5] added setting to enable/disable news-feed on admin-dashboard Signed-off-by: Michael Kaufmann (d00p) --- actions/admin/settings/100.panel.php | 8 ++++++++ install/froxlor.sql | 1 + install/updates/froxlor/0.9/update_0.9.inc.php | 14 ++++++++++++++ .../updates/preconfig/0.9/preconfig_0.9.inc.php | 9 +++++++++ lng/english.lng.php | 1 + lng/german.lng.php | 1 + templates/Sparkle/admin/index/index.tpl | 6 ++++-- 7 files changed, 38 insertions(+), 2 deletions(-) diff --git a/actions/admin/settings/100.panel.php b/actions/admin/settings/100.panel.php index 9a8859d9..7e9dbb40 100644 --- a/actions/admin/settings/100.panel.php +++ b/actions/admin/settings/100.panel.php @@ -194,6 +194,14 @@ return array( 'default' => false, 'save_method' => 'storeSettingField', ), + 'admin_show_news_feed' => array( + 'label' => $lng['admin']['show_news_feed'], + 'settinggroup' => 'admin', + 'varname' => 'show_news_feed', + 'type' => 'bool', + 'default' => false, + 'save_method' => 'storeSettingField', + ), 'panel_allow_domain_change_admin' => array( 'label' => $lng['serversettings']['panel_allow_domain_change_admin'], 'settinggroup' => 'panel', diff --git a/install/froxlor.sql b/install/froxlor.sql index ee12dd34..b80c508f 100644 --- a/install/froxlor.sql +++ b/install/froxlor.sql @@ -376,6 +376,7 @@ INSERT INTO `panel_settings` (`settinggroup`, `varname`, `value`) VALUES ('dkim', 'dkimrestart_command', '/etc/init.d/dkim-filter restart'), ('autoresponder', 'autoresponder_active', '0'), ('autoresponder', 'last_autoresponder_run', '0'), + ('admin', 'show_news_feed', '1'), ('admin', 'show_version_login', '0'), ('admin', 'show_version_footer', '0'), ('aps', 'items_per_page', '20'), 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 567106a9..89d403c4 100644 --- a/install/updates/froxlor/0.9/update_0.9.inc.php +++ b/install/updates/froxlor/0.9/update_0.9.inc.php @@ -2519,3 +2519,17 @@ if (isFroxlorVersion('0.9.31-dev6')) { lastStepStatus(0); updateToVersion('0.9.31-rc1'); } + +if (isFroxlorVersion('0.9.31-rc1')) { + showUpdateStep("Updating from 0.9.31-rc1 to 0.9.31-rc2"); + lastStepStatus(0); + + $update_admin_news_feed = isset($_POST['update_admin_news_feed']) ? (int)$_POST['update_admin_news_feed'] : '1'; + showUpdateStep("Adding new news-feed option"); + $ins_stmt = Database::prepare(" + INSERT INTO `".TABLE_PANEL_SETTINGS."` SET `settinggroup` = 'admin', `varname` = 'show_news_feed', `value` = :value + "); + Database::pexecute($ins_stmt, array('value' => $update_admin_news_feed)); + + updateToVersion('0.9.31-rc2'); +} diff --git a/install/updates/preconfig/0.9/preconfig_0.9.inc.php b/install/updates/preconfig/0.9/preconfig_0.9.inc.php index 6d9d3221..cf59e47c 100644 --- a/install/updates/preconfig/0.9/preconfig_0.9.inc.php +++ b/install/updates/preconfig/0.9/preconfig_0.9.inc.php @@ -601,4 +601,13 @@ function parseAndOutputPreconfig(&$has_preconfig, &$return, $current_version) $question.= makeyesno('update_error_report_customer', '1', '0', '0'); eval("\$return.=\"" . getTemplate("update/preconfigitem") . "\";"); } + + if (versionInUpdate($current_version, '0.9.31-rc2')) { + $has_preconfig = true; + $description = 'You can enable/disable the display/usage of the news-feed for admins

'; + $question = 'Do you want to enable the news-feed for admins? (default: yes): '; + $question.= makeyesno('update_admin_news_feed', '1', '0', '1').'
'; + eval("\$return.=\"" . getTemplate("update/preconfigitem") . "\";"); + } + } diff --git a/lng/english.lng.php b/lng/english.lng.php index 372f06b3..1c986c5b 100644 --- a/lng/english.lng.php +++ b/lng/english.lng.php @@ -2001,3 +2001,4 @@ $lng['admin']['templates']['SERVER_HOSTNAME'] = 'Replaces the system-hostname (U $lng['admin']['templates']['SERVER_IP'] = 'Replaces the default server ip-address'; $lng['admin']['templates']['SERVER_PORT'] = 'Replaces the default server port'; $lng['admin']['templates']['DOMAINNAME'] = 'Replaces the customers standard-subdomain (can be empty if none is generated)'; +$lng['admin']['show_news_feed'] = 'Show news-feed on admin-dashboard'; diff --git a/lng/german.lng.php b/lng/german.lng.php index 61e64fd6..1f04bebf 100644 --- a/lng/german.lng.php +++ b/lng/german.lng.php @@ -1727,3 +1727,4 @@ $lng['admin']['templates']['SERVER_HOSTNAME'] = 'Wird mit dem System-Hostname (U $lng['admin']['templates']['SERVER_IP'] = 'Wird mit der standard System IP-Adresse ersetzt'; $lng['admin']['templates']['SERVER_PORT'] = 'Wird mit dem standard Port ersetzt'; $lng['admin']['templates']['DOMAINNAME'] = 'Wird mit der Standardsubdomain des Kunden ersetzt (kann leer sein, wenn keine erstellt werden soll)'; +$lng['admin']['show_news_feed'] = 'Zeige News-Feed im Admin-Dashboard'; diff --git a/templates/Sparkle/admin/index/index.tpl b/templates/Sparkle/admin/index/index.tpl index 36e0e4ff..2bb5453c 100644 --- a/templates/Sparkle/admin/index/index.tpl +++ b/templates/Sparkle/admin/index/index.tpl @@ -195,7 +195,8 @@ $header - + + - + +
From 9f8a6a6f5e6d2e88efc0f56ec9afd128152529a3 Mon Sep 17 00:00:00 2001 From: "Michael Kaufmann (d00p)" Date: Fri, 6 Dec 2013 14:40:59 +0100 Subject: [PATCH 3/5] set version everywhere so updater takes effect :P Signed-off-by: Michael Kaufmann (d00p) --- actions/admin/settings/100.panel.php | 2 +- install/froxlor.sql | 2 +- lib/tables.inc.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/actions/admin/settings/100.panel.php b/actions/admin/settings/100.panel.php index 7e9dbb40..7c390e3f 100644 --- a/actions/admin/settings/100.panel.php +++ b/actions/admin/settings/100.panel.php @@ -199,7 +199,7 @@ return array( 'settinggroup' => 'admin', 'varname' => 'show_news_feed', 'type' => 'bool', - 'default' => false, + 'default' => true, 'save_method' => 'storeSettingField', ), 'panel_allow_domain_change_admin' => array( diff --git a/install/froxlor.sql b/install/froxlor.sql index b80c508f..a08b3cd2 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-rc1'); + ('panel', 'version', '0.9.31-rc2'); DROP TABLE IF EXISTS `panel_tasks`; diff --git a/lib/tables.inc.php b/lib/tables.inc.php index f8d5054b..7e6da0ce 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-rc1'; +$version = '0.9.31-rc2'; $dbversion = '2'; $branding = ''; From 6a6c5db88d5f0d17ea764c5d437355837fdce27e Mon Sep 17 00:00:00 2001 From: "Michael Kaufmann (d00p)" Date: Fri, 6 Dec 2013 14:43:01 +0100 Subject: [PATCH 4/5] forgot the update-status --- install/updates/froxlor/0.9/update_0.9.inc.php | 1 + 1 file changed, 1 insertion(+) 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 89d403c4..1e3b380e 100644 --- a/install/updates/froxlor/0.9/update_0.9.inc.php +++ b/install/updates/froxlor/0.9/update_0.9.inc.php @@ -2530,6 +2530,7 @@ if (isFroxlorVersion('0.9.31-rc1')) { INSERT INTO `".TABLE_PANEL_SETTINGS."` SET `settinggroup` = 'admin', `varname` = 'show_news_feed', `value` = :value "); Database::pexecute($ins_stmt, array('value' => $update_admin_news_feed)); + lastStepStatus(0); updateToVersion('0.9.31-rc2'); } From dde6581f9c37c45bc10da23444b2aa3da4e33a0e Mon Sep 17 00:00:00 2001 From: "Michael Kaufmann (d00p)" Date: Sun, 8 Dec 2013 10:18:18 +0100 Subject: [PATCH 5/5] create SuexecUserGroup-statement on apache/fpm if customer has perl enabled so perl-scripts run under the same username, fixes #1317 Signed-off-by: Michael Kaufmann (d00p) --- scripts/jobs/cron_tasks.inc.http.15.apache_fcgid.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/scripts/jobs/cron_tasks.inc.http.15.apache_fcgid.php b/scripts/jobs/cron_tasks.inc.http.15.apache_fcgid.php index bda8c1df..c331a944 100644 --- a/scripts/jobs/cron_tasks.inc.http.15.apache_fcgid.php +++ b/scripts/jobs/cron_tasks.inc.http.15.apache_fcgid.php @@ -34,6 +34,11 @@ class apache_fcgid extends apache if ($domain['ssl'] == 1 && $ssl_vhost) { $srvName = 'ssl-fpm.external'; } + // #1317 - perl is executed via apache and therefore, when using fpm, does not know the user + // which perl is supposed to run as, hence the need for Suexec need + if (customerHasPerlEnabled($domain['customerid'])) { + $php_options_text.= ' SuexecUserGroup "' . $domain['loginname'] . '" "' . $domain['loginname'] . '"' . "\n"; + } $php_options_text.= ' FastCgiExternalServer ' . $php->getInterface()->getAliasConfigDir() . $srvName . ' -socket ' . $php->getInterface()->getSocketFile() . ' -idle-timeout ' . $this->settings['phpfpm']['idle_timeout'] . "\n"; $php_options_text.= ' ' . "\n"; $php_options_text.= ' ' . "\n";