diff --git a/customer_domains.php b/customer_domains.php
index 933edd13..45348e2f 100644
--- a/customer_domains.php
+++ b/customer_domains.php
@@ -51,7 +51,7 @@ $id = (int)Request::any('id');
if ($page == 'overview' || $page == 'domains') {
if ($action == '') {
- $log->logAction(FroxlorLogger::USR_ACTION, LOG_NOTICE, "viewed customer_domains::domains");
+ $log->logAction(FroxlorLogger::USR_ACTION, LOG_INFO, "viewed customer_domains::domains");
$parentdomain_id = (int)Request::any('pid', '0');
@@ -73,10 +73,17 @@ if ($page == 'overview' || $page == 'domains') {
];
}
- UI::view('user/table.html.twig', [
+ $table_tpl = 'table.html.twig';
+ if ($collection->count() == 0) {
+ $table_tpl = 'table-note.html.twig';
+ }
+ UI::view('user/' . $table_tpl, [
'listing' => Listing::format($collection, $domain_list_data, 'domain_list'),
'actions_links' => $actions_links,
- 'entity_info' => lng('domains.description')
+ 'entity_info' => lng('domains.description'),
+ // alert-box
+ 'type' => 'warning',
+ 'alert_msg' => lng('domains.nodomainsassignedbyadmin')
]);
} elseif ($action == 'delete' && $id != 0) {
try {
@@ -139,6 +146,14 @@ if ($page == 'overview' || $page == 'domains') {
$domains[$row['domain']] = $idna_convert->decode($row['domain']);
}
+ // check of there are any domains to be used
+ if (count($domains) <= 0) {
+ // no, possible direct URL access, redirect to overview
+ Response::redirectTo($filename, [
+ 'page' => $page
+ ]);
+ }
+
$aliasdomains[0] = lng('domains.noaliasdomain');
$domains_stmt = Database::prepare("SELECT `d`.`id`, `d`.`domain` FROM `" . TABLE_PANEL_DOMAINS . "` `d`, `" . TABLE_PANEL_CUSTOMERS . "` `c`
WHERE `d`.`aliasdomain` IS NULL
diff --git a/customer_email.php b/customer_email.php
index a9944734..ca311caa 100644
--- a/customer_email.php
+++ b/customer_email.php
@@ -84,7 +84,7 @@ if ($page == 'overview' || $page == 'emails') {
if ($page == 'email_domain') {
$email_domainid = Request::any('domainid', 0);
if ($action == '') {
- $log->logAction(FroxlorLogger::USR_ACTION, LOG_NOTICE, "viewed customer_email::emails");
+ $log->logAction(FroxlorLogger::USR_ACTION, LOG_INFO, "viewed customer_email::emails");
$sql_search = [];
if ($email_domainid > 0) {
diff --git a/lib/Froxlor/Api/ApiCommand.php b/lib/Froxlor/Api/ApiCommand.php
index 210d28ac..327a1b4d 100644
--- a/lib/Froxlor/Api/ApiCommand.php
+++ b/lib/Froxlor/Api/ApiCommand.php
@@ -272,7 +272,8 @@ abstract class ApiCommand extends ApiParameter
$ops = [
'<',
'>',
- '='
+ '=',
+ '<>'
];
$first = true;
foreach ($search as $field => $valoper) {
diff --git a/lib/Froxlor/Cron/Http/Php/Fpm.php b/lib/Froxlor/Cron/Http/Php/Fpm.php
index 1cf84901..3c96fe1b 100644
--- a/lib/Froxlor/Cron/Http/Php/Fpm.php
+++ b/lib/Froxlor/Cron/Http/Php/Fpm.php
@@ -289,7 +289,7 @@ pm.max_children = 1
}
}
- // now check if 'sendmail_path' has not beed set in the custom-php.ini
+ // now check if 'sendmail_path' has not been set in the custom-php.ini
// if not we use our fallback-default as usual
if (strpos($fpm_config, 'php_admin_value[sendmail_path]') === false) {
$fpm_config .= 'php_admin_value[sendmail_path] = /usr/sbin/sendmail -t -i -f ' . $this->domain['email'] . "\n";
diff --git a/lib/Froxlor/CurrentUser.php b/lib/Froxlor/CurrentUser.php
index 22a62082..6c814b47 100644
--- a/lib/Froxlor/CurrentUser.php
+++ b/lib/Froxlor/CurrentUser.php
@@ -25,10 +25,10 @@
namespace Froxlor;
-use Froxlor\Database\Database;
-use Froxlor\UI\Collection;
use Froxlor\Api\Commands\Customers;
use Froxlor\Api\Commands\SubDomains;
+use Froxlor\Database\Database;
+use Froxlor\UI\Collection;
/**
* Class to manage the current user / session
@@ -151,15 +151,21 @@ class CurrentUser
]);
$addition = $result['emaildomains'] != 0;
} elseif ($resource == 'subdomains') {
- $parentDomainCollection = (new Collection(SubDomains::class, $_SESSION['userinfo'],
- ['sql_search' => ['d.parentdomainid' => 0]]));
- $addition = $parentDomainCollection != 0;
+ $parentDomainCollection = (new Collection(
+ SubDomains::class,
+ $_SESSION['userinfo'],
+ ['sql_search' => [
+ 'd.parentdomainid' => 0,
+ 'd.id' => ['op' => '<>', 'value' => $_SESSION['userinfo']['standardsubdomain']]
+ ]
+ ]
+ ));
+ $addition = $parentDomainCollection->count() != 0;
} elseif ($resource == 'domains') {
$customerCollection = (new Collection(Customers::class, $_SESSION['userinfo']));
- $addition = $customerCollection != 0;
+ $addition = $customerCollection->count() != 0;
}
return ($_SESSION['userinfo'][$resource . '_used'] < $_SESSION['userinfo'][$resource] || $_SESSION['userinfo'][$resource] == '-1') && $addition;
}
-
}
diff --git a/lng/de.lng.php b/lng/de.lng.php
index 616f92aa..0c6e3353 100644
--- a/lng/de.lng.php
+++ b/lng/de.lng.php
@@ -699,6 +699,7 @@ return [
'openbasedirenabled' => 'Openbasedir Einschränkung',
'hsts' => 'HSTS aktiviert',
'aliasdomainid' => 'ID der Alias-Domain',
+ 'nodomainsassignedbyadmin' => 'Diesem Account wurde noch keine Domain zugewiesen. Bitte kontaktiere deinen Administrator, wenn du der Meinung bist, das ist nicht korrekt.',
],
'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 45925fc2..51f8f784 100644
--- a/lng/en.lng.php
+++ b/lng/en.lng.php
@@ -765,6 +765,7 @@ return [
'openbasedirenabled' => 'Openbasedir restiction',
'hsts' => 'HSTS enabled',
'aliasdomainid' => 'ID of alias domain',
+ 'nodomainsassignedbyadmin' => 'Your account has currently no domains assigned to it. Please contact your administrator if you think this is wrong.',
],
'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',
diff --git a/templates/Froxlor/user/table.html.twig b/templates/Froxlor/user/table.html.twig
index 5ca36e4f..fac9e0d6 100644
--- a/templates/Froxlor/user/table.html.twig
+++ b/templates/Froxlor/user/table.html.twig
@@ -35,7 +35,7 @@
{% for link in actions_links %}
- {{ link.label }}
+ {% if link.label is defined and link.label is not empty %}{{ link.label }}{% endif %}
{% endfor %}
{% endif %}