Commit 6a17cb69 by Nilu

forgot password - applicant portal

parent 915561ae
...@@ -10,6 +10,8 @@ ...@@ -10,6 +10,8 @@
<column name="object_created_date" type="Date" nullable="false" length="22"/> <column name="object_created_date" type="Date" nullable="false" length="22"/>
<column name="object_type" type="String" nullable="false" length="30"/> <column name="object_type" type="String" nullable="false" length="30"/>
<column name="phone" type="String" nullable="true" length="30"/> <column name="phone" type="String" nullable="true" length="30"/>
<column name="forgot_password_mail_send_date" type="Date" nullable="true"/>
<column name="forgot_password_key" type="String" nullable="true" length="10"/>
<column name="verification_mail_send_date" type="Date" nullable="true"/> <column name="verification_mail_send_date" type="Date" nullable="true"/>
<column name="verification_key" type="String" nullable="true" length="10"/> <column name="verification_key" type="String" nullable="true" length="10"/>
<column name="is_account_verified" type="Boolean" nullable="true"/> <column name="is_account_verified" type="Boolean" nullable="true"/>
......
...@@ -9,6 +9,8 @@ CREATE TABLE oneit_sec_user_extension ( ...@@ -9,6 +9,8 @@ CREATE TABLE oneit_sec_user_extension (
object_created_date datetime DEFAULT getdate() NOT NULL object_created_date datetime DEFAULT getdate() NOT NULL
, object_type varchar(30) NOT NULL , , object_type varchar(30) NOT NULL ,
phone varchar(30) NULL, phone varchar(30) NULL,
forgot_password_mail_send_date datetime NULL,
forgot_password_key varchar(10) NULL,
verification_mail_send_date datetime NULL, verification_mail_send_date datetime NULL,
verification_key varchar(10) NULL, verification_key varchar(10) NULL,
is_account_verified char(1) NULL, is_account_verified char(1) NULL,
......
...@@ -10,6 +10,8 @@ CREATE TABLE oneit_sec_user_extension ( ...@@ -10,6 +10,8 @@ CREATE TABLE oneit_sec_user_extension (
object_created_date date DEFAULT SYSDATE NOT NULL object_created_date date DEFAULT SYSDATE NOT NULL
, object_type varchar2(30) NOT NULL , , object_type varchar2(30) NOT NULL ,
phone varchar2(30) NULL, phone varchar2(30) NULL,
forgot_password_mail_send_date date NULL,
forgot_password_key varchar2(10) NULL,
verification_mail_send_date date NULL, verification_mail_send_date date NULL,
verification_key varchar2(10) NULL, verification_key varchar2(10) NULL,
is_account_verified char(1) NULL, is_account_verified char(1) NULL,
......
...@@ -10,6 +10,8 @@ CREATE TABLE oneit_sec_user_extension ( ...@@ -10,6 +10,8 @@ CREATE TABLE oneit_sec_user_extension (
object_created_date timestamp DEFAULT NOW() NOT NULL object_created_date timestamp DEFAULT NOW() NOT NULL
, object_type varchar(30) NOT NULL , , object_type varchar(30) NOT NULL ,
phone varchar(30) NULL, phone varchar(30) NULL,
forgot_password_mail_send_date timestamp NULL,
forgot_password_key varchar(10) NULL,
verification_mail_send_date timestamp NULL, verification_mail_send_date timestamp NULL,
verification_key varchar(10) NULL, verification_key varchar(10) NULL,
is_account_verified char(1) NULL, is_account_verified char(1) NULL,
......
...@@ -3,6 +3,7 @@ package performa.form; ...@@ -3,6 +3,7 @@ package performa.form;
import java.util.Date; import java.util.Date;
import java.util.Map; import java.util.Map;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import oneit.business.content.Article;
import oneit.components.ParticipantInitialisationContext; import oneit.components.ParticipantInitialisationContext;
import oneit.email.ConfigurableEmailer; import oneit.email.ConfigurableEmailer;
import oneit.logging.*; import oneit.logging.*;
...@@ -18,7 +19,9 @@ import oneit.utils.transform.MapTransform; ...@@ -18,7 +19,9 @@ import oneit.utils.transform.MapTransform;
import oneit.utils.transform.param.ErrorTransform; import oneit.utils.transform.param.ErrorTransform;
import oneit.utils.transform.param.ORMTransform; import oneit.utils.transform.param.ORMTransform;
import oneit.utils.transform.param.PrefixCompoundTransform; import oneit.utils.transform.param.PrefixCompoundTransform;
import performa.orm.Candidate;
import performa.orm.CompanyUser; import performa.orm.CompanyUser;
import performa.utils.WebUtils;
public class ForgotPasswordFP extends SaveFP public class ForgotPasswordFP extends SaveFP
...@@ -34,6 +37,7 @@ public class ForgotPasswordFP extends SaveFP ...@@ -34,6 +37,7 @@ public class ForgotPasswordFP extends SaveFP
HttpServletRequest request = submission.getRequest(); HttpServletRequest request = submission.getRequest();
ObjectTransaction objTran = process.getTransaction(); ObjectTransaction objTran = process.getTransaction();
String email = (String) request.getParameter("email"); String email = (String) request.getParameter("email");
String nextPage = (String) request.getAttribute("nextPage");
Debug.assertion(email != null, "Email not avaialble"); Debug.assertion(email != null, "Email not avaialble");
...@@ -58,9 +62,13 @@ public class ForgotPasswordFP extends SaveFP ...@@ -58,9 +62,13 @@ public class ForgotPasswordFP extends SaveFP
{ {
LogMgr.log(LOG, LogLevel.PROCESSING1, "Inside ForgotPasswordFP for send reset pasword link mail to ", email); LogMgr.log(LOG, LogLevel.PROCESSING1, "Inside ForgotPasswordFP for send reset pasword link mail to ", email);
CompanyUser companyUser = secUser.getExtensionOrCreate(CompanyUser.REFERENCE_CompanyUser); Map emailParams;
if(companyUser.getForgotPasswordKey()==null) CompanyUser companyUser = secUser.getExtension(CompanyUser.REFERENCE_CompanyUser);
if(companyUser != null)
{
if(companyUser.getForgotPasswordKey() == null)
{ {
String resetCode = new RandomStringGen().generateHumanAlphaNum(new Integer(DEFAULT_PASSWORD_LENGTH)); String resetCode = new RandomStringGen().generateHumanAlphaNum(new Integer(DEFAULT_PASSWORD_LENGTH));
companyUser.setForgotPasswordKey(resetCode); companyUser.setForgotPasswordKey(resetCode);
...@@ -68,11 +76,31 @@ public class ForgotPasswordFP extends SaveFP ...@@ -68,11 +76,31 @@ public class ForgotPasswordFP extends SaveFP
companyUser.setForgotPasswordMailSendDate(new Date()); companyUser.setForgotPasswordMailSendDate(new Date());
Map emailParams = CollectionUtils.mapEntry("resetcode", companyUser.getForgotPasswordKey()) emailParams = CollectionUtils.mapEntry("resetcode", companyUser.getForgotPasswordKey())
.mapEntry("url", LoopbackHTTP.getRemoteAccessURL() .mapEntry("url", LoopbackHTTP.getRemoteAccessURL()
+ "/extensions/adminportal/reset_password.jsp" + "/extensions/adminportal/reset_password.jsp"
+ "?id=" + companyUser.getID() + "?id=" + companyUser.getID()
+ "&key=" + companyUser.getForgotPasswordKey()).toMap(); + "&key=" + companyUser.getForgotPasswordKey()).toMap();
}
else
{
Candidate candidate = secUser.getExtension(Candidate.REFERENCE_Candidate);
Article applyJobArticle = WebUtils.getArticleByShortCut(objTran, WebUtils.APPLY_JOB);
if(candidate.getForgotPasswordKey() == null)
{
String resetCode = new RandomStringGen().generateHumanAlphaNum(new Integer(DEFAULT_PASSWORD_LENGTH));
candidate.setForgotPasswordKey(resetCode);
}
candidate.setForgotPasswordMailSendDate(new Date());
emailParams = CollectionUtils.mapEntry("resetcode", candidate.getForgotPasswordKey())
.mapEntry("url", LoopbackHTTP.getRemoteAccessURL(request)
+ applyJobArticle.getLink(request, CollectionUtils.EMPTY_MAP, "/")
+ "?id=" + candidate.getID()
+ "&key=" + candidate.getForgotPasswordKey()).toMap();
}
PrefixCompoundTransform compoundTransform = new PrefixCompoundTransform(); PrefixCompoundTransform compoundTransform = new PrefixCompoundTransform();
ObjectTransform defaultTransform = new MapTransform(emailParams); ObjectTransform defaultTransform = new MapTransform(emailParams);
...@@ -101,10 +129,13 @@ public class ForgotPasswordFP extends SaveFP ...@@ -101,10 +129,13 @@ public class ForgotPasswordFP extends SaveFP
throw new BusinessException("Sorry, we don't recognize that email address."); throw new BusinessException("Sorry, we don't recognize that email address.");
} }
return super.processForm(process, submission, params); process.completeAndRestart();
return new ProcessRedirectResult(nextPage, new String[0]);
} }
@Override
public void init(ParticipantInitialisationContext context) throws InitialisationException public void init(ParticipantInitialisationContext context) throws InitialisationException
{ {
super.init(context); super.init(context);
......
...@@ -8,6 +8,7 @@ import oneit.security.SecUser; ...@@ -8,6 +8,7 @@ import oneit.security.SecUser;
import oneit.servlets.forms.*; import oneit.servlets.forms.*;
import oneit.servlets.process.*; import oneit.servlets.process.*;
import oneit.utils.*; import oneit.utils.*;
import performa.orm.Candidate;
import performa.orm.CompanyUser; import performa.orm.CompanyUser;
import performa.utils.Utils; import performa.utils.Utils;
...@@ -22,13 +23,20 @@ public class ResetPasswordFP extends ORMProcessFormProcessor ...@@ -22,13 +23,20 @@ public class ResetPasswordFP extends ORMProcessFormProcessor
{ {
SecUser user = (SecUser) process.getAttribute("SecUser"); SecUser user = (SecUser) process.getAttribute("SecUser");
CompanyUser companyUser = user.getExtension(CompanyUser.REFERENCE_CompanyUser); CompanyUser companyUser = user.getExtension(CompanyUser.REFERENCE_CompanyUser);
Candidate candidate = user.getExtension(Candidate.REFERENCE_Candidate);
if(companyUser != null) if(companyUser != null)
{ {
LogMgr.log(LOG, LogLevel.PROCESSING1, "Inside ResetPasswordFP for reset pasword to ", user); LogMgr.log(LOG, LogLevel.PROCESSING1, "Inside ResetPasswordFP for Company User reset pasword to ", user);
companyUser.setForgotPasswordKey(null); companyUser.setForgotPasswordKey(null);
} }
else if (candidate != null)
{
LogMgr.log(LOG, LogLevel.PROCESSING1, "Inside ResetPasswordFP for Candidate reset pasword to ", user);
candidate.setForgotPasswordKey(null);
}
return Utils.processSuccessfulLogin(process, submission, params, user); return Utils.processSuccessfulLogin(process, submission, params, user);
} }
......
...@@ -41,6 +41,8 @@ public abstract class BaseCandidate extends SecUserExtension ...@@ -41,6 +41,8 @@ public abstract class BaseCandidate extends SecUserExtension
// Static constants corresponding to field names // Static constants corresponding to field names
public static final String FIELD_Phone = "Phone"; public static final String FIELD_Phone = "Phone";
public static final String FIELD_ForgotPasswordMailSendDate = "ForgotPasswordMailSendDate";
public static final String FIELD_ForgotPasswordKey = "ForgotPasswordKey";
public static final String FIELD_VerificationMailSendDate = "VerificationMailSendDate"; public static final String FIELD_VerificationMailSendDate = "VerificationMailSendDate";
public static final String FIELD_VerificationKey = "VerificationKey"; public static final String FIELD_VerificationKey = "VerificationKey";
public static final String FIELD_IsAccountVerified = "IsAccountVerified"; public static final String FIELD_IsAccountVerified = "IsAccountVerified";
...@@ -62,6 +64,8 @@ public abstract class BaseCandidate extends SecUserExtension ...@@ -62,6 +64,8 @@ public abstract class BaseCandidate extends SecUserExtension
// Static constants corresponding to attribute helpers // Static constants corresponding to attribute helpers
private static final DefaultAttributeHelper<Candidate> HELPER_Phone = DefaultAttributeHelper.INSTANCE; private static final DefaultAttributeHelper<Candidate> HELPER_Phone = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper<Candidate> HELPER_ForgotPasswordMailSendDate = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper<Candidate> HELPER_ForgotPasswordKey = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper<Candidate> HELPER_VerificationMailSendDate = DefaultAttributeHelper.INSTANCE; private static final DefaultAttributeHelper<Candidate> HELPER_VerificationMailSendDate = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper<Candidate> HELPER_VerificationKey = DefaultAttributeHelper.INSTANCE; private static final DefaultAttributeHelper<Candidate> HELPER_VerificationKey = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper<Candidate> HELPER_IsAccountVerified = DefaultAttributeHelper.INSTANCE; private static final DefaultAttributeHelper<Candidate> HELPER_IsAccountVerified = DefaultAttributeHelper.INSTANCE;
...@@ -69,6 +73,8 @@ public abstract class BaseCandidate extends SecUserExtension ...@@ -69,6 +73,8 @@ public abstract class BaseCandidate extends SecUserExtension
// Private attributes corresponding to business object data // Private attributes corresponding to business object data
private String _Phone; private String _Phone;
private Date _ForgotPasswordMailSendDate;
private String _ForgotPasswordKey;
private Date _VerificationMailSendDate; private Date _VerificationMailSendDate;
private String _VerificationKey; private String _VerificationKey;
private Boolean _IsAccountVerified; private Boolean _IsAccountVerified;
...@@ -90,6 +96,8 @@ public abstract class BaseCandidate extends SecUserExtension ...@@ -90,6 +96,8 @@ public abstract class BaseCandidate extends SecUserExtension
// Arrays of validators for each attribute // Arrays of validators for each attribute
private static final AttributeValidator[] FIELD_Phone_Validators; private static final AttributeValidator[] FIELD_Phone_Validators;
private static final AttributeValidator[] FIELD_ForgotPasswordMailSendDate_Validators;
private static final AttributeValidator[] FIELD_ForgotPasswordKey_Validators;
private static final AttributeValidator[] FIELD_VerificationMailSendDate_Validators; private static final AttributeValidator[] FIELD_VerificationMailSendDate_Validators;
private static final AttributeValidator[] FIELD_VerificationKey_Validators; private static final AttributeValidator[] FIELD_VerificationKey_Validators;
private static final AttributeValidator[] FIELD_IsAccountVerified_Validators; private static final AttributeValidator[] FIELD_IsAccountVerified_Validators;
...@@ -117,6 +125,8 @@ public abstract class BaseCandidate extends SecUserExtension ...@@ -117,6 +125,8 @@ public abstract class BaseCandidate extends SecUserExtension
setupAssocMetaData_ProfileAssessmentAnswers(); setupAssocMetaData_ProfileAssessmentAnswers();
setupAssocMetaData_TestInput(); setupAssocMetaData_TestInput();
FIELD_Phone_Validators = (AttributeValidator[])setupAttribMetaData_Phone(validatorMapping).toArray (new AttributeValidator[0]); FIELD_Phone_Validators = (AttributeValidator[])setupAttribMetaData_Phone(validatorMapping).toArray (new AttributeValidator[0]);
FIELD_ForgotPasswordMailSendDate_Validators = (AttributeValidator[])setupAttribMetaData_ForgotPasswordMailSendDate(validatorMapping).toArray (new AttributeValidator[0]);
FIELD_ForgotPasswordKey_Validators = (AttributeValidator[])setupAttribMetaData_ForgotPasswordKey(validatorMapping).toArray (new AttributeValidator[0]);
FIELD_VerificationMailSendDate_Validators = (AttributeValidator[])setupAttribMetaData_VerificationMailSendDate(validatorMapping).toArray (new AttributeValidator[0]); FIELD_VerificationMailSendDate_Validators = (AttributeValidator[])setupAttribMetaData_VerificationMailSendDate(validatorMapping).toArray (new AttributeValidator[0]);
FIELD_VerificationKey_Validators = (AttributeValidator[])setupAttribMetaData_VerificationKey(validatorMapping).toArray (new AttributeValidator[0]); FIELD_VerificationKey_Validators = (AttributeValidator[])setupAttribMetaData_VerificationKey(validatorMapping).toArray (new AttributeValidator[0]);
FIELD_IsAccountVerified_Validators = (AttributeValidator[])setupAttribMetaData_IsAccountVerified(validatorMapping).toArray (new AttributeValidator[0]); FIELD_IsAccountVerified_Validators = (AttributeValidator[])setupAttribMetaData_IsAccountVerified(validatorMapping).toArray (new AttributeValidator[0]);
...@@ -225,6 +235,43 @@ public abstract class BaseCandidate extends SecUserExtension ...@@ -225,6 +235,43 @@ public abstract class BaseCandidate extends SecUserExtension
} }
// Meta Info setup // Meta Info setup
private static List setupAttribMetaData_ForgotPasswordMailSendDate(Map validatorMapping)
{
Map metaInfo = new HashMap ();
metaInfo.put ("dbcol", "forgot_password_mail_send_date");
metaInfo.put ("name", "ForgotPasswordMailSendDate");
metaInfo.put ("type", "Date");
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG2, "Metadata for Candidate.ForgotPasswordMailSendDate:", metaInfo);
ATTRIBUTES_METADATA_Candidate.put (FIELD_ForgotPasswordMailSendDate, Collections.unmodifiableMap (metaInfo));
List validators = BaseBusinessClass.getAttribValidators(Candidate.class, "ForgotPasswordMailSendDate", metaInfo, validatorMapping);
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG1, "Validators for Candidate.ForgotPasswordMailSendDate:", validators);
return validators;
}
// Meta Info setup
private static List setupAttribMetaData_ForgotPasswordKey(Map validatorMapping)
{
Map metaInfo = new HashMap ();
metaInfo.put ("dbcol", "forgot_password_key");
metaInfo.put ("length", "10");
metaInfo.put ("name", "ForgotPasswordKey");
metaInfo.put ("type", "String");
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG2, "Metadata for Candidate.ForgotPasswordKey:", metaInfo);
ATTRIBUTES_METADATA_Candidate.put (FIELD_ForgotPasswordKey, Collections.unmodifiableMap (metaInfo));
List validators = BaseBusinessClass.getAttribValidators(Candidate.class, "ForgotPasswordKey", metaInfo, validatorMapping);
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG1, "Validators for Candidate.ForgotPasswordKey:", validators);
return validators;
}
// Meta Info setup
private static List setupAttribMetaData_VerificationMailSendDate(Map validatorMapping) private static List setupAttribMetaData_VerificationMailSendDate(Map validatorMapping)
{ {
Map metaInfo = new HashMap (); Map metaInfo = new HashMap ();
...@@ -308,6 +355,8 @@ public abstract class BaseCandidate extends SecUserExtension ...@@ -308,6 +355,8 @@ public abstract class BaseCandidate extends SecUserExtension
_Phone = (String)(HELPER_Phone.initialise (_Phone)); _Phone = (String)(HELPER_Phone.initialise (_Phone));
_ForgotPasswordMailSendDate = (Date)(HELPER_ForgotPasswordMailSendDate.initialise (_ForgotPasswordMailSendDate));
_ForgotPasswordKey = (String)(HELPER_ForgotPasswordKey.initialise (_ForgotPasswordKey));
_VerificationMailSendDate = (Date)(HELPER_VerificationMailSendDate.initialise (_VerificationMailSendDate)); _VerificationMailSendDate = (Date)(HELPER_VerificationMailSendDate.initialise (_VerificationMailSendDate));
_VerificationKey = (String)(HELPER_VerificationKey.initialise (_VerificationKey)); _VerificationKey = (String)(HELPER_VerificationKey.initialise (_VerificationKey));
_IsAccountVerified = (Boolean)(Boolean.FALSE); _IsAccountVerified = (Boolean)(Boolean.FALSE);
...@@ -444,6 +493,202 @@ public abstract class BaseCandidate extends SecUserExtension ...@@ -444,6 +493,202 @@ public abstract class BaseCandidate extends SecUserExtension
} }
/** /**
* Get the attribute ForgotPasswordMailSendDate
*/
public Date getForgotPasswordMailSendDate ()
{
assertValid();
Date valToReturn = _ForgotPasswordMailSendDate;
for (CandidateBehaviourDecorator bhd : Candidate_BehaviourDecorators)
{
valToReturn = bhd.getForgotPasswordMailSendDate ((Candidate)this, valToReturn);
}
return valToReturn;
}
/**
* Called prior to the attribute changing. Subclasses need not call super. If a field exception
* is thrown, the attribute change will fail. The new value is different to the old value.
*/
protected void preForgotPasswordMailSendDateChange (Date newForgotPasswordMailSendDate) throws FieldException
{
}
/**
* Called after the attribute changes.
* If a field exception is thrown, the value is still changed, however it
* may lead to the TX being rolled back
*/
protected void postForgotPasswordMailSendDateChange () throws FieldException
{
}
public FieldWriteability getWriteability_ForgotPasswordMailSendDate ()
{
return getFieldWritabilityUtil (FieldWriteability.TRUE);
}
/**
* Set the attribute ForgotPasswordMailSendDate. Checks to ensure a new value
* has been supplied. If so, marks the field as altered and sets the attribute.
*/
public void setForgotPasswordMailSendDate (Date newForgotPasswordMailSendDate) throws FieldException
{
boolean oldAndNewIdentical = HELPER_ForgotPasswordMailSendDate.compare (_ForgotPasswordMailSendDate, newForgotPasswordMailSendDate);
try
{
for (CandidateBehaviourDecorator bhd : Candidate_BehaviourDecorators)
{
newForgotPasswordMailSendDate = bhd.setForgotPasswordMailSendDate ((Candidate)this, newForgotPasswordMailSendDate);
oldAndNewIdentical = HELPER_ForgotPasswordMailSendDate.compare (_ForgotPasswordMailSendDate, newForgotPasswordMailSendDate);
}
if (FIELD_ForgotPasswordMailSendDate_Validators.length > 0)
{
Object newForgotPasswordMailSendDateObj = HELPER_ForgotPasswordMailSendDate.toObject (newForgotPasswordMailSendDate);
if (newForgotPasswordMailSendDateObj != null)
{
int loopMax = FIELD_ForgotPasswordMailSendDate_Validators.length;
Map metadata = (Map)ATTRIBUTES_METADATA_Candidate.get (FIELD_ForgotPasswordMailSendDate);
for (int v = 0 ; v < loopMax ; ++v)
{
FIELD_ForgotPasswordMailSendDate_Validators[v].checkAttribute (this, FIELD_ForgotPasswordMailSendDate, metadata, newForgotPasswordMailSendDateObj);
}
}
}
}
catch (FieldException e)
{
if (!oldAndNewIdentical)
{
e.setWouldModify ();
}
throw e;
}
if (!oldAndNewIdentical)
{
assertValid();
Debug.assertion (getWriteability_ForgotPasswordMailSendDate () != FieldWriteability.FALSE, "Field ForgotPasswordMailSendDate is not writeable");
preForgotPasswordMailSendDateChange (newForgotPasswordMailSendDate);
markFieldChange (FIELD_ForgotPasswordMailSendDate);
_ForgotPasswordMailSendDate = newForgotPasswordMailSendDate;
postFieldChange (FIELD_ForgotPasswordMailSendDate);
postForgotPasswordMailSendDateChange ();
}
}
/**
* Get the attribute ForgotPasswordKey
*/
public String getForgotPasswordKey ()
{
assertValid();
String valToReturn = _ForgotPasswordKey;
for (CandidateBehaviourDecorator bhd : Candidate_BehaviourDecorators)
{
valToReturn = bhd.getForgotPasswordKey ((Candidate)this, valToReturn);
}
return valToReturn;
}
/**
* Called prior to the attribute changing. Subclasses need not call super. If a field exception
* is thrown, the attribute change will fail. The new value is different to the old value.
*/
protected void preForgotPasswordKeyChange (String newForgotPasswordKey) throws FieldException
{
}
/**
* Called after the attribute changes.
* If a field exception is thrown, the value is still changed, however it
* may lead to the TX being rolled back
*/
protected void postForgotPasswordKeyChange () throws FieldException
{
}
public FieldWriteability getWriteability_ForgotPasswordKey ()
{
return getFieldWritabilityUtil (FieldWriteability.TRUE);
}
/**
* Set the attribute ForgotPasswordKey. Checks to ensure a new value
* has been supplied. If so, marks the field as altered and sets the attribute.
*/
public void setForgotPasswordKey (String newForgotPasswordKey) throws FieldException
{
boolean oldAndNewIdentical = HELPER_ForgotPasswordKey.compare (_ForgotPasswordKey, newForgotPasswordKey);
try
{
for (CandidateBehaviourDecorator bhd : Candidate_BehaviourDecorators)
{
newForgotPasswordKey = bhd.setForgotPasswordKey ((Candidate)this, newForgotPasswordKey);
oldAndNewIdentical = HELPER_ForgotPasswordKey.compare (_ForgotPasswordKey, newForgotPasswordKey);
}
if (FIELD_ForgotPasswordKey_Validators.length > 0)
{
Object newForgotPasswordKeyObj = HELPER_ForgotPasswordKey.toObject (newForgotPasswordKey);
if (newForgotPasswordKeyObj != null)
{
int loopMax = FIELD_ForgotPasswordKey_Validators.length;
Map metadata = (Map)ATTRIBUTES_METADATA_Candidate.get (FIELD_ForgotPasswordKey);
for (int v = 0 ; v < loopMax ; ++v)
{
FIELD_ForgotPasswordKey_Validators[v].checkAttribute (this, FIELD_ForgotPasswordKey, metadata, newForgotPasswordKeyObj);
}
}
}
}
catch (FieldException e)
{
if (!oldAndNewIdentical)
{
e.setWouldModify ();
}
throw e;
}
if (!oldAndNewIdentical)
{
assertValid();
Debug.assertion (getWriteability_ForgotPasswordKey () != FieldWriteability.FALSE, "Field ForgotPasswordKey is not writeable");
preForgotPasswordKeyChange (newForgotPasswordKey);
markFieldChange (FIELD_ForgotPasswordKey);
_ForgotPasswordKey = newForgotPasswordKey;
postFieldChange (FIELD_ForgotPasswordKey);
postForgotPasswordKeyChange ();
}
}
/**
* Get the attribute VerificationMailSendDate * Get the attribute VerificationMailSendDate
*/ */
public Date getVerificationMailSendDate () public Date getVerificationMailSendDate ()
...@@ -1625,6 +1870,8 @@ public abstract class BaseCandidate extends SecUserExtension ...@@ -1625,6 +1870,8 @@ public abstract class BaseCandidate extends SecUserExtension
oneit_sec_user_extensionPSet.setAttrib (FIELD_ObjectID, myID); oneit_sec_user_extensionPSet.setAttrib (FIELD_ObjectID, myID);
oneit_sec_user_extensionPSet.setAttrib (FIELD_Phone, HELPER_Phone.toObject (_Phone)); // oneit_sec_user_extensionPSet.setAttrib (FIELD_Phone, HELPER_Phone.toObject (_Phone)); //
oneit_sec_user_extensionPSet.setAttrib (FIELD_ForgotPasswordMailSendDate, HELPER_ForgotPasswordMailSendDate.toObject (_ForgotPasswordMailSendDate)); //
oneit_sec_user_extensionPSet.setAttrib (FIELD_ForgotPasswordKey, HELPER_ForgotPasswordKey.toObject (_ForgotPasswordKey)); //
oneit_sec_user_extensionPSet.setAttrib (FIELD_VerificationMailSendDate, HELPER_VerificationMailSendDate.toObject (_VerificationMailSendDate)); // oneit_sec_user_extensionPSet.setAttrib (FIELD_VerificationMailSendDate, HELPER_VerificationMailSendDate.toObject (_VerificationMailSendDate)); //
oneit_sec_user_extensionPSet.setAttrib (FIELD_VerificationKey, HELPER_VerificationKey.toObject (_VerificationKey)); // oneit_sec_user_extensionPSet.setAttrib (FIELD_VerificationKey, HELPER_VerificationKey.toObject (_VerificationKey)); //
oneit_sec_user_extensionPSet.setAttrib (FIELD_IsAccountVerified, HELPER_IsAccountVerified.toObject (_IsAccountVerified)); // oneit_sec_user_extensionPSet.setAttrib (FIELD_IsAccountVerified, HELPER_IsAccountVerified.toObject (_IsAccountVerified)); //
...@@ -1644,6 +1891,8 @@ public abstract class BaseCandidate extends SecUserExtension ...@@ -1644,6 +1891,8 @@ public abstract class BaseCandidate extends SecUserExtension
PersistentSet oneit_sec_user_extensionPSet = allSets.getPersistentSet (objectID, "oneit_sec_user_extension"); PersistentSet oneit_sec_user_extensionPSet = allSets.getPersistentSet (objectID, "oneit_sec_user_extension");
_Phone = (String)(HELPER_Phone.fromObject (_Phone, oneit_sec_user_extensionPSet.getAttrib (FIELD_Phone))); // _Phone = (String)(HELPER_Phone.fromObject (_Phone, oneit_sec_user_extensionPSet.getAttrib (FIELD_Phone))); //
_ForgotPasswordMailSendDate = (Date)(HELPER_ForgotPasswordMailSendDate.fromObject (_ForgotPasswordMailSendDate, oneit_sec_user_extensionPSet.getAttrib (FIELD_ForgotPasswordMailSendDate))); //
_ForgotPasswordKey = (String)(HELPER_ForgotPasswordKey.fromObject (_ForgotPasswordKey, oneit_sec_user_extensionPSet.getAttrib (FIELD_ForgotPasswordKey))); //
_VerificationMailSendDate = (Date)(HELPER_VerificationMailSendDate.fromObject (_VerificationMailSendDate, oneit_sec_user_extensionPSet.getAttrib (FIELD_VerificationMailSendDate))); // _VerificationMailSendDate = (Date)(HELPER_VerificationMailSendDate.fromObject (_VerificationMailSendDate, oneit_sec_user_extensionPSet.getAttrib (FIELD_VerificationMailSendDate))); //
_VerificationKey = (String)(HELPER_VerificationKey.fromObject (_VerificationKey, oneit_sec_user_extensionPSet.getAttrib (FIELD_VerificationKey))); // _VerificationKey = (String)(HELPER_VerificationKey.fromObject (_VerificationKey, oneit_sec_user_extensionPSet.getAttrib (FIELD_VerificationKey))); //
_IsAccountVerified = (Boolean)(HELPER_IsAccountVerified.fromObject (_IsAccountVerified, oneit_sec_user_extensionPSet.getAttrib (FIELD_IsAccountVerified))); // _IsAccountVerified = (Boolean)(HELPER_IsAccountVerified.fromObject (_IsAccountVerified, oneit_sec_user_extensionPSet.getAttrib (FIELD_IsAccountVerified))); //
...@@ -1674,6 +1923,24 @@ public abstract class BaseCandidate extends SecUserExtension ...@@ -1674,6 +1923,24 @@ public abstract class BaseCandidate extends SecUserExtension
try try
{ {
setForgotPasswordMailSendDate (otherCandidate.getForgotPasswordMailSendDate ());
}
catch (FieldException ex)
{
e.addException (ex);
}
try
{
setForgotPasswordKey (otherCandidate.getForgotPasswordKey ());
}
catch (FieldException ex)
{
e.addException (ex);
}
try
{
setVerificationMailSendDate (otherCandidate.getVerificationMailSendDate ()); setVerificationMailSendDate (otherCandidate.getVerificationMailSendDate ());
} }
catch (FieldException ex) catch (FieldException ex)
...@@ -1715,6 +1982,8 @@ public abstract class BaseCandidate extends SecUserExtension ...@@ -1715,6 +1982,8 @@ public abstract class BaseCandidate extends SecUserExtension
BaseCandidate sourceCandidate = (BaseCandidate)(source); BaseCandidate sourceCandidate = (BaseCandidate)(source);
_Phone = sourceCandidate._Phone; _Phone = sourceCandidate._Phone;
_ForgotPasswordMailSendDate = sourceCandidate._ForgotPasswordMailSendDate;
_ForgotPasswordKey = sourceCandidate._ForgotPasswordKey;
_VerificationMailSendDate = sourceCandidate._VerificationMailSendDate; _VerificationMailSendDate = sourceCandidate._VerificationMailSendDate;
_VerificationKey = sourceCandidate._VerificationKey; _VerificationKey = sourceCandidate._VerificationKey;
_IsAccountVerified = sourceCandidate._IsAccountVerified; _IsAccountVerified = sourceCandidate._IsAccountVerified;
...@@ -1776,6 +2045,8 @@ public abstract class BaseCandidate extends SecUserExtension ...@@ -1776,6 +2045,8 @@ public abstract class BaseCandidate extends SecUserExtension
super.readExternalData(vals); super.readExternalData(vals);
_Phone = (String)(HELPER_Phone.readExternal (_Phone, vals.get(FIELD_Phone))); // _Phone = (String)(HELPER_Phone.readExternal (_Phone, vals.get(FIELD_Phone))); //
_ForgotPasswordMailSendDate = (Date)(HELPER_ForgotPasswordMailSendDate.readExternal (_ForgotPasswordMailSendDate, vals.get(FIELD_ForgotPasswordMailSendDate))); //
_ForgotPasswordKey = (String)(HELPER_ForgotPasswordKey.readExternal (_ForgotPasswordKey, vals.get(FIELD_ForgotPasswordKey))); //
_VerificationMailSendDate = (Date)(HELPER_VerificationMailSendDate.readExternal (_VerificationMailSendDate, vals.get(FIELD_VerificationMailSendDate))); // _VerificationMailSendDate = (Date)(HELPER_VerificationMailSendDate.readExternal (_VerificationMailSendDate, vals.get(FIELD_VerificationMailSendDate))); //
_VerificationKey = (String)(HELPER_VerificationKey.readExternal (_VerificationKey, vals.get(FIELD_VerificationKey))); // _VerificationKey = (String)(HELPER_VerificationKey.readExternal (_VerificationKey, vals.get(FIELD_VerificationKey))); //
_IsAccountVerified = (Boolean)(HELPER_IsAccountVerified.readExternal (_IsAccountVerified, vals.get(FIELD_IsAccountVerified))); // _IsAccountVerified = (Boolean)(HELPER_IsAccountVerified.readExternal (_IsAccountVerified, vals.get(FIELD_IsAccountVerified))); //
...@@ -1796,6 +2067,8 @@ public abstract class BaseCandidate extends SecUserExtension ...@@ -1796,6 +2067,8 @@ public abstract class BaseCandidate extends SecUserExtension
super.writeExternalData(vals); super.writeExternalData(vals);
vals.put (FIELD_Phone, HELPER_Phone.writeExternal (_Phone)); vals.put (FIELD_Phone, HELPER_Phone.writeExternal (_Phone));
vals.put (FIELD_ForgotPasswordMailSendDate, HELPER_ForgotPasswordMailSendDate.writeExternal (_ForgotPasswordMailSendDate));
vals.put (FIELD_ForgotPasswordKey, HELPER_ForgotPasswordKey.writeExternal (_ForgotPasswordKey));
vals.put (FIELD_VerificationMailSendDate, HELPER_VerificationMailSendDate.writeExternal (_VerificationMailSendDate)); vals.put (FIELD_VerificationMailSendDate, HELPER_VerificationMailSendDate.writeExternal (_VerificationMailSendDate));
vals.put (FIELD_VerificationKey, HELPER_VerificationKey.writeExternal (_VerificationKey)); vals.put (FIELD_VerificationKey, HELPER_VerificationKey.writeExternal (_VerificationKey));
vals.put (FIELD_IsAccountVerified, HELPER_IsAccountVerified.writeExternal (_IsAccountVerified)); vals.put (FIELD_IsAccountVerified, HELPER_IsAccountVerified.writeExternal (_IsAccountVerified));
...@@ -1821,6 +2094,14 @@ public abstract class BaseCandidate extends SecUserExtension ...@@ -1821,6 +2094,14 @@ public abstract class BaseCandidate extends SecUserExtension
{ {
listener.notifyFieldChange(this, other, FIELD_Phone, HELPER_Phone.toObject(this._Phone), HELPER_Phone.toObject(otherCandidate._Phone)); listener.notifyFieldChange(this, other, FIELD_Phone, HELPER_Phone.toObject(this._Phone), HELPER_Phone.toObject(otherCandidate._Phone));
} }
if (!HELPER_ForgotPasswordMailSendDate.compare(this._ForgotPasswordMailSendDate, otherCandidate._ForgotPasswordMailSendDate))
{
listener.notifyFieldChange(this, other, FIELD_ForgotPasswordMailSendDate, HELPER_ForgotPasswordMailSendDate.toObject(this._ForgotPasswordMailSendDate), HELPER_ForgotPasswordMailSendDate.toObject(otherCandidate._ForgotPasswordMailSendDate));
}
if (!HELPER_ForgotPasswordKey.compare(this._ForgotPasswordKey, otherCandidate._ForgotPasswordKey))
{
listener.notifyFieldChange(this, other, FIELD_ForgotPasswordKey, HELPER_ForgotPasswordKey.toObject(this._ForgotPasswordKey), HELPER_ForgotPasswordKey.toObject(otherCandidate._ForgotPasswordKey));
}
if (!HELPER_VerificationMailSendDate.compare(this._VerificationMailSendDate, otherCandidate._VerificationMailSendDate)) if (!HELPER_VerificationMailSendDate.compare(this._VerificationMailSendDate, otherCandidate._VerificationMailSendDate))
{ {
listener.notifyFieldChange(this, other, FIELD_VerificationMailSendDate, HELPER_VerificationMailSendDate.toObject(this._VerificationMailSendDate), HELPER_VerificationMailSendDate.toObject(otherCandidate._VerificationMailSendDate)); listener.notifyFieldChange(this, other, FIELD_VerificationMailSendDate, HELPER_VerificationMailSendDate.toObject(this._VerificationMailSendDate), HELPER_VerificationMailSendDate.toObject(otherCandidate._VerificationMailSendDate));
...@@ -1861,6 +2142,8 @@ public abstract class BaseCandidate extends SecUserExtension ...@@ -1861,6 +2142,8 @@ public abstract class BaseCandidate extends SecUserExtension
super.visitAttributes (visitor); super.visitAttributes (visitor);
visitor.visitField(this, FIELD_Phone, HELPER_Phone.toObject(getPhone())); visitor.visitField(this, FIELD_Phone, HELPER_Phone.toObject(getPhone()));
visitor.visitField(this, FIELD_ForgotPasswordMailSendDate, HELPER_ForgotPasswordMailSendDate.toObject(getForgotPasswordMailSendDate()));
visitor.visitField(this, FIELD_ForgotPasswordKey, HELPER_ForgotPasswordKey.toObject(getForgotPasswordKey()));
visitor.visitField(this, FIELD_VerificationMailSendDate, HELPER_VerificationMailSendDate.toObject(getVerificationMailSendDate())); visitor.visitField(this, FIELD_VerificationMailSendDate, HELPER_VerificationMailSendDate.toObject(getVerificationMailSendDate()));
visitor.visitField(this, FIELD_VerificationKey, HELPER_VerificationKey.toObject(getVerificationKey())); visitor.visitField(this, FIELD_VerificationKey, HELPER_VerificationKey.toObject(getVerificationKey()));
visitor.visitField(this, FIELD_IsAccountVerified, HELPER_IsAccountVerified.toObject(getIsAccountVerified())); visitor.visitField(this, FIELD_IsAccountVerified, HELPER_IsAccountVerified.toObject(getIsAccountVerified()));
...@@ -1926,6 +2209,14 @@ public abstract class BaseCandidate extends SecUserExtension ...@@ -1926,6 +2209,14 @@ public abstract class BaseCandidate extends SecUserExtension
{ {
return filter.matches (getPhone ()); return filter.matches (getPhone ());
} }
else if (attribName.equals (FIELD_ForgotPasswordMailSendDate))
{
return filter.matches (getForgotPasswordMailSendDate ());
}
else if (attribName.equals (FIELD_ForgotPasswordKey))
{
return filter.matches (getForgotPasswordKey ());
}
else if (attribName.equals (FIELD_VerificationMailSendDate)) else if (attribName.equals (FIELD_VerificationMailSendDate))
{ {
return filter.matches (getVerificationMailSendDate ()); return filter.matches (getVerificationMailSendDate ());
...@@ -1979,6 +2270,18 @@ public abstract class BaseCandidate extends SecUserExtension ...@@ -1979,6 +2270,18 @@ public abstract class BaseCandidate extends SecUserExtension
return this; return this;
} }
public SearchAll andForgotPasswordMailSendDate (QueryFilter<Date> filter)
{
filter.addFilter (context, "oneit_sec_user_extension.forgot_password_mail_send_date", "ForgotPasswordMailSendDate");
return this;
}
public SearchAll andForgotPasswordKey (QueryFilter<String> filter)
{
filter.addFilter (context, "oneit_sec_user_extension.forgot_password_key", "ForgotPasswordKey");
return this;
}
public SearchAll andVerificationMailSendDate (QueryFilter<Date> filter) public SearchAll andVerificationMailSendDate (QueryFilter<Date> filter)
{ {
filter.addFilter (context, "oneit_sec_user_extension.verification_mail_send_date", "VerificationMailSendDate"); filter.addFilter (context, "oneit_sec_user_extension.verification_mail_send_date", "VerificationMailSendDate");
...@@ -2078,6 +2381,18 @@ public abstract class BaseCandidate extends SecUserExtension ...@@ -2078,6 +2381,18 @@ public abstract class BaseCandidate extends SecUserExtension
return this; return this;
} }
public SearchIdPin andForgotPasswordMailSendDate (QueryFilter<Date> filter)
{
filter.addFilter (context, "oneit_sec_user_extension.forgot_password_mail_send_date", "ForgotPasswordMailSendDate");
return this;
}
public SearchIdPin andForgotPasswordKey (QueryFilter<String> filter)
{
filter.addFilter (context, "oneit_sec_user_extension.forgot_password_key", "ForgotPasswordKey");
return this;
}
public SearchIdPin andVerificationMailSendDate (QueryFilter<Date> filter) public SearchIdPin andVerificationMailSendDate (QueryFilter<Date> filter)
{ {
filter.addFilter (context, "oneit_sec_user_extension.verification_mail_send_date", "VerificationMailSendDate"); filter.addFilter (context, "oneit_sec_user_extension.verification_mail_send_date", "VerificationMailSendDate");
...@@ -2147,6 +2462,14 @@ public abstract class BaseCandidate extends SecUserExtension ...@@ -2147,6 +2462,14 @@ public abstract class BaseCandidate extends SecUserExtension
{ {
return HELPER_Phone.toObject (getPhone ()); return HELPER_Phone.toObject (getPhone ());
} }
else if (attribName.equals (FIELD_ForgotPasswordMailSendDate))
{
return HELPER_ForgotPasswordMailSendDate.toObject (getForgotPasswordMailSendDate ());
}
else if (attribName.equals (FIELD_ForgotPasswordKey))
{
return HELPER_ForgotPasswordKey.toObject (getForgotPasswordKey ());
}
else if (attribName.equals (FIELD_VerificationMailSendDate)) else if (attribName.equals (FIELD_VerificationMailSendDate))
{ {
return HELPER_VerificationMailSendDate.toObject (getVerificationMailSendDate ()); return HELPER_VerificationMailSendDate.toObject (getVerificationMailSendDate ());
...@@ -2176,6 +2499,14 @@ public abstract class BaseCandidate extends SecUserExtension ...@@ -2176,6 +2499,14 @@ public abstract class BaseCandidate extends SecUserExtension
{ {
return HELPER_Phone; return HELPER_Phone;
} }
else if (attribName.equals (FIELD_ForgotPasswordMailSendDate))
{
return HELPER_ForgotPasswordMailSendDate;
}
else if (attribName.equals (FIELD_ForgotPasswordKey))
{
return HELPER_ForgotPasswordKey;
}
else if (attribName.equals (FIELD_VerificationMailSendDate)) else if (attribName.equals (FIELD_VerificationMailSendDate))
{ {
return HELPER_VerificationMailSendDate; return HELPER_VerificationMailSendDate;
...@@ -2205,6 +2536,14 @@ public abstract class BaseCandidate extends SecUserExtension ...@@ -2205,6 +2536,14 @@ public abstract class BaseCandidate extends SecUserExtension
{ {
setPhone ((String)(HELPER_Phone.fromObject (_Phone, attribValue))); setPhone ((String)(HELPER_Phone.fromObject (_Phone, attribValue)));
} }
else if (attribName.equals (FIELD_ForgotPasswordMailSendDate))
{
setForgotPasswordMailSendDate ((Date)(HELPER_ForgotPasswordMailSendDate.fromObject (_ForgotPasswordMailSendDate, attribValue)));
}
else if (attribName.equals (FIELD_ForgotPasswordKey))
{
setForgotPasswordKey ((String)(HELPER_ForgotPasswordKey.fromObject (_ForgotPasswordKey, attribValue)));
}
else if (attribName.equals (FIELD_VerificationMailSendDate)) else if (attribName.equals (FIELD_VerificationMailSendDate))
{ {
setVerificationMailSendDate ((Date)(HELPER_VerificationMailSendDate.fromObject (_VerificationMailSendDate, attribValue))); setVerificationMailSendDate ((Date)(HELPER_VerificationMailSendDate.fromObject (_VerificationMailSendDate, attribValue)));
...@@ -2241,6 +2580,14 @@ public abstract class BaseCandidate extends SecUserExtension ...@@ -2241,6 +2580,14 @@ public abstract class BaseCandidate extends SecUserExtension
{ {
return getWriteability_Phone (); return getWriteability_Phone ();
} }
else if (fieldName.equals (FIELD_ForgotPasswordMailSendDate))
{
return getWriteability_ForgotPasswordMailSendDate ();
}
else if (fieldName.equals (FIELD_ForgotPasswordKey))
{
return getWriteability_ForgotPasswordKey ();
}
else if (fieldName.equals (FIELD_VerificationMailSendDate)) else if (fieldName.equals (FIELD_VerificationMailSendDate))
{ {
return getWriteability_VerificationMailSendDate (); return getWriteability_VerificationMailSendDate ();
...@@ -2288,6 +2635,16 @@ public abstract class BaseCandidate extends SecUserExtension ...@@ -2288,6 +2635,16 @@ public abstract class BaseCandidate extends SecUserExtension
fields.add (FIELD_Phone); fields.add (FIELD_Phone);
} }
if (getWriteability_ForgotPasswordMailSendDate () != FieldWriteability.TRUE)
{
fields.add (FIELD_ForgotPasswordMailSendDate);
}
if (getWriteability_ForgotPasswordKey () != FieldWriteability.TRUE)
{
fields.add (FIELD_ForgotPasswordKey);
}
if (getWriteability_VerificationMailSendDate () != FieldWriteability.TRUE) if (getWriteability_VerificationMailSendDate () != FieldWriteability.TRUE)
{ {
fields.add (FIELD_VerificationMailSendDate); fields.add (FIELD_VerificationMailSendDate);
...@@ -2313,6 +2670,8 @@ public abstract class BaseCandidate extends SecUserExtension ...@@ -2313,6 +2670,8 @@ public abstract class BaseCandidate extends SecUserExtension
result.add(HELPER_Phone.getAttribObject (getClass (), _Phone, false, FIELD_Phone)); result.add(HELPER_Phone.getAttribObject (getClass (), _Phone, false, FIELD_Phone));
result.add(HELPER_ForgotPasswordMailSendDate.getAttribObject (getClass (), _ForgotPasswordMailSendDate, false, FIELD_ForgotPasswordMailSendDate));
result.add(HELPER_ForgotPasswordKey.getAttribObject (getClass (), _ForgotPasswordKey, false, FIELD_ForgotPasswordKey));
result.add(HELPER_VerificationMailSendDate.getAttribObject (getClass (), _VerificationMailSendDate, false, FIELD_VerificationMailSendDate)); result.add(HELPER_VerificationMailSendDate.getAttribObject (getClass (), _VerificationMailSendDate, false, FIELD_VerificationMailSendDate));
result.add(HELPER_VerificationKey.getAttribObject (getClass (), _VerificationKey, false, FIELD_VerificationKey)); result.add(HELPER_VerificationKey.getAttribObject (getClass (), _VerificationKey, false, FIELD_VerificationKey));
result.add(HELPER_IsAccountVerified.getAttribObject (getClass (), _IsAccountVerified, false, FIELD_IsAccountVerified)); result.add(HELPER_IsAccountVerified.getAttribObject (getClass (), _IsAccountVerified, false, FIELD_IsAccountVerified));
...@@ -2385,6 +2744,42 @@ public abstract class BaseCandidate extends SecUserExtension ...@@ -2385,6 +2744,42 @@ public abstract class BaseCandidate extends SecUserExtension
} }
/** /**
* Get the attribute ForgotPasswordMailSendDate
*/
public Date getForgotPasswordMailSendDate (Candidate obj, Date original)
{
return original;
}
/**
* Change the value set for attribute ForgotPasswordMailSendDate.
* May modify the field beforehand
* Occurs before validation.
*/
public Date setForgotPasswordMailSendDate (Candidate obj, Date newForgotPasswordMailSendDate) throws FieldException
{
return newForgotPasswordMailSendDate;
}
/**
* Get the attribute ForgotPasswordKey
*/
public String getForgotPasswordKey (Candidate obj, String original)
{
return original;
}
/**
* Change the value set for attribute ForgotPasswordKey.
* May modify the field beforehand
* Occurs before validation.
*/
public String setForgotPasswordKey (Candidate obj, String newForgotPasswordKey) throws FieldException
{
return newForgotPasswordKey;
}
/**
* Get the attribute VerificationMailSendDate * Get the attribute VerificationMailSendDate
*/ */
public Date getVerificationMailSendDate (Candidate obj, Date original) public Date getVerificationMailSendDate (Candidate obj, Date original)
...@@ -2510,6 +2905,14 @@ public abstract class BaseCandidate extends SecUserExtension ...@@ -2510,6 +2905,14 @@ public abstract class BaseCandidate extends SecUserExtension
{ {
return toPhone (); return toPhone ();
} }
if (name.equals ("ForgotPasswordMailSendDate"))
{
return toForgotPasswordMailSendDate ();
}
if (name.equals ("ForgotPasswordKey"))
{
return toForgotPasswordKey ();
}
if (name.equals ("VerificationMailSendDate")) if (name.equals ("VerificationMailSendDate"))
{ {
return toVerificationMailSendDate (); return toVerificationMailSendDate ();
...@@ -2534,6 +2937,10 @@ public abstract class BaseCandidate extends SecUserExtension ...@@ -2534,6 +2937,10 @@ public abstract class BaseCandidate extends SecUserExtension
public PipeLine<From, String> toPhone () { return pipe(new ORMAttributePipe<Me, String>(FIELD_Phone)); } public PipeLine<From, String> toPhone () { return pipe(new ORMAttributePipe<Me, String>(FIELD_Phone)); }
public PipeLine<From, Date> toForgotPasswordMailSendDate () { return pipe(new ORMAttributePipe<Me, Date>(FIELD_ForgotPasswordMailSendDate)); }
public PipeLine<From, String> toForgotPasswordKey () { return pipe(new ORMAttributePipe<Me, String>(FIELD_ForgotPasswordKey)); }
public PipeLine<From, Date> toVerificationMailSendDate () { return pipe(new ORMAttributePipe<Me, Date>(FIELD_VerificationMailSendDate)); } public PipeLine<From, Date> toVerificationMailSendDate () { return pipe(new ORMAttributePipe<Me, Date>(FIELD_VerificationMailSendDate)); }
public PipeLine<From, String> toVerificationKey () { return pipe(new ORMAttributePipe<Me, String>(FIELD_VerificationKey)); } public PipeLine<From, String> toVerificationKey () { return pipe(new ORMAttributePipe<Me, String>(FIELD_VerificationKey)); }
......
...@@ -132,4 +132,23 @@ public class Candidate extends BaseCandidate ...@@ -132,4 +132,23 @@ public class Candidate extends BaseCandidate
new ObjectTransform[] {CultureCriteriaAnswer.pipesCultureCriteriaAnswer().toObjectID()}, new ObjectTransform[] {CultureCriteriaAnswer.pipesCultureCriteriaAnswer().toObjectID()},
new Comparator[]{CollectionUtils.DEFAULT_COMPARATOR}); new Comparator[]{CollectionUtils.DEFAULT_COMPARATOR});
} }
public static Candidate getCandidateForForgotPassword(ObjectTransaction transaction, String userIDStr, String code)
{
userIDStr = StringUtils.subBlanks(userIDStr);
code = StringUtils.subBlanks(code);
if(userIDStr != null && code!=null)
{
Candidate candidate = Candidate.getCandidateByID(transaction, Long.parseLong(userIDStr));
if(candidate != null && CollectionUtils.equals(candidate.getForgotPasswordKey(), code))
{
return candidate;
}
}
return null;
}
} }
\ No newline at end of file
...@@ -14,7 +14,8 @@ ...@@ -14,7 +14,8 @@
<TABLE name="oneit_sec_user_extension" tablePrefix="object" polymorphic="TRUE"> <TABLE name="oneit_sec_user_extension" tablePrefix="object" polymorphic="TRUE">
<ATTRIB name="Phone" type="String" dbcol="phone" length="30"/> <ATTRIB name="Phone" type="String" dbcol="phone" length="30"/>
<ATTRIB name="ForgotPasswordMailSendDate" type="Date" dbcol="forgot_password_mail_send_date" />
<ATTRIB name="ForgotPasswordKey" type="String" dbcol="forgot_password_key" length="10"/>
<ATTRIB name="VerificationMailSendDate" type="Date" dbcol="verification_mail_send_date" /> <ATTRIB name="VerificationMailSendDate" type="Date" dbcol="verification_mail_send_date" />
<ATTRIB name="VerificationKey" type="String" dbcol="verification_key" length="10"/> <ATTRIB name="VerificationKey" type="String" dbcol="verification_key" length="10"/>
<ATTRIB name="IsAccountVerified" type="Boolean" dbcol="is_account_verified" defaultValue="Boolean.FALSE"/> <ATTRIB name="IsAccountVerified" type="Boolean" dbcol="is_account_verified" defaultValue="Boolean.FALSE"/>
......
...@@ -28,6 +28,8 @@ public class CandidatePersistenceMgr extends SecUserExtensionPersistenceMgr ...@@ -28,6 +28,8 @@ public class CandidatePersistenceMgr extends SecUserExtensionPersistenceMgr
// Private attributes corresponding to business object data // Private attributes corresponding to business object data
private String dummyPhone; private String dummyPhone;
private Date dummyForgotPasswordMailSendDate;
private String dummyForgotPasswordKey;
private Date dummyVerificationMailSendDate; private Date dummyVerificationMailSendDate;
private String dummyVerificationKey; private String dummyVerificationKey;
private Boolean dummyIsAccountVerified; private Boolean dummyIsAccountVerified;
...@@ -35,6 +37,8 @@ public class CandidatePersistenceMgr extends SecUserExtensionPersistenceMgr ...@@ -35,6 +37,8 @@ public class CandidatePersistenceMgr extends SecUserExtensionPersistenceMgr
// Static constants corresponding to attribute helpers // Static constants corresponding to attribute helpers
private static final DefaultAttributeHelper HELPER_Phone = DefaultAttributeHelper.INSTANCE; private static final DefaultAttributeHelper HELPER_Phone = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper HELPER_ForgotPasswordMailSendDate = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper HELPER_ForgotPasswordKey = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper HELPER_VerificationMailSendDate = DefaultAttributeHelper.INSTANCE; private static final DefaultAttributeHelper HELPER_VerificationMailSendDate = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper HELPER_VerificationKey = DefaultAttributeHelper.INSTANCE; private static final DefaultAttributeHelper HELPER_VerificationKey = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper HELPER_IsAccountVerified = DefaultAttributeHelper.INSTANCE; private static final DefaultAttributeHelper HELPER_IsAccountVerified = DefaultAttributeHelper.INSTANCE;
...@@ -45,13 +49,15 @@ public class CandidatePersistenceMgr extends SecUserExtensionPersistenceMgr ...@@ -45,13 +49,15 @@ public class CandidatePersistenceMgr extends SecUserExtensionPersistenceMgr
public CandidatePersistenceMgr () public CandidatePersistenceMgr ()
{ {
dummyPhone = (String)(HELPER_Phone.initialise (dummyPhone)); dummyPhone = (String)(HELPER_Phone.initialise (dummyPhone));
dummyForgotPasswordMailSendDate = (Date)(HELPER_ForgotPasswordMailSendDate.initialise (dummyForgotPasswordMailSendDate));
dummyForgotPasswordKey = (String)(HELPER_ForgotPasswordKey.initialise (dummyForgotPasswordKey));
dummyVerificationMailSendDate = (Date)(HELPER_VerificationMailSendDate.initialise (dummyVerificationMailSendDate)); dummyVerificationMailSendDate = (Date)(HELPER_VerificationMailSendDate.initialise (dummyVerificationMailSendDate));
dummyVerificationKey = (String)(HELPER_VerificationKey.initialise (dummyVerificationKey)); dummyVerificationKey = (String)(HELPER_VerificationKey.initialise (dummyVerificationKey));
dummyIsAccountVerified = (Boolean)(HELPER_IsAccountVerified.initialise (dummyIsAccountVerified)); dummyIsAccountVerified = (Boolean)(HELPER_IsAccountVerified.initialise (dummyIsAccountVerified));
} }
private String SELECT_COLUMNS = "{PREFIX}oneit_sec_user_extension.object_id as id, {PREFIX}oneit_sec_user_extension.object_LAST_UPDATED_DATE as LAST_UPDATED_DATE, {PREFIX}oneit_sec_user_extension.object_CREATED_DATE as CREATED_DATE, {PREFIX}oneit_sec_user_extension.object_TYPE as OBJECT_TYPE, {PREFIX}oneit_sec_user_extension.phone, {PREFIX}oneit_sec_user_extension.verification_mail_send_date, {PREFIX}oneit_sec_user_extension.verification_key, {PREFIX}oneit_sec_user_extension.is_account_verified, {PREFIX}oneit_sec_user_extension.test_input_id, {PREFIX}oneit_sec_user_extension.user_id, 1 AS commasafe "; private String SELECT_COLUMNS = "{PREFIX}oneit_sec_user_extension.object_id as id, {PREFIX}oneit_sec_user_extension.object_LAST_UPDATED_DATE as LAST_UPDATED_DATE, {PREFIX}oneit_sec_user_extension.object_CREATED_DATE as CREATED_DATE, {PREFIX}oneit_sec_user_extension.object_TYPE as OBJECT_TYPE, {PREFIX}oneit_sec_user_extension.phone, {PREFIX}oneit_sec_user_extension.forgot_password_mail_send_date, {PREFIX}oneit_sec_user_extension.forgot_password_key, {PREFIX}oneit_sec_user_extension.verification_mail_send_date, {PREFIX}oneit_sec_user_extension.verification_key, {PREFIX}oneit_sec_user_extension.is_account_verified, {PREFIX}oneit_sec_user_extension.test_input_id, {PREFIX}oneit_sec_user_extension.user_id, 1 AS commasafe ";
private String SELECT_JOINS = ""; private String SELECT_JOINS = "";
public BaseBusinessClass fetchByID(ObjectID id, PersistentSetCollection allPSets, RDBMSPersistenceContext context, SQLManager sqlMgr) throws SQLException, StorageException public BaseBusinessClass fetchByID(ObjectID id, PersistentSetCollection allPSets, RDBMSPersistenceContext context, SQLManager sqlMgr) throws SQLException, StorageException
...@@ -104,6 +110,8 @@ public class CandidatePersistenceMgr extends SecUserExtensionPersistenceMgr ...@@ -104,6 +110,8 @@ public class CandidatePersistenceMgr extends SecUserExtensionPersistenceMgr
if (false || if (false ||
!oneit_sec_user_extensionPSet.containsAttrib("OBJECT_TYPE") || !oneit_sec_user_extensionPSet.containsAttrib(BaseBusinessClass.FIELD_ObjectLastModified) || !oneit_sec_user_extensionPSet.containsAttrib("OBJECT_TYPE") || !oneit_sec_user_extensionPSet.containsAttrib(BaseBusinessClass.FIELD_ObjectLastModified) ||
!oneit_sec_user_extensionPSet.containsAttrib(Candidate.FIELD_Phone)|| !oneit_sec_user_extensionPSet.containsAttrib(Candidate.FIELD_Phone)||
!oneit_sec_user_extensionPSet.containsAttrib(Candidate.FIELD_ForgotPasswordMailSendDate)||
!oneit_sec_user_extensionPSet.containsAttrib(Candidate.FIELD_ForgotPasswordKey)||
!oneit_sec_user_extensionPSet.containsAttrib(Candidate.FIELD_VerificationMailSendDate)|| !oneit_sec_user_extensionPSet.containsAttrib(Candidate.FIELD_VerificationMailSendDate)||
!oneit_sec_user_extensionPSet.containsAttrib(Candidate.FIELD_VerificationKey)|| !oneit_sec_user_extensionPSet.containsAttrib(Candidate.FIELD_VerificationKey)||
!oneit_sec_user_extensionPSet.containsAttrib(Candidate.FIELD_IsAccountVerified)|| !oneit_sec_user_extensionPSet.containsAttrib(Candidate.FIELD_IsAccountVerified)||
...@@ -207,10 +215,10 @@ public class CandidatePersistenceMgr extends SecUserExtensionPersistenceMgr ...@@ -207,10 +215,10 @@ public class CandidatePersistenceMgr extends SecUserExtensionPersistenceMgr
{ {
int rowsUpdated = executeStatement (sqlMgr, int rowsUpdated = executeStatement (sqlMgr,
"UPDATE {PREFIX}oneit_sec_user_extension " + "UPDATE {PREFIX}oneit_sec_user_extension " +
"SET phone = ?, verification_mail_send_date = ?, verification_key = ?, is_account_verified = ?, test_input_id = ? , user_id = ? , object_LAST_UPDATED_DATE = " + sqlMgr.getPortabilityServices ().getTimestampExpression () + " " + "SET phone = ?, forgot_password_mail_send_date = ?, forgot_password_key = ?, verification_mail_send_date = ?, verification_key = ?, is_account_verified = ?, test_input_id = ? , user_id = ? , object_LAST_UPDATED_DATE = " + sqlMgr.getPortabilityServices ().getTimestampExpression () + " " +
"WHERE oneit_sec_user_extension.object_id = ? AND " + getConcurrencyCheck (sqlMgr, "object_LAST_UPDATED_DATE", obj.getObjectLastModified ()) + " ", "WHERE oneit_sec_user_extension.object_id = ? AND " + getConcurrencyCheck (sqlMgr, "object_LAST_UPDATED_DATE", obj.getObjectLastModified ()) + " ",
CollectionUtils.listEntry (HELPER_Phone.getForSQL(dummyPhone, oneit_sec_user_extensionPSet.getAttrib (Candidate.FIELD_Phone))).listEntry (HELPER_VerificationMailSendDate.getForSQL(dummyVerificationMailSendDate, oneit_sec_user_extensionPSet.getAttrib (Candidate.FIELD_VerificationMailSendDate))).listEntry (HELPER_VerificationKey.getForSQL(dummyVerificationKey, oneit_sec_user_extensionPSet.getAttrib (Candidate.FIELD_VerificationKey))).listEntry (HELPER_IsAccountVerified.getForSQL(dummyIsAccountVerified, oneit_sec_user_extensionPSet.getAttrib (Candidate.FIELD_IsAccountVerified))).listEntry (SQLManager.CheckNull((Long)(oneit_sec_user_extensionPSet.getAttrib (Candidate.SINGLEREFERENCE_TestInput)))).listEntry (SQLManager.CheckNull((Long)(oneit_sec_user_extensionPSet.getAttrib (Candidate.SINGLEREFERENCE_User)))).listEntry (objectID.longID ()).listEntry (obj.getObjectLastModified ()).toList().toArray()); CollectionUtils.listEntry (HELPER_Phone.getForSQL(dummyPhone, oneit_sec_user_extensionPSet.getAttrib (Candidate.FIELD_Phone))).listEntry (HELPER_ForgotPasswordMailSendDate.getForSQL(dummyForgotPasswordMailSendDate, oneit_sec_user_extensionPSet.getAttrib (Candidate.FIELD_ForgotPasswordMailSendDate))).listEntry (HELPER_ForgotPasswordKey.getForSQL(dummyForgotPasswordKey, oneit_sec_user_extensionPSet.getAttrib (Candidate.FIELD_ForgotPasswordKey))).listEntry (HELPER_VerificationMailSendDate.getForSQL(dummyVerificationMailSendDate, oneit_sec_user_extensionPSet.getAttrib (Candidate.FIELD_VerificationMailSendDate))).listEntry (HELPER_VerificationKey.getForSQL(dummyVerificationKey, oneit_sec_user_extensionPSet.getAttrib (Candidate.FIELD_VerificationKey))).listEntry (HELPER_IsAccountVerified.getForSQL(dummyIsAccountVerified, oneit_sec_user_extensionPSet.getAttrib (Candidate.FIELD_IsAccountVerified))).listEntry (SQLManager.CheckNull((Long)(oneit_sec_user_extensionPSet.getAttrib (Candidate.SINGLEREFERENCE_TestInput)))).listEntry (SQLManager.CheckNull((Long)(oneit_sec_user_extensionPSet.getAttrib (Candidate.SINGLEREFERENCE_User)))).listEntry (objectID.longID ()).listEntry (obj.getObjectLastModified ()).toList().toArray());
if (rowsUpdated != 1) if (rowsUpdated != 1)
{ {
...@@ -574,6 +582,8 @@ public class CandidatePersistenceMgr extends SecUserExtensionPersistenceMgr ...@@ -574,6 +582,8 @@ public class CandidatePersistenceMgr extends SecUserExtensionPersistenceMgr
oneit_sec_user_extensionPSet.setAttrib(BaseBusinessClass.FIELD_ObjectCreated, r.getTimestamp ("CREATED_DATE"));oneit_sec_user_extensionPSet.setAttrib("OBJECT_TYPE", r.getString ("OBJECT_TYPE")); oneit_sec_user_extensionPSet.setAttrib(BaseBusinessClass.FIELD_ObjectCreated, r.getTimestamp ("CREATED_DATE"));oneit_sec_user_extensionPSet.setAttrib("OBJECT_TYPE", r.getString ("OBJECT_TYPE"));
oneit_sec_user_extensionPSet.setAttrib(Candidate.FIELD_Phone, HELPER_Phone.getFromRS(dummyPhone, r, "phone")); oneit_sec_user_extensionPSet.setAttrib(Candidate.FIELD_Phone, HELPER_Phone.getFromRS(dummyPhone, r, "phone"));
oneit_sec_user_extensionPSet.setAttrib(Candidate.FIELD_ForgotPasswordMailSendDate, HELPER_ForgotPasswordMailSendDate.getFromRS(dummyForgotPasswordMailSendDate, r, "forgot_password_mail_send_date"));
oneit_sec_user_extensionPSet.setAttrib(Candidate.FIELD_ForgotPasswordKey, HELPER_ForgotPasswordKey.getFromRS(dummyForgotPasswordKey, r, "forgot_password_key"));
oneit_sec_user_extensionPSet.setAttrib(Candidate.FIELD_VerificationMailSendDate, HELPER_VerificationMailSendDate.getFromRS(dummyVerificationMailSendDate, r, "verification_mail_send_date")); oneit_sec_user_extensionPSet.setAttrib(Candidate.FIELD_VerificationMailSendDate, HELPER_VerificationMailSendDate.getFromRS(dummyVerificationMailSendDate, r, "verification_mail_send_date"));
oneit_sec_user_extensionPSet.setAttrib(Candidate.FIELD_VerificationKey, HELPER_VerificationKey.getFromRS(dummyVerificationKey, r, "verification_key")); oneit_sec_user_extensionPSet.setAttrib(Candidate.FIELD_VerificationKey, HELPER_VerificationKey.getFromRS(dummyVerificationKey, r, "verification_key"));
oneit_sec_user_extensionPSet.setAttrib(Candidate.FIELD_IsAccountVerified, HELPER_IsAccountVerified.getFromRS(dummyIsAccountVerified, r, "is_account_verified")); oneit_sec_user_extensionPSet.setAttrib(Candidate.FIELD_IsAccountVerified, HELPER_IsAccountVerified.getFromRS(dummyIsAccountVerified, r, "is_account_verified"));
...@@ -596,10 +606,10 @@ public class CandidatePersistenceMgr extends SecUserExtensionPersistenceMgr ...@@ -596,10 +606,10 @@ public class CandidatePersistenceMgr extends SecUserExtensionPersistenceMgr
{ {
executeStatement (sqlMgr, executeStatement (sqlMgr,
"INSERT INTO {PREFIX}oneit_sec_user_extension " + "INSERT INTO {PREFIX}oneit_sec_user_extension " +
" (phone, verification_mail_send_date, verification_key, is_account_verified, test_input_id, user_id, object_id, object_LAST_UPDATED_DATE, object_CREATED_DATE, object_TYPE) " + " (phone, forgot_password_mail_send_date, forgot_password_key, verification_mail_send_date, verification_key, is_account_verified, test_input_id, user_id, object_id, object_LAST_UPDATED_DATE, object_CREATED_DATE, object_TYPE) " +
"VALUES " + "VALUES " +
" (?, ?, ?, ?, ?, ?, ?, " + sqlMgr.getPortabilityServices ().getTimestampExpression () + ", " + sqlMgr.getPortabilityServices ().getTimestampExpression () + ", ?)", " (?, ?, ?, ?, ?, ?, ?, ?, ?, " + sqlMgr.getPortabilityServices ().getTimestampExpression () + ", " + sqlMgr.getPortabilityServices ().getTimestampExpression () + ", ?)",
CollectionUtils.listEntry (HELPER_Phone.getForSQL(dummyPhone, oneit_sec_user_extensionPSet.getAttrib (Candidate.FIELD_Phone))).listEntry (HELPER_VerificationMailSendDate.getForSQL(dummyVerificationMailSendDate, oneit_sec_user_extensionPSet.getAttrib (Candidate.FIELD_VerificationMailSendDate))).listEntry (HELPER_VerificationKey.getForSQL(dummyVerificationKey, oneit_sec_user_extensionPSet.getAttrib (Candidate.FIELD_VerificationKey))).listEntry (HELPER_IsAccountVerified.getForSQL(dummyIsAccountVerified, oneit_sec_user_extensionPSet.getAttrib (Candidate.FIELD_IsAccountVerified))) .listEntry (SQLManager.CheckNull((Long)(oneit_sec_user_extensionPSet.getAttrib (Candidate.SINGLEREFERENCE_TestInput)))).listEntry (SQLManager.CheckNull((Long)(oneit_sec_user_extensionPSet.getAttrib (Candidate.SINGLEREFERENCE_User)))) .listEntry (objectID.longID ()).listEntry (context.getTag (obj)).toList().toArray()); CollectionUtils.listEntry (HELPER_Phone.getForSQL(dummyPhone, oneit_sec_user_extensionPSet.getAttrib (Candidate.FIELD_Phone))).listEntry (HELPER_ForgotPasswordMailSendDate.getForSQL(dummyForgotPasswordMailSendDate, oneit_sec_user_extensionPSet.getAttrib (Candidate.FIELD_ForgotPasswordMailSendDate))).listEntry (HELPER_ForgotPasswordKey.getForSQL(dummyForgotPasswordKey, oneit_sec_user_extensionPSet.getAttrib (Candidate.FIELD_ForgotPasswordKey))).listEntry (HELPER_VerificationMailSendDate.getForSQL(dummyVerificationMailSendDate, oneit_sec_user_extensionPSet.getAttrib (Candidate.FIELD_VerificationMailSendDate))).listEntry (HELPER_VerificationKey.getForSQL(dummyVerificationKey, oneit_sec_user_extensionPSet.getAttrib (Candidate.FIELD_VerificationKey))).listEntry (HELPER_IsAccountVerified.getForSQL(dummyIsAccountVerified, oneit_sec_user_extensionPSet.getAttrib (Candidate.FIELD_IsAccountVerified))) .listEntry (SQLManager.CheckNull((Long)(oneit_sec_user_extensionPSet.getAttrib (Candidate.SINGLEREFERENCE_TestInput)))).listEntry (SQLManager.CheckNull((Long)(oneit_sec_user_extensionPSet.getAttrib (Candidate.SINGLEREFERENCE_User)))) .listEntry (objectID.longID ()).listEntry (context.getTag (obj)).toList().toArray());
oneit_sec_user_extensionPSet.setStatus (PersistentSetStatus.PROCESSED); oneit_sec_user_extensionPSet.setStatus (PersistentSetStatus.PROCESSED);
} }
......
...@@ -44,6 +44,7 @@ public class WebUtils ...@@ -44,6 +44,7 @@ public class WebUtils
public static final String RESET_PASSWORD_ARTICLE = "ResetPasswordEmail"; public static final String RESET_PASSWORD_ARTICLE = "ResetPasswordEmail";
public static final String COMPANY_ACCOUNT_VERIFICATION = "CompanyAccountVerification"; public static final String COMPANY_ACCOUNT_VERIFICATION = "CompanyAccountVerification";
public static final String MY_DETAILS = "MyDetails"; public static final String MY_DETAILS = "MyDetails";
public static final String RESET_PASSWORD = "ResetPassword";
public static String getArticleLink(HttpServletRequest request, ObjectTransaction objTran, String articleShortcut, String renderMode) public static String getArticleLink(HttpServletRequest request, ObjectTransaction objTran, String articleShortcut, String renderMode)
......
...@@ -16,6 +16,10 @@ ...@@ -16,6 +16,10 @@
<FORM name="*.facebookOAuthLogin" factory="Participant" class="oneit.security.oauth.form.FacebookOAuthLoginFP"/> <FORM name="*.facebookOAuthLogin" factory="Participant" class="oneit.security.oauth.form.FacebookOAuthLoginFP"/>
<FORM name="*.googleOAuthLogin" factory="Participant" class="oneit.security.oauth.form.GoogleOAuthLoginFP"/> <FORM name="*.googleOAuthLogin" factory="Participant" class="oneit.security.oauth.form.GoogleOAuthLoginFP"/>
<!--<FORM name="*.linkedinOAuthLogin" factory="Participant" class="performa.form.LinkedInOAuthLoginFP"/>--> <!--<FORM name="*.linkedinOAuthLogin" factory="Participant" class="performa.form.LinkedInOAuthLoginFP"/>-->
<FORM name="*.forgotPassword" factory="Participant" class="performa.form.ForgotPasswordFP">
<ResetCodeEmailer factory="Participant" class="oneit.email.ConfigurableArticleTemplateEmailer" templateShortcut="ResetCodeEmail"/>
</FORM>
<FORM name="*.resetPassword" factory="Participant" class="performa.form.ResetPasswordFP"/>
</NODE> </NODE>
<NODE name="dynamic_content_form_applicant" factory="Participant"> <NODE name="dynamic_content_form_applicant" factory="Participant">
......
...@@ -25,6 +25,8 @@ ...@@ -25,6 +25,8 @@
<RenderMode name="Page" preIncludeJSP="extensions/applicantportal/job_overview.jsp"/> <RenderMode name="Page" preIncludeJSP="extensions/applicantportal/job_overview.jsp"/>
<RenderMode name="SignIn" preIncludeJSP="extensions/applicantportal/sign_in.jsp"/> <RenderMode name="SignIn" preIncludeJSP="extensions/applicantportal/sign_in.jsp"/>
<RenderMode name="ForgotPassword" preIncludeJSP="extensions/applicantportal/forgot_password.jsp"/> <RenderMode name="ForgotPassword" preIncludeJSP="extensions/applicantportal/forgot_password.jsp"/>
<RenderMode name="ResetPassword" preIncludeJSP="extensions/applicantportal/forgot_password.jsp"/>
<RenderMode name="ResetPasswordSent" preIncludeJSP="extensions/applicantportal/reset_password_sent.jsp"/>
</NODE> </NODE>
......
...@@ -53,9 +53,8 @@ ...@@ -53,9 +53,8 @@
</div> </div>
<div class="form-group"> <div class="form-group">
<oneit:button value="Send" name="forgotPassword" cssClass="box-btn send-btn" <oneit:button value="Send" name="gotoPage" cssClass="box-btn send-btn"
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", "sign_in.jsp?sent=true") requestAttribs="<%= CollectionUtils.mapEntry("nextPage", WebUtils.getSamePageInRenderMode(request, "ResetPasswordSent"))
.mapEntry(NotificationUtils.NOTIFICATION_MSG_PARAM, "resetPasswordEmailSent")
.toMap() %>"/> .toMap() %>"/>
</div> </div>
</div> </div>
......
<%@ page extends="oneit.servlets.jsp.JSPInclude" %>
<%@ include file="/setuprequest.jsp" %>
<%@ include file="/inc/stdimports50.jsp" %><%-- This is in cougar --%>
<%@ include file="/extensions/performa/inc/stdimports.jsp" %>
<oneit:dynIncluded>
<%
ORMProcessState process = (ORMProcessState)ProcessDecorator.getDefaultProcess(request);
String candidateID = (String) process.getAttribute("candidateID"); //request.getParameter("id");
String forgotpasswordCode = (String) process.getAttribute("forgotpasswordCode"); //request.getParameter("key");
SecUser user = (SecUser) process.getAttribute("SecUser");
Article home = WebUtils.getArticleByShortCut(process.getTransaction(), WebUtils.ADMIN_HOME);
String nextPage = home.getLink(request);
if(request.getParameter("id")!=null)
{
candidateID = request.getParameter("id");
process.setAttribute("candidateID", candidateID);
}
if(request.getParameter("key")!=null)
{
forgotpasswordCode = request.getParameter("key");
process.setAttribute("forgotpasswordCode", forgotpasswordCode);
}
if(StringUtils.subBlanks(companyUserID) != null)
{
Canddate candidate = CompanyUser.getCandidateForForgotPassword(process.getTransaction(), candidateID, forgotpasswordCode);
if(candidate != null)
{
user = candidate.getUser();
// if(StringUtils.subBlanks(forgotpasswordCode) != null)
// {
// RandomStringGen random = new RandomStringGen();
//
// user.setAttribute("md5:Password", random.generateAlphaNum(8));
// }
process.setAttribute("SecUser", user);
}
}
%>
<script type="text/javascript">
$(document).ready(function() {
validate();
$('input').on('change keyup', function() { validate() });
});
function validate() {
var empty = false;
$('.password-field').each(function() {
if ( $.trim($( this ).val()) == '') {
empty = true;
}
});
if (empty) {
$('.reset-btn').attr('disabled', 'disabled');
} else {
$('.reset-btn').removeAttr('disabled');
}
}
</script>
<style>
button[disabled] {
opacity: 0.6;
background-color: #0582ba;
}
</style>
<oneit:form name="resetPassword" method="post">
<oneit:dynInclude page="/extensions/applicantportal/inc/multifieldtext.jsp" data="<%= CollectionUtils.EMPTY_MAP%>"/>
<%
if(user!=null)
{
String key = Utils.getPwdKeyOfSecUser(request, user, true);
%>
<div class="main-box-layout login-box">
<div class="text-left">
<p >
Please enter a new password below.
</p>
</div>
<div>&nbsp;</div>
<div class="form-group text-left">
<label>Password *</label>
<oneit:input type="password" name="<%= key %>" class="form-control password-field"/>
</div> <!-- form-group -->
<div class="form-group text-left">
<label>Confirm Password *</label>
<oneit:input type="password" name="<%= key + 2 %>" class="form-control password-field"/>
</div> <!-- form-group -->
<div class="col-sm-12">
<oneit:button value="Set New Password" name="resetPassword" cssClass="box-btn reset-btn"
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", nextPage).toMap() %>"/>
</div>
</div>
<%
}
else
{
%>
<h3 class="text-danger">Invalid User or this link has been expired, generate new link to access this page.</h3>
<%
}
%>
</oneit:form>
</oneit:dynIncluded>
\ No newline at end of file
<%@ page extends="oneit.servlets.jsp.JSPInclude" %>
<%@ include file="/setuprequest.jsp" %>
<%@ include file="/inc/stdimports50.jsp" %><%-- This is in cougar --%>
<%@ include file="/extensions/performa/inc/stdimports.jsp" %>
<oneit:dynIncluded>
<div class="main-verify-identity">
<div class="login-logo"><img src="<%= request.getContextPath() %>/images/logo.svg" /></div>
<div class="main-box-layout login-box">
<div class="text-left">
<p>
Enter your email address below. If we find a matching account, then you'll receive an email with a password reset link.
</p>
</div>
</div>
</div>
</oneit:dynIncluded>
\ No newline at end of file
...@@ -144,6 +144,7 @@ ...@@ -144,6 +144,7 @@
<div class="form-group"> <div class="form-group">
<oneit:button value="Forgot password?" name="gotoPage" cssClass="forgot-pass" skin="link" <oneit:button value="Forgot password?" name="gotoPage" cssClass="forgot-pass" skin="link"
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", WebUtils.getSamePageInRenderMode(request, "ForgotPassword")) requestAttribs="<%= CollectionUtils.mapEntry("nextPage", WebUtils.getSamePageInRenderMode(request, "ForgotPassword"))
.mapEntry("procParams", CollectionUtils.mapEntry("Job", job).toMap())
.toMap() %>"/> .toMap() %>"/>
<oneit:button value="Sign In" name="signIn" cssClass="box-btn sign-in-btn" <oneit:button value="Sign In" name="signIn" cssClass="box-btn sign-in-btn"
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", nextPage) requestAttribs="<%= CollectionUtils.mapEntry("nextPage", nextPage)
......
<?xml version="1.0" encoding="UTF-8"?>
<!-- @AutoRun -->
<OBJECTS name="" xmlns:oneit="http://www.1iT.com.au">
<NODE name="Script" factory="Vector">
<NODE name="DDL" factory="Participant" class="oneit.sql.transfer.RedefineTableOperation">
<tableName factory="String">oneit_sec_user_extension</tableName>
<column name="forgot_password_mail_send_date" type="Date" nullable="true"/>
<column name="forgot_password_key" type="String" nullable="true" length="10"/>
</NODE>
</NODE>
</OBJECTS>
\ No newline at end of file
Markdown is supported
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