Commit 4ed5f0e3 by Nilu

reset password applicant portal

parent 37f0a136
...@@ -21,6 +21,7 @@ import oneit.utils.transform.param.ORMTransform; ...@@ -21,6 +21,7 @@ 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.Candidate;
import performa.orm.CompanyUser; import performa.orm.CompanyUser;
import performa.orm.Job;
import performa.utils.WebUtils; import performa.utils.WebUtils;
...@@ -37,7 +38,7 @@ public class ForgotPasswordFP extends SaveFP ...@@ -37,7 +38,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"); Job job = (Job) process.getAttribute("Job");
Debug.assertion(email != null, "Email not avaialble"); Debug.assertion(email != null, "Email not avaialble");
...@@ -97,9 +98,10 @@ public class ForgotPasswordFP extends SaveFP ...@@ -97,9 +98,10 @@ public class ForgotPasswordFP extends SaveFP
emailParams = CollectionUtils.mapEntry("resetcode", candidate.getForgotPasswordKey()) emailParams = CollectionUtils.mapEntry("resetcode", candidate.getForgotPasswordKey())
.mapEntry("url", LoopbackHTTP.getRemoteAccessURL(request) .mapEntry("url", LoopbackHTTP.getRemoteAccessURL(request)
+ applyJobArticle.getLink(request, CollectionUtils.EMPTY_MAP, "/") + applyJobArticle.getLink(request, CollectionUtils.mapEntry("cms.rm", WebUtils.RESET_PASSWORD).toMap(), "/")
+ "?id=" + candidate.getID() + "&id=" + candidate.getID()
+ "&key=" + candidate.getForgotPasswordKey()).toMap(); + "&key=" + candidate.getForgotPasswordKey()
+ "&jid=" + job.getID()).toMap();
} }
PrefixCompoundTransform compoundTransform = new PrefixCompoundTransform(); PrefixCompoundTransform compoundTransform = new PrefixCompoundTransform();
...@@ -129,9 +131,7 @@ public class ForgotPasswordFP extends SaveFP ...@@ -129,9 +131,7 @@ 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.");
} }
process.completeAndRestart(); return super.processForm(process, submission, params);
return new ProcessRedirectResult(nextPage, new String[0]);
} }
......
...@@ -4852,6 +4852,10 @@ label, label .label-title span { ...@@ -4852,6 +4852,10 @@ label, label .label-title span {
font-size: 26px; font-size: 26px;
} }
.smaller-face{
width: 20.2px;
}
.mob-smile-face{ .mob-smile-face{
position: absolute; position: absolute;
width: 16.2px; width: 16.2px;
......
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
<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="ResetPassword" preIncludeJSP="extensions/applicantportal/reset_password.jsp"/>
<RenderMode name="ResetPasswordSent" preIncludeJSP="extensions/applicantportal/reset_password_sent.jsp"/> <RenderMode name="ResetPasswordSent" preIncludeJSP="extensions/applicantportal/reset_password_sent.jsp"/>
</NODE> </NODE>
......
...@@ -7,6 +7,8 @@ ...@@ -7,6 +7,8 @@
<oneit:dynIncluded> <oneit:dynIncluded>
<script type="text/javascript"> <script type="text/javascript">
$(document.body).addClass('bg-color');
$(document).ready(function() { $(document).ready(function() {
validate(); validate();
$('input').on('change keyup', function() { validate() }); $('input').on('change keyup', function() { validate() });
...@@ -53,8 +55,10 @@ ...@@ -53,8 +55,10 @@
</div> </div>
<div class="form-group"> <div class="form-group">
<oneit:button value="Send" name="gotoPage" cssClass="box-btn send-btn" <oneit:button value="Send" name="forgotPassword" cssClass="box-btn send-btn"
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", WebUtils.getSamePageInRenderMode(request, "ResetPasswordSent")) requestAttribs="<%= CollectionUtils.mapEntry("nextPage", WebUtils.getSamePageInRenderMode(request, "ResetPasswordSent"))
.mapEntry ("restartProcess", Boolean.TRUE)
.mapEntry ("attribNamesToRestore", Collections.singleton("Job"))
.toMap() %>"/> .toMap() %>"/>
</div> </div>
</div> </div>
......
...@@ -8,45 +8,47 @@ ...@@ -8,45 +8,47 @@
<% <%
ORMProcessState process = (ORMProcessState)ProcessDecorator.getDefaultProcess(request); ORMProcessState process = (ORMProcessState)ProcessDecorator.getDefaultProcess(request);
ObjectTransaction objTran = process.getTransaction ();
String candidateID = (String) process.getAttribute("candidateID"); //request.getParameter("id"); String candidateID = (String) process.getAttribute("candidateID"); //request.getParameter("id");
String forgotpasswordCode = (String) process.getAttribute("forgotpasswordCode"); //request.getParameter("key"); String forgotpasswordCode = (String) process.getAttribute("forgotpasswordCode"); //request.getParameter("key");
SecUser user = (SecUser) process.getAttribute("SecUser"); SecUser user = (SecUser) process.getAttribute("SecUser");
Article home = WebUtils.getArticleByShortCut(process.getTransaction(), WebUtils.ADMIN_HOME); String nextPage = WebUtils.getArticleLink(request, objTran, WebUtils.JOB_APPLICATION, "SignIn");
String nextPage = home.getLink(request); Job job = (Job) process.getAttribute("Job");
if(request.getParameter("id")!=null) if(request.getParameter("id")!= null)
{ {
candidateID = request.getParameter("id"); candidateID = request.getParameter("id");
process.setAttribute("candidateID", candidateID); process.setAttribute("candidateID", candidateID);
} }
if(request.getParameter("key")!=null) if(request.getParameter("key")!= null)
{ {
forgotpasswordCode = request.getParameter("key"); forgotpasswordCode = request.getParameter("key");
process.setAttribute("forgotpasswordCode", forgotpasswordCode); process.setAttribute("forgotpasswordCode", forgotpasswordCode);
} }
if(StringUtils.subBlanks(companyUserID) != null) if(request.getParameter("jid")!= null)
{ {
Canddate candidate = CompanyUser.getCandidateForForgotPassword(process.getTransaction(), candidateID, forgotpasswordCode); String jobID = request.getParameter("jid");
job = Job.getJobByID(objTran, Long.parseLong(jobID));
process.setAttribute("Job", job);
}
if(StringUtils.subBlanks(candidateID) != null)
{
Candidate candidate = Candidate.getCandidateForForgotPassword(objTran, candidateID, forgotpasswordCode);
if(candidate != null) if(candidate != null)
{ {
user = candidate.getUser(); user = candidate.getUser();
// if(StringUtils.subBlanks(forgotpasswordCode) != null)
// {
// RandomStringGen random = new RandomStringGen();
//
// user.setAttribute("md5:Password", random.generateAlphaNum(8));
// }
process.setAttribute("SecUser", user); process.setAttribute("SecUser", user);
} }
} }
%> %>
<script type="text/javascript">
$(document.body).addClass('bg-color');
<script type="text/javascript">
$(document).ready(function() { $(document).ready(function() {
validate(); validate();
$('input').on('change keyup', function() { validate() }); $('input').on('change keyup', function() { validate() });
...@@ -66,14 +68,15 @@ ...@@ -66,14 +68,15 @@
$('.reset-btn').removeAttr('disabled'); $('.reset-btn').removeAttr('disabled');
} }
} }
</script> </script>
<style> <style>
button[disabled] { button[disabled] {
opacity: 0.6; opacity: 0.6;
background-color: #0582ba; background-color: #0582ba;
} }
</style> </style>
<div class="main-verify-identity">
<div class="login-logo"><img src="<%= request.getContextPath() %>/images/logo.svg" /></div>
<oneit:form name="resetPassword" method="post"> <oneit:form name="resetPassword" method="post">
<oneit:dynInclude page="/extensions/applicantportal/inc/multifieldtext.jsp" data="<%= CollectionUtils.EMPTY_MAP%>"/> <oneit:dynInclude page="/extensions/applicantportal/inc/multifieldtext.jsp" data="<%= CollectionUtils.EMPTY_MAP%>"/>
...@@ -100,7 +103,8 @@ ...@@ -100,7 +103,8 @@
</div> <!-- form-group --> </div> <!-- form-group -->
<div class="col-sm-12"> <div class="col-sm-12">
<oneit:button value="Set New Password" name="resetPassword" cssClass="box-btn reset-btn" <oneit:button value="Set New Password" name="resetPassword" cssClass="box-btn reset-btn"
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", nextPage).toMap() %>"/> requestAttribs="<%= CollectionUtils.mapEntry("nextPage", nextPage + "&JobID=" + job.getID().toString())
.toMap() %>"/>
</div> </div>
</div> </div>
<% <%
...@@ -113,4 +117,5 @@ ...@@ -113,4 +117,5 @@
} }
%> %>
</oneit:form> </oneit:form>
</div>
</oneit:dynIncluded> </oneit:dynIncluded>
\ No newline at end of file
...@@ -6,12 +6,16 @@ ...@@ -6,12 +6,16 @@
<oneit:dynIncluded> <oneit:dynIncluded>
<script type="text/javascript">
$(document.body).addClass('bg-color');
</script>
<div class="main-verify-identity"> <div class="main-verify-identity">
<div class="login-logo"><img src="<%= request.getContextPath() %>/images/logo.svg" /></div> <div class="login-logo"><img src="<%= request.getContextPath() %>/images/logo.svg" /></div>
<div class="main-box-layout login-box"> <div class="main-box-layout login-box">
<div class="text-left"> <div>
<p> <p>
Enter your email address below. If we find a matching account, then you'll receive an email with a password reset link. Sent! Check your email now.<span><img class="smile-face smaller-face"src="images/smile-face.png" /></span>
</p> </p>
</div> </div>
</div> </div>
......
<?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