Commit 32687700 authored by Sonia Zorba's avatar Sonia Zorba
Browse files

Added user field in invited_registration_request table

parent 17c4724e
......@@ -109,6 +109,7 @@ public class InvitedRegistrationManager extends UserAwareComponent {
permissionsService.addPermission(groupEntity, userId, entry.getValue());
}
invitedRegistration.setUserId(getCurrentUserId());
invitedRegistrationDAO.setRegistrationDone(invitedRegistration);
httpSession.removeAttribute(INVITED_REGISTRATION);
......
......@@ -94,11 +94,12 @@ public class InvitedRegistrationDAO {
public void setRegistrationDone(InvitedRegistration invitedRegistration) {
String sql = "UPDATE invited_registration_request SET done = true WHERE id = ?";
String sql = "UPDATE invited_registration_request SET \"user\" = ?, done = true WHERE id = ?";
jdbcTemplate.update(conn -> {
PreparedStatement ps = conn.prepareStatement(sql);
ps.setString(1, invitedRegistration.getId());
ps.setString(1, invitedRegistration.getUserId());
ps.setString(2, invitedRegistration.getId());
return ps;
});
}
......
......@@ -9,6 +9,7 @@ public class InvitedRegistration {
private String tokenHash;
private String email;
private boolean done;
private String userId;
private Map<String, Permission> groupsPermissions;
public String getId() {
......@@ -47,6 +48,14 @@ public class InvitedRegistration {
return this;
}
public String getUserId() {
return userId;
}
public void setUserId(String userId) {
this.userId = userId;
}
public Map<String, Permission> getGroupsPermissions() {
return groupsPermissions;
}
......
......@@ -49,6 +49,7 @@ CREATE TABLE invited_registration_request (
token_hash varchar NOT NULL,
email varchar NOT NULL,
creation_time timestamp DEFAULT NOW(),
"user" varchar NULL, -- for audit purposes
done boolean,
PRIMARY KEY(id)
);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment