Commit d5f156e0 by Nilu

admin portal forgot password modifications

parent 2ff58003
......@@ -87,4 +87,17 @@ public class CompanyUser extends BaseCompanyUser
return super.getWriteability_Role();
}
public Boolean emailExists()
{
if(getEmail() != null)
{
SecUser user = SecUser.searchNAME(getTransaction(), getEmail().toLowerCase());
return user != null && user.getExtension(CompanyUser.REFERENCE_CompanyUser) != null;
}
return Boolean.FALSE;
}
}
\ No newline at end of file
......@@ -7,6 +7,7 @@
<IMPORT value="oneit.security.*" />
<IMPORT value="performa.orm.types.*"/>
<TRANSIENT name="Email" type="String" validators="Email" />
<TRANSIENT name="Password" type="String"/>
<TRANSIENT name="ConfirmPassword" type="String"/>
......
......@@ -5516,4 +5516,9 @@ label, label .label-title span {
input{
font-family: "Usual-Light";
}
.text-justify{
font-family: "Usual-Light";
text-align: justify;
}
\ No newline at end of file
......@@ -10,22 +10,22 @@
<script type="text/javascript">
$(document).ready(function() {
recalcFunction = setupRecalc ($("form"), {'recalcOnError':true});
validate();
$('input').on('change keyup', function() { validate() });
$('input[type="text"]').keyup(function() {
$(this).change();
validate();
});
$('#right-mark-div').onChange(function() {
alert($(this).attr('class'));
});
});
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) {
if ($('#send-link-div')) {
$('.send-btn').attr('disabled', 'disabled');
} else {
$('.send-btn').removeAttr('disabled');
......@@ -33,33 +33,59 @@
}
</script>
<style>
button[disabled] {
.btn-disabled button{
opacity: 0.6;
background-color: #0582ba;
}
</style>
<oneit:form name="forgotPassword" method="post">
<oneit:dynInclude page="/extensions/applicantportal/inc/multifieldtext.jsp" data="<%= CollectionUtils.EMPTY_MAP%>"/>
<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>&nbsp;</div>
<div class="form-group text-left">
<label>Email Address</label>
<input type="email" class="form-control" name="email" required>
</div>
#right-mark {
width: 24px;
height: 24px;
border-radius: 30px;
position: absolute;
top: 51%;
right: 37px;
background-color: #67b413;
padding-top: 5px;
}
<div class="form-group">
<oneit:button value="Send" name="forgotPassword" cssClass="box-btn send-btn"
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", "sign_in.jsp?sent=true")
.mapEntry(NotificationUtils.NOTIFICATION_MSG_PARAM, "resetPasswordEmailSent")
.toMap() %>"/>
#right-mark img {
width: 15px;
height: 15px;
display: block;
margin: auto auto;
}
</style>
<%
ORMProcessState process = (ORMProcessState) ProcessDecorator.getDefaultProcess(request);
ObjectTransaction objTran = process.getTransaction ();
CompanyUser companyUser = CompanyUser.createCompanyUser(objTran);
%>
<oneit:form name="forgotPassword" method="post" enctype="multipart/form-data">
<oneit:dynInclude page="/extensions/applicantportal/inc/multifieldtext.jsp" data="<%= CollectionUtils.EMPTY_MAP%>"/>
<div class="main-box-layout login-box">
<div class="text-justify">
<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>&nbsp;</div>
<div class="form-group text-left">
<label>Email Address</label>
<oneit:ormInput obj="<%= companyUser %>" type="text" attributeName="Email" cssClass="form-control" autocomplete="off"/>
<oneit:recalcClass id="right-mark-div" htmlTag="div" classScript="companyUser.emailExists() ? 'show': 'hide'" companyUser="<%= companyUser %>" class="right-mark">
<span id="right-mark"><img src="../../images/right-mark.svg"/></span>
</oneit:recalcClass>
</div>
<div class="form-group">
<oneit:recalcClass id="right-mark-div" htmlTag="div" classScript="companyUser.emailExists() ? 'show': 'btn-disabled'" companyUser="<%= companyUser %>" class="right-mark">
<oneit:button value="Send reset link" name="forgotPassword" cssClass="box-btn send-btn"
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", "sign_in.jsp?sent=true")
.mapEntry(NotificationUtils.NOTIFICATION_MSG_PARAM, "resetPasswordEmailSent")
.toMap() %>"/>
</oneit:recalcClass>
</div>
</div>
</div>
</oneit:form>
</oneit:form>
<%@ include file="inc/htmlfooter_nopriv.jsp" %>
\ 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