Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
PERFORMA_REPLICA
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Muhammad Usman
PERFORMA_REPLICA
Commits
016c4c6b
Commit
016c4c6b
authored
Oct 04, 2017
by
chenith
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added validations when ForgotPassword action.
parent
bdff8195
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
47 additions
and
6 deletions
+47
-6
ForgotPasswordFP.java
cmsWebApp/src/performa/form/ForgotPasswordFP.java
+30
-3
forgot_password.jsp
cmsWebApp/webroot/extensions/adminportal/forgot_password.jsp
+17
-3
No files found.
cmsWebApp/src/performa/form/ForgotPasswordFP.java
View file @
016c4c6b
...
@@ -8,6 +8,7 @@ import oneit.email.ConfigurableEmailer;
...
@@ -8,6 +8,7 @@ import oneit.email.ConfigurableEmailer;
import
oneit.logging.*
;
import
oneit.logging.*
;
import
oneit.net.LoopbackHTTP
;
import
oneit.net.LoopbackHTTP
;
import
oneit.objstore.*
;
import
oneit.objstore.*
;
import
oneit.objstore.parser.BusinessObjectParser
;
import
oneit.objstore.rdbms.filters.EqualsFilter
;
import
oneit.objstore.rdbms.filters.EqualsFilter
;
import
oneit.security.SecUser
;
import
oneit.security.SecUser
;
import
oneit.servlets.forms.*
;
import
oneit.servlets.forms.*
;
...
@@ -29,8 +30,8 @@ public class ForgotPasswordFP extends SaveFP
...
@@ -29,8 +30,8 @@ public class ForgotPasswordFP extends SaveFP
HttpServletRequest
request
=
submission
.
getRequest
();
HttpServletRequest
request
=
submission
.
getRequest
();
ObjectTransaction
objTran
=
process
.
getTransaction
();
ObjectTransaction
objTran
=
process
.
getTransaction
();
Job
job
=
(
Job
)
process
.
getAttribute
(
"Job"
);
Job
job
=
(
Job
)
process
.
getAttribute
(
"Job"
);
CompanyUser
companyUser
=
(
CompanyUser
)
request
.
getAttribute
(
"CompanyUser"
);
CompanyUser
tmpComUser
=
(
CompanyUser
)
process
.
getAttribute
(
"CompanyUser"
);
String
email
=
job
!=
null
?
job
.
getEmail
()
:
(
companyUser
!=
null
?
company
User
.
getEmail
()
:
null
);
String
email
=
job
!=
null
?
job
.
getEmail
()
:
(
tmpComUser
!=
null
?
tmpCom
User
.
getEmail
()
:
null
);
Debug
.
assertion
(
StringUtils
.
subBlanks
(
email
)
!=
null
,
"Email not avaialble"
);
Debug
.
assertion
(
StringUtils
.
subBlanks
(
email
)
!=
null
,
"Email not avaialble"
);
...
@@ -55,7 +56,7 @@ public class ForgotPasswordFP extends SaveFP
...
@@ -55,7 +56,7 @@ public class ForgotPasswordFP extends SaveFP
LogMgr
.
log
(
LOG
,
LogLevel
.
PROCESSING1
,
"Inside ForgotPasswordFP for send reset pasword link mail to "
,
email
);
LogMgr
.
log
(
LOG
,
LogLevel
.
PROCESSING1
,
"Inside ForgotPasswordFP for send reset pasword link mail to "
,
email
);
Map
emailParams
;
Map
emailParams
;
companyUser
=
secUser
.
getExtension
(
CompanyUser
.
REFERENCE_CompanyUser
);
CompanyUser
companyUser
=
secUser
.
getExtension
(
CompanyUser
.
REFERENCE_CompanyUser
);
if
(
companyUser
!=
null
)
if
(
companyUser
!=
null
)
{
{
...
@@ -119,6 +120,12 @@ public class ForgotPasswordFP extends SaveFP
...
@@ -119,6 +120,12 @@ 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."
);
}
}
//remove temporary object
if
(
tmpComUser
!=
null
)
{
tmpComUser
.
delete
();
}
return
super
.
processForm
(
process
,
submission
,
params
);
return
super
.
processForm
(
process
,
submission
,
params
);
}
}
...
@@ -130,4 +137,23 @@ public class ForgotPasswordFP extends SaveFP
...
@@ -130,4 +137,23 @@ public class ForgotPasswordFP extends SaveFP
resetCodeEmailer
=
(
ConfigurableEmailer
)(
context
.
getSingleChild
(
"ResetCodeEmailer"
));
resetCodeEmailer
=
(
ConfigurableEmailer
)(
context
.
getSingleChild
(
"ResetCodeEmailer"
));
}
}
@Override
public
void
validate
(
ORMProcessState
process
,
SubmissionDetails
submission
,
MultiException
exceptions
,
Map
params
)
throws
StorageException
{
super
.
validate
(
process
,
submission
,
exceptions
,
params
);
HttpServletRequest
request
=
submission
.
getRequest
();
Job
job
=
(
Job
)
process
.
getAttribute
(
"Job"
);
CompanyUser
companyUser
=
(
CompanyUser
)
process
.
getAttribute
(
"CompanyUser"
);
if
(
job
!=
null
)
{
BusinessObjectParser
.
assertFieldCondition
(
StringUtils
.
subBlanks
(
job
.
getEmail
())
!=
null
,
job
,
Job
.
FIELD_Email
,
"mandatory"
,
exceptions
,
true
,
request
);
}
else
if
(
companyUser
!=
null
)
{
BusinessObjectParser
.
assertFieldCondition
(
StringUtils
.
subBlanks
(
companyUser
.
getEmail
())
!=
null
,
companyUser
,
CompanyUser
.
FIELD_Email
,
"mandatory"
,
exceptions
,
true
,
request
);
}
}
}
}
\ No newline at end of file
cmsWebApp/webroot/extensions/adminportal/forgot_password.jsp
View file @
016c4c6b
...
@@ -19,9 +19,10 @@
...
@@ -19,9 +19,10 @@
</script>
</script>
<style>
<style>
.btn-disabled
button
{
.btn-disabled{
opacity: 0.6;
opacity: 0.6;
background-color: #0582ba;
background-color: #0582ba;
cursor: not-allowed;
}
}
#right-mark {
#right-mark {
...
@@ -42,10 +43,20 @@
...
@@ -42,10 +43,20 @@
margin: auto auto;
margin: auto auto;
}
}
</style>
</style>
<%
<%
ORMProcessState process = (ORMProcessState) ProcessDecorator.getDefaultProcess(request);
ORMProcessState process = (ORMProcessState) ProcessDecorator.getDefaultProcess(request);
ObjectTransaction objTran = process.getTransaction ();
ObjectTransaction objTran = process.getTransaction ();
CompanyUser companyUser = CompanyUser.createCompanyUser(objTran);
CompanyUser companyUser = (CompanyUser) process.getAttribute("CompanyUser");
if(companyUser==null)
{
companyUser = CompanyUser.createCompanyUser(objTran);
process.setAttribute("CompanyUser", companyUser);
%><%@include file="/saferedirect.jsp"%><%
}
%>
%>
<oneit:form name="forgotPassword" method="post" enctype="multipart/form-data">
<oneit:form name="forgotPassword" method="post" enctype="multipart/form-data">
<oneit:dynInclude page="/extensions/applicantportal/inc/multifieldtext.jsp" data="<%= CollectionUtils.EMPTY_MAP%>"/>
<oneit:dynInclude page="/extensions/applicantportal/inc/multifieldtext.jsp" data="<%= CollectionUtils.EMPTY_MAP%>"/>
...
@@ -64,12 +75,15 @@
...
@@ -64,12 +75,15 @@
</oneit:recalcClass>
</oneit:recalcClass>
</div>
</div>
<div class="form-group">
<div class="form-group">
<oneit:recalcClass htmlTag="div" classScript="companyUser.emailExists() ? 'show': '
btn-disabled
'" companyUser="<%= companyUser %>">
<oneit:recalcClass htmlTag="div" classScript="companyUser.emailExists() ? 'show': '
hide
'" companyUser="<%= companyUser %>">
<oneit:button value="Send reset link" name="forgotPassword" cssClass="box-btn send-btn"
<oneit:button value="Send reset link" name="forgotPassword" cssClass="box-btn send-btn"
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", "reset_password_sent.jsp")
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", "reset_password_sent.jsp")
.mapEntry ("CompanyUser", companyUser)
.mapEntry ("CompanyUser", companyUser)
.toMap() %>"/>
.toMap() %>"/>
</oneit:recalcClass>
</oneit:recalcClass>
<oneit:recalcClass htmlTag="div" classScript="companyUser.emailExists() ? 'hide': 'show'" companyUser="<%= companyUser %>">
<input type="button" value="Send reset link" disabled="true" class="box-btn send-btn btn-disabled">
</oneit:recalcClass>
</div>
</div>
</div>
</div>
</oneit:form>
</oneit:form>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment