Commit d5f156e0 by Nilu

admin portal forgot password modifications

parent 2ff58003
...@@ -87,4 +87,17 @@ public class CompanyUser extends BaseCompanyUser ...@@ -87,4 +87,17 @@ public class CompanyUser extends BaseCompanyUser
return super.getWriteability_Role(); 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 @@ ...@@ -7,6 +7,7 @@
<IMPORT value="oneit.security.*" /> <IMPORT value="oneit.security.*" />
<IMPORT value="performa.orm.types.*"/> <IMPORT value="performa.orm.types.*"/>
<TRANSIENT name="Email" type="String" validators="Email" />
<TRANSIENT name="Password" type="String"/> <TRANSIENT name="Password" type="String"/>
<TRANSIENT name="ConfirmPassword" type="String"/> <TRANSIENT name="ConfirmPassword" type="String"/>
......
...@@ -5516,4 +5516,9 @@ label, label .label-title span { ...@@ -5516,4 +5516,9 @@ label, label .label-title span {
input{ input{
font-family: "Usual-Light"; font-family: "Usual-Light";
}
.text-justify{
font-family: "Usual-Light";
text-align: justify;
} }
\ No newline at end of file
...@@ -10,22 +10,22 @@ ...@@ -10,22 +10,22 @@
<script type="text/javascript"> <script type="text/javascript">
$(document).ready(function() { $(document).ready(function() {
recalcFunction = setupRecalc ($("form"), {'recalcOnError':true});
validate(); 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() { function validate() {
var empty = false; if ($('#send-link-div')) {
$('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'); $('.send-btn').attr('disabled', 'disabled');
} else { } else {
$('.send-btn').removeAttr('disabled'); $('.send-btn').removeAttr('disabled');
...@@ -33,33 +33,59 @@ ...@@ -33,33 +33,59 @@
} }
</script> </script>
<style> <style>
button[disabled] { .btn-disabled button{
opacity: 0.6; opacity: 0.6;
background-color: #0582ba; background-color: #0582ba;
} }
</style>
<oneit:form name="forgotPassword" method="post"> #right-mark {
<oneit:dynInclude page="/extensions/applicantportal/inc/multifieldtext.jsp" data="<%= CollectionUtils.EMPTY_MAP%>"/> width: 24px;
<div class="main-box-layout login-box"> height: 24px;
<div class="text-left"> border-radius: 30px;
<p > position: absolute;
Enter your email address below. If we find a matching account, then you'll receive an email with a password reset link. top: 51%;
</p> right: 37px;
</div> background-color: #67b413;
<div>&nbsp;</div> padding-top: 5px;
<div class="form-group text-left"> }
<label>Email Address</label>
<input type="email" class="form-control" name="email" required>
</div>
<div class="form-group"> #right-mark img {
<oneit:button value="Send" name="forgotPassword" cssClass="box-btn send-btn" width: 15px;
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", "sign_in.jsp?sent=true") height: 15px;
.mapEntry(NotificationUtils.NOTIFICATION_MSG_PARAM, "resetPasswordEmailSent") display: block;
.toMap() %>"/> 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>
</div> </oneit:form>
</oneit:form>
<%@ include file="inc/htmlfooter_nopriv.jsp" %> <%@ 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