From 3b0e29d5ae146172f7326681df2b6b77e41546eb Mon Sep 17 00:00:00 2001 From: Peter Hormanns Date: Wed, 21 Jun 2017 20:39:45 +0200 Subject: [PATCH] prepare letsencrypt feature --- .../de/hsadmin/web/DomainOptionsEditor.java | 4 ++-- .../de/hsadmin/web/EntryPointsSelector.java | 17 ++++++++++++++++- .../resources/de/hsadmin/web/main.properties | 3 +++ .../resources/de/hsadmin/web/main_de.properties | 3 +++ 4 files changed, 24 insertions(+), 3 deletions(-) diff --git a/web/src/main/java/de/hsadmin/web/DomainOptionsEditor.java b/web/src/main/java/de/hsadmin/web/DomainOptionsEditor.java index a422a4a..7b37388 100644 --- a/web/src/main/java/de/hsadmin/web/DomainOptionsEditor.java +++ b/web/src/main/java/de/hsadmin/web/DomainOptionsEditor.java @@ -16,9 +16,9 @@ import de.hsadmin.rpc.PropertyInfo; public class DomainOptionsEditor extends CustomComponent implements IHSEditor { - private static final long serialVersionUID = 1L; + private static final long serialVersionUID = 2L; - private static final String[] OPTIONS = new String[] { "greylisting", "multiviews", "indexes", "htdocsfallback", "includes", "backupmxforexternalmx" }; + private static final String[] OPTIONS = new String[] { "greylisting", "multiviews", "indexes", "htdocsfallback", "includes", "backupmxforexternalmx", "letsencrypt" }; private final PropertyInfo propertyInfo; private final VerticalLayout layout; diff --git a/web/src/main/java/de/hsadmin/web/EntryPointsSelector.java b/web/src/main/java/de/hsadmin/web/EntryPointsSelector.java index 88beae3..db7918f 100644 --- a/web/src/main/java/de/hsadmin/web/EntryPointsSelector.java +++ b/web/src/main/java/de/hsadmin/web/EntryPointsSelector.java @@ -16,6 +16,7 @@ import com.vaadin.ui.TabSheet.SelectedTabChangeEvent; import com.vaadin.ui.TabSheet.SelectedTabChangeListener; import com.vaadin.ui.Table; +import de.hsadmin.login.Role; import de.hsadmin.model.IRemote; import de.hsadmin.model.TicketService; import de.hsadmin.rpc.RpcException; @@ -64,12 +65,26 @@ public class EntryPointsSelector extends CustomComponent implements ItemClickLis final String serviceTicket = ticketService.getServiceTicket(grantingTicket); try { final List> list = rolesProxy.search(user, serviceTicket, new HashMap()); - return (String) list.get(0).get("role"); + final String remoteRole = (String) list.get(0).get("role"); + return fixRole(remoteRole); } catch (XmlRpcException e) { throw new RpcException(e); } } + private String fixRole(String remoteRole) { + if ("HOSTMASTER".equals(remoteRole)) { + return Role.SYSTEM.name(); + } + if ("PAC_ADMIN_DW".equals(remoteRole)) { + return Role.PACKET.name(); + } + if ("DOM_ADMIN".equals(remoteRole)) { + return Role.DOMAIN.name(); + } + return remoteRole; + } + @Override public void itemClick(ItemClickEvent event) { Table table = (Table) event.getSource(); diff --git a/web/src/main/resources/de/hsadmin/web/main.properties b/web/src/main/resources/de/hsadmin/web/main.properties index be469bf..d183aa8 100644 --- a/web/src/main/resources/de/hsadmin/web/main.properties +++ b/web/src/main/resources/de/hsadmin/web/main.properties @@ -32,12 +32,14 @@ domain.user=Domain User domain.since=Domain since domain.dnsMaster=DNS master domain.domainoptions=Domain options +domain.validsubdomainnames=valid subdomain names domainoption.greylisting=greylisting domainoption.multiviews=multiviews domainoption.indexes=indexes domainoption.htdocsfallback=htdocsfallback domainoption.includes=includes domainoption.backupmxforexternalmx=backupmxforexternalmx +domainoption.letsencrypt=letsencrypt mysqluser.name=MySql username mysqluser.instance=MySql instance mysqluser.pac=MySql package @@ -89,6 +91,7 @@ quota_softlimit=Quota soft limit quota_hardlimit=Quota hard limit target=Target owner=Owner +validsubdomainnames=valid subdomain names encoding=Encoding localpart=Local part subdomain=Subdomain diff --git a/web/src/main/resources/de/hsadmin/web/main_de.properties b/web/src/main/resources/de/hsadmin/web/main_de.properties index 8ed70ac..e69f622 100644 --- a/web/src/main/resources/de/hsadmin/web/main_de.properties +++ b/web/src/main/resources/de/hsadmin/web/main_de.properties @@ -32,12 +32,14 @@ domain.user=Domain-Administrator domain.since=eingerichtet am domain.dnsMaster=DNS Server domain.domainoptions=Domain-Optionen +domain.validsubdomainnames=gültige Subdomain (oder * für Wildcard) domainoption.greylisting=Greylisting domainoption.multiviews=Multiviews domainoption.indexes=Indexes domainoption.htdocsfallback=htdocsfallback domainoption.includes=Includes domainoption.backupmxforexternalmx=Backupmx for external MX +domainoption.letsencrypt=Lets Encrypt Zertifikat mysqluser.name=MySql User mysqluser.instance=Datenbank-System mysqluser.pac=Web-Paket @@ -88,6 +90,7 @@ quota_softlimit=Quota (Soft-Limit) quota_hardlimit=Quota (Hard-Limit) target=Postfach/Weiterleitung owner=Domain-Administrator +validsubdomainnames=gültige Subdomain encoding=Zeichen-Kodierung localpart=lokaler Teil subdomain=Subdomain