forked from External/mage
spjspj - Add Set Active to server console
This commit is contained in:
parent
156a14a123
commit
6d3324378f
4 changed files with 36 additions and 0 deletions
|
|
@ -1008,6 +1008,20 @@ public class MageServerImpl implements MageServer {
|
|||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setActivation(final String sessionId, final String userName, boolean active) throws MageException {
|
||||
execute("setActivation", sessionId, () -> {
|
||||
User user = UserManager.getInstance().getUserByName(userName);
|
||||
if (user != null) {
|
||||
user.setActive(active);
|
||||
if (!user.isActive() && user.isConnected()) {
|
||||
SessionManager.getInstance().disconnectUser(sessionId, user.getSessionId());
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void toggleActivation(final String sessionId, final String userName) throws MageException {
|
||||
execute("toggleActivation", sessionId, () -> {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue