From 14d5c9da6c8070dceed827ee8b284a8358c51176 Mon Sep 17 00:00:00 2001 From: Michael Kaufmann Date: Sun, 15 May 2022 18:39:36 +0200 Subject: [PATCH] add more columns for custom-column selection (customer view) Signed-off-by: Michael Kaufmann --- lib/Froxlor/UI/Callbacks/Email.php | 12 +++++++ .../customer/tablelisting.domains.php | 35 ++++++++++++++++--- .../customer/tablelisting.emails.php | 2 +- lng/de.lng.php | 1 + lng/en.lng.php | 1 + 5 files changed, 46 insertions(+), 5 deletions(-) diff --git a/lib/Froxlor/UI/Callbacks/Email.php b/lib/Froxlor/UI/Callbacks/Email.php index 34449b46..a4ca94d1 100644 --- a/lib/Froxlor/UI/Callbacks/Email.php +++ b/lib/Froxlor/UI/Callbacks/Email.php @@ -40,4 +40,16 @@ class Email ] ]; } + + public static function forwarderList(array $attributes) + { + $forwarders = explode(" ", $attributes['data']); + if (($key = array_search($attributes['fields']['email_full'], $forwarders)) !== false) { + unset($forwarders[$key]); + } + if (count($forwarders) > 0) { + return implode("
", $forwarders); + } + return ""; + } } diff --git a/lib/tablelisting/customer/tablelisting.domains.php b/lib/tablelisting/customer/tablelisting.domains.php index 7f701812..4b46620a 100644 --- a/lib/tablelisting/customer/tablelisting.domains.php +++ b/lib/tablelisting/customer/tablelisting.domains.php @@ -25,6 +25,7 @@ use Froxlor\UI\Callbacks\Domain; use Froxlor\UI\Callbacks\Style; +use Froxlor\UI\Callbacks\Text; use Froxlor\UI\Listing; return [ @@ -33,9 +34,6 @@ return [ 'icon' => 'fa-solid fa-globe', 'self_overview' => ['section' => 'domains', 'page' => 'domains'], 'columns' => [ - 'ad.id' => [ - 'field' => 'aliasdomainid' - ], 'd.domain_ace' => [ 'label' => lng('domains.domainname'), 'field' => 'domain_ace', @@ -45,7 +43,36 @@ return [ 'label' => lng('panel.path'), 'field' => 'documentroot', 'callback' => [Domain::class, 'domainTarget'], - ] + ], + 'd.isbinddomain' => [ + 'label' => lng('domains.isbinddomain'), + 'field' => 'isbinddomain', + 'callback' => [Text::class, 'boolean'], + ], + 'd.isemaildomain' => [ + 'label' => lng('admin.emaildomain'), + 'field' => 'isemaildomain', + 'callback' => [Text::class, 'boolean'], + ], + 'd.email_only' => [ + 'label' => lng('admin.email_only'), + 'field' => 'email_only', + 'callback' => [Text::class, 'boolean'], + ], + 'd.iswildcarddomain' => [ + 'label' => lng('domains.serveraliasoption_wildcard'), + 'field' => 'iswildcarddomain', + 'callback' => [Text::class, 'boolean'], + ], + 'd.letsencrypt' => [ + 'label' => lng('panel.letsencrypt'), + 'field' => 'letsencrypt', + 'callback' => [Text::class, 'boolean'], + ], + 'ad.id' => [ + 'label' => lng('domains.aliasdomainid'), + 'field' => 'aliasdomainid' + ], ], 'visible_columns' => Listing::getVisibleColumnsForListing('domain_list', [ 'd.domain_ace', diff --git a/lib/tablelisting/customer/tablelisting.emails.php b/lib/tablelisting/customer/tablelisting.emails.php index f8f017e1..22e974dc 100644 --- a/lib/tablelisting/customer/tablelisting.emails.php +++ b/lib/tablelisting/customer/tablelisting.emails.php @@ -41,7 +41,7 @@ return [ 'm.destination' => [ 'label' => lng('emails.forwarders'), 'field' => 'destination', - // @todo formatting + 'callback' => [Email::class, 'forwarderList'], ], 'm.popaccountid' => [ 'label' => lng('emails.account'), diff --git a/lng/de.lng.php b/lng/de.lng.php index aa94bc14..e42b52eb 100644 --- a/lng/de.lng.php +++ b/lng/de.lng.php @@ -663,6 +663,7 @@ return [ 'dkimenabled' => 'DKIM aktiviert', 'openbasedirenabled' => 'Openbasedir Einschränkung', 'hsts' => 'HSTS aktiviert', + 'aliasdomainid' => 'ID der Alias-Domain', ], 'emails' => [ 'description' => 'Hier können Sie Ihre E-Mail-Adressen einrichten.
Ein Konto ist wie Ihr Briefkasten vor der Haustür. Wenn jemand eine E-Mail an Sie schreibt, wird diese in dieses Konto gelegt.

Die Zugangsdaten lauten wie folgt: (Die Angaben in kursiver Schrift sind durch die jeweiligen Einträge zu ersetzen)

Hostname: Domainname
Benutzername: Kontoname / E-Mail-Adresse
Passwort: das gewählte Passwort', diff --git a/lng/en.lng.php b/lng/en.lng.php index 7d9f328a..76b51137 100644 --- a/lng/en.lng.php +++ b/lng/en.lng.php @@ -975,6 +975,7 @@ return [ 'dkimenabled' => 'DKIM enabled', 'openbasedirenabled' => 'Openbasedir restiction', 'hsts' => 'HSTS enabled', + 'aliasdomainid' => 'ID of alias domain', ], 'emails' => [ 'description' => 'Here you can create and change your email addresses.
An account is like your letterbox in front of your house. If someone sends you an email, it will be dropped into the account.

To download your emails use the following settings in your mailprogram: (The data in italics has to be changed to the equivalents you typed in!)
Hostname: domainname
Username: account name / e-mail address
password: the password you\'ve chosen',