From 51843474f0ccb0670ebc1838ecfa4ff88db0fa7f Mon Sep 17 00:00:00 2001 From: spjspj Date: Sat, 14 Jan 2017 16:46:27 +1100 Subject: [PATCH] spjspj - Add Set Active to server console --- Mage.Server/src/main/java/mage/server/MageServerImpl.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Mage.Server/src/main/java/mage/server/MageServerImpl.java b/Mage.Server/src/main/java/mage/server/MageServerImpl.java index 98bcd80746..bf7030be66 100644 --- a/Mage.Server/src/main/java/mage/server/MageServerImpl.java +++ b/Mage.Server/src/main/java/mage/server/MageServerImpl.java @@ -1011,12 +1011,16 @@ public class MageServerImpl implements MageServer { @Override public void setActivation(final String sessionId, final String userName, boolean active) throws MageException { execute("setActivation", sessionId, () -> { + AuthorizedUser authorizedUser = AuthorizedUserRepository.instance.getByName(userName); User user = UserManager.getInstance().getUserByName(userName); if (user != null) { user.setActive(active); if (!user.isActive() && user.isConnected()) { SessionManager.getInstance().disconnectUser(sessionId, user.getSessionId()); } + } else if (authorizedUser != null) { + User theUser = new User(userName, "localhost", authorizedUser); + theUser.setActive(active); } });