Added support for Terms of Use Display

git-svn-id: https://svn.research-infrastructures.eu/d4science/gcube/trunk/portlets/user/join-vre@150827 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Massimiliano Assante 2017-07-05 17:41:27 +00:00
parent 3101ad62ab
commit 97ccf4e896
1 changed files with 10 additions and 4 deletions

View File

@ -107,7 +107,7 @@ public class JoinServiceImpl extends RemoteServiceServlet implements JoinService
*/
@Override
public String getTermsOfUse(long siteId) {
TermsOfUse tou = new TermsOfUseImpl();
try {
long groupId = new LiferayGroupManager().getGroup(siteId).getGroupId();
@ -377,6 +377,10 @@ public class JoinServiceImpl extends RemoteServiceServlet implements JoinService
}
_log.debug("Request does not exist, addMembershipRequest for user " + username);
LoginServiceUtil.addMembershipRequest(username, scope, optionalMessage, getThreadLocalRequest());
if (getTermsOfUse(groupId) != null) {
new TermsOfUseImpl().hasAcceptedToU(username, groupId);
_log.info(username + "has requested and acceptedToU OK for " + scope);
}
} catch (Exception e) {
e.printStackTrace();
}
@ -417,8 +421,10 @@ public class JoinServiceImpl extends RemoteServiceServlet implements JoinService
LoginServiceUtil.notifyUserSelfRegistration(currUser.getUsername(), scope, getThreadLocalRequest());
_log.info("notifyUserSelfRegistration sent");
}
new TermsOfUseImpl().hasAcceptedToU(currUser.getUsername(), groupId);
_log.info("hasAcceptedToU OK for " + currUser.getUsername());
if (getTermsOfUse(groupId) != null) {
new TermsOfUseImpl().hasAcceptedToU(currUser.getUsername(), groupId);
_log.info("hasAcceptedToU OK for " + currUser.getUsername());
}
}
catch (Exception e) {
e.printStackTrace();
@ -456,7 +462,7 @@ public class JoinServiceImpl extends RemoteServiceServlet implements JoinService
_log.debug("checking if invite exists for " + email + " on " +infraScope);
return store.isExistingInvite(infraScope, email);
}
/**