sort distribution-names in admin_configfiles, it's confusing otherwise; display the default/recommended daemon of every service; fix small c'n'p error (courier is not our recommended default)
Signed-off-by: Michael Kaufmann (d00p) <d00p@froxlor.org>
This commit is contained in:
@@ -71,7 +71,11 @@ if ($userinfo['change_serversettings'] == '1') {
|
|||||||
|
|
||||||
if ($daemon == "") {
|
if ($daemon == "") {
|
||||||
foreach ($daemons as $di => $dd) {
|
foreach ($daemons as $di => $dd) {
|
||||||
$daemons_select .= makeoption($dd->title, $di);
|
$title = $dd->title;
|
||||||
|
if ($dd->default) {
|
||||||
|
$title = $title." ".$lng['panel']['default'];
|
||||||
|
}
|
||||||
|
$daemons_select .= makeoption($title, $di);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@@ -83,14 +87,24 @@ if ($userinfo['change_serversettings'] == '1') {
|
|||||||
|
|
||||||
// show list of available distro's
|
// show list of available distro's
|
||||||
$distros = glob($config_dir . '*.xml');
|
$distros = glob($config_dir . '*.xml');
|
||||||
|
// tmp array
|
||||||
|
$distributions_select_data = array();
|
||||||
// read in all the distros
|
// read in all the distros
|
||||||
foreach ($distros as $_distribution) {
|
foreach ($distros as $_distribution) {
|
||||||
// get configparser object
|
// get configparser object
|
||||||
$dist = new ConfigParser($_distribution);
|
$dist = new ConfigParser($_distribution);
|
||||||
// get distro-info
|
// get distro-info
|
||||||
$dist_display = getCompleteDistroName($dist);
|
$dist_display = getCompleteDistroName($dist);
|
||||||
|
// store in tmp array
|
||||||
|
$distributions_select_data[$dist_display] = str_replace(".xml", "", strtolower(basename($_distribution)));
|
||||||
|
}
|
||||||
|
|
||||||
|
// sort by distribution name
|
||||||
|
ksort($distributions_select_data);
|
||||||
|
|
||||||
|
foreach ($distributions_select_data as $dist_display => $dist_index) {
|
||||||
// create select-box-option
|
// create select-box-option
|
||||||
$distributions_select .= makeoption($dist_display, str_replace(".xml", "", strtolower(basename($_distribution))));
|
$distributions_select .= makeoption($dist_display, $dist_index);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -66,6 +66,12 @@ class ConfigDaemon {
|
|||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
public $title;
|
public $title;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Whether this is the default daemon of the service-category
|
||||||
|
* @var boolean
|
||||||
|
*/
|
||||||
|
public $default;
|
||||||
|
|
||||||
public function __construct($xml, $xpath) {
|
public function __construct($xml, $xpath) {
|
||||||
$this->fullxml = $xml;
|
$this->fullxml = $xml;
|
||||||
@@ -75,6 +81,9 @@ class ConfigDaemon {
|
|||||||
if ($attributes['title'] != '') {
|
if ($attributes['title'] != '') {
|
||||||
$this->title = $this->_parseContent((string)$attributes['title']);
|
$this->title = $this->_parseContent((string)$attributes['title']);
|
||||||
}
|
}
|
||||||
|
if (isset($attributes['default'])) {
|
||||||
|
$this->default = ($attributes['default'] == true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -954,7 +954,7 @@ iterate_query = SELECT username AS user FROM mail_users WHERE (imap = 1 OR pop3
|
|||||||
<command><![CDATA[/etc/init.d/dovecot restart]]></command>
|
<command><![CDATA[/etc/init.d/dovecot restart]]></command>
|
||||||
</daemon>
|
</daemon>
|
||||||
<!-- Courier -->
|
<!-- Courier -->
|
||||||
<daemon name="courier" title="Courier" default="true">
|
<daemon name="courier" title="Courier">
|
||||||
<install><![CDATA[apt-get install courier-pop courier-imap courier-authlib-mysql]]></install>
|
<install><![CDATA[apt-get install courier-pop courier-imap courier-authlib-mysql]]></install>
|
||||||
<file name="/etc/courier/authdaemonrc" chown="root:0" chmod="0600"
|
<file name="/etc/courier/authdaemonrc" chown="root:0" chmod="0600"
|
||||||
backup="true">
|
backup="true">
|
||||||
|
|||||||
@@ -932,7 +932,7 @@ iterate_query = SELECT username AS user FROM mail_users WHERE (imap = 1 OR pop3
|
|||||||
<command><![CDATA[service dovecot restart]]></command>
|
<command><![CDATA[service dovecot restart]]></command>
|
||||||
</daemon>
|
</daemon>
|
||||||
<!-- Courier -->
|
<!-- Courier -->
|
||||||
<daemon name="courier" title="Courier" default="true">
|
<daemon name="courier" title="Courier">
|
||||||
<install><![CDATA[apt-get install courier-pop courier-imap courier-authlib-mysql]]></install>
|
<install><![CDATA[apt-get install courier-pop courier-imap courier-authlib-mysql]]></install>
|
||||||
<file name="/etc/courier/authdaemonrc" chown="root:0" chmod="0600"
|
<file name="/etc/courier/authdaemonrc" chown="root:0" chmod="0600"
|
||||||
backup="true">
|
backup="true">
|
||||||
|
|||||||
@@ -3745,7 +3745,7 @@ plugin {
|
|||||||
<command><![CDATA[/etc/init.d/dovecot restart]]></command>
|
<command><![CDATA[/etc/init.d/dovecot restart]]></command>
|
||||||
</daemon>
|
</daemon>
|
||||||
<!-- Courier -->
|
<!-- Courier -->
|
||||||
<daemon name="courier" title="Courier" default="true">
|
<daemon name="courier" title="Courier">
|
||||||
<install><![CDATA[apt-get install courier-pop courier-imap courier-authlib-mysql]]></install>
|
<install><![CDATA[apt-get install courier-pop courier-imap courier-authlib-mysql]]></install>
|
||||||
<file name="/etc/courier/authdaemonrc" chown="root:0" chmod="0600"
|
<file name="/etc/courier/authdaemonrc" chown="root:0" chmod="0600"
|
||||||
backup="true">
|
backup="true">
|
||||||
|
|||||||
Reference in New Issue
Block a user