enhanced listing actions

Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
This commit is contained in:
Michael Kaufmann
2022-02-28 09:21:04 +01:00
parent 2b771b11d6
commit 5b961be0f8
21 changed files with 279 additions and 135 deletions

View File

@@ -62,6 +62,13 @@ class Domain
&& empty($attributes['fields']['domainaliasid']);
}
public static function adminCanDelete(array $attributes): bool
{
return $attributes['fields']['id'] != Settings::Get('system.hostname_id')
&& empty($attributes['fields']['domainaliasid'])
&& $attributes['fields']['standardsubdomain'] != $attributes['fields']['id'];
}
public static function canEditDNS(array $attributes): bool
{
return $attributes['fields']['isbinddomain'] == '1'
@@ -71,6 +78,13 @@ class Domain
&& Settings::Get('system.dnsenabled') == '1';
}
public static function adminCanEditDNS(array $attributes): bool
{
return $attributes['fields']['isbinddomain'] == '1'
&& Settings::Get('system.bind_enable') == '1'
&& Settings::Get('system.dnsenabled') == '1';
}
public function canEditSSL(array $attributes): bool
{
// FIXME: https://github.com/Froxlor/Froxlor/blob/master/templates/Sparkle/customer/domains/domains_domain.tpl#L41