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) <d00p@froxlor.org>
This commit is contained in:
Michael Kaufmann (d00p)
2016-03-05 13:56:34 +01:00
parent ca34f7a78a
commit 77502efce7
8 changed files with 37 additions and 8 deletions

View File

@@ -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'),

View File

@@ -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
*/

View File

@@ -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<br><small>(https://inside.froxlor.org/news/)</small>';
$lng['install']['serversettings'] = 'Server settings';
$lng['install']['servername'] = 'Server name (FQDN, no ip-address)';
$lng['install']['serverip'] = 'Server IP';

View File

@@ -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<br><small>(https://inside.froxlor.org/news/)</small>';
$lng['install']['serversettings'] = 'Servereinstellungen';
$lng['install']['servername'] = 'Servername (FQDN, keine IP-Adresse)';
$lng['install']['serverip'] = 'Server-IP';

View File

@@ -0,0 +1,4 @@
<p>
<label for="{$fieldname}" class="install-block {$style}">{$fieldlabel}:</label>
<input type="checkbox" name="{$fieldname}" id="{$fieldname}" value="1" {$checked} />
</p>