keine E-Mail fuer neues Paket, Passwort 17 Zeichen

This commit is contained in:
Peter Hormanns 2012-06-25 11:06:58 +00:00
parent 8db019e5eb
commit 88dff73e4a
2 changed files with 22 additions and 22 deletions

View File

@ -18,7 +18,7 @@ public class PasswordTool {
} }
public static String generatePassword() { public static String generatePassword() {
String password = PwGenerator.generatePassword(7, flagBuilder.build(), 100, random); String password = PwGenerator.generatePassword(17, flagBuilder.build(), 100, random);
return password; return password;
} }

View File

@ -11,7 +11,7 @@ import javax.persistence.EntityManager;
import de.hsadmin.core.model.AbstractEntity; import de.hsadmin.core.model.AbstractEntity;
import de.hsadmin.core.qserv.CompoundProcessor; import de.hsadmin.core.qserv.CompoundProcessor;
import de.hsadmin.core.qserv.EntityProcessorFactory; import de.hsadmin.core.qserv.EntityProcessorFactory;
import de.hsadmin.core.qserv.MailerProcessor; //import de.hsadmin.core.qserv.MailerProcessor;
import de.hsadmin.core.qserv.Processor; import de.hsadmin.core.qserv.Processor;
import de.hsadmin.core.qserv.ProcessorException; import de.hsadmin.core.qserv.ProcessorException;
import de.hsadmin.core.qserv.ShellProcessor; import de.hsadmin.core.qserv.ShellProcessor;
@ -28,13 +28,13 @@ public class PacProcessorFactory implements EntityProcessorFactory {
EntityManager em, T entity) throws ProcessorException { EntityManager em, T entity) throws ProcessorException {
Pac pac = (Pac) entity; Pac pac = (Pac) entity;
String pacName = pac.getName(); String pacName = pac.getName();
String customerEMail = pac.getCustomer().getContractualContact().getEmail(); // String customerEMail = pac.getCustomer().getContractualContact().getEmail();
Hive hive = pac.getHive(); Hive hive = pac.getHive();
UnixUser unixUser = getPacAdminUser(pac); UnixUser unixUser = getPacAdminUser(pac);
String password = PasswordTool.generatePassword(); String password = PasswordTool.generatePassword();
Map<String, String> hiveValues = fillHiveValues(hive); Map<String, String> hiveValues = fillHiveValues(hive);
List<Map<String, String>> pacValuesList = fillPacValuesList(hive, null); List<Map<String, String>> pacValuesList = fillPacValuesList(hive, null);
Map<String, String> emailVars = fillEMailValues(pacName, customerEMail, password); // Map<String, String> emailVars = fillEMailValues(pacName, customerEMail, password);
Processor priProcessor = new CompoundProcessor( Processor priProcessor = new CompoundProcessor(
createAddUserProc(pacName, unixUser, password), createAddUserProc(pacName, unixUser, password),
createSetQuotaProc(pac), createSetQuotaProc(pac),
@ -46,7 +46,7 @@ public class PacProcessorFactory implements EntityProcessorFactory {
createMakePacDirectoryStructure(unixUser), createMakePacDirectoryStructure(unixUser),
createIfUp(pacName)); createIfUp(pacName));
WaitingTasksProcessor secProcessor = new WaitingTasksProcessor(priProcessor); WaitingTasksProcessor secProcessor = new WaitingTasksProcessor(priProcessor);
secProcessor.appendProcessor(pac.getHiveName(), createSendEMailProc(pacName, customerEMail, emailVars), "send email to customer"); // secProcessor.appendProcessor(pac.getHiveName(), createSendEMailProc(pacName, customerEMail, emailVars), "send email to customer");
return secProcessor; return secProcessor;
} }
@ -151,15 +151,15 @@ public class PacProcessorFactory implements EntityProcessorFactory {
); );
} }
private Processor createSendEMailProc(String pacName, // private Processor createSendEMailProc(String pacName,
String customerEMail, Map<String, String> emailVars) throws ProcessorException { // String customerEMail, Map<String, String> emailVars) throws ProcessorException {
return new MailerProcessor( // return new MailerProcessor(
customerEMail, // customerEMail,
"Zugangsdaten des neue Hostsharing Pakets " + pacName, // "Zugangsdaten des neue Hostsharing Pakets " + pacName,
"/de/hsadmin/mods/pac/email_new_pac_account.jtpl", // "/de/hsadmin/mods/pac/email_new_pac_account.jtpl",
emailVars // emailVars
); // );
} // }
private Processor createIfUp(String pacName) { private Processor createIfUp(String pacName) {
return new ShellProcessor("ifup eth0:" + pacName); return new ShellProcessor("ifup eth0:" + pacName);
@ -207,13 +207,13 @@ public class PacProcessorFactory implements EntityProcessorFactory {
return pacValuesList; return pacValuesList;
} }
private Map<String, String> fillEMailValues(String pacName, // private Map<String, String> fillEMailValues(String pacName,
String customerEMail, String password) { // String customerEMail, String password) {
Map<String, String> emailVars = new HashMap<String, String>(); // Map<String, String> emailVars = new HashMap<String, String>();
emailVars.put("PAC", pacName); // emailVars.put("PAC", pacName);
emailVars.put("PASSWORD", password); // emailVars.put("PASSWORD", password);
emailVars.put("CUST_EMAIL", customerEMail); // emailVars.put("CUST_EMAIL", customerEMail);
return emailVars; // return emailVars;
} // }
} }