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
c40e8d1c
Commit
c40e8d1c
authored
Oct 02, 2017
by
chenith
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
User email address change - new proces.
parent
ab7d093f
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
74 additions
and
33 deletions
+74
-33
SaveUserDetailsFP.java
cmsWebApp/src/performa/form/SaveUserDetailsFP.java
+0
-2
UserLoginFP.java
cmsWebApp/src/performa/form/UserLoginFP.java
+31
-0
Utils.java
cmsWebApp/src/performa/utils/Utils.java
+1
-1
email_verified.jsp
cmsWebApp/webroot/extensions/adminportal/email_verified.jsp
+7
-28
messagesOverride.txt
...root/extensions/adminportal/messages/messagesOverride.txt
+2
-0
my_details.jsp
cmsWebApp/webroot/extensions/adminportal/my_details.jsp
+10
-1
page_admin_home.jsp
cmsWebApp/webroot/extensions/adminportal/page_admin_home.jsp
+12
-1
sign_in.jsp
cmsWebApp/webroot/extensions/adminportal/sign_in.jsp
+11
-0
No files found.
cmsWebApp/src/performa/form/SaveUserDetailsFP.java
View file @
c40e8d1c
...
@@ -71,8 +71,6 @@ public class SaveUserDetailsFP extends SaveFP
...
@@ -71,8 +71,6 @@ public class SaveUserDetailsFP extends SaveFP
Utils
.
sendEmailChangedMail
(
companyUser
,
request
,
emailer
,
SaveUserDetailsFP
.
class
.
getName
());
Utils
.
sendEmailChangedMail
(
companyUser
,
request
,
emailer
,
SaveUserDetailsFP
.
class
.
getName
());
}
}
}
}
// secUser.setEmail(secUser.getUserName());
}
}
else
//email changed for social login
else
//email changed for social login
{
{
...
...
cmsWebApp/src/performa/form/UserLoginFP.java
View file @
c40e8d1c
package
performa
.
form
;
package
performa
.
form
;
import
java.util.Map
;
import
java.util.Map
;
import
javax.servlet.http.HttpServletRequest
;
import
oneit.logging.LogLevel
;
import
oneit.logging.LogMgr
;
import
oneit.logging.LoggingArea
;
import
oneit.objstore.ObjectTransaction
;
import
oneit.objstore.ObjectTransaction
;
import
oneit.security.LoginProcessor
;
import
oneit.security.LoginProcessor
;
import
oneit.security.SecUser
;
import
oneit.security.SecUser
;
...
@@ -27,5 +31,31 @@ public class UserLoginFP extends LoginProcessor
...
@@ -27,5 +31,31 @@ public class UserLoginFP extends LoginProcessor
{
{
throw
new
FieldException
(
"You're not an authorised user to access this portal."
,
SecUser
.
FIELD_UserName
);
throw
new
FieldException
(
"You're not an authorised user to access this portal."
,
SecUser
.
FIELD_UserName
);
}
}
else
{
//verify email change
HttpServletRequest
request
=
submission
.
getRequest
();
if
(
request
.
getSession
().
getAttribute
(
"EmailToVerify"
)!=
null
&&
companyUser
.
getIsEmailChanged
()==
Boolean
.
TRUE
)
{
companyUser
.
setIsEmailChanged
(
Boolean
.
FALSE
);
if
(!
companyUser
.
isLoggedViaSocial
())
{
SecUser
secUser
=
companyUser
.
getUser
();
secUser
.
setUserName
(
secUser
.
getEmail
());
LogMgr
.
log
(
LoggingArea
.
ALL
,
LogLevel
.
PROCESSING2
,
"User name changed."
,
secUser
);
}
LogMgr
.
log
(
LoggingArea
.
ALL
,
LogLevel
.
PROCESSING1
,
"User Email verified"
,
companyUser
);
request
.
getSession
().
setAttribute
(
"EmailToVerify"
,
null
);
request
.
getSession
().
setAttribute
(
"EmailVerified"
,
true
);
}
}
}
}
}
}
\ No newline at end of file
cmsWebApp/src/performa/utils/Utils.java
View file @
c40e8d1c
...
@@ -463,7 +463,7 @@ public class Utils
...
@@ -463,7 +463,7 @@ public class Utils
Map
defaultParams
=
CollectionUtils
.
mapEntry
(
"link"
,
link
).
toMap
();
Map
defaultParams
=
CollectionUtils
.
mapEntry
(
"link"
,
link
).
toMap
();
ObjectTransform
transform
=
Utils
.
createCompoundTransform
(
defaultParams
,
companyUser
);
ObjectTransform
transform
=
Utils
.
createCompoundTransform
(
defaultParams
,
companyUser
);
Utils
.
sendMail
(
emailer
,
transform
,
new
String
[]{
companyUser
.
get
EmailAddressFromUser
()},
null
,
companyUser
);
Utils
.
sendMail
(
emailer
,
transform
,
new
String
[]{
companyUser
.
get
User
().
getEmail
()},
null
,
companyUser
);
LogMgr
.
log
(
CompanyUser
.
LOG
,
LogLevel
.
PROCESSING1
,
"Sent email changed mail successfully from "
+
callingClass
+
" to :: "
,
companyUser
);
LogMgr
.
log
(
CompanyUser
.
LOG
,
LogLevel
.
PROCESSING1
,
"Sent email changed mail successfully from "
+
callingClass
+
" to :: "
,
companyUser
);
}
}
...
...
cmsWebApp/webroot/extensions/adminportal/email_verified.jsp
View file @
c40e8d1c
...
@@ -16,7 +16,6 @@
...
@@ -16,7 +16,6 @@
//to process company user verification
//to process company user verification
String id = request.getParameter("id");
String id = request.getParameter("id");
String key = request.getParameter("key");
String key = request.getParameter("key");
Boolean invalid = Boolean.TRUE;
if(id!=null && key!=null)
if(id!=null && key!=null)
{
{
...
@@ -24,38 +23,19 @@
...
@@ -24,38 +23,19 @@
if(companyUser!=null && companyUser.getIsEmailChanged()==Boolean.TRUE)
if(companyUser!=null && companyUser.getIsEmailChanged()==Boolean.TRUE)
{
{
try
session = request.getSession();
{
session.invalidate();
companyUser.setIsEmailChanged(Boolean.FALSE);
companyUser.setIsAccountVerified(Boolean.TRUE);
objTran.commit();
session = request.getSession(true);
objTran.commitResources();
session.setAttribute("EmailToVerify", true);
}
response.sendRedirect(nextPage);
finally
{
objTran.releaseResources();
}
invalid = Boolean.FALSE;
return;
// response.sendRedirect(nextPage);
}
}
}
}
if(invalid)
{
%>
%>
<h3>Verification Error</h3>
<h3>Verification Error</h3>
<p><span>Access expired.</span></p>
<p><span>Access expired.</span></p>
<%
}
else
{
%>
<p>Your e-mail address is successfully verified! Please login to access your account!</p>
<a class="btn btn-primary" href="<%= nextPage %>">Go to login</a>
<%
}
%>
<%@ include file="inc/htmlfooter_nopriv.jsp" %>
<%@ include file="inc/htmlfooter_nopriv.jsp" %>
\ No newline at end of file
cmsWebApp/webroot/extensions/adminportal/messages/messagesOverride.txt
View file @
c40e8d1c
...
@@ -4,3 +4,4 @@
...
@@ -4,3 +4,4 @@
#passwordNotMatch = The password does not match. Please try again.
#passwordNotMatch = The password does not match. Please try again.
#invitationSent = Your invitation has been successfully sent.
#invitationSent = Your invitation has been successfully sent.
#invalidEmail = Invalid email address.
#invalidEmail = Invalid email address.
#emailChanged = Your email address is successfully verified!
\ No newline at end of file
cmsWebApp/webroot/extensions/adminportal/my_details.jsp
View file @
c40e8d1c
...
@@ -6,6 +6,7 @@
...
@@ -6,6 +6,7 @@
<oneit:dynIncluded>
<oneit:dynIncluded>
<%
<%
ObjectTransaction objTran = process.getTransaction ();
SecUser loggedInUser = SecUser.getTXUser(transaction);
SecUser loggedInUser = SecUser.getTXUser(transaction);
CompanyUser companyUser = loggedInUser.getExtension(CompanyUser.REFERENCE_CompanyUser);
CompanyUser companyUser = loggedInUser.getExtension(CompanyUser.REFERENCE_CompanyUser);
...
@@ -13,6 +14,14 @@
...
@@ -13,6 +14,14 @@
String nextPage = WebUtils.getSamePageInRenderMode(request, "Page");
String nextPage = WebUtils.getSamePageInRenderMode(request, "Page");
boolean emailChanged = request.getAttribute("EmailChanged") != null ? (boolean) request.getAttribute("EmailChanged") : false;
boolean emailChanged = request.getAttribute("EmailChanged") != null ? (boolean) request.getAttribute("EmailChanged") : false;
Boolean verified = request.getSession().getAttribute("EmailVerified")!=null;
if(verified)
{
request.getSession().setAttribute("EmailVerified", null);
}
%>
%>
<script type="text/javascript">
<script type="text/javascript">
$(document).ready(function()
$(document).ready(function()
...
@@ -37,7 +46,7 @@
...
@@ -37,7 +46,7 @@
<div class="container-fluid">
<div class="container-fluid">
<div class="row content">
<div class="row content">
<div class="main-content-area">
<div class="main-content-area">
<h1 class="page-title">My Details</h1>
<h1 class="page-title">My Details<
%= verified ? "--changed" : "" %><
/h1>
<div style="padding-left: 15px; padding-right: 15px;">
<div style="padding-left: 15px; padding-right: 15px;">
<oneit:dynInclude page="/extensions/applicantportal/inc/multifieldtext.jsp" data="<%= CollectionUtils.EMPTY_MAP%>"/>
<oneit:dynInclude page="/extensions/applicantportal/inc/multifieldtext.jsp" data="<%= CollectionUtils.EMPTY_MAP%>"/>
</div>
</div>
...
...
cmsWebApp/webroot/extensions/adminportal/page_admin_home.jsp
View file @
c40e8d1c
...
@@ -14,11 +14,22 @@
...
@@ -14,11 +14,22 @@
{
{
CompanyUser companyUser = secUser.getExtension(CompanyUser.REFERENCE_CompanyUser);
CompanyUser companyUser = secUser.getExtension(CompanyUser.REFERENCE_CompanyUser);
if(companyUser!=null && companyUser.isLoggedViaSocial() && companyUser.getIsAccountVerified()!=Boolean.TRUE)
if(companyUser!=null)
{
if(companyUser.isLoggedViaSocial() && companyUser.getIsAccountVerified()!=Boolean.TRUE)
{
{
response.sendRedirect(WebUtils.getArticleByShortCut(process.getTransaction(), WebUtils.COMPANY_ACCOUNT_VERIFICATION).getLink(request));
response.sendRedirect(WebUtils.getArticleByShortCut(process.getTransaction(), WebUtils.COMPANY_ACCOUNT_VERIFICATION).getLink(request));
return;
return;
}
}
//to notify email address changed
if(request.getSession().getAttribute("EmailVerified")!=null)
{
String messageId = NotificationUtils.getNotifyIdIfRequired(process, request);
response.sendRedirect(NotificationUtils.appendNotifyIDToURL(WebUtils.getArticleByShortCut(process.getTransaction(), WebUtils.MY_DETAILS).getLink(request), messageId));
return;
}
}
}
}
Job[] jobs = Job.SearchByCompany().andJobStatus(new EqualsFilter<>(JobStatus.OPEN))
Job[] jobs = Job.SearchByCompany().andJobStatus(new EqualsFilter<>(JobStatus.OPEN))
...
...
cmsWebApp/webroot/extensions/adminportal/sign_in.jsp
View file @
c40e8d1c
...
@@ -48,6 +48,17 @@
...
@@ -48,6 +48,17 @@
}
}
</style>
</style>
<%
if(request.getSession().getAttribute("EmailToVerify")!=null)
{
%>
<div class="form-group">
<p>Please login to verify your email address.</p>
</div>
<%
}
%>
<div class="main-box-layout login-box">
<div class="main-box-layout login-box">
<oneit:form name="login" method="post">
<oneit:form name="login" 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%>"/>
...
...
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