mirror of
https://github.com/correl/mage.git
synced 2024-11-14 19:19:32 +00:00
Exit early for less indentation.
This commit is contained in:
parent
3bc8f4bec2
commit
8dd1e21dba
1 changed files with 14 additions and 15 deletions
|
@ -72,23 +72,22 @@ public class SessionManager {
|
|||
|
||||
public boolean registerUser(String sessionId, String userName, String password, String email) throws MageException {
|
||||
Session session = sessions.get(sessionId);
|
||||
if (session != null) {
|
||||
String returnMessage = session.registerUser(userName, password, email);
|
||||
if (returnMessage == null) {
|
||||
LogServiceImpl.instance.log(LogKeys.KEY_USER_REGISTERED, userName, session.getHost(), sessionId);
|
||||
|
||||
logger.info(userName + " registered");
|
||||
logger.debug("- userId: " + session.getUserId());
|
||||
logger.debug("- sessionId: " + sessionId);
|
||||
logger.debug("- host: " + session.getHost());
|
||||
return true;
|
||||
} else {
|
||||
logger.debug(userName + " not registered: " + returnMessage);
|
||||
}
|
||||
} else {
|
||||
if (session == null) {
|
||||
logger.error(userName + " tried to register with no sessionId");
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
String returnMessage = session.registerUser(userName, password, email);
|
||||
if (returnMessage != null) {
|
||||
logger.debug(userName + " not registered: " + returnMessage);
|
||||
return false;
|
||||
}
|
||||
LogServiceImpl.instance.log(LogKeys.KEY_USER_REGISTERED, userName, session.getHost(), sessionId);
|
||||
|
||||
logger.info(userName + " registered");
|
||||
logger.debug("- userId: " + session.getUserId());
|
||||
logger.debug("- sessionId: " + sessionId);
|
||||
logger.debug("- host: " + session.getHost());
|
||||
return true;
|
||||
}
|
||||
|
||||
public boolean connectUser(String sessionId, String userName, String password) throws MageException {
|
||||
|
|
Loading…
Reference in a new issue