HSAdmin Backend Domains, E-Mail, Datenbanken
Peter Hormanns
2017-06-21 0e59e02ef0f50101657be724c16a6d38491731de
rename subdomains column
4 files modified
26 ■■■■■ changed files
hsarback/database/database_update.sql 4 ●●●● patch | view | raw | blame | history
hsarback/src/de/hsadmin/mods/dom/Domain.java 12 ●●●● patch | view | raw | blame | history
hsarback/src/de/hsadmin/mods/dom/DomainModuleImpl.java 4 ●●●● patch | view | raw | blame | history
hsarback/src/de/hsadmin/remote/DomainRemote.java 6 ●●●●● patch | view | raw | blame | history
hsarback/database/database_update.sql
@@ -2,10 +2,10 @@
    VALUES ('letsencrypt');
ALTER TABLE domain 
    ADD COLUMN cert_dns_alt_names CHARACTER VARYING(512);
    ADD COLUMN valid_subdomain_names CHARACTER VARYING(512);
UPDATE domain 
    SET cert_dns_alt_names = domain_name || ',www.' || domain_name ;
    SET valid_subdomain_names = '*' ;
INSERT INTO contactrole_ref (contact_id, role) 
    ( SELECT contact_id, 'voting-right' FROM contact );
hsarback/src/de/hsadmin/mods/dom/Domain.java
@@ -62,8 +62,8 @@
        inverseJoinColumns={@JoinColumn(name="domain_option_id", referencedColumnName="domain_option_id")})
    private Set<DomainOption> domainoptions;
    @Column(name = "cert_dns_alt_names", columnDefinition = "character varying(512)")
    private String certDNSAltNames;
    @Column(name = "valid_subdomain_names", columnDefinition = "character varying(512)")
    private String validSubdomainNames;
    
    public Domain() {
    }
@@ -182,12 +182,12 @@
        this.domainoptions = domainOptions;
    }
    public String getCertDNSAltNames() {
        return certDNSAltNames;
    public String getValidSubdomainNames() {
        return validSubdomainNames;
    }
    public void setCertDNSAltNames(String certDNSAltNames) {
        this.certDNSAltNames = certDNSAltNames;
    public void setValidSubdomainNames(String validSubdomainNames) {
        this.validSubdomainNames = validSubdomainNames;
    }
}
hsarback/src/de/hsadmin/mods/dom/DomainModuleImpl.java
@@ -181,8 +181,8 @@
            }
            dom.setDomainoptions(domainOptions);
        }
        if (dom.getCertDNSAltNames() == null) {
            dom.setCertDNSAltNames(domName + ",www." + domName);
        if (dom.getValidSubdomainNames() == null) {
            dom.setValidSubdomainNames("www");
        }
        if (dom.isPacDomain()) {
            em.persist(new EMailAddress("owner", "", dom, dom.getUser().getPac().getCustomer().getName().substring(6) + "@hostsharing.net"));
hsarback/src/de/hsadmin/remote/DomainRemote.java
@@ -47,6 +47,8 @@
                domainOptionsList.add(opt.getName());
            }
        }
        final String validsubdomains = dom.getValidSubdomainNames();
        resultMap.put("validsubdomains", validsubdomains);
    }
    @Override
@@ -73,6 +75,10 @@
            }
            dom.setDomainoptions(domainOptionsSet);
        }
        final Object validsubdomains = setParams.get("validsubdomains");
        if (validsubdomains != null && validsubdomains instanceof String) {
            dom.setValidSubdomainNames((String) validsubdomains);
        }
    }
    @Override