Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 19 additions & 13 deletions xmppserver/src/main/java/org/jivesoftware/openfire/XMPPServer.java
Original file line number Diff line number Diff line change
Expand Up @@ -516,19 +516,25 @@ void runAutoSetup() {
JiveGlobals.setProperty("user.scramHashedPasswordOnly", "true");
}

// steps from setup-admin-settings.jsp
try {
User adminUser = UserManager.getInstance().getUser("admin");
adminUser.setPassword(JiveGlobals.getXMLProperty("autosetup.admin.password"));
adminUser.setEmail(JiveGlobals.getXMLProperty("autosetup.admin.email"));
Date now = new Date();
adminUser.setCreationDate(now);
adminUser.setModificationDate(now);
} catch (Exception e) {
e.printStackTrace();
logger.warn("There was an unexpected error encountered when "
+ "setting the new admin information. Please check your error "
+ "logs and try to remedy the problem.");
// steps from setup-admin-settings.jsp: change attributes of the default admin user
if (JiveGlobals.getXMLProperty("autosetup.admin.password") != null || JiveGlobals.getXMLProperty("autosetup.admin.email") != null) {
try {
User adminUser = UserManager.getInstance().getUser("admin");
if (JiveGlobals.getXMLProperty("autosetup.admin.password") != null) {
adminUser.setPassword(JiveGlobals.getXMLProperty("autosetup.admin.password"));
}
if (JiveGlobals.getXMLProperty("autosetup.admin.email") != null) {
adminUser.setEmail(JiveGlobals.getXMLProperty("autosetup.admin.email"));
Comment thread
guusdk marked this conversation as resolved.
}
Date now = new Date();
adminUser.setCreationDate(now);
adminUser.setModificationDate(now);
} catch (Exception e) {
e.printStackTrace();
logger.warn("There was an unexpected error encountered when "
+ "setting the new admin information. Please check your error "
+ "logs and try to remedy the problem.");
}
}

// Import any provisioned users.
Expand Down
Loading