works!
git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/portlets/user/accept-invite-portlet@160095 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
4bf9153c45
commit
4aa47b4a30
|
@ -189,7 +189,7 @@ public class PortletViewController {
|
||||||
}
|
}
|
||||||
|
|
||||||
//checking if the user has been already registered or is already in the portal
|
//checking if the user has been already registered or is already in the portal
|
||||||
GCubeUser theUser = register(firstName, lastName, email, password);
|
User theUser = register(firstName, lastName, email, password);
|
||||||
if (theUser != null)
|
if (theUser != null)
|
||||||
response.getWriter().println("OK");
|
response.getWriter().println("OK");
|
||||||
else
|
else
|
||||||
|
@ -202,8 +202,8 @@ public class PortletViewController {
|
||||||
return matcher.find();
|
return matcher.find();
|
||||||
}
|
}
|
||||||
|
|
||||||
private GCubeUser register(String firstName, String lastName, String email, String password1) {
|
private User register(String firstName, String lastName, String email, String password1) {
|
||||||
GCubeUser toReturn = null;
|
User toReturn = null;
|
||||||
try{
|
try{
|
||||||
_log.debug("Trying createuser " + email);
|
_log.debug("Trying createuser " + email);
|
||||||
Long defaultCompanyId = PortalUtil.getDefaultCompanyId();
|
Long defaultCompanyId = PortalUtil.getDefaultCompanyId();
|
||||||
|
@ -217,7 +217,7 @@ public class PortletViewController {
|
||||||
int birthdayDay = 1;
|
int birthdayDay = 1;
|
||||||
int birthdayYear = 1970;
|
int birthdayYear = 1970;
|
||||||
String password2 = password1;
|
String password2 = password1;
|
||||||
User added = UserLocalServiceUtil.addUser(
|
toReturn = UserLocalServiceUtil.addUser(
|
||||||
defaultUserId,
|
defaultUserId,
|
||||||
defaultCompanyId,
|
defaultCompanyId,
|
||||||
autoPassword,
|
autoPassword,
|
||||||
|
@ -246,8 +246,8 @@ public class PortletViewController {
|
||||||
true,
|
true,
|
||||||
new ServiceContext());
|
new ServiceContext());
|
||||||
_log.debug("CreateUser " + lastName + " SUCCESS");
|
_log.debug("CreateUser " + lastName + " SUCCESS");
|
||||||
UserLocalServiceUtil.updateAgreedToTermsOfUse(added.getUserId(), false);
|
UserLocalServiceUtil.updateAgreedToTermsOfUse(toReturn.getUserId(), false);
|
||||||
UserLocalServiceUtil.updatePasswordReset(added.getUserId(), false);
|
UserLocalServiceUtil.updatePasswordReset(toReturn.getUserId(), false);
|
||||||
|
|
||||||
}
|
}
|
||||||
catch(Exception e){
|
catch(Exception e){
|
||||||
|
|
|
@ -30,7 +30,8 @@
|
||||||
},
|
},
|
||||||
success : function(data) {
|
success : function(data) {
|
||||||
$('#loadingAjaxCallback').css("display", "none");
|
$('#loadingAjaxCallback').css("display", "none");
|
||||||
if (data == "OK") {
|
var result = data.toString().trim();
|
||||||
|
if (result == "OK") {
|
||||||
$('#successDiv').css("display", "block");
|
$('#successDiv').css("display", "block");
|
||||||
} else {
|
} else {
|
||||||
$('#errorDiv').css("display", "block");
|
$('#errorDiv').css("display", "block");
|
||||||
|
|
Loading…
Reference in New Issue