Added ability to change the password, theoretically on client and server
(needs testing!)
This commit is contained in:
44
common/src/main/java/envoy/event/PasswordChangeRequest.java
Normal file
44
common/src/main/java/envoy/event/PasswordChangeRequest.java
Normal file
@ -0,0 +1,44 @@
|
||||
package envoy.event;
|
||||
|
||||
import envoy.data.Contact;
|
||||
|
||||
/**
|
||||
* Project: <strong>envoy-common</strong><br>
|
||||
* File: <strong>PasswordChangeRequest.java</strong><br>
|
||||
* Created: <strong>31.07.2020</strong><br>
|
||||
*
|
||||
* @author Leon Hofmeister
|
||||
* @since Envoy Common v0.2-beta
|
||||
*/
|
||||
public class PasswordChangeRequest extends Event<String> {
|
||||
|
||||
private final long id;
|
||||
|
||||
private final String oldPassword;
|
||||
|
||||
private static final long serialVersionUID = 0L;
|
||||
|
||||
/**
|
||||
* @param newPassword the new password of that user
|
||||
* @param oldPassword the old password of that user
|
||||
* @param userID the ID of the user who wants to change his password
|
||||
* @since Envoy Common v0.2-beta
|
||||
*/
|
||||
public PasswordChangeRequest(String newPassword, String oldPassword, long userID) {
|
||||
super(newPassword);
|
||||
this.oldPassword = oldPassword;
|
||||
id = userID;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the ID of the {@link Contact} this event is related to
|
||||
* @since Envoy Common v0.2-alpha
|
||||
*/
|
||||
public long getID() { return id; }
|
||||
|
||||
/**
|
||||
* @return the old password of the underlying user
|
||||
* @since Envoy Common v0.2-beta
|
||||
*/
|
||||
public String getOldPassword() { return oldPassword; }
|
||||
}
|
26
common/src/main/java/envoy/event/PasswordChangeResult.java
Normal file
26
common/src/main/java/envoy/event/PasswordChangeResult.java
Normal file
@ -0,0 +1,26 @@
|
||||
package envoy.event;
|
||||
|
||||
/**
|
||||
* This class acts as a notice to the user whether his
|
||||
* {@link envoy.event.PasswordChangeRequest} was successful.
|
||||
* <p>
|
||||
* Project: <strong>envoy-common</strong><br>
|
||||
* File: <strong>PasswordChangeResult.java</strong><br>
|
||||
* Created: <strong>01.08.2020</strong><br>
|
||||
*
|
||||
* @author Leon Hofmeister
|
||||
* @since Envoy Common v0.2-beta
|
||||
*/
|
||||
public class PasswordChangeResult extends Event<Boolean> {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* Creates an instance of {@code PasswordChangeResult}.
|
||||
*
|
||||
* @param value whether the preceding {@link envoy.event.PasswordChangeRequest}
|
||||
* was successful.
|
||||
* @since Envoy Common v0.2-beta
|
||||
*/
|
||||
public PasswordChangeResult(boolean value) { super(value); }
|
||||
}
|
Reference in New Issue
Block a user