From 88dff73e4a4433a0dc2aea6ccc619e25708137ea Mon Sep 17 00:00:00 2001
From: Peter Hormanns <peter.hormanns@hostsharing.net>
Date: Mon, 25 Jun 2012 13:06:58 +0200
Subject: [PATCH] keine E-Mail fuer neues Paket, Passwort 17 Zeichen

---
 hsarback/src/de/hsadmin/mods/pac/PacProcessorFactory.java |   42 +++++++++++++++++++++---------------------
 hsarback/src/de/hsadmin/core/util/PasswordTool.java       |    2 +-
 2 files changed, 22 insertions(+), 22 deletions(-)

diff --git a/hsarback/src/de/hsadmin/core/util/PasswordTool.java b/hsarback/src/de/hsadmin/core/util/PasswordTool.java
index 7cb7cc0..004b07d 100644
--- a/hsarback/src/de/hsadmin/core/util/PasswordTool.java
+++ b/hsarback/src/de/hsadmin/core/util/PasswordTool.java
@@ -18,7 +18,7 @@
 	}
 	
 	public static String generatePassword() {
-		String password = PwGenerator.generatePassword(7, flagBuilder.build(), 100, random);
+		String password = PwGenerator.generatePassword(17, flagBuilder.build(), 100, random);
 		return password;
 	}
 
diff --git a/hsarback/src/de/hsadmin/mods/pac/PacProcessorFactory.java b/hsarback/src/de/hsadmin/mods/pac/PacProcessorFactory.java
index 16e4399..9ded029 100644
--- a/hsarback/src/de/hsadmin/mods/pac/PacProcessorFactory.java
+++ b/hsarback/src/de/hsadmin/mods/pac/PacProcessorFactory.java
@@ -11,7 +11,7 @@
 import de.hsadmin.core.model.AbstractEntity;
 import de.hsadmin.core.qserv.CompoundProcessor;
 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.ProcessorException;
 import de.hsadmin.core.qserv.ShellProcessor;
@@ -28,13 +28,13 @@
 			EntityManager em, T entity) throws ProcessorException {
 		Pac pac = (Pac) entity;
 		String pacName = pac.getName();
-		String customerEMail = pac.getCustomer().getContractualContact().getEmail();
+//		String customerEMail = pac.getCustomer().getContractualContact().getEmail();
 		Hive hive = pac.getHive();
 		UnixUser unixUser = getPacAdminUser(pac);
 		String password = PasswordTool.generatePassword();
 		Map<String, String> hiveValues = fillHiveValues(hive);
 		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(
 				createAddUserProc(pacName, unixUser, password), 
 				createSetQuotaProc(pac),
@@ -46,7 +46,7 @@
 				createMakePacDirectoryStructure(unixUser),
 				createIfUp(pacName));
 		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;
 	}
 
@@ -151,15 +151,15 @@
 				);
 	}
 
-	private Processor createSendEMailProc(String pacName,
-			String customerEMail, Map<String, String> emailVars) throws ProcessorException {
-		return new MailerProcessor(
-						customerEMail, 
-						"Zugangsdaten des neue Hostsharing Pakets " + pacName,
-						"/de/hsadmin/mods/pac/email_new_pac_account.jtpl",
-						emailVars
-			);
-	}
+//	private Processor createSendEMailProc(String pacName,
+//			String customerEMail, Map<String, String> emailVars) throws ProcessorException {
+//		return new MailerProcessor(
+//						customerEMail, 
+//						"Zugangsdaten des neue Hostsharing Pakets " + pacName,
+//						"/de/hsadmin/mods/pac/email_new_pac_account.jtpl",
+//						emailVars
+//			);
+//	}
 
 	private Processor createIfUp(String pacName) {
 		return new ShellProcessor("ifup eth0:" + pacName);
@@ -207,13 +207,13 @@
 		return pacValuesList;
 	}
 
-	private Map<String, String> fillEMailValues(String pacName,
-			String customerEMail, String password) {
-		Map<String, String> emailVars = new HashMap<String, String>();
-		emailVars.put("PAC", pacName);
-		emailVars.put("PASSWORD", password);
-		emailVars.put("CUST_EMAIL", customerEMail);
-		return emailVars;
-	}
+//	private Map<String, String> fillEMailValues(String pacName,
+//			String customerEMail, String password) {
+//		Map<String, String> emailVars = new HashMap<String, String>();
+//		emailVars.put("PAC", pacName);
+//		emailVars.put("PASSWORD", password);
+//		emailVars.put("CUST_EMAIL", customerEMail);
+//		return emailVars;
+//	}
 
 }

--
Gitblit v1.9.1