Commit 3a0c6d4a by chenith Committed by Harsh Shah

Introduced signup/new company account creation in admin portal.

Added account verification email for company.
parent 3de71597
......@@ -13,6 +13,9 @@
<column name="forgot_password_key" type="String" nullable="true" length="10"/>
<column name="role_type" type="String" nullable="true" length="200"/>
<column name="phone" type="String" nullable="true" length="30"/>
<column name="verification_mail_send_date" type="Date" nullable="true"/>
<column name="verification_key" type="String" nullable="true" length="10"/>
<column name="is_account_verified" type="Boolean" nullable="true"/>
<column name="user_id" type="Long" length="11" nullable="true"/>
<column name="company_id" type="Long" length="11" nullable="true"/>
</NODE>
......
......@@ -12,6 +12,9 @@ CREATE TABLE oneit_sec_user_extension (
forgot_password_key varchar(10) NULL,
role_type varchar(200) NULL,
phone varchar(30) NULL,
verification_mail_send_date datetime NULL,
verification_key varchar(10) NULL,
is_account_verified char(1) NULL,
user_id numeric(12) NULL,
company_id numeric(12) NULL
);
......
......@@ -13,6 +13,9 @@ CREATE TABLE oneit_sec_user_extension (
forgot_password_key varchar2(10) NULL,
role_type varchar2(200) NULL,
phone varchar2(30) NULL,
verification_mail_send_date date NULL,
verification_key varchar2(10) NULL,
is_account_verified char(1) NULL,
user_id number(12) NULL,
company_id number(12) NULL
);
......
......@@ -13,6 +13,9 @@ CREATE TABLE oneit_sec_user_extension (
forgot_password_key varchar(10) NULL,
role_type varchar(200) NULL,
phone varchar(30) NULL,
verification_mail_send_date timestamp NULL,
verification_key varchar(10) NULL,
is_account_verified char(1) NULL,
user_id numeric(12) NULL,
company_id numeric(12) NULL
);
......
......@@ -12,6 +12,7 @@ import oneit.net.LoopbackHTTP;
import oneit.objstore.ObjectTransaction;
import oneit.objstore.StorageException;
import oneit.objstore.parser.BusinessObjectParser;
import oneit.objstore.rdbms.filters.EqualsFilter;
import oneit.security.SecUser;
import oneit.servlets.forms.*;
import oneit.servlets.process.*;
......@@ -31,10 +32,23 @@ public class SendVerificationMailFP extends SaveFP
@Override
public void validate(ORMProcessState process, SubmissionDetails submission, MultiException exceptions, Map params) throws StorageException
{
HttpServletRequest request = submission.getRequest();
Job job = (Job) request.getAttribute("Job");
HttpServletRequest request = submission.getRequest();
Job job = (Job) request.getAttribute("Job");
Company company = (Company) request.getAttribute("Company");
Debug.assertion(company != null || job!=null, "BO not avaialble");
BusinessObjectParser.assertFieldCondition(!job.isEmailFound(), job, Job.FIELD_Email, "emailExists", exceptions, true, request);
if(company!=null)
{
CompanyUser companyUser = company.getAddedByUser();
SecUser secUser = companyUser.getUser();
BusinessObjectParser.assertFieldCondition(!isEmailFound(process.getTransaction(), secUser.getEmail()), secUser, SecUser.FIELD_Email, "emailExists", exceptions, true, request);
}
else
{
BusinessObjectParser.assertFieldCondition(!job.isEmailFound(), job, Job.FIELD_Email, "emailExists", exceptions, true, request);
}
super.validate(process, submission, exceptions, params);
}
......@@ -46,33 +60,56 @@ public class SendVerificationMailFP extends SaveFP
HttpServletRequest request = submission.getRequest();
ObjectTransaction objTran = process.getTransaction();
Job job = (Job) request.getAttribute("Job");
String email = job.getEmail();
Company company = (Company) request.getAttribute("Company");
Debug.assertion(email != null, "Email not avaialble");
LogMgr.log(LOG, LogLevel.PROCESSING1, "Started to send varification email.", job , email);
SecUser secUser = SecUser.searchNAME(objTran, email);
Debug.assertion(secUser == null, "user available", email);
if(company!=null)
{
CompanyUser companyUser = company.getAddedByUser();
SecUser secUser = companyUser.getUser();
LogMgr.log(LOG, LogLevel.PROCESSING1, "Inside SendVerificationMailFP for send account verification mail for ", email);
LogMgr.log(LOG, LogLevel.PROCESSING1, "Started to send varification email.", companyUser);
secUser.setUserName(secUser.getEmail().toLowerCase());
secUser.setAttribute("md5:" + SecUser.FIELD_Password, DEFAULT_PASSWORD);
secUser.addRole(Utils.getRole(Utils.ROLE_CLIENT, objTran));
LogMgr.log(LOG, LogLevel.PROCESSING1, "New user created :: ", secUser);
SecUser newSecUser = SecUser.createSecUser(objTran);
sendVerificationMail(companyUser, request);
newSecUser.setUserName(email.toLowerCase());
newSecUser.setAttribute("md5:" + SecUser.FIELD_Password, DEFAULT_PASSWORD);
LogMgr.log(LOG, LogLevel.PROCESSING1, "End of sending varification email.", companyUser);
}
else
{
String email = job.getEmail();
LogMgr.log(LOG, LogLevel.PROCESSING1, "New user created :: ", newSecUser);
Debug.assertion(email != null, "Email not avaialble");
email = email.toLowerCase();
newSecUser.addRole(Utils.getRole(Utils.ROLE_APPLICANT, objTran));
LogMgr.log(LOG, LogLevel.PROCESSING1, "Started to send varification email.", job , email);
Candidate candidate = newSecUser.getExtensionOrCreate(Candidate.REFERENCE_Candidate);
SecUser secUser = SecUser.searchNAME(objTran, email);
sendVerificationMail(candidate, job, request);
request.setAttribute("nextPage", request.getAttribute("nextPage") + "&JobID=" + job.getID());
Debug.assertion(secUser == null, "user available", email);
LogMgr.log(LOG, LogLevel.PROCESSING1, "Inside SendVerificationMailFP for send account verification mail for ", email);
SecUser newSecUser = SecUser.createSecUser(objTran);
newSecUser.setUserName(email);
newSecUser.setAttribute("md5:" + SecUser.FIELD_Password, DEFAULT_PASSWORD);
newSecUser.addRole(Utils.getRole(Utils.ROLE_APPLICANT, objTran));
Candidate candidate = newSecUser.getExtensionOrCreate(Candidate.REFERENCE_Candidate);
LogMgr.log(LOG, LogLevel.PROCESSING1, "New user created :: ", newSecUser);
sendVerificationMail(candidate, job, request);
request.setAttribute("nextPage", request.getAttribute("nextPage") + "&JobID=" + job.getID());
}
return super.processForm(process, submission, params);
}
......@@ -127,4 +164,60 @@ public class SendVerificationMailFP extends SaveFP
LogMgr.log(LOG, LogLevel.PROCESSING1, "Call from " + SendVerificationMailFP.class + ". Account is already verified for candidate :: ", candidate);
}
}
protected void sendVerificationMail(CompanyUser companyUser, HttpServletRequest request) throws BusinessException
{
if(companyUser.getIsAccountVerified()!=Boolean.TRUE)
{
try
{
LogMgr.log(LOG, LogLevel.PROCESSING1, "Sending verification mail from SendVerificationMailFP to :: ", companyUser);
Article verificationArticle = WebUtils.getArticleByShortCut(companyUser.getTransaction(), WebUtils.COMPANY_ACCOUNT_VERIFICATION);
RandomStringGen random = new RandomStringGen();
//set verification key and send mail time
companyUser.setVerificationKey(random.generateAlphaNum(6));
companyUser.setVerificationMailSendDate(new Date());
String link = LoopbackHTTP.getRemoteAccessURL(request)
+ verificationArticle.getLink(request, CollectionUtils.EMPTY_MAP, "/")
+ "?id=" + companyUser.getID()
+ "&key=" + companyUser.getVerificationKey();
Map defaultParams = CollectionUtils.mapEntry("link", link).toMap();
ObjectTransform transform = Utils.createCompoundTransform(defaultParams, companyUser);
Utils.sendMail(emailer, transform, new String[]{companyUser.getUser().getEmail()}, null, companyUser);
LogMgr.log(LOG, LogLevel.PROCESSING1, "Sent verification mail successfully from " + SendVerificationMailFP.class + " to :: ", companyUser);
}
catch (ConfigurableEmailerException ex)
{
LogMgr.log(LOG, LogLevel.SYSTEMERROR1, ex, "Error occured while sending mail for Candidate :: " + companyUser);
throw new BusinessException("We are unable to send mail. Please try again or contact Talentology for more details.");
}
}
else
{
LogMgr.log(LOG, LogLevel.PROCESSING1, "Call from " + SendVerificationMailFP.class + ". Account is already verified for candidate :: ", companyUser);
}
}
private Boolean isEmailFound(ObjectTransaction objTran, String email)
{
if(email!=null)
{
SecUser user = SecUser.searchNAME(objTran, email.toLowerCase());
if(user!=null) //&& user.getExtension(CompanyUser.REFERENCE_CompanyUser)!=null
{
return Boolean.TRUE;
}
}
return Boolean.FALSE;
}
}
\ No newline at end of file
......@@ -46,11 +46,15 @@ public abstract class BaseCompanyUser extends SecUserExtension
public static final String FIELD_ForgotPasswordKey = "ForgotPasswordKey";
public static final String FIELD_Role = "Role";
public static final String FIELD_Phone = "Phone";
public static final String FIELD_VerificationMailSendDate = "VerificationMailSendDate";
public static final String FIELD_VerificationKey = "VerificationKey";
public static final String FIELD_IsAccountVerified = "IsAccountVerified";
public static final String SINGLEREFERENCE_Company = "Company";
public static final String BACKREF_Company = "";
// Static constants corresponding to searches
public static final String SEARCH_All = "All";
public static final String SEARCH_IdPin = "IdPin";
// Static constants corresponding to attribute helpers
......@@ -58,6 +62,9 @@ public abstract class BaseCompanyUser extends SecUserExtension
private static final DefaultAttributeHelper<CompanyUser> HELPER_ForgotPasswordKey = DefaultAttributeHelper.INSTANCE;
private static final EnumeratedAttributeHelper<CompanyUser, RoleType> HELPER_Role = new EnumeratedAttributeHelper<CompanyUser, RoleType> (RoleType.FACTORY_RoleType);
private static final DefaultAttributeHelper<CompanyUser> HELPER_Phone = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper<CompanyUser> HELPER_VerificationMailSendDate = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper<CompanyUser> HELPER_VerificationKey = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper<CompanyUser> HELPER_IsAccountVerified = DefaultAttributeHelper.INSTANCE;
// Private attributes corresponding to business object data
......@@ -65,6 +72,9 @@ public abstract class BaseCompanyUser extends SecUserExtension
private String _ForgotPasswordKey;
private RoleType _Role;
private String _Phone;
private Date _VerificationMailSendDate;
private String _VerificationKey;
private Boolean _IsAccountVerified;
// Private attributes corresponding to single references
......@@ -82,6 +92,9 @@ public abstract class BaseCompanyUser extends SecUserExtension
private static final AttributeValidator[] FIELD_ForgotPasswordKey_Validators;
private static final AttributeValidator[] FIELD_Role_Validators;
private static final AttributeValidator[] FIELD_Phone_Validators;
private static final AttributeValidator[] FIELD_VerificationMailSendDate_Validators;
private static final AttributeValidator[] FIELD_VerificationKey_Validators;
private static final AttributeValidator[] FIELD_IsAccountVerified_Validators;
// Arrays of behaviour decorators
......@@ -101,6 +114,9 @@ public abstract class BaseCompanyUser extends SecUserExtension
FIELD_ForgotPasswordKey_Validators = (AttributeValidator[])setupAttribMetaData_ForgotPasswordKey(validatorMapping).toArray (new AttributeValidator[0]);
FIELD_Role_Validators = (AttributeValidator[])setupAttribMetaData_Role(validatorMapping).toArray (new AttributeValidator[0]);
FIELD_Phone_Validators = (AttributeValidator[])setupAttribMetaData_Phone(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_IsAccountVerified_Validators = (AttributeValidator[])setupAttribMetaData_IsAccountVerified(validatorMapping).toArray (new AttributeValidator[0]);
REFERENCE_CompanyUser.initialiseReference ();
......@@ -207,6 +223,62 @@ public abstract class BaseCompanyUser extends SecUserExtension
return validators;
}
// Meta Info setup
private static List setupAttribMetaData_VerificationMailSendDate(Map validatorMapping)
{
Map metaInfo = new HashMap ();
metaInfo.put ("dbcol", "verification_mail_send_date");
metaInfo.put ("name", "VerificationMailSendDate");
metaInfo.put ("type", "Date");
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG2, "Metadata for CompanyUser.VerificationMailSendDate:", metaInfo);
ATTRIBUTES_METADATA_CompanyUser.put (FIELD_VerificationMailSendDate, Collections.unmodifiableMap (metaInfo));
List validators = BaseBusinessClass.getAttribValidators(CompanyUser.class, "VerificationMailSendDate", metaInfo, validatorMapping);
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG1, "Validators for CompanyUser.VerificationMailSendDate:", validators);
return validators;
}
// Meta Info setup
private static List setupAttribMetaData_VerificationKey(Map validatorMapping)
{
Map metaInfo = new HashMap ();
metaInfo.put ("dbcol", "verification_key");
metaInfo.put ("length", "10");
metaInfo.put ("name", "VerificationKey");
metaInfo.put ("type", "String");
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG2, "Metadata for CompanyUser.VerificationKey:", metaInfo);
ATTRIBUTES_METADATA_CompanyUser.put (FIELD_VerificationKey, Collections.unmodifiableMap (metaInfo));
List validators = BaseBusinessClass.getAttribValidators(CompanyUser.class, "VerificationKey", metaInfo, validatorMapping);
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG1, "Validators for CompanyUser.VerificationKey:", validators);
return validators;
}
// Meta Info setup
private static List setupAttribMetaData_IsAccountVerified(Map validatorMapping)
{
Map metaInfo = new HashMap ();
metaInfo.put ("dbcol", "is_account_verified");
metaInfo.put ("defaultValue", "Boolean.FALSE");
metaInfo.put ("name", "IsAccountVerified");
metaInfo.put ("type", "Boolean");
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG2, "Metadata for CompanyUser.IsAccountVerified:", metaInfo);
ATTRIBUTES_METADATA_CompanyUser.put (FIELD_IsAccountVerified, Collections.unmodifiableMap (metaInfo));
List validators = BaseBusinessClass.getAttribValidators(CompanyUser.class, "IsAccountVerified", metaInfo, validatorMapping);
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG1, "Validators for CompanyUser.IsAccountVerified:", validators);
return validators;
}
// END OF STATIC METADATA DEFINITION
......@@ -238,6 +310,9 @@ public abstract class BaseCompanyUser extends SecUserExtension
_ForgotPasswordKey = (String)(HELPER_ForgotPasswordKey.initialise (_ForgotPasswordKey));
_Role = (RoleType)(HELPER_Role.initialise (_Role));
_Phone = (String)(HELPER_Phone.initialise (_Phone));
_VerificationMailSendDate = (Date)(HELPER_VerificationMailSendDate.initialise (_VerificationMailSendDate));
_VerificationKey = (String)(HELPER_VerificationKey.initialise (_VerificationKey));
_IsAccountVerified = (Boolean)(Boolean.FALSE);
}
......@@ -656,6 +731,300 @@ public abstract class BaseCompanyUser extends SecUserExtension
}
}
/**
* Get the attribute VerificationMailSendDate
*/
public Date getVerificationMailSendDate ()
{
assertValid();
Date valToReturn = _VerificationMailSendDate;
for (CompanyUserBehaviourDecorator bhd : CompanyUser_BehaviourDecorators)
{
valToReturn = bhd.getVerificationMailSendDate ((CompanyUser)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 preVerificationMailSendDateChange (Date newVerificationMailSendDate) 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 postVerificationMailSendDateChange () throws FieldException
{
}
public FieldWriteability getWriteability_VerificationMailSendDate ()
{
return getFieldWritabilityUtil (FieldWriteability.TRUE);
}
/**
* Set the attribute VerificationMailSendDate. Checks to ensure a new value
* has been supplied. If so, marks the field as altered and sets the attribute.
*/
public void setVerificationMailSendDate (Date newVerificationMailSendDate) throws FieldException
{
boolean oldAndNewIdentical = HELPER_VerificationMailSendDate.compare (_VerificationMailSendDate, newVerificationMailSendDate);
try
{
for (CompanyUserBehaviourDecorator bhd : CompanyUser_BehaviourDecorators)
{
newVerificationMailSendDate = bhd.setVerificationMailSendDate ((CompanyUser)this, newVerificationMailSendDate);
oldAndNewIdentical = HELPER_VerificationMailSendDate.compare (_VerificationMailSendDate, newVerificationMailSendDate);
}
if (FIELD_VerificationMailSendDate_Validators.length > 0)
{
Object newVerificationMailSendDateObj = HELPER_VerificationMailSendDate.toObject (newVerificationMailSendDate);
if (newVerificationMailSendDateObj != null)
{
int loopMax = FIELD_VerificationMailSendDate_Validators.length;
Map metadata = (Map)ATTRIBUTES_METADATA_CompanyUser.get (FIELD_VerificationMailSendDate);
for (int v = 0 ; v < loopMax ; ++v)
{
FIELD_VerificationMailSendDate_Validators[v].checkAttribute (this, FIELD_VerificationMailSendDate, metadata, newVerificationMailSendDateObj);
}
}
}
}
catch (FieldException e)
{
if (!oldAndNewIdentical)
{
e.setWouldModify ();
}
throw e;
}
if (!oldAndNewIdentical)
{
assertValid();
Debug.assertion (getWriteability_VerificationMailSendDate () != FieldWriteability.FALSE, "Field VerificationMailSendDate is not writeable");
preVerificationMailSendDateChange (newVerificationMailSendDate);
markFieldChange (FIELD_VerificationMailSendDate);
_VerificationMailSendDate = newVerificationMailSendDate;
postFieldChange (FIELD_VerificationMailSendDate);
postVerificationMailSendDateChange ();
}
}
/**
* Get the attribute VerificationKey
*/
public String getVerificationKey ()
{
assertValid();
String valToReturn = _VerificationKey;
for (CompanyUserBehaviourDecorator bhd : CompanyUser_BehaviourDecorators)
{
valToReturn = bhd.getVerificationKey ((CompanyUser)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 preVerificationKeyChange (String newVerificationKey) 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 postVerificationKeyChange () throws FieldException
{
}
public FieldWriteability getWriteability_VerificationKey ()
{
return getFieldWritabilityUtil (FieldWriteability.TRUE);
}
/**
* Set the attribute VerificationKey. Checks to ensure a new value
* has been supplied. If so, marks the field as altered and sets the attribute.
*/
public void setVerificationKey (String newVerificationKey) throws FieldException
{
boolean oldAndNewIdentical = HELPER_VerificationKey.compare (_VerificationKey, newVerificationKey);
try
{
for (CompanyUserBehaviourDecorator bhd : CompanyUser_BehaviourDecorators)
{
newVerificationKey = bhd.setVerificationKey ((CompanyUser)this, newVerificationKey);
oldAndNewIdentical = HELPER_VerificationKey.compare (_VerificationKey, newVerificationKey);
}
if (FIELD_VerificationKey_Validators.length > 0)
{
Object newVerificationKeyObj = HELPER_VerificationKey.toObject (newVerificationKey);
if (newVerificationKeyObj != null)
{
int loopMax = FIELD_VerificationKey_Validators.length;
Map metadata = (Map)ATTRIBUTES_METADATA_CompanyUser.get (FIELD_VerificationKey);
for (int v = 0 ; v < loopMax ; ++v)
{
FIELD_VerificationKey_Validators[v].checkAttribute (this, FIELD_VerificationKey, metadata, newVerificationKeyObj);
}
}
}
}
catch (FieldException e)
{
if (!oldAndNewIdentical)
{
e.setWouldModify ();
}
throw e;
}
if (!oldAndNewIdentical)
{
assertValid();
Debug.assertion (getWriteability_VerificationKey () != FieldWriteability.FALSE, "Field VerificationKey is not writeable");
preVerificationKeyChange (newVerificationKey);
markFieldChange (FIELD_VerificationKey);
_VerificationKey = newVerificationKey;
postFieldChange (FIELD_VerificationKey);
postVerificationKeyChange ();
}
}
/**
* Get the attribute IsAccountVerified
*/
public Boolean getIsAccountVerified ()
{
assertValid();
Boolean valToReturn = _IsAccountVerified;
for (CompanyUserBehaviourDecorator bhd : CompanyUser_BehaviourDecorators)
{
valToReturn = bhd.getIsAccountVerified ((CompanyUser)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 preIsAccountVerifiedChange (Boolean newIsAccountVerified) 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 postIsAccountVerifiedChange () throws FieldException
{
}
public FieldWriteability getWriteability_IsAccountVerified ()
{
return getFieldWritabilityUtil (FieldWriteability.TRUE);
}
/**
* Set the attribute IsAccountVerified. Checks to ensure a new value
* has been supplied. If so, marks the field as altered and sets the attribute.
*/
public void setIsAccountVerified (Boolean newIsAccountVerified) throws FieldException
{
boolean oldAndNewIdentical = HELPER_IsAccountVerified.compare (_IsAccountVerified, newIsAccountVerified);
try
{
for (CompanyUserBehaviourDecorator bhd : CompanyUser_BehaviourDecorators)
{
newIsAccountVerified = bhd.setIsAccountVerified ((CompanyUser)this, newIsAccountVerified);
oldAndNewIdentical = HELPER_IsAccountVerified.compare (_IsAccountVerified, newIsAccountVerified);
}
if (FIELD_IsAccountVerified_Validators.length > 0)
{
Object newIsAccountVerifiedObj = HELPER_IsAccountVerified.toObject (newIsAccountVerified);
if (newIsAccountVerifiedObj != null)
{
int loopMax = FIELD_IsAccountVerified_Validators.length;
Map metadata = (Map)ATTRIBUTES_METADATA_CompanyUser.get (FIELD_IsAccountVerified);
for (int v = 0 ; v < loopMax ; ++v)
{
FIELD_IsAccountVerified_Validators[v].checkAttribute (this, FIELD_IsAccountVerified, metadata, newIsAccountVerifiedObj);
}
}
}
}
catch (FieldException e)
{
if (!oldAndNewIdentical)
{
e.setWouldModify ();
}
throw e;
}
if (!oldAndNewIdentical)
{
assertValid();
Debug.assertion (getWriteability_IsAccountVerified () != FieldWriteability.FALSE, "Field IsAccountVerified is not writeable");
preIsAccountVerifiedChange (newIsAccountVerified);
markFieldChange (FIELD_IsAccountVerified);
_IsAccountVerified = newIsAccountVerified;
postFieldChange (FIELD_IsAccountVerified);
postIsAccountVerifiedChange ();
}
}
/**
......@@ -1059,6 +1428,9 @@ public abstract class BaseCompanyUser extends SecUserExtension
oneit_sec_user_extensionPSet.setAttrib (FIELD_ForgotPasswordKey, HELPER_ForgotPasswordKey.toObject (_ForgotPasswordKey)); //
oneit_sec_user_extensionPSet.setAttrib (FIELD_Role, HELPER_Role.toObject (_Role)); //
oneit_sec_user_extensionPSet.setAttrib (FIELD_Phone, HELPER_Phone.toObject (_Phone)); //
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_IsAccountVerified, HELPER_IsAccountVerified.toObject (_IsAccountVerified)); //
_Company.getPersistentSets (allSets);
}
......@@ -1078,6 +1450,9 @@ public abstract class BaseCompanyUser extends SecUserExtension
_ForgotPasswordKey = (String)(HELPER_ForgotPasswordKey.fromObject (_ForgotPasswordKey, oneit_sec_user_extensionPSet.getAttrib (FIELD_ForgotPasswordKey))); //
_Role = (RoleType)(HELPER_Role.fromObject (_Role, oneit_sec_user_extensionPSet.getAttrib (FIELD_Role))); //
_Phone = (String)(HELPER_Phone.fromObject (_Phone, oneit_sec_user_extensionPSet.getAttrib (FIELD_Phone))); //
_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))); //
_IsAccountVerified = (Boolean)(HELPER_IsAccountVerified.fromObject (_IsAccountVerified, oneit_sec_user_extensionPSet.getAttrib (FIELD_IsAccountVerified))); //
_Company.setFromPersistentSets (objectID, allSets);
}
......@@ -1130,6 +1505,33 @@ public abstract class BaseCompanyUser extends SecUserExtension
e.addException (ex);
}
try
{
setVerificationMailSendDate (otherCompanyUser.getVerificationMailSendDate ());
}
catch (FieldException ex)
{
e.addException (ex);
}
try
{
setVerificationKey (otherCompanyUser.getVerificationKey ());
}
catch (FieldException ex)
{
e.addException (ex);
}
try
{
setIsAccountVerified (otherCompanyUser.getIsAccountVerified ());
}
catch (FieldException ex)
{
e.addException (ex);
}
}
}
......@@ -1149,6 +1551,9 @@ public abstract class BaseCompanyUser extends SecUserExtension
_ForgotPasswordKey = sourceCompanyUser._ForgotPasswordKey;
_Role = sourceCompanyUser._Role;
_Phone = sourceCompanyUser._Phone;
_VerificationMailSendDate = sourceCompanyUser._VerificationMailSendDate;
_VerificationKey = sourceCompanyUser._VerificationKey;
_IsAccountVerified = sourceCompanyUser._IsAccountVerified;
}
}
......@@ -1206,6 +1611,9 @@ public abstract class BaseCompanyUser extends SecUserExtension
_ForgotPasswordKey = (String)(HELPER_ForgotPasswordKey.readExternal (_ForgotPasswordKey, vals.get(FIELD_ForgotPasswordKey))); //
_Role = (RoleType)(HELPER_Role.readExternal (_Role, vals.get(FIELD_Role))); //
_Phone = (String)(HELPER_Phone.readExternal (_Phone, vals.get(FIELD_Phone))); //
_VerificationMailSendDate = (Date)(HELPER_VerificationMailSendDate.readExternal (_VerificationMailSendDate, vals.get(FIELD_VerificationMailSendDate))); //
_VerificationKey = (String)(HELPER_VerificationKey.readExternal (_VerificationKey, vals.get(FIELD_VerificationKey))); //
_IsAccountVerified = (Boolean)(HELPER_IsAccountVerified.readExternal (_IsAccountVerified, vals.get(FIELD_IsAccountVerified))); //
_Company.readExternalData(vals.get(SINGLEREFERENCE_Company));
}
......@@ -1222,6 +1630,9 @@ public abstract class BaseCompanyUser extends SecUserExtension
vals.put (FIELD_ForgotPasswordKey, HELPER_ForgotPasswordKey.writeExternal (_ForgotPasswordKey));
vals.put (FIELD_Role, HELPER_Role.writeExternal (_Role));
vals.put (FIELD_Phone, HELPER_Phone.writeExternal (_Phone));
vals.put (FIELD_VerificationMailSendDate, HELPER_VerificationMailSendDate.writeExternal (_VerificationMailSendDate));
vals.put (FIELD_VerificationKey, HELPER_VerificationKey.writeExternal (_VerificationKey));
vals.put (FIELD_IsAccountVerified, HELPER_IsAccountVerified.writeExternal (_IsAccountVerified));
vals.put (SINGLEREFERENCE_Company, _Company.writeExternalData());
}
......@@ -1252,6 +1663,18 @@ public abstract class BaseCompanyUser extends SecUserExtension
{
listener.notifyFieldChange(this, other, FIELD_Phone, HELPER_Phone.toObject(this._Phone), HELPER_Phone.toObject(otherCompanyUser._Phone));
}
if (!HELPER_VerificationMailSendDate.compare(this._VerificationMailSendDate, otherCompanyUser._VerificationMailSendDate))
{
listener.notifyFieldChange(this, other, FIELD_VerificationMailSendDate, HELPER_VerificationMailSendDate.toObject(this._VerificationMailSendDate), HELPER_VerificationMailSendDate.toObject(otherCompanyUser._VerificationMailSendDate));
}
if (!HELPER_VerificationKey.compare(this._VerificationKey, otherCompanyUser._VerificationKey))
{
listener.notifyFieldChange(this, other, FIELD_VerificationKey, HELPER_VerificationKey.toObject(this._VerificationKey), HELPER_VerificationKey.toObject(otherCompanyUser._VerificationKey));
}
if (!HELPER_IsAccountVerified.compare(this._IsAccountVerified, otherCompanyUser._IsAccountVerified))
{
listener.notifyFieldChange(this, other, FIELD_IsAccountVerified, HELPER_IsAccountVerified.toObject(this._IsAccountVerified), HELPER_IsAccountVerified.toObject(otherCompanyUser._IsAccountVerified));
}
// Compare single assocs
_Company.compare (otherCompanyUser._Company, listener);
......@@ -1279,6 +1702,9 @@ public abstract class BaseCompanyUser extends SecUserExtension
visitor.visitField(this, FIELD_ForgotPasswordKey, HELPER_ForgotPasswordKey.toObject(getForgotPasswordKey()));
visitor.visitField(this, FIELD_Role, HELPER_Role.toObject(getRole()));
visitor.visitField(this, FIELD_Phone, HELPER_Phone.toObject(getPhone()));
visitor.visitField(this, FIELD_VerificationMailSendDate, HELPER_VerificationMailSendDate.toObject(getVerificationMailSendDate()));
visitor.visitField(this, FIELD_VerificationKey, HELPER_VerificationKey.toObject(getVerificationKey()));
visitor.visitField(this, FIELD_IsAccountVerified, HELPER_IsAccountVerified.toObject(getIsAccountVerified()));
visitor.visitAssociation (_Company);
}
......@@ -1333,6 +1759,18 @@ public abstract class BaseCompanyUser extends SecUserExtension
{
return filter.matches (getPhone ());
}
else if (attribName.equals (FIELD_VerificationMailSendDate))
{
return filter.matches (getVerificationMailSendDate ());
}
else if (attribName.equals (FIELD_VerificationKey))
{
return filter.matches (getVerificationKey ());
}
else if (attribName.equals (FIELD_IsAccountVerified))
{
return filter.matches (getIsAccountVerified ());
}
else if (attribName.equals (SINGLEREFERENCE_Company))
{
return filter.matches (getCompany ());
......@@ -1392,6 +1830,24 @@ public abstract class BaseCompanyUser extends SecUserExtension
return this;
}
public SearchAll andVerificationMailSendDate (QueryFilter<Date> filter)
{
filter.addFilter (context, "oneit_sec_user_extension.verification_mail_send_date", "VerificationMailSendDate");
return this;
}
public SearchAll andVerificationKey (QueryFilter<String> filter)
{
filter.addFilter (context, "oneit_sec_user_extension.verification_key", "VerificationKey");
return this;
}
public SearchAll andIsAccountVerified (QueryFilter<Boolean> filter)
{
filter.addFilter (context, "oneit_sec_user_extension.is_account_verified", "IsAccountVerified");
return this;
}
public SearchAll andUser (QueryFilter<SecUser> filter)
{
filter.addFilter (context, "oneit_sec_user_extension.user_id", "User");
......@@ -1431,6 +1887,123 @@ public abstract class BaseCompanyUser extends SecUserExtension
.search (transaction);
}
public static SearchIdPin SearchByIdPin () { return new SearchIdPin (); }
public static class SearchIdPin extends SearchObject<CompanyUser>
{
public SearchIdPin byID (Long ID)
{
by ("ID", ID);
return this;
}
public SearchIdPin byPin (String Pin)
{
by ("Pin", Pin);
return this;
}
public SearchIdPin andObjectID (QueryFilter<Long> filter)
{
filter.addFilter (context, "oneit_sec_user_extension.object_id", FIELD_ObjectID);
return this;
}
public SearchIdPin andObjectCreated (QueryFilter<Date> filter)
{
filter.addFilter (context, "oneit_sec_user_extension.object_created_date", FIELD_ObjectCreated);
return this;
}
public SearchIdPin andObjectLastModified (QueryFilter<Date> filter)
{
filter.addFilter (context, "oneit_sec_user_extension.object_last_updated_date", FIELD_ObjectLastModified);
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 andRole (QueryFilter<RoleType> filter)
{
filter.addFilter (context, "oneit_sec_user_extension.role_type", "Role");
return this;
}
public SearchIdPin andPhone (QueryFilter<String> filter)
{
filter.addFilter (context, "oneit_sec_user_extension.phone", "Phone");
return this;
}
public SearchIdPin andVerificationMailSendDate (QueryFilter<Date> filter)
{
filter.addFilter (context, "oneit_sec_user_extension.verification_mail_send_date", "VerificationMailSendDate");
return this;
}
public SearchIdPin andVerificationKey (QueryFilter<String> filter)
{
filter.addFilter (context, "oneit_sec_user_extension.verification_key", "VerificationKey");
return this;
}
public SearchIdPin andIsAccountVerified (QueryFilter<Boolean> filter)
{
filter.addFilter (context, "oneit_sec_user_extension.is_account_verified", "IsAccountVerified");
return this;
}
public SearchIdPin andUser (QueryFilter<SecUser> filter)
{
filter.addFilter (context, "oneit_sec_user_extension.user_id", "User");
return this;
}
public SearchIdPin andCompany (QueryFilter<Company> filter)
{
filter.addFilter (context, "oneit_sec_user_extension.company_id", "Company");
return this;
}
public CompanyUser search (ObjectTransaction transaction) throws StorageException
{
BaseBusinessClass[] results = super.search (transaction, REFERENCE_CompanyUser, SEARCH_IdPin, criteria);
Set<CompanyUser> typedResults = new LinkedHashSet <CompanyUser> ();
for (BaseBusinessClass bbcResult : results)
{
CompanyUser aResult = (CompanyUser)bbcResult;
typedResults.add (aResult);
}
return (CompanyUser)singletonResult(ObjstoreUtils.removeDeleted(transaction, typedResults).toArray(new BaseBusinessClass[0]), "CompanyUser", "");
}
}
public static CompanyUser searchIdPin (ObjectTransaction transaction, Long ID, String Pin) throws StorageException
{
return SearchByIdPin ()
.byID (ID)
.byPin (Pin)
.search (transaction);
}
public Object getAttribute (String attribName)
......@@ -1455,6 +2028,18 @@ public abstract class BaseCompanyUser extends SecUserExtension
{
return HELPER_Phone.toObject (getPhone ());
}
else if (attribName.equals (FIELD_VerificationMailSendDate))
{
return HELPER_VerificationMailSendDate.toObject (getVerificationMailSendDate ());
}
else if (attribName.equals (FIELD_VerificationKey))
{
return HELPER_VerificationKey.toObject (getVerificationKey ());
}
else if (attribName.equals (FIELD_IsAccountVerified))
{
return HELPER_IsAccountVerified.toObject (getIsAccountVerified ());
}
else
{
return super.getAttribute (attribName);
......@@ -1484,6 +2069,18 @@ public abstract class BaseCompanyUser extends SecUserExtension
{
return HELPER_Phone;
}
else if (attribName.equals (FIELD_VerificationMailSendDate))
{
return HELPER_VerificationMailSendDate;
}
else if (attribName.equals (FIELD_VerificationKey))
{
return HELPER_VerificationKey;
}
else if (attribName.equals (FIELD_IsAccountVerified))
{
return HELPER_IsAccountVerified;
}
else
{
return super.getAttributeHelper (attribName);
......@@ -1513,6 +2110,18 @@ public abstract class BaseCompanyUser extends SecUserExtension
{
setPhone ((String)(HELPER_Phone.fromObject (_Phone, attribValue)));
}
else if (attribName.equals (FIELD_VerificationMailSendDate))
{
setVerificationMailSendDate ((Date)(HELPER_VerificationMailSendDate.fromObject (_VerificationMailSendDate, attribValue)));
}
else if (attribName.equals (FIELD_VerificationKey))
{
setVerificationKey ((String)(HELPER_VerificationKey.fromObject (_VerificationKey, attribValue)));
}
else if (attribName.equals (FIELD_IsAccountVerified))
{
setIsAccountVerified ((Boolean)(HELPER_IsAccountVerified.fromObject (_IsAccountVerified, attribValue)));
}
else
{
super.setAttribute (attribName, attribValue);
......@@ -1549,6 +2158,18 @@ public abstract class BaseCompanyUser extends SecUserExtension
{
return getWriteability_Phone ();
}
else if (fieldName.equals (FIELD_VerificationMailSendDate))
{
return getWriteability_VerificationMailSendDate ();
}
else if (fieldName.equals (FIELD_VerificationKey))
{
return getWriteability_VerificationKey ();
}
else if (fieldName.equals (FIELD_IsAccountVerified))
{
return getWriteability_IsAccountVerified ();
}
else if (fieldName.equals (SINGLEREFERENCE_Company))
{
return getWriteability_Company ();
......@@ -1583,6 +2204,21 @@ public abstract class BaseCompanyUser extends SecUserExtension
fields.add (FIELD_Phone);
}
if (getWriteability_VerificationMailSendDate () != FieldWriteability.TRUE)
{
fields.add (FIELD_VerificationMailSendDate);
}
if (getWriteability_VerificationKey () != FieldWriteability.TRUE)
{
fields.add (FIELD_VerificationKey);
}
if (getWriteability_IsAccountVerified () != FieldWriteability.TRUE)
{
fields.add (FIELD_IsAccountVerified);
}
super.putUnwriteable (fields);
}
......@@ -1596,6 +2232,9 @@ public abstract class BaseCompanyUser extends SecUserExtension
result.add(HELPER_ForgotPasswordKey.getAttribObject (getClass (), _ForgotPasswordKey, false, FIELD_ForgotPasswordKey));
result.add(HELPER_Role.getAttribObject (getClass (), _Role, false, FIELD_Role));
result.add(HELPER_Phone.getAttribObject (getClass (), _Phone, false, FIELD_Phone));
result.add(HELPER_VerificationMailSendDate.getAttribObject (getClass (), _VerificationMailSendDate, false, FIELD_VerificationMailSendDate));
result.add(HELPER_VerificationKey.getAttribObject (getClass (), _VerificationKey, false, FIELD_VerificationKey));
result.add(HELPER_IsAccountVerified.getAttribObject (getClass (), _IsAccountVerified, false, FIELD_IsAccountVerified));
return result;
}
......@@ -1718,6 +2357,60 @@ public abstract class BaseCompanyUser extends SecUserExtension
return newPhone;
}
/**
* Get the attribute VerificationMailSendDate
*/
public Date getVerificationMailSendDate (CompanyUser obj, Date original)
{
return original;
}
/**
* Change the value set for attribute VerificationMailSendDate.
* May modify the field beforehand
* Occurs before validation.
*/
public Date setVerificationMailSendDate (CompanyUser obj, Date newVerificationMailSendDate) throws FieldException
{
return newVerificationMailSendDate;
}
/**
* Get the attribute VerificationKey
*/
public String getVerificationKey (CompanyUser obj, String original)
{
return original;
}
/**
* Change the value set for attribute VerificationKey.
* May modify the field beforehand
* Occurs before validation.
*/
public String setVerificationKey (CompanyUser obj, String newVerificationKey) throws FieldException
{
return newVerificationKey;
}
/**
* Get the attribute IsAccountVerified
*/
public Boolean getIsAccountVerified (CompanyUser obj, Boolean original)
{
return original;
}
/**
* Change the value set for attribute IsAccountVerified.
* May modify the field beforehand
* Occurs before validation.
*/
public Boolean setIsAccountVerified (CompanyUser obj, Boolean newIsAccountVerified) throws FieldException
{
return newIsAccountVerified;
}
}
......@@ -1786,6 +2479,18 @@ public abstract class BaseCompanyUser extends SecUserExtension
{
return toPhone ();
}
if (name.equals ("VerificationMailSendDate"))
{
return toVerificationMailSendDate ();
}
if (name.equals ("VerificationKey"))
{
return toVerificationKey ();
}
if (name.equals ("IsAccountVerified"))
{
return toIsAccountVerified ();
}
if (name.equals ("Company"))
{
return toCompany ();
......@@ -1803,6 +2508,12 @@ public abstract class BaseCompanyUser extends SecUserExtension
public PipeLine<From, RoleType> toRole () { return pipe(new ORMAttributePipe<Me, RoleType>(FIELD_Role)); }
public PipeLine<From, String> toPhone () { return pipe(new ORMAttributePipe<Me, String>(FIELD_Phone)); }
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, Boolean> toIsAccountVerified () { return pipe(new ORMAttributePipe<Me, Boolean>(FIELD_IsAccountVerified)); }
public Company.CompanyPipeLineFactory<From, Company> toCompany () { return toCompany (Filter.ALL); }
public Company.CompanyPipeLineFactory<From, Company> toCompany (Filter<Company> filter)
......
......@@ -13,6 +13,9 @@
<ATTRIB name="ForgotPasswordKey" type="String" dbcol="forgot_password_key" length="10"/>
<ATTRIB name="Role" type="RoleType" dbcol="role_type" mandatory="false" attribHelper="EnumeratedAttributeHelper"/>
<ATTRIB name="Phone" type="String" dbcol="phone" mandatory="false" length="30" />
<ATTRIB name="VerificationMailSendDate" type="Date" dbcol="verification_mail_send_date" />
<ATTRIB name="VerificationKey" type="String" dbcol="verification_key" length="10"/>
<ATTRIB name="IsAccountVerified" type="Boolean" dbcol="is_account_verified" defaultValue="Boolean.FALSE"/>
<SINGLEREFERENCE name="User" type="SecUser" dbcol="user_id" backreferenceName="Extensions" inSuper='TRUE'/>
<SINGLEREFERENCE name="Company" type="Company" dbcol="company_id" backreferenceName="Users"/>
......@@ -22,6 +25,11 @@
<SEARCH type="All" paramFilter="oneit_sec_user_extension.object_id is not null" >
</SEARCH>
<SEARCH type="IdPin" paramFilter="oneit_sec_user_extension.object_id is not null" singleton="TRUE">
<PARAM name="ID" type="Long" paramFilter="object_id = ${ID} " />
<PARAM name="Pin" type="String" paramFilter="verification_key = ${Pin}" />
</SEARCH>
</BUSINESSCLASS>
</ROOT>
\ No newline at end of file
......@@ -32,6 +32,9 @@ public class CompanyUserPersistenceMgr extends SecUserExtensionPersistenceMgr
private String dummyForgotPasswordKey;
private RoleType dummyRole;
private String dummyPhone;
private Date dummyVerificationMailSendDate;
private String dummyVerificationKey;
private Boolean dummyIsAccountVerified;
// Static constants corresponding to attribute helpers
......@@ -39,6 +42,9 @@ public class CompanyUserPersistenceMgr extends SecUserExtensionPersistenceMgr
private static final DefaultAttributeHelper HELPER_ForgotPasswordKey = DefaultAttributeHelper.INSTANCE;
private static final EnumeratedAttributeHelper HELPER_Role = new EnumeratedAttributeHelper (RoleType.FACTORY_RoleType);
private static final DefaultAttributeHelper HELPER_Phone = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper HELPER_VerificationMailSendDate = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper HELPER_VerificationKey = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper HELPER_IsAccountVerified = DefaultAttributeHelper.INSTANCE;
......@@ -49,10 +55,13 @@ public class CompanyUserPersistenceMgr extends SecUserExtensionPersistenceMgr
dummyForgotPasswordKey = (String)(HELPER_ForgotPasswordKey.initialise (dummyForgotPasswordKey));
dummyRole = (RoleType)(HELPER_Role.initialise (dummyRole));
dummyPhone = (String)(HELPER_Phone.initialise (dummyPhone));
dummyVerificationMailSendDate = (Date)(HELPER_VerificationMailSendDate.initialise (dummyVerificationMailSendDate));
dummyVerificationKey = (String)(HELPER_VerificationKey.initialise (dummyVerificationKey));
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.forgot_password_mail_send_date, {PREFIX}oneit_sec_user_extension.forgot_password_key, {PREFIX}oneit_sec_user_extension.role_type, {PREFIX}oneit_sec_user_extension.phone, {PREFIX}oneit_sec_user_extension.user_id, {PREFIX}oneit_sec_user_extension.company_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.forgot_password_mail_send_date, {PREFIX}oneit_sec_user_extension.forgot_password_key, {PREFIX}oneit_sec_user_extension.role_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.user_id, {PREFIX}oneit_sec_user_extension.company_id, 1 AS commasafe ";
private String SELECT_JOINS = "";
public BaseBusinessClass fetchByID(ObjectID id, PersistentSetCollection allPSets, RDBMSPersistenceContext context, SQLManager sqlMgr) throws SQLException, StorageException
......@@ -108,6 +117,9 @@ public class CompanyUserPersistenceMgr extends SecUserExtensionPersistenceMgr
!oneit_sec_user_extensionPSet.containsAttrib(CompanyUser.FIELD_ForgotPasswordKey)||
!oneit_sec_user_extensionPSet.containsAttrib(CompanyUser.FIELD_Role)||
!oneit_sec_user_extensionPSet.containsAttrib(CompanyUser.FIELD_Phone)||
!oneit_sec_user_extensionPSet.containsAttrib(CompanyUser.FIELD_VerificationMailSendDate)||
!oneit_sec_user_extensionPSet.containsAttrib(CompanyUser.FIELD_VerificationKey)||
!oneit_sec_user_extensionPSet.containsAttrib(CompanyUser.FIELD_IsAccountVerified)||
!oneit_sec_user_extensionPSet.containsAttrib(CompanyUser.SINGLEREFERENCE_User)||
!oneit_sec_user_extensionPSet.containsAttrib(CompanyUser.SINGLEREFERENCE_Company))
{
......@@ -208,10 +220,10 @@ public class CompanyUserPersistenceMgr extends SecUserExtensionPersistenceMgr
{
int rowsUpdated = executeStatement (sqlMgr,
"UPDATE {PREFIX}oneit_sec_user_extension " +
"SET forgot_password_mail_send_date = ?, forgot_password_key = ?, role_type = ?, phone = ?, user_id = ? , company_id = ? , object_LAST_UPDATED_DATE = " + sqlMgr.getPortabilityServices ().getTimestampExpression () + " " +
"SET forgot_password_mail_send_date = ?, forgot_password_key = ?, role_type = ?, phone = ?, verification_mail_send_date = ?, verification_key = ?, is_account_verified = ?, user_id = ? , company_id = ? , object_LAST_UPDATED_DATE = " + sqlMgr.getPortabilityServices ().getTimestampExpression () + " " +
"WHERE oneit_sec_user_extension.object_id = ? AND " + getConcurrencyCheck (sqlMgr, "object_LAST_UPDATED_DATE", obj.getObjectLastModified ()) + " ",
CollectionUtils.listEntry (HELPER_ForgotPasswordMailSendDate.getForSQL(dummyForgotPasswordMailSendDate, oneit_sec_user_extensionPSet.getAttrib (CompanyUser.FIELD_ForgotPasswordMailSendDate))).listEntry (HELPER_ForgotPasswordKey.getForSQL(dummyForgotPasswordKey, oneit_sec_user_extensionPSet.getAttrib (CompanyUser.FIELD_ForgotPasswordKey))).listEntry (HELPER_Role.getForSQL(dummyRole, oneit_sec_user_extensionPSet.getAttrib (CompanyUser.FIELD_Role))).listEntry (HELPER_Phone.getForSQL(dummyPhone, oneit_sec_user_extensionPSet.getAttrib (CompanyUser.FIELD_Phone))).listEntry (SQLManager.CheckNull((Long)(oneit_sec_user_extensionPSet.getAttrib (CompanyUser.SINGLEREFERENCE_User)))).listEntry (SQLManager.CheckNull((Long)(oneit_sec_user_extensionPSet.getAttrib (CompanyUser.SINGLEREFERENCE_Company)))).listEntry (objectID.longID ()).listEntry (obj.getObjectLastModified ()).toList().toArray());
CollectionUtils.listEntry (HELPER_ForgotPasswordMailSendDate.getForSQL(dummyForgotPasswordMailSendDate, oneit_sec_user_extensionPSet.getAttrib (CompanyUser.FIELD_ForgotPasswordMailSendDate))).listEntry (HELPER_ForgotPasswordKey.getForSQL(dummyForgotPasswordKey, oneit_sec_user_extensionPSet.getAttrib (CompanyUser.FIELD_ForgotPasswordKey))).listEntry (HELPER_Role.getForSQL(dummyRole, oneit_sec_user_extensionPSet.getAttrib (CompanyUser.FIELD_Role))).listEntry (HELPER_Phone.getForSQL(dummyPhone, oneit_sec_user_extensionPSet.getAttrib (CompanyUser.FIELD_Phone))).listEntry (HELPER_VerificationMailSendDate.getForSQL(dummyVerificationMailSendDate, oneit_sec_user_extensionPSet.getAttrib (CompanyUser.FIELD_VerificationMailSendDate))).listEntry (HELPER_VerificationKey.getForSQL(dummyVerificationKey, oneit_sec_user_extensionPSet.getAttrib (CompanyUser.FIELD_VerificationKey))).listEntry (HELPER_IsAccountVerified.getForSQL(dummyIsAccountVerified, oneit_sec_user_extensionPSet.getAttrib (CompanyUser.FIELD_IsAccountVerified))).listEntry (SQLManager.CheckNull((Long)(oneit_sec_user_extensionPSet.getAttrib (CompanyUser.SINGLEREFERENCE_User)))).listEntry (SQLManager.CheckNull((Long)(oneit_sec_user_extensionPSet.getAttrib (CompanyUser.SINGLEREFERENCE_Company)))).listEntry (objectID.longID ()).listEntry (obj.getObjectLastModified ()).toList().toArray());
if (rowsUpdated != 1)
{
......@@ -299,6 +311,10 @@ public class CompanyUserPersistenceMgr extends SecUserExtensionPersistenceMgr
{
throw new RuntimeException ("NOT implemented: executeSearchQueryAll");
}
public ResultSet executeSearchQueryIdPin (SQLManager sqlMgr, Long ID, String Pin) throws SQLException
{
throw new RuntimeException ("NOT implemented: executeSearchQueryIdPin");
}
......@@ -479,6 +495,58 @@ public class CompanyUserPersistenceMgr extends SecUserExtensionPersistenceMgr
return results;
}
else if (searchType.equals (CompanyUser.SEARCH_IdPin))
{
// Local scope for transformed variables
{
}
String orderBy = " ";
String tables = " ";
Set<String> joinTableSet = new HashSet<String>();
String filter;
Object[] searchParams; // paramFilter: oneit_sec_user_extension.object_id is not null
String preFilter = "(oneit_sec_user_extension.object_id is not null)"
+ " ";
if (criteria.containsKey("ID"))
{
preFilter += " AND (object_id = ${ID} ) ";
preFilter += "";
}
if (criteria.containsKey("Pin"))
{
preFilter += " AND (verification_key = ${Pin}) ";
preFilter += "";
}
preFilter += context.getLoadingAttributes ().getCustomSQL() ;
SearchParamTransform tx = new SearchParamTransform (criteria);
filter = StringUtils.replaceParams (preFilter, tx);
searchParams = tx.getParamsArray();
Integer maxRows = context.getLoadingAttributes ().getMaxRows ();
boolean truncateExtra = !context.getLoadingAttributes ().isFailIfMaxExceeded();
String query = "SELECT " + SELECT_COLUMNS +
"FROM {PREFIX}oneit_sec_user_extension " + tables + tableSetToSQL(joinTableSet) +
"WHERE " + SELECT_JOINS + " " + filter + orderBy;
BaseBusinessClass[] results = loadQuery (allPSets, sqlMgr, context, query, searchParams, maxRows, truncateExtra);
return results;
}
else
{
......@@ -522,6 +590,9 @@ public class CompanyUserPersistenceMgr extends SecUserExtensionPersistenceMgr
oneit_sec_user_extensionPSet.setAttrib(CompanyUser.FIELD_ForgotPasswordKey, HELPER_ForgotPasswordKey.getFromRS(dummyForgotPasswordKey, r, "forgot_password_key"));
oneit_sec_user_extensionPSet.setAttrib(CompanyUser.FIELD_Role, HELPER_Role.getFromRS(dummyRole, r, "role_type"));
oneit_sec_user_extensionPSet.setAttrib(CompanyUser.FIELD_Phone, HELPER_Phone.getFromRS(dummyPhone, r, "phone"));
oneit_sec_user_extensionPSet.setAttrib(CompanyUser.FIELD_VerificationMailSendDate, HELPER_VerificationMailSendDate.getFromRS(dummyVerificationMailSendDate, r, "verification_mail_send_date"));
oneit_sec_user_extensionPSet.setAttrib(CompanyUser.FIELD_VerificationKey, HELPER_VerificationKey.getFromRS(dummyVerificationKey, r, "verification_key"));
oneit_sec_user_extensionPSet.setAttrib(CompanyUser.FIELD_IsAccountVerified, HELPER_IsAccountVerified.getFromRS(dummyIsAccountVerified, r, "is_account_verified"));
oneit_sec_user_extensionPSet.setAttrib(CompanyUser.SINGLEREFERENCE_User, r.getObject ("user_id"));
oneit_sec_user_extensionPSet.setAttrib(CompanyUser.SINGLEREFERENCE_Company, r.getObject ("company_id"));
......@@ -541,10 +612,10 @@ public class CompanyUserPersistenceMgr extends SecUserExtensionPersistenceMgr
{
executeStatement (sqlMgr,
"INSERT INTO {PREFIX}oneit_sec_user_extension " +
" (forgot_password_mail_send_date, forgot_password_key, role_type, phone, user_id, company_id, object_id, object_LAST_UPDATED_DATE, object_CREATED_DATE, object_TYPE) " +
" (forgot_password_mail_send_date, forgot_password_key, role_type, phone, verification_mail_send_date, verification_key, is_account_verified, user_id, company_id, object_id, object_LAST_UPDATED_DATE, object_CREATED_DATE, object_TYPE) " +
"VALUES " +
" (?, ?, ?, ?, ?, ?, ?, " + sqlMgr.getPortabilityServices ().getTimestampExpression () + ", " + sqlMgr.getPortabilityServices ().getTimestampExpression () + ", ?)",
CollectionUtils.listEntry (HELPER_ForgotPasswordMailSendDate.getForSQL(dummyForgotPasswordMailSendDate, oneit_sec_user_extensionPSet.getAttrib (CompanyUser.FIELD_ForgotPasswordMailSendDate))).listEntry (HELPER_ForgotPasswordKey.getForSQL(dummyForgotPasswordKey, oneit_sec_user_extensionPSet.getAttrib (CompanyUser.FIELD_ForgotPasswordKey))).listEntry (HELPER_Role.getForSQL(dummyRole, oneit_sec_user_extensionPSet.getAttrib (CompanyUser.FIELD_Role))).listEntry (HELPER_Phone.getForSQL(dummyPhone, oneit_sec_user_extensionPSet.getAttrib (CompanyUser.FIELD_Phone))) .listEntry (SQLManager.CheckNull((Long)(oneit_sec_user_extensionPSet.getAttrib (CompanyUser.SINGLEREFERENCE_User)))).listEntry (SQLManager.CheckNull((Long)(oneit_sec_user_extensionPSet.getAttrib (CompanyUser.SINGLEREFERENCE_Company)))) .listEntry (objectID.longID ()).listEntry (context.getTag (obj)).toList().toArray());
" (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, " + sqlMgr.getPortabilityServices ().getTimestampExpression () + ", " + sqlMgr.getPortabilityServices ().getTimestampExpression () + ", ?)",
CollectionUtils.listEntry (HELPER_ForgotPasswordMailSendDate.getForSQL(dummyForgotPasswordMailSendDate, oneit_sec_user_extensionPSet.getAttrib (CompanyUser.FIELD_ForgotPasswordMailSendDate))).listEntry (HELPER_ForgotPasswordKey.getForSQL(dummyForgotPasswordKey, oneit_sec_user_extensionPSet.getAttrib (CompanyUser.FIELD_ForgotPasswordKey))).listEntry (HELPER_Role.getForSQL(dummyRole, oneit_sec_user_extensionPSet.getAttrib (CompanyUser.FIELD_Role))).listEntry (HELPER_Phone.getForSQL(dummyPhone, oneit_sec_user_extensionPSet.getAttrib (CompanyUser.FIELD_Phone))).listEntry (HELPER_VerificationMailSendDate.getForSQL(dummyVerificationMailSendDate, oneit_sec_user_extensionPSet.getAttrib (CompanyUser.FIELD_VerificationMailSendDate))).listEntry (HELPER_VerificationKey.getForSQL(dummyVerificationKey, oneit_sec_user_extensionPSet.getAttrib (CompanyUser.FIELD_VerificationKey))).listEntry (HELPER_IsAccountVerified.getForSQL(dummyIsAccountVerified, oneit_sec_user_extensionPSet.getAttrib (CompanyUser.FIELD_IsAccountVerified))) .listEntry (SQLManager.CheckNull((Long)(oneit_sec_user_extensionPSet.getAttrib (CompanyUser.SINGLEREFERENCE_User)))).listEntry (SQLManager.CheckNull((Long)(oneit_sec_user_extensionPSet.getAttrib (CompanyUser.SINGLEREFERENCE_Company)))) .listEntry (objectID.longID ()).listEntry (context.getTag (obj)).toList().toArray());
oneit_sec_user_extensionPSet.setStatus (PersistentSetStatus.PROCESSED);
}
......
......@@ -42,6 +42,7 @@ public class WebUtils
public static final String VIEW_APPLICANTS_GRID = "ViewApplicantsGrid";
public static final String APPLICANT_ACCOUNT_VERIFICATION = "ApplicantAccountVerification";
public static final String RESET_PASSWORD_ARTICLE = "ResetPasswordEmail";
public static final String COMPANY_ACCOUNT_VERIFICATION = "CompanyAccountVerification";
public static String getArticleLink(HttpServletRequest request, ObjectTransaction objTran, String articleShortcut, String renderMode)
......
......@@ -4764,3 +4764,12 @@ label, label .label-title span {
font-size: 20px;
}
/* End of Clients HT010 */
.hire-the-right-candi {
height: 24px;
font-family: Usual-Medium;
font-size: 20px;
font-weight: 500;
text-align: center;
color: #4a4a4a;
}
\ No newline at end of file
......@@ -66,6 +66,13 @@
<FORM name="*.resetPassword" factory="Participant" class="performa.form.ResetPasswordFP"/>
</NODE>
<NODE name="sign_up_jsp" factory="Participant">
<INHERITS factory="Named" nodename="CoreORMAdminNoPriv"/>
<FORM name="*.send" factory="Participant" class="performa.form.SendVerificationMailFP">
<AccountVerificationEmailer factory="Participant" class="oneit.email.ConfigurableArticleTemplateEmailer" templateShortcut="CompanyAccountVerificationMail"/>
</FORM>
</NODE>
<NODE name="ORMErrorConfig::ADMIN_PORTAL" factory="Participant" class="oneit.servlets.forms.ErrorReportConfig">
<format item="field.*.error.pageHeader_performa_errorPrefix">
<![CDATA[<div class="error-message message-common"><img src="${contextRoot}/images/error-alert.png" class="alert-icon" /><span class="message-txt" style="font-weight: bold">${translateLabel:Errors_Occurred:Errors occurred, please correct them and try again}</span><br/>]]>
......
......@@ -84,6 +84,16 @@
</NODE>
</MAP>
<MAP value="COMPANY_ACCOUNT_VERIFICATION" description="Company Account Verification" TemplatePage="dynamic_content_form.jsp">
<NODE name="Config" factory="Participant" class="oneit.business.content.ArticleConfiguration">
<INHERITS nodename="StandardJSP"/>
<RenderMode name="Page" preIncludeJSP="extensions/adminportal/verify_company.jsp"/>
<RenderMode name="AuthError" preIncludeJSP="extensions/adminportal/auth_error.jsp"/>
</NODE>
</MAP>
</NODE>
<NODE name="StandardJSP::AdminPortal">
......
<%@ page extends="oneit.servlets.jsp.JSPInclude" %>
<oneit:dynIncluded>
<div style="width: 50%; margin: 0px auto 0px auto; text-align: center">
<h3>Authentication Error</h3>
<p><span>Access expired.</span></p>
</div>
</oneit:dynIncluded>
<%@ page extends="oneit.servlets.jsp.JSPInclude" %>
<%@ include file="/inc/stdimports50.jsp" %><%-- This is in cougar --%>
<%@ include file="/extensions/performa/inc/stdimports.jsp" %>
<%@ page import="oneit.security.SecUser"%>
<oneit:dynIncluded>
<%
CompanyUser companyUser = (CompanyUser) getData(request, "CompanyUser");
Debug.assertion(companyUser != null, "Invalid CompanyUser in admin portal");
SecUser secUser = companyUser.getUser();
Company company = companyUser.getCompany();
Boolean readOnly = companyUser.getStatus()!=ObjectStatus.NEW;
%>
<div class="form-group text-left">
<label>Email Address</label>
<oneit:ormInput obj="<%= secUser %>" type="text" attributeName="Email" cssClass="form-control" style="text-transform: lowercase" required="true" readOnly="<%= readOnly? "true" : "false"%>"/>
</div>
<div class="row">
<div class="form-group text-left col-sm-6 col-xs-12">
<label><oneit:ormlabel obj="<%= secUser %>" field="FirstName" /></label>
<oneit:ormInput obj="<%= secUser %>" type="text" attributeName="FirstName" cssClass="form-control second-style" required="true" />
</div>
<div class="form-group text-left col-sm-6 col-xs-12">
<label><oneit:ormlabel obj="<%= secUser %>" field="LastName" /></label>
<oneit:ormInput obj="<%= secUser %>" type="text" attributeName="LastName" cssClass="form-control second-style" required="true"/>
</div>
</div>
<div class="form-group text-left">
<label><oneit:ormlabel obj="<%= companyUser %>" field="Phone" /></label>
<oneit:ormInput obj="<%= companyUser %>" type="text" attributeName="Phone" cssClass="form-control" required="true"/>
</div>
<div class="form-group text-left">
<label>Company</label>
<oneit:ormInput obj="<%= company %>" type="text" attributeName="CompanyName" cssClass="form-control" required="true"/>
</div>
</oneit:dynIncluded>
......@@ -68,6 +68,11 @@
<oneit:button value="Sign in" name="login" cssClass="box-btn login-btn"
requestAttribs="<%= CollectionUtils.EMPTY_MAP%>"/>
</div>
<div class="form-group">
<oneit:button value="Dont have an account? Create account" name="gotoPage" cssClass="forgot-pass" skin="link"
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", "sign_up.jsp")
.toMap() %>"></oneit:button>
</div>
</oneit:form>
<div class="box-br-line"><span></span></div>
<div class="box-label">Sign in using your social network of choice</div>
......
<%@ page extends="oneit.servlets.jsp.FormJSP" %>
<%@ include file="/setuprequest.jsp" %>
<%@ include file="/inc/stdimports50.jsp" %><%-- This is in cougar --%>
<%@ include file="/extensions/performa/inc/stdimports.jsp" %>
<%! protected String getName (ServletConfig config) { return "sign_up_jsp"; } %>
<%@ include file="inc/htmlheader_nopriv.jsp" %>
<%
ORMProcessState process = (ORMProcessState) ProcessDecorator.getDefaultProcess(request);
ObjectTransaction objTran = process.getTransaction ();
Boolean toRedirect = GenericObjDF.getOrCreateObject (request, "Company", Company.REFERENCE_Company);
Company company = (Company) process.getAttribute("Company");
SecUser secUser = null;
CompanyUser companyUser = company.getAddedByUser();
if(companyUser==null)
{
secUser = SecUser.createSecUser(objTran);
companyUser = secUser.getExtensionOrCreate(CompanyUser.REFERENCE_CompanyUser);
company.setAddedByUser(companyUser);
companyUser.setCompany(company);
}
secUser = companyUser.getUser();
if(toRedirect)
{
%><%@include file="/saferedirect.jsp"%><%
}
Debug.assertion(companyUser != null, "CompanyUser is null in admin portal");
%>
<script type="text/javascript">
$(document).ready(function() {
validate();
$('input').on('change keyup', function() { validate() });
});
function validate() {
var empty = false;
$('input[required]').each(function() {
if ( $.trim($( this ).val()) == '') {
empty = true;
if ($( this ).css('background-color') == 'rgb(250, 255, 189)') {
empty = false;
}
}
});
if (empty) {
$('.send-btn').attr('disabled', 'disabled');
} else {
$('.send-btn').removeAttr('disabled');
}
}
</script>
<style>
button[disabled] {
opacity: 0.6;
background-color: #0582ba;
}
</style>
<div class="hire-the-right-candi">Hire the right candidate</div>
<div>&nbsp;</div>
<oneit:form name="sign_up" method="post">
<oneit:dynInclude page="/extensions/applicantportal/inc/multifieldtext.jsp" data="<%= CollectionUtils.EMPTY_MAP%>"/>
<div class="main-box-layout login-box">
<oneit:dynInclude page="/extensions/adminportal/inc/company_user_data.jsp" data="<%= CollectionUtils.EMPTY_MAP%>" CompanyUser="<%= companyUser %>"/>
<oneit:button value="Send" name="send" cssClass="box-btn send-btn"
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", "sign_in.jsp?sent=true")
.mapEntry(NotificationUtils.NOTIFICATION_MSG_PARAM, "emailSent")
.mapEntry("Company", company)
.toMap() %>"/>
</div>
</oneit:form>
<%@ include file="inc/htmlfooter_nopriv.jsp" %>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<OBJECTS xmlns:oneit="http://www.1iT.com.au" name="">
<NODE factory="Vector" name="Script"><NODE class="oneit.appservices.upgrade.cms.CMSArticleUpdateOperation" factory="Participant" name="Company Account Verification">
<createSpecificIdentifier factory='String' value='VV5IJAZF8G4KUHHN8OPS1G57IUY4SZ'/>
<articleIdentifiers factory="Array" class="java.lang.String">
<NODE factory="String" value="VV5IJAZF8G4KUHHN8OPS1G57IUY4SZ"/>
</articleIdentifiers>
<createdLabel factory="String" value="VV5IJAZF8G4KUHHN8OPS1G57IUY4SZ"/>
<newParentCategory factory="String" value="created:5L47UE8LMI51VOIOS8YTLLVQAT5NTW"/>
<articleAttributeChanges factory="Map">
<NODE name="Additional CSS Class" factory="Null"/>
<NODE name="Exclude From Sitemap" factory="Boolean" value="false"/>
<NODE name="Exclude from SEO Indexing" factory="Boolean" value="false"/>
<NODE name="Add Brackline Separator" factory="Boolean" value="false"/>
<NODE name="On Top Menu" factory="Boolean" value="false"/>
<NODE name="On Footer Left" factory="Boolean" value="false"/>
<NODE name="Menu Title" factory="Null"/>
<NODE name="On Footer Menu" factory="Boolean" value="false"/>
<NODE name="Exclude From Search" factory="Boolean" value="false"/>
<NODE name="Menu Icon CSS" factory="Null"/>
<NODE name="On Left Menu" factory="Boolean" value="false"/>
<NODE name="Shortcuts" factory="String" value="CompanyAccountVerification"/>
<NODE name="Exclude From Navigation" factory="Boolean" value="false"/>
<NODE name="On Footer Right" factory="Boolean" value="false"/>
</articleAttributeChanges>
<ormAttributeChanges factory="Map">
<NODE name="PublishDate" factory="Date" value="2017-06-20 00:00:00"/>
<NODE name="WithdrawDate" factory="Date" value="2067-06-20 13:00:00"/>
<NODE name="Title" factory="String" value="Company Account Verification"/>
<NODE name="ShortTitle" factory="String" value="Account Verification"/>
<NODE name="SortOrder" factory="Integer" value="-36831674"/>
<NODE name="Type" factory="Enumerated" class="oneit.business.content.ArticleType" value="ARTICLE"/>
<NODE name="Template" factory="Enumerated" class="oneit.business.content.ArticleTemplate" value="COMPANY_ACCOUNT_VERIFICATION"/>
</ormAttributeChanges>
<content factory="Map"> <NODE name="Body" factory="Map">
<NODE name="Content" factory="String"><![CDATA[<html>
<head>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta content="HTML Tidy, see www.w3.org" name="generator">
<title></title>
</head>
<body>
<p>&nbsp;</p>
</body>
</html>
]]></NODE>
<NODE name="TransformedContent" factory="String"><![CDATA[<p>&nbsp;</p>
]]></NODE>
<NODE name="IncludeContent" factory="Boolean" value="true"/>
</NODE>
<NODE name="Synopsis" factory="Map">
<NODE name="Content" factory="String"><![CDATA[
<p></p>
]]></NODE>
<NODE name="IncludeContent" factory="Boolean" value="true"/>
</NODE>
</content>
</NODE>
</NODE>
</OBJECTS>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<OBJECTS xmlns:oneit="http://www.1iT.com.au" name="">
<NODE factory="Vector" name="Script"><NODE class="oneit.appservices.upgrade.cms.CMSArticleUpdateOperation" factory="Participant" name="Company Account Verification Mail">
<createSpecificIdentifier factory='String' value='P1U6WNGWG39B7X9W9Q7MX0Q8YAZGOB'/>
<articleIdentifiers factory="Array" class="java.lang.String">
<NODE factory="String" value="P1U6WNGWG39B7X9W9Q7MX0Q8YAZGOB"/>
</articleIdentifiers>
<createdLabel factory="String" value="P1U6WNGWG39B7X9W9Q7MX0Q8YAZGOB"/>
<newParentCategory factory="String" value="RESOURCE_LIBRARY"/>
<articleAttributeChanges factory="Map">
<NODE name="EmailTo" factory="Null"/>
<NODE name="EmailFrom" factory="String" value="info@talentology.com.au"/>
<NODE name="EmailSubject" factory="String" value="Verify your email"/>
<NODE name="Shortcuts" factory="String" value="CompanyAccountVerificationMail"/>
<NODE name="EmailCC" factory="Null"/>
<NODE name="EmailBCC" factory="Null"/>
</articleAttributeChanges>
<ormAttributeChanges factory="Map">
<NODE name="PublishDate" factory="Date" value="2016-02-05 00:00:00"/>
<NODE name="WithdrawDate" factory="Date" value="2066-02-05 16:00:00"/>
<NODE name="Title" factory="String" value="Company Account Verification Mail"/>
<NODE name="ShortTitle" factory="String" value="Reset Code Email"/>
<NODE name="SortOrder" factory="Integer" value="-200926"/>
<NODE name="Type" factory="Enumerated" class="oneit.business.content.ArticleType" value="ARTICLE"/>
<NODE name="Template" factory="Enumerated" class="oneit.business.content.ArticleTemplate" value="EMAIL_TEMPLATE"/>
</ormAttributeChanges>
<content factory="Map"> <NODE name="EmailBody" factory="Map">
<NODE name="Content" factory="String"><![CDATA[<html>
<head>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta content="HTML Tidy, see www.w3.org" name="generator">
<title></title>
</head>
<body>
<p>Hello,</p>
<p>Welcome to Talantology! Your account has been created.</p>
<p>To verify this account please <a href="${link}">click here</a>. After verifying your account, you can create jobs.</p>
<p>Thank You.</p>
</body>
</html>
]]></NODE>
<NODE name="TransformedContent" factory="String"><![CDATA[<p>Hello,</p><p>Welcome to Talantology! Your account has been created.</p><p>To verify this account please <a href="${link}">click here</a>. After verifying your account, you can create jobs.</p><p>Thank You.</p>
]]></NODE>
<NODE name="IncludeContent" factory="Boolean" value="true"/>
</NODE>
<NODE name="" factory="Map">
<NODE name="Content" factory="String"><![CDATA[
<p></p>
]]></NODE>
<NODE name="IncludeContent" factory="Boolean" value="true"/>
</NODE>
</content>
</NODE>
</NODE>
</OBJECTS>
\ No newline at end of file
<%@ page extends="oneit.servlets.jsp.JSPInclude" %>
<%@ include file="/inc/stdimports50.jsp" %><%-- This is in cougar --%>
<%@ include file="/inc/stdcms.jsp" %><%-- This is in cougar --%>
<%@ include file="/extensions/performa/inc/stdimports.jsp" %>
<%@ include file="inc/htmlheader_nopriv.jsp" %>
<oneit:dynIncluded>
<%
String nextPage = WebUtils.getArticleLink(request, process.getTransaction (), WebUtils.JOB_APPLICATION, "Page");
CompanyUser companyUser = (CompanyUser) process.getAttribute("CompanyUser");
SecUser secUser = null;
//to process company user verification
String id = request.getParameter("id");
String key = request.getParameter("key");
Boolean isVerify = Boolean.FALSE;
if(id!=null && key!=null)
{
isVerify = Boolean.TRUE;
companyUser = CompanyUser.searchIdPin(transaction, Long.parseLong(id), key);
if(companyUser!=null && companyUser.getIsAccountVerified()!=Boolean.TRUE)
{
secUser = companyUser.getUser();
process.setAttribute("CompanyUser", companyUser);
}
}
else
{
response.sendRedirect(WebUtils.getSamePageInRenderMode(request, "AuthError"));
}
Debug.assertion(companyUser != null, "Invalid CompanyUser in admin portal");
%>
<script type="text/javascript">
$(document.body).addClass('bg-color');
$(document).ready(function() {
validate();
$('input').on('change keyup', function() { validate() });
interval = setInterval(function() { validate(); }, 500);
});
function validate() {
var empty = false;
$('input[required]').each(function() {
if ($( this ).val() == '') {
empty = true;
if ($( this ).css('background-color') == 'rgb(250, 255, 189)') {
empty = false;
}
}
});
if (empty) {
$('.verify-btn').attr('disabled', 'disabled');
} else {
$('.verify-btn').removeAttr('disabled');
clearInterval(interval);
}
}
</script>
<style>
button[disabled] {
opacity: 0.6;
background-color: #0582ba;
}
</style>
<oneit:form name="verify" method="post">
<oneit:dynInclude page="/extensions/applicantportal/inc/multifieldtext.jsp" data="<%= CollectionUtils.EMPTY_MAP%>"/>
<div class="main-box-layout login-box">
<oneit:dynInclude page="/extensions/adminportal/inc/company_user_data.jsp" data="<%= CollectionUtils.EMPTY_MAP%>" CompanyUser="<%= companyUser %>"/>
<oneit:button value="Verify and login" name="xxx" cssClass="box-btn send-btn"
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", "sign_in.jsp").toMap() %>"/>
</div>
</oneit:form>
</oneit:dynIncluded>
\ 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