mirror of
https://github.com/AuthMe/AuthMeReloaded.git
synced 2024-11-09 20:21:02 +01:00
Remember to sync before pushing!
This commit is contained in:
parent
91a4afb41f
commit
aa871e2dcf
@ -11,7 +11,6 @@ import fr.xephi.authme.AuthMe;
|
|||||||
import fr.xephi.authme.ConsoleLogger;
|
import fr.xephi.authme.ConsoleLogger;
|
||||||
import fr.xephi.authme.cache.auth.PlayerAuth;
|
import fr.xephi.authme.cache.auth.PlayerAuth;
|
||||||
import fr.xephi.authme.cache.auth.PlayerCache;
|
import fr.xephi.authme.cache.auth.PlayerCache;
|
||||||
import fr.xephi.authme.datasource.DataSource;
|
|
||||||
import fr.xephi.authme.security.PasswordSecurity;
|
import fr.xephi.authme.security.PasswordSecurity;
|
||||||
import fr.xephi.authme.settings.Messages;
|
import fr.xephi.authme.settings.Messages;
|
||||||
import fr.xephi.authme.settings.Settings;
|
import fr.xephi.authme.settings.Settings;
|
||||||
@ -19,11 +18,9 @@ import fr.xephi.authme.settings.Settings;
|
|||||||
public class ChangePasswordCommand implements CommandExecutor {
|
public class ChangePasswordCommand implements CommandExecutor {
|
||||||
|
|
||||||
private Messages m = Messages.getInstance();
|
private Messages m = Messages.getInstance();
|
||||||
private DataSource database;
|
|
||||||
public AuthMe plugin;
|
public AuthMe plugin;
|
||||||
|
|
||||||
public ChangePasswordCommand(DataSource database, AuthMe plugin) {
|
public ChangePasswordCommand(AuthMe plugin) {
|
||||||
this.database = database;
|
|
||||||
this.plugin = plugin;
|
this.plugin = plugin;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -79,11 +76,11 @@ public class ChangePasswordCommand implements CommandExecutor {
|
|||||||
if (PasswordSecurity.userSalt.containsKey(name) && PasswordSecurity.userSalt.get(name) != null)
|
if (PasswordSecurity.userSalt.containsKey(name) && PasswordSecurity.userSalt.get(name) != null)
|
||||||
auth.setSalt(PasswordSecurity.userSalt.get(name));
|
auth.setSalt(PasswordSecurity.userSalt.get(name));
|
||||||
else auth.setSalt("");
|
else auth.setSalt("");
|
||||||
if (!database.updatePassword(auth)) {
|
if (!plugin.database.updatePassword(auth)) {
|
||||||
m.send(player, "error");
|
m.send(player, "error");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
database.updateSalt(auth);
|
plugin.database.updateSalt(auth);
|
||||||
PlayerCache.getInstance().updatePlayer(auth);
|
PlayerCache.getInstance().updatePlayer(auth);
|
||||||
m.send(player, "pwd_changed");
|
m.send(player, "pwd_changed");
|
||||||
ConsoleLogger.info(player.getName() + " changed his password");
|
ConsoleLogger.info(player.getName() + " changed his password");
|
||||||
|
Loading…
Reference in New Issue
Block a user