Commit 4ed5f0e3 by Nilu

reset password applicant portal

parent 37f0a136
......@@ -21,6 +21,7 @@ import oneit.utils.transform.param.ORMTransform;
import oneit.utils.transform.param.PrefixCompoundTransform;
import performa.orm.Candidate;
import performa.orm.CompanyUser;
import performa.orm.Job;
import performa.utils.WebUtils;
......@@ -37,7 +38,7 @@ public class ForgotPasswordFP extends SaveFP
HttpServletRequest request = submission.getRequest();
ObjectTransaction objTran = process.getTransaction();
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");
......@@ -97,9 +98,10 @@ public class ForgotPasswordFP extends SaveFP
emailParams = CollectionUtils.mapEntry("resetcode", candidate.getForgotPasswordKey())
.mapEntry("url", LoopbackHTTP.getRemoteAccessURL(request)
+ applyJobArticle.getLink(request, CollectionUtils.EMPTY_MAP, "/")
+ "?id=" + candidate.getID()
+ "&key=" + candidate.getForgotPasswordKey()).toMap();
+ applyJobArticle.getLink(request, CollectionUtils.mapEntry("cms.rm", WebUtils.RESET_PASSWORD).toMap(), "/")
+ "&id=" + candidate.getID()
+ "&key=" + candidate.getForgotPasswordKey()
+ "&jid=" + job.getID()).toMap();
}
PrefixCompoundTransform compoundTransform = new PrefixCompoundTransform();
......@@ -129,9 +131,7 @@ public class ForgotPasswordFP extends SaveFP
throw new BusinessException("Sorry, we don't recognize that email address.");
}
process.completeAndRestart();
return new ProcessRedirectResult(nextPage, new String[0]);
return super.processForm(process, submission, params);
}
......
......@@ -4852,6 +4852,10 @@ label, label .label-title span {
font-size: 26px;
}
.smaller-face{
width: 20.2px;
}
.mob-smile-face{
position: absolute;
width: 16.2px;
......
......@@ -25,7 +25,7 @@
<RenderMode name="Page" preIncludeJSP="extensions/applicantportal/job_overview.jsp"/>
<RenderMode name="SignIn" preIncludeJSP="extensions/applicantportal/sign_in.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"/>
</NODE>
......
......@@ -7,6 +7,8 @@
<oneit:dynIncluded>
<script type="text/javascript">
$(document.body).addClass('bg-color');
$(document).ready(function() {
validate();
$('input').on('change keyup', function() { validate() });
......@@ -53,8 +55,10 @@
</div>
<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"))
.mapEntry ("restartProcess", Boolean.TRUE)
.mapEntry ("attribNamesToRestore", Collections.singleton("Job"))
.toMap() %>"/>
</div>
</div>
......
......@@ -8,45 +8,47 @@
<%
ORMProcessState process = (ORMProcessState)ProcessDecorator.getDefaultProcess(request);
ObjectTransaction objTran = process.getTransaction ();
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);
String nextPage = WebUtils.getArticleLink(request, objTran, WebUtils.JOB_APPLICATION, "SignIn");
Job job = (Job) process.getAttribute("Job");
if(request.getParameter("id")!=null)
if(request.getParameter("id")!= null)
{
candidateID = request.getParameter("id");
process.setAttribute("candidateID", candidateID);
}
if(request.getParameter("key")!=null)
if(request.getParameter("key")!= null)
{
forgotpasswordCode = request.getParameter("key");
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)
{
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.body).addClass('bg-color');
<script type="text/javascript">
$(document).ready(function() {
validate();
$('input').on('change keyup', function() { validate() });
......@@ -66,14 +68,15 @@
$('.reset-btn').removeAttr('disabled');
}
}
</script>
<style>
</script>
<style>
button[disabled] {
opacity: 0.6;
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:dynInclude page="/extensions/applicantportal/inc/multifieldtext.jsp" data="<%= CollectionUtils.EMPTY_MAP%>"/>
......@@ -100,7 +103,8 @@
</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() %>"/>
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", nextPage + "&JobID=" + job.getID().toString())
.toMap() %>"/>
</div>
</div>
<%
......@@ -113,4 +117,5 @@
}
%>
</oneit:form>
</div>
</oneit:dynIncluded>
\ No newline at end of file
......@@ -6,12 +6,16 @@
<oneit:dynIncluded>
<script type="text/javascript">
$(document.body).addClass('bg-color');
</script>
<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">
<div>
<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>
</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