Added ability to change the password, theoretically on client and server

(needs testing!)
This commit is contained in:
delvh
2020-08-01 10:17:39 +02:00
parent 719aa4cd4f
commit 0d77fbf831
5 changed files with 144 additions and 5 deletions

View 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; }
}

View 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); }
}