Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
IA2
GMS
Commits
32687700
Commit
32687700
authored
Apr 22, 2020
by
Sonia Zorba
Browse files
Added user field in invited_registration_request table
parent
17c4724e
Changes
4
Hide whitespace changes
Inline
Side-by-side
gms/src/main/java/it/inaf/ia2/gms/manager/InvitedRegistrationManager.java
View file @
32687700
...
...
@@ -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
);
...
...
gms/src/main/java/it/inaf/ia2/gms/persistence/InvitedRegistrationDAO.java
View file @
32687700
...
...
@@ -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
;
});
}
...
...
gms/src/main/java/it/inaf/ia2/gms/persistence/model/InvitedRegistration.java
View file @
32687700
...
...
@@ -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
;
}
...
...
gms/src/main/resources/sql/init.sql
View file @
32687700
...
...
@@ -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
)
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment