fix wrong visible-callback for ssl-editor in domain-listing; fix adding new certificate via form; don't show logs-icon when domain is email_only
Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
This commit is contained in:
@@ -17,6 +17,9 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
use Froxlor\Froxlor;
|
||||||
|
use Froxlor\FileDir;
|
||||||
|
use Froxlor\Config\ConfigParser;
|
||||||
use Froxlor\UI\Panel\UI;
|
use Froxlor\UI\Panel\UI;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -595,10 +598,10 @@ class FroxlorInstall
|
|||||||
$this->_updateSetting($upd_stmt, 'error', 'system', 'errorlog_level');
|
$this->_updateSetting($upd_stmt, 'error', 'system', 'errorlog_level');
|
||||||
}
|
}
|
||||||
|
|
||||||
$distros = glob(\Froxlor\FileDir::makeCorrectDir(\Froxlor\Froxlor::getInstallDir() . '/lib/configfiles/') . '*.xml');
|
$distros = glob(FileDir::makeCorrectDir(Froxlor::getInstallDir() . '/lib/configfiles/') . '*.xml');
|
||||||
foreach ($distros as $_distribution) {
|
foreach ($distros as $_distribution) {
|
||||||
if ($this->_data['distribution'] == str_replace(".xml", "", strtolower(basename($_distribution)))) {
|
if ($this->_data['distribution'] == str_replace(".xml", "", strtolower(basename($_distribution)))) {
|
||||||
$dist = new \Froxlor\Config\ConfigParser($_distribution);
|
$dist = new ConfigParser($_distribution);
|
||||||
$defaults = $dist->getDefaults();
|
$defaults = $dist->getDefaults();
|
||||||
if (!empty($defaults)) {
|
if (!empty($defaults)) {
|
||||||
foreach ($defaults as $property) {
|
foreach ($defaults as $property) {
|
||||||
|
|||||||
@@ -88,11 +88,13 @@ class Domain
|
|||||||
|
|
||||||
public static function canViewLogs(array $attributes): bool
|
public static function canViewLogs(array $attributes): bool
|
||||||
{
|
{
|
||||||
|
if ((int)$attributes['fields']['email_only'] == 0) {
|
||||||
if ((int) UI::getCurrentUser()['adminsession'] == 0 && (bool)UI::getCurrentUser()['logviewenabled']) {
|
if ((int) UI::getCurrentUser()['adminsession'] == 0 && (bool)UI::getCurrentUser()['logviewenabled']) {
|
||||||
return true;
|
return true;
|
||||||
} elseif ((int) UI::getCurrentUser()['adminsession'] == 1 && (int)$attributes['fields']['email_only'] == 0) {
|
} elseif ((int) UI::getCurrentUser()['adminsession'] == 1) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -59,6 +59,11 @@ return array(
|
|||||||
'cols' => 100,
|
'cols' => 100,
|
||||||
'rows' => 15,
|
'rows' => 15,
|
||||||
'value' => $result['ssl_ca_file']
|
'value' => $result['ssl_ca_file']
|
||||||
|
),
|
||||||
|
'do_insert' => array(
|
||||||
|
'type' => 'hidden',
|
||||||
|
'value' => '1',
|
||||||
|
'visible' => empty($result['ssl_cert_file'])
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -173,7 +173,7 @@ return [
|
|||||||
'action' => 'view',
|
'action' => 'view',
|
||||||
'id' => ':id'
|
'id' => ':id'
|
||||||
],
|
],
|
||||||
'visible' => [Domain::class, 'adminCanEditDNS']
|
'visible' => [Domain::class, 'canEditSSL']
|
||||||
],
|
],
|
||||||
'letsencrypt' => [
|
'letsencrypt' => [
|
||||||
'icon' => 'fa fa-shield',
|
'icon' => 'fa fa-shield',
|
||||||
|
|||||||
Reference in New Issue
Block a user