fix styling of deactivated/locked customers in overview and 0-value in edit-form
Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
This commit is contained in:
@@ -123,7 +123,7 @@ class PhpSettings extends ApiCommand implements ResourceEntity
|
|||||||
}
|
}
|
||||||
|
|
||||||
// check whether we use that config as froxor-vhost config
|
// check whether we use that config as froxor-vhost config
|
||||||
if (Settings::Get('system.mod_fcgid_defaultini_ownvhost') == $row['id'] || Settings::Get('phpfpm.vhost_defaultini') == $row['id']) {
|
if ((Settings::Get('system.mod_fcgid') == '1' && Settings::Get('system.mod_fcgid_defaultini_ownvhost') == $row['id']) || (Settings::Get('phpfpm.enabled') == '1' && Settings::Get('phpfpm.vhost_defaultini') == $row['id'])) {
|
||||||
$domains[] = Settings::Get('system.hostname');
|
$domains[] = Settings::Get('system.hostname');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -66,6 +66,21 @@ class Style
|
|||||||
return $attributes['fields']['deactivated'] ? 'bg-info' : $termination_css;
|
return $attributes['fields']['deactivated'] ? 'bg-info' : $termination_css;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static function resultCustomerLockedOrDeactivated(array $attributes): string
|
||||||
|
{
|
||||||
|
$row_css = '';
|
||||||
|
if ((int)$attributes['fields']['deactivated'] == 1) {
|
||||||
|
$row_css = 'bg-info';
|
||||||
|
} elseif (
|
||||||
|
$attributes['fields']['loginfail_count'] >= Settings::Get('login.maxloginattempts')
|
||||||
|
&& $attributes['fields']['lastlogin_fail'] > (time() - Settings::Get('login.deactivatetime'))
|
||||||
|
) {
|
||||||
|
$row_css = 'bg-warning';
|
||||||
|
}
|
||||||
|
|
||||||
|
return $row_css;
|
||||||
|
}
|
||||||
|
|
||||||
public static function diskspaceWarning(array $attributes): string
|
public static function diskspaceWarning(array $attributes): string
|
||||||
{
|
{
|
||||||
return self::getWarningStyle('diskspace', $attributes['fields'], (int)Settings::Get('system.report_webmax'));
|
return self::getWarningStyle('diskspace', $attributes['fields'], (int)Settings::Get('system.report_webmax'));
|
||||||
|
|||||||
@@ -195,49 +195,49 @@ return [
|
|||||||
'diskspace' => [
|
'diskspace' => [
|
||||||
'label' => lng('customer.diskspace') . ' (' . lng('customer.mib') . ')',
|
'label' => lng('customer.diskspace') . ' (' . lng('customer.mib') . ')',
|
||||||
'type' => 'textul',
|
'type' => 'textul',
|
||||||
'value' => $result['diskspace'],
|
'value' => empty($result['diskspace']) ? '0' : $result['diskspace'],
|
||||||
'maxlength' => 16,
|
'maxlength' => 16,
|
||||||
'mandatory' => true
|
'mandatory' => true
|
||||||
],
|
],
|
||||||
'traffic' => [
|
'traffic' => [
|
||||||
'label' => lng('customer.traffic') . ' (' . lng('customer.gib') . ')',
|
'label' => lng('customer.traffic') . ' (' . lng('customer.gib') . ')',
|
||||||
'type' => 'textul',
|
'type' => 'textul',
|
||||||
'value' => $result['traffic'],
|
'value' => empty($result['traffic']) ? '0' : $result['traffic'],
|
||||||
'maxlength' => 14,
|
'maxlength' => 14,
|
||||||
'mandatory' => true
|
'mandatory' => true
|
||||||
],
|
],
|
||||||
'subdomains' => [
|
'subdomains' => [
|
||||||
'label' => lng('customer.subdomains'),
|
'label' => lng('customer.subdomains'),
|
||||||
'type' => 'textul',
|
'type' => 'textul',
|
||||||
'value' => $result['subdomains'],
|
'value' => empty($result['subdomains']) ? '0' : $result['subdomains'],
|
||||||
'maxlength' => 9,
|
'maxlength' => 9,
|
||||||
'mandatory' => true
|
'mandatory' => true
|
||||||
],
|
],
|
||||||
'emails' => [
|
'emails' => [
|
||||||
'label' => lng('customer.emails'),
|
'label' => lng('customer.emails'),
|
||||||
'type' => 'textul',
|
'type' => 'textul',
|
||||||
'value' => $result['emails'],
|
'value' => empty($result['emails']) ? '0' : $result['emails'],
|
||||||
'maxlength' => 9,
|
'maxlength' => 9,
|
||||||
'mandatory' => true
|
'mandatory' => true
|
||||||
],
|
],
|
||||||
'email_accounts' => [
|
'email_accounts' => [
|
||||||
'label' => lng('customer.accounts'),
|
'label' => lng('customer.accounts'),
|
||||||
'type' => 'textul',
|
'type' => 'textul',
|
||||||
'value' => $result['email_accounts'],
|
'value' => empty($result['email_accounts']) ? '0' : $result['email_accounts'],
|
||||||
'maxlength' => 9,
|
'maxlength' => 9,
|
||||||
'mandatory' => true
|
'mandatory' => true
|
||||||
],
|
],
|
||||||
'email_forwarders' => [
|
'email_forwarders' => [
|
||||||
'label' => lng('customer.forwarders'),
|
'label' => lng('customer.forwarders'),
|
||||||
'type' => 'textul',
|
'type' => 'textul',
|
||||||
'value' => $result['email_forwarders'],
|
'value' => empty($result['email_forwarders']) ? '0' : $result['email_forwarders'],
|
||||||
'maxlength' => 9,
|
'maxlength' => 9,
|
||||||
'mandatory' => true
|
'mandatory' => true
|
||||||
],
|
],
|
||||||
'email_quota' => [
|
'email_quota' => [
|
||||||
'label' => lng('customer.email_quota') . ' (' . lng('customer.mib') . ')',
|
'label' => lng('customer.email_quota') . ' (' . lng('customer.mib') . ')',
|
||||||
'type' => 'textul',
|
'type' => 'textul',
|
||||||
'value' => $result['email_quota'],
|
'value' => empty($result['email_quota']) ? '0' : $result['email_quota'],
|
||||||
'maxlength' => 9,
|
'maxlength' => 9,
|
||||||
'visible' => Settings::Get('system.mail_quota_enabled') == '1',
|
'visible' => Settings::Get('system.mail_quota_enabled') == '1',
|
||||||
'mandatory' => true
|
'mandatory' => true
|
||||||
@@ -259,13 +259,14 @@ return [
|
|||||||
'ftps' => [
|
'ftps' => [
|
||||||
'label' => lng('customer.ftps'),
|
'label' => lng('customer.ftps'),
|
||||||
'type' => 'textul',
|
'type' => 'textul',
|
||||||
'value' => $result['ftps'],
|
'value' => empty($result['ftps']) ? '0' : $result['ftps'],
|
||||||
'maxlength' => 9
|
'maxlength' => 9,
|
||||||
|
'mandatory' => true
|
||||||
],
|
],
|
||||||
'mysqls' => [
|
'mysqls' => [
|
||||||
'label' => lng('customer.mysqls'),
|
'label' => lng('customer.mysqls'),
|
||||||
'type' => 'textul',
|
'type' => 'textul',
|
||||||
'value' => $result['mysqls'],
|
'value' => empty($result['mysql']) ? '0' : $result['mysqls'],
|
||||||
'maxlength' => 9,
|
'maxlength' => 9,
|
||||||
'mandatory' => true
|
'mandatory' => true
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -27,6 +27,7 @@ use Froxlor\UI\Callbacks\Customer;
|
|||||||
use Froxlor\UI\Callbacks\Impersonate;
|
use Froxlor\UI\Callbacks\Impersonate;
|
||||||
use Froxlor\UI\Callbacks\ProgressBar;
|
use Froxlor\UI\Callbacks\ProgressBar;
|
||||||
use Froxlor\UI\Callbacks\Text;
|
use Froxlor\UI\Callbacks\Text;
|
||||||
|
use Froxlor\UI\Callbacks\Style;
|
||||||
use Froxlor\UI\Listing;
|
use Froxlor\UI\Listing;
|
||||||
|
|
||||||
return [
|
return [
|
||||||
@@ -155,7 +156,7 @@ return [
|
|||||||
'unlock' => [
|
'unlock' => [
|
||||||
'icon' => 'fa fa-unlock',
|
'icon' => 'fa fa-unlock',
|
||||||
'title' => lng('panel.unlock'),
|
'title' => lng('panel.unlock'),
|
||||||
'class' => 'text-warning',
|
'class' => 'btn-outline-secondary',
|
||||||
'href' => [
|
'href' => [
|
||||||
'section' => 'customers',
|
'section' => 'customers',
|
||||||
'page' => 'customers',
|
'page' => 'customers',
|
||||||
@@ -186,5 +187,8 @@ return [
|
|||||||
],
|
],
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
|
'format_callback' => [
|
||||||
|
[Style::class, 'resultCustomerLockedOrDeactivated']
|
||||||
|
]
|
||||||
]
|
]
|
||||||
];
|
];
|
||||||
|
|||||||
Reference in New Issue
Block a user