forked from External/mage
Added chat mute and user (de)activation actions to the Mage server console.
This commit is contained in:
parent
7c4b40073c
commit
c46f75ac28
18 changed files with 511 additions and 213 deletions
|
|
@ -180,14 +180,15 @@ public class Session {
|
|||
|
||||
public String connectUserHandling(String userName, String password) throws MageException {
|
||||
this.isAdmin = false;
|
||||
AuthorizedUser authorizedUser = null;
|
||||
if (ConfigSettings.getInstance().isAuthenticationActivated()) {
|
||||
AuthorizedUser authorizedUser = AuthorizedUserRepository.instance.getByName(userName);
|
||||
authorizedUser = AuthorizedUserRepository.instance.getByName(userName);
|
||||
if (authorizedUser == null || !authorizedUser.doCredentialsMatch(userName, password)) {
|
||||
return "Wrong username or password. In case you haven't, please register your account first.";
|
||||
}
|
||||
}
|
||||
|
||||
User user = UserManager.getInstance().createUser(userName, host);
|
||||
User user = UserManager.getInstance().createUser(userName, host, authorizedUser);
|
||||
boolean reconnect = false;
|
||||
if (user == null) { // user already exists
|
||||
user = UserManager.getInstance().getUserByName(userName);
|
||||
|
|
@ -223,7 +224,7 @@ public class Session {
|
|||
|
||||
public void connectAdmin() {
|
||||
this.isAdmin = true;
|
||||
User user = UserManager.getInstance().createUser("Admin", host);
|
||||
User user = UserManager.getInstance().createUser("Admin", host, null);
|
||||
if (user == null) {
|
||||
user = UserManager.getInstance().getUserByName("Admin");
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue