honor caneditdomain flag correctly; corrected error messages; updated external URLs

Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
This commit is contained in:
Michael Kaufmann
2022-11-20 12:22:03 +01:00
parent eb13796976
commit 777991e0e3
6 changed files with 37 additions and 26 deletions

View File

@@ -223,6 +223,11 @@ if ($page == 'overview' || $page == 'domains') {
$result = json_decode($json_result, true)['data'];
if (isset($result['customerid']) && $result['customerid'] == $userinfo['customerid']) {
if ((int) $result['caneditdomain'] == 0) {
Response::standardError('domaincannotbeedited', $result['domain']);
}
if (isset($_POST['send']) && $_POST['send'] == 'send') {
try {
SubDomains::getLocal($userinfo, $_POST)->update();

View File

@@ -630,6 +630,10 @@ class SubDomains extends ApiCommand implements ResourceEntity
]);
$id = $result['id'];
if ($this->isAdmin() == false && (int)$result['caneditdomain'] == 0) {
throw new Exception(lng('error.domaincannotbeedited', [$result['domain']]), 406);
}
// parameters
$aliasdomain = $this->getParam('alias', true, 0);
$path = $this->getParam('path', true, $result['documentroot']);

View File

@@ -149,13 +149,6 @@ return [
'select_var' => $serveraliasoptions,
'selected' => Settings::Get('system.domaindefaultalias')
],
'speciallogfile' => [
'label' => lng('admin.speciallogfile.title'),
'desc' => lng('admin.speciallogfile.description'),
'type' => 'checkbox',
'value' => '1',
'checked' => false
],
'specialsettings' => [
'visible' => $userinfo['change_serversettings'] == '1',
'label' => lng('admin.ownvhostsettings'),
@@ -185,7 +178,14 @@ return [
'type' => 'checkbox',
'value' => '1',
'checked' => true
]
],
'speciallogfile' => [
'label' => lng('admin.speciallogfile.title'),
'desc' => lng('admin.speciallogfile.description'),
'type' => 'checkbox',
'value' => '1',
'checked' => false
],
]
],
'section_bssl' => [

View File

@@ -163,17 +163,6 @@ return [
'select_var' => $serveraliasoptions,
'selected' => $result['iswildcarddomain'] == '1' ? 0 : ($result['wwwserveralias'] == '1' ? 1 : 2)
],
'speciallogfile' => [
'label' => lng('admin.speciallogfile.title'),
'desc' => lng('admin.speciallogfile.description'),
'type' => 'checkbox',
'value' => '1',
'checked' => $result['speciallogfile']
],
'speciallogverified' => [
'type' => 'hidden',
'value' => '0'
],
'specialsettings' => [
'visible' => $userinfo['change_serversettings'] == '1',
'label' => lng('admin.ownvhostsettings'),
@@ -212,7 +201,18 @@ return [
'type' => 'checkbox',
'value' => '1',
'checked' => $result['writeerrorlog']
]
],
'speciallogfile' => [
'label' => lng('admin.speciallogfile.title'),
'desc' => lng('admin.speciallogfile.description'),
'type' => 'checkbox',
'value' => '1',
'checked' => $result['speciallogfile']
],
'speciallogverified' => [
'type' => 'hidden',
'value' => '0'
],
]
],
'section_bssl' => [

View File

@@ -421,8 +421,8 @@ return [
'description' => 'Die optionale "includeSubDomains" Direktive, wenn vorhanden, signalisiert dem UA, dass die HSTS Regel für diese Domain und auch jede Subdomain dieser gilt.',
],
'domain_hsts_preload' => [
'title' => 'Füge Domain in die <a href="https://hstspreload.appspot.com/" target="_blank">HSTS preload Liste</a> hinzu',
'description' => 'Wenn die Domain in die HSTS preload Liste, verwaltet von Chrome (und genutzt von Firefox und Safari), hinzugefügt werden soll, dann aktivieren Sie diese Einstellung.<br>Die preload-Direktive zu senden kann PERMANTENTE KONSEQUENZEN haben und dazu führen, dass Benutzer auf diese Domain und auch Subdomains nicht zugreifen können.<br>Beachten Sie die Details unter <a href="https://hstspreload.appspot.com/#removal" target="_blank">hstspreload.appspot.com/#removal</a> bevor ein Header mit "preload" gesendet wird.',
'title' => 'Füge Domain in die <a href="https://hstspreload.org/" target="_blank">HSTS preload Liste</a> hinzu',
'description' => 'Wenn die Domain in die HSTS preload Liste, verwaltet von Chrome (und genutzt von Firefox und Safari), hinzugefügt werden soll, dann aktivieren Sie diese Einstellung.<br>Die preload-Direktive zu senden kann PERMANTENTE KONSEQUENZEN haben und dazu führen, dass Benutzer auf diese Domain und auch Subdomains nicht zugreifen können.<br>Beachten Sie die Details unter <a href="https://hstspreload.org/#removal" target="_blank">https://hstspreload.org/#removal</a> bevor ein Header mit "preload" gesendet wird.',
],
'domain_ocsp_stapling' => [
'title' => 'OCSP stapling',
@@ -724,7 +724,7 @@ return [
'directorymustexist' => 'Das Verzeichnis "%s" muss existieren. Legen Sie es bitte mit Ihrem FTP-Programm an.',
'filemustexist' => 'Die Datei "%s" muss existieren.',
'allresourcesused' => 'Sie haben bereits alle Ihnen zur Verfügung stehenden Ressourcen verbraucht.',
'domains_cantdeletemaindomain' => 'Sie können keine Domain, die als E-Mail-Domain verwendet wird, löschen. ',
'domains_cantdeletemaindomain' => 'Sie können keine zugewiesene Domain löschen. ',
'domains_canteditdomain' => 'Sie können diese Domain nicht bearbeiten. Dies wurde durch den Admin verweigert.',
'domains_cantdeletedomainwithemail' => 'Sie können keine Domain löschen, die noch als E-Mail-Domain verwendet wird. Löschen Sie zuerst alle E-Mail-Adressen dieser Domain.',
'firstdeleteallsubdomains' => 'Sie müssen zuerst alle Subdomains löschen, bevor Sie eine Wildcarddomain anlegen können.',
@@ -914,6 +914,7 @@ return [
'notallowedphpconfigused' => 'Nutzung einer PHP-Konfiguration welche nicht dem Kunden zugeordnet ist',
'pathmustberelative' => 'Der Benutzer hat nicht die benötigten Berechtigungen, um Pfade außerhalb des Kunden-Heimatverzeichnisses anzugeben. Bitte einen relativen Pfad angeben (kein führendes /).',
'mysqlserverstillhasdbs' => 'Datenbank-Server kann für den Kunden nicht entfernt werden, da sich dort noch Datenbanken befinden.',
'domaincannotbeedited' => 'Keine Berechtigung, um die Domain %s zu bearbeiten',
],
'extras' => [
'description' => 'Hier können Sie zusätzliche Extras einrichten, wie zum Beispiel einen Verzeichnisschutz.<br />Die Änderungen sind erst nach einer kurzen Zeit wirksam.',

View File

@@ -428,8 +428,8 @@ return [
'description' => 'The optional "includeSubDomains" directive, if present, signals the UA that the HSTS Policy applies to this HSTS Host as well as any subdomains of the host\'s domain name.',
],
'domain_hsts_preload' => [
'title' => 'Include domain in <a href="https://hstspreload.appspot.com/" target="_blank">HSTS preload list</a>',
'description' => 'If you would like this domain to be included in the HSTS preload list maintained by Chrome (and used by Firefox and Safari), then use activate this.<br>Sending the preload directive from your site can have PERMANENT CONSEQUENCES and prevent users from accessing your site and any of its subdomains.<br>Please read the details at <a href="https://hstspreload.appspot.com/#removal" target="_blank">hstspreload.appspot.com/#removal</a> before sending the header with "preload".',
'title' => 'Include domain in <a href="https://hstspreload.org/" target="_blank">HSTS preload list</a>',
'description' => 'If you would like this domain to be included in the HSTS preload list maintained by Chrome (and used by Firefox and Safari), then use activate this.<br>Sending the preload directive from your site can have PERMANENT CONSEQUENCES and prevent users from accessing your site and any of its subdomains.<br>Please read the details at <a href="https://hstspreload.org/#removal" target="_blank">https://hstspreload.org/#removal</a> before sending the header with "preload".',
],
'domain_ocsp_stapling' => [
'title' => 'OCSP stapling',
@@ -788,7 +788,7 @@ return [
'directorymustexist' => 'The directory %s must exist. Please create it with your FTP client.',
'filemustexist' => 'The file %s must exist.',
'allresourcesused' => 'You have already used all of your resources.',
'domains_cantdeletemaindomain' => 'You cannot delete a domain which is used as an email-domain.',
'domains_cantdeletemaindomain' => 'You cannot delete an assigned domain.',
'domains_canteditdomain' => 'You cannot edit this domain. It has been disabled by the admin.',
'domains_cantdeletedomainwithemail' => 'You cannot delete a domain which is used as an email-domain. Delete all email addresses first.',
'firstdeleteallsubdomains' => 'You have to delete all subdomains first before you can create a wildcard domain.',
@@ -981,6 +981,7 @@ return [
'notallowedphpconfigused' => 'Trying to use php-config which is not assigned to customer',
'pathmustberelative' => 'The user does not have the permission to specify directories outside the customers home-directory. Please specify a relative path (no leading /).',
'mysqlserverstillhasdbs' => 'Cannot remove database server from customers allow-list as there are still databases on it.',
'domaincannotbeedited' => 'You are not permitted to edit the domain %s',
],
'extras' => [
'description' => 'Here you can add some extras, for example directory protection.<br />The system will need some time to apply the new settings after every change.',