Changeset 675
- Timestamp:
- 02/24/10 16:35:19 (7 months ago)
- Location:
- trunk/src/com/calenco
- Files:
-
- 2 edited
-
CalencoV2.java (modified) (3 diffs)
-
security/SUSecurityManager.java (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/com/calenco/CalencoV2.java
r667 r675 67 67 private static final Logger log = Logger.getLogger(CalencoV2.class); 68 68 69 private static SUSecurityManager suSecMgr = SUSecurityManager.getInstance();70 71 69 public CalencoV2() throws Exception { 72 70 initRepo(); 71 SUSecurityManager.getInstance(); 73 72 } 74 73 … … 201 200 202 201 /** 203 * Store s ome files on the content root, and basic users and groups202 * Store system resources 204 203 * 205 204 * @param session the <code>javax.jcr.Session</code> used for item storage … … 217 216 admin = udao.addOrUpdate(admin); 218 217 } 219 // Create, or update, publication user220 User pubuser = new User();221 pubuser.setEmail(User.PUB_USER_EMAIL); // NOI18N222 pubuser.setName("Special User Running Publications"); // NOI18N223 pubuser.setPassword(suSecMgr.getPubPass());224 pubuser = udao.addOrUpdate(pubuser);225 218 } 226 219 -
trunk/src/com/calenco/security/SUSecurityManager.java
r674 r675 63 63 isAdminPassSet = false; 64 64 } 65 /* Generate and store the password for the pub user */ 65 // Create, or update, publication user 66 User pubuser = new User(); 67 pubuser.setEmail(User.PUB_USER_EMAIL); 68 pubuser.setName("Special User Running Publications"); // NOI18N 66 69 SecureRandom rng = new SecureRandom(); 67 70 byte[] passBytes = new byte[20]; 68 71 rng.nextBytes(passBytes); 69 72 pubPass = new String(passBytes); 70 UserDAO udao = new UserDAO(session); 71 User pubUser = udao.findByName(User.PUB_USER_EMAIL); 72 pubUser.setPassword(pubPass); 73 pubUser = udao.addOrUpdate(pubUser); 73 pubuser.setPassword(pubPass); 74 pubuser = new UserDAO(session).addOrUpdate(pubuser); 75 log.debug(String.format("%s instantiated.", getClass())); 74 76 } catch (Exception e) { 75 77 log.error("Cannot instantiate system users security manager", e);
Note: See TracChangeset
for help on using the changeset viewer.
