HSAdmin Backend Domains, E-Mail, Datenbanken
Peter Hormanns
2019-10-23 90d6ce1b6fc58e3e41c811890614a3ac67df9001
fix error user -> username
1 files modified
47 ■■■■ changed files
hsarback/src/de/hsadmin/mods/dom/DomainProcessorFactory.java 47 ●●●● patch | view | raw | blame | history
hsarback/src/de/hsadmin/mods/dom/DomainProcessorFactory.java
@@ -350,34 +350,37 @@
    }
    private Processor createApacheVHostDeleteProcessor(Domain dom) {
        final String domName = dom.getName();
        final int level = domName.split("\\.").length;
        final String domname = dom.getName();
        final int level = domname.split("\\.").length;
        final String linkPrefix = Integer.toString(100 - level);
        final UnixUser user = dom.getUser();
        final String homedir = user.getHomedir();
        if (dom.isPacDomain()) {
            final String username = user.getName();
            return 
                new ShellProcessor("rm -f /home/doms/" + domName +
                        " && rm -f /etc/apache2/sites-enabled/" + linkPrefix + "-" + domName +
                        " && rm -f /etc/apache2/sites-available/" + domName +
                        " && rm -f /etc/apache2/pems-enabled/" + domName + ".crt" +
                        " && rm -f /etc/apache2/pems-enabled/" + domName + ".key" +
                        " && rm -f /etc/apache2/pems-enabled/" + domName + ".chain" +
                        " && rm -f /etc/apache2/pems-generated/" + domName + ".crt" +
                        " && rm -f /etc/apache2/pems-generated/" + domName + ".key" +
                        " && rm -f /etc/apache2/pems-generated/" + domName + ".chain" +
                        " && chown -R " + dom.getUser() + ":" + dom.getUser() + " " + dom.getUser().getHomedir() + "/doms/" + domName +
                new ShellProcessor("rm -f /home/doms/" + domname +
                        " && rm -f /etc/apache2/sites-enabled/" + linkPrefix + "-" + domname +
                        " && rm -f /etc/apache2/sites-available/" + domname +
                        " && rm -f /etc/apache2/pems-enabled/" + domname + ".crt" +
                        " && rm -f /etc/apache2/pems-enabled/" + domname + ".key" +
                        " && rm -f /etc/apache2/pems-enabled/" + domname + ".chain" +
                        " && rm -f /etc/apache2/pems-generated/" + domname + ".crt" +
                        " && rm -f /etc/apache2/pems-generated/" + domname + ".key" +
                        " && rm -f /etc/apache2/pems-generated/" + domname + ".chain" +
                        " && chown -R " + username + ":" + username + " " + homedir + "/doms/" + domname +
                        " && invoke-rc.d apache2 reload >/dev/null 2>&1");
        }
        return
            new ShellProcessor("rm -f /home/doms/" + domName +
                " && rm -f /etc/apache2/sites-enabled/" + linkPrefix + "-" + domName +
                " && rm -f /etc/apache2/sites-available/" + domName +
                " && rm -f /etc/apache2/pems-enabled/" + domName + ".crt" +
                " && rm -f /etc/apache2/pems-enabled/" + domName + ".key" +
                " && rm -f /etc/apache2/pems-enabled/" + domName + ".chain" +
                " && rm -f /etc/apache2/pems-generated/" + domName + ".crt" +
                " && rm -f /etc/apache2/pems-generated/" + domName + ".key" +
                " && rm -f /etc/apache2/pems-generated/" + domName + ".chain" +
                " && rm -rf " + dom.getUser().getHomedir() + "/doms/" + domName +
            new ShellProcessor("rm -f /home/doms/" + domname +
                " && rm -f /etc/apache2/sites-enabled/" + linkPrefix + "-" + domname +
                " && rm -f /etc/apache2/sites-available/" + domname +
                " && rm -f /etc/apache2/pems-enabled/" + domname + ".crt" +
                " && rm -f /etc/apache2/pems-enabled/" + domname + ".key" +
                " && rm -f /etc/apache2/pems-enabled/" + domname + ".chain" +
                " && rm -f /etc/apache2/pems-generated/" + domname + ".crt" +
                " && rm -f /etc/apache2/pems-generated/" + domname + ".key" +
                " && rm -f /etc/apache2/pems-generated/" + domname + ".chain" +
                " && rm -rf " + homedir + "/doms/" + domname +
                " && invoke-rc.d apache2 reload >/dev/null 2>&1");
    }