From 77502efce7ca227a1cb7fc61aa9d135c3e6cc980 Mon Sep 17 00:00:00 2001 From: "Michael Kaufmann (d00p)" Date: Sat, 5 Mar 2016 13:56:34 +0100 Subject: [PATCH] enhance description of newsfeed-settings; ask whether to activate the newsfeed on install in case admin does not want any external requests Signed-off-by: Michael Kaufmann (d00p) --- install/froxlor.sql | 2 +- install/lib/class.FroxlorInstall.php | 27 +++++++++++++++++++++++++-- install/lng/english.lng.php | 1 + install/lng/german.lng.php | 1 + install/templates/dataitemyesno.tpl | 4 ++++ lib/ajax.php | 2 +- lng/english.lng.php | 4 ++-- lng/german.lng.php | 4 ++-- 8 files changed, 37 insertions(+), 8 deletions(-) create mode 100644 install/templates/dataitemyesno.tpl diff --git a/install/froxlor.sql b/install/froxlor.sql index 9f84c0f6..6afd3bfa 100644 --- a/install/froxlor.sql +++ b/install/froxlor.sql @@ -372,7 +372,7 @@ INSERT INTO `panel_settings` (`settinggroup`, `varname`, `value`) VALUES ('dkim', 'dkim_domains', 'domains'), ('dkim', 'dkim_dkimkeys', 'dkim-keys.conf'), ('dkim', 'dkimrestart_command', '/etc/init.d/dkim-filter restart'), - ('admin', 'show_news_feed', '1'), + ('admin', 'show_news_feed', '0'), ('admin', 'show_version_login', '0'), ('admin', 'show_version_footer', '0'), ('spf', 'use_spf', '0'), diff --git a/install/lib/class.FroxlorInstall.php b/install/lib/class.FroxlorInstall.php index 8cbab9af..73fd3eb8 100644 --- a/install/lib/class.FroxlorInstall.php +++ b/install/lib/class.FroxlorInstall.php @@ -160,6 +160,7 @@ class FroxlorInstall { $this->_getPostField('admin_user', 'admin'); $this->_getPostField('admin_pass1'); $this->_getPostField('admin_pass2'); + $this->_getPostField('activate_newsfeed', 1); $posixusername = posix_getpwuid(posix_getuid()); $this->_getPostField('httpuser', $posixusername['name']); $posixgroup = posix_getgrgid(posix_getgid()); @@ -473,6 +474,7 @@ class FroxlorInstall { $this->_updateSetting($upd_stmt, '/var/run/', 'phpfpm', 'fastcgi_ipcdir'); } + $this->_updateSetting($upd_stmt, $this->_data['activate_newsfeed'], 'admin', 'show_news_feed'); $this->_updateSetting($upd_stmt, dirname(dirname(dirname(__FILE__))), 'system', 'letsencryptchallengepath'); // insert the lastcronrun to be the installation date @@ -746,6 +748,8 @@ class FroxlorInstall { } else { $style = ''; } $formdata .= $this->_getSectionItemString('admin_pass2', true, $style, 'password'); + // activate newsfeed? + $formdata .= $this->_getSectionItemYesNo('activate_newsfeed', true); /** * Server data @@ -819,10 +823,10 @@ class FroxlorInstall { } /** - * generate form checkbox field + * generate form radio field for webserver-selection * * @param string $fieldname - * @param boolean $required + * @param boolean $checked * @param string $style * * @return string @@ -837,6 +841,25 @@ class FroxlorInstall { return $sectionitem; } + /** + * generate form checkbox field + * + * @param string $fieldname + * @param boolean $checked + * @param string $style + * + * @return string + */ + private function _getSectionItemYesNo($fieldname = null, $checked = false, $style = "") { + $fieldlabel = $this->_lng['install'][$fieldname]; + if ($checked) { + $checked = 'checked="checked"'; + } + $sectionitem = ""; + eval("\$sectionitem .= \"" . $this->_getTemplate("dataitemyesno") . "\";"); + return $sectionitem; + } + /** * check for requirements froxlor needs */ diff --git a/install/lng/english.lng.php b/install/lng/english.lng.php index f0cd71d7..bab624aa 100644 --- a/install/lng/english.lng.php +++ b/install/lng/english.lng.php @@ -56,6 +56,7 @@ $lng['install']['admin_account'] = 'Administrator Account'; $lng['install']['admin_user'] = 'Administrator Username'; $lng['install']['admin_pass1'] = 'Administrator Password'; $lng['install']['admin_pass2'] = 'Administrator-Password (confirm)'; +$lng['install']['activate_newsfeed'] = 'Enable the official newsfeed
(https://inside.froxlor.org/news/)'; $lng['install']['serversettings'] = 'Server settings'; $lng['install']['servername'] = 'Server name (FQDN, no ip-address)'; $lng['install']['serverip'] = 'Server IP'; diff --git a/install/lng/german.lng.php b/install/lng/german.lng.php index b2b21db4..dd60e772 100644 --- a/install/lng/german.lng.php +++ b/install/lng/german.lng.php @@ -56,6 +56,7 @@ $lng['install']['admin_account'] = 'Admin-Zugang'; $lng['install']['admin_user'] = 'Administrator-Benutzername'; $lng['install']['admin_pass1'] = 'Administrator-Passwort'; $lng['install']['admin_pass2'] = 'Administrator-Passwort (Bestätigung)'; +$lng['install']['activate_newsfeed'] = 'Aktiviere das offizielle Newsfeed
(https://inside.froxlor.org/news/)'; $lng['install']['serversettings'] = 'Servereinstellungen'; $lng['install']['servername'] = 'Servername (FQDN, keine IP-Adresse)'; $lng['install']['serverip'] = 'Server-IP'; diff --git a/install/templates/dataitemyesno.tpl b/install/templates/dataitemyesno.tpl new file mode 100644 index 00000000..0f370820 --- /dev/null +++ b/install/templates/dataitemyesno.tpl @@ -0,0 +1,4 @@ +

+ + +

diff --git a/lib/ajax.php b/lib/ajax.php index 97fdb591..23370663 100644 --- a/lib/ajax.php +++ b/lib/ajax.php @@ -40,7 +40,7 @@ if ($action == "newsfeed") { if (isset($_GET['role']) && $_GET['role'] == "customer") { $feed = Settings::Get("customer.news_feed_url"); } else { - $feed = "http://inside.froxlor.org/news/"; + $feed = "https://inside.froxlor.org/news/"; } if (function_exists("simplexml_load_file") == false) { diff --git a/lng/english.lng.php b/lng/english.lng.php index de7c6820..449ceb90 100644 --- a/lng/english.lng.php +++ b/lng/english.lng.php @@ -1762,7 +1762,7 @@ $lng['admin']['templates']['SERVER_IP'] = 'Replaces the default server ip-addres $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']['title'] = 'Show news-feed on admin-dashboard'; -$lng['admin']['show_news_feed']['description'] = 'Enable this to show the official froxlor newsfeed on your dashboard and never miss important information or release-announcements.'; +$lng['admin']['show_news_feed']['description'] = 'Enable this to show the official froxlor newsfeed (https://inside.froxlor.org/news/) on your dashboard and never miss important information or release-announcements.'; $lng['panel']['newsfeed_disabled'] = 'The newsfeed is disabled. Click the edit icon to go to the settings.'; // Added in Froxlor 0.9.32 @@ -1807,7 +1807,7 @@ $lng['error']['passwordshouldnotbeusername'] = 'The password should not be the s // Added in Froxlor 0.9.33 $lng['admin']['customer_show_news_feed'] = "Show newsfeed on customer-dashboard"; $lng['admin']['customer_news_feed_url']['title'] = "Use custom RSS-feed"; -$lng['admin']['customer_news_feed_url']['description'] = "Specify a custom RSS-feed that will be shown to your customers on their dashboard.
Leave this empty to use the official froxlor newsfeed."; +$lng['admin']['customer_news_feed_url']['description'] = "Specify a custom RSS-feed that will be shown to your customers on their dashboard.
Leave this empty to use the official froxlor newsfeed (https://inside.froxlor.org/news/)."; $lng['serversettings']['dns_createhostnameentry'] = "Create bind-zone/config for system hostname"; $lng['serversettings']['panel_password_alpha_lower']['title'] = 'Lowercase character'; $lng['serversettings']['panel_password_alpha_lower']['description'] = 'Password must contain at least one lowercase letter (a-z).'; diff --git a/lng/german.lng.php b/lng/german.lng.php index 34d8d5c6..640b58b3 100644 --- a/lng/german.lng.php +++ b/lng/german.lng.php @@ -1488,7 +1488,7 @@ $lng['admin']['templates']['SERVER_IP'] = 'Wird mit der Standard-System-IP-Adres $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']['title'] = 'Zeige Newsfeed im Admin-Dashboard'; -$lng['admin']['show_news_feed']['description'] = 'Aktiviere diese Option, um das offizielle Froxlor newsfeed auf deinem Dashboard anzuzeigen und verpasse keine wichtigen Informationen oder Release-Announcements.'; +$lng['admin']['show_news_feed']['description'] = 'Aktiviere diese Option, um das offizielle Froxlor newsfeed (https://inside.froxlor.org/news/) auf deinem Dashboard anzuzeigen und verpasse keine wichtigen Informationen oder Release-Announcements.'; $lng['panel']['newsfeed_disabled'] = 'Das Newsfeed ist deaktiviert. Klicke das Editier-Icon, um zu den Einstellungen zu gelangen.'; // Added in Froxlfor 0.9.32 @@ -1533,7 +1533,7 @@ $lng['error']['passwordshouldnotbeusername'] = 'Das Passwort sollte nicht mit de // Added in Froxlor 0.9.33 $lng['admin']['customer_show_news_feed'] = "Zeige Newsfeed im Kunden-Dashboard"; $lng['admin']['customer_news_feed_url']['title'] = "Benutzerdefiniertes RSS-Feed"; -$lng['admin']['customer_news_feed_url']['description'] = "Hier kann ein eigenes RSS-Feed angegeben werden, welches den Kunden auf dem Dashboard angezeigt wird.
Leerlassen um das offizielle Froxlor Newsfeed zu verwenden."; +$lng['admin']['customer_news_feed_url']['description'] = "Hier kann ein eigenes RSS-Feed angegeben werden, welches den Kunden auf dem Dashboard angezeigt wird.
Leerlassen um das offizielle Froxlor Newsfeed (https://inside.froxlor.org/news/) zu verwenden."; $lng['serversettings']['dns_createhostnameentry'] = "Erstelle bind-Zone/Konfiguration für den System-Hostnamen"; $lng['serversettings']['panel_password_alpha_lower']['title'] = 'Kleinbuchstaben'; $lng['serversettings']['panel_password_alpha_lower']['description'] = 'Das Passwort muss mindestens einen Kleinbuchstaben (a-z) enthalten.';