Commit 7b7854f8 by Harsh Shah

NPE fix for user invitation, Restrict header/footer for verification article, Minor review changes

parent d704fc95
...@@ -57,7 +57,6 @@ public class SendUserInvitationFP extends SaveFP ...@@ -57,7 +57,6 @@ public class SendUserInvitationFP extends SaveFP
ObjectTransaction objTran = process.getTransaction(); ObjectTransaction objTran = process.getTransaction();
Company company = (Company) process.getAttribute("Company"); Company company = (Company) process.getAttribute("Company");
CompanyUser resendUser = (CompanyUser) request.getAttribute("ResendUser"); CompanyUser resendUser = (CompanyUser) request.getAttribute("ResendUser");
String email = company.getUserEmail().toLowerCase();
if(resendUser!=null) if(resendUser!=null)
{ {
...@@ -71,17 +70,13 @@ public class SendUserInvitationFP extends SaveFP ...@@ -71,17 +70,13 @@ public class SendUserInvitationFP extends SaveFP
{ {
LogMgr.log(LOG, LogLevel.PROCESSING1, "Started to create new use", company); LogMgr.log(LOG, LogLevel.PROCESSING1, "Started to create new use", company);
SecUser secUser = null; SecUser secUser = SecUser.searchNAME(objTran, company.getUserEmail());
if(SecUser.searchNAME(objTran, company.getUserEmail())!=null) if(secUser == null)
{
secUser = SecUser.searchNAME(objTran, company.getUserEmail());
}
else
{ {
secUser = SecUser.createSecUser(objTran); secUser = SecUser.createSecUser(objTran);
secUser.setUserName(email); secUser.setUserName(company.getUserEmail().toLowerCase());
} }
CompanyUser newComUser = secUser.getExtensionOrCreate(CompanyUser.REFERENCE_CompanyUser); CompanyUser newComUser = secUser.getExtensionOrCreate(CompanyUser.REFERENCE_CompanyUser);
...@@ -117,7 +112,7 @@ public class SendUserInvitationFP extends SaveFP ...@@ -117,7 +112,7 @@ public class SendUserInvitationFP extends SaveFP
protected void sendInvitationMail(CompanyUser companyUser, HttpServletRequest request) throws BusinessException protected void sendInvitationMail(CompanyUser companyUser, HttpServletRequest request) throws BusinessException
{ {
if(companyUser.getIsAccountVerified()!=Boolean.TRUE) if(!companyUser.isTrue(companyUser.getIsAccountVerified()))
{ {
try try
{ {
......
...@@ -141,4 +141,18 @@ public class WebUtils ...@@ -141,4 +141,18 @@ public class WebUtils
renderMode.equals(JOB_REVIEW) || renderMode.equals(JOB_REVIEW) ||
renderMode.equals(CREATED_JOB); renderMode.equals(CREATED_JOB);
} }
public static boolean showHeaderFooter(ObjectTransaction objTran, Article article)
{
Article accVerificationArticle = getArticleByShortCut(objTran, COMPANY_ACCOUNT_VERIFICATION);
if(accVerificationArticle != null)
{
if(descendsFrom(article, accVerificationArticle.getIdentifier()))
{
return false;
}
}
return true;
}
} }
\ No newline at end of file
...@@ -17,6 +17,8 @@ ...@@ -17,6 +17,8 @@
<%@ include file="setuprequest.jsp" %> <%@ include file="setuprequest.jsp" %>
<% <%
if(WebUtils.showHeaderFooter(objTran, article))
{
if(CollectionUtils.equals(portalName, WebUtils.ADMIN_PORTAL)) if(CollectionUtils.equals(portalName, WebUtils.ADMIN_PORTAL))
{ {
%> %>
...@@ -31,7 +33,7 @@ ...@@ -31,7 +33,7 @@
<%@ include file="extensions/applicantportal/inc/menuinclude.jsp" %> <%@ include file="extensions/applicantportal/inc/menuinclude.jsp" %>
<% <%
} }
}
Map m = CollectionUtils.mapEntry(NavigationBarDF.NAV_BAR, navbar.getChildNavBarFor (article)) Map m = CollectionUtils.mapEntry(NavigationBarDF.NAV_BAR, navbar.getChildNavBarFor (article))
.mapEntry("StartLevel", new Integer (0)) .mapEntry("StartLevel", new Integer (0))
...@@ -41,6 +43,8 @@ ...@@ -41,6 +43,8 @@
%> %>
<oneit:dynInclude page="descendPageContent.jsp" data="<%= m %>"/> <oneit:dynInclude page="descendPageContent.jsp" data="<%= m %>"/>
<% <%
if(WebUtils.showHeaderFooter(objTran, article))
{
if(CollectionUtils.equals(portalName, WebUtils.ADMIN_PORTAL)) if(CollectionUtils.equals(portalName, WebUtils.ADMIN_PORTAL))
{ {
%><%@ include file="extensions/adminportal/inc/htmlfooter.jsp" %><% %><%@ include file="extensions/adminportal/inc/htmlfooter.jsp" %><%
...@@ -49,4 +53,5 @@ ...@@ -49,4 +53,5 @@
{ {
%><%@ include file="extensions/applicantportal/inc/htmlfooter.jsp" %><% %><%@ include file="extensions/applicantportal/inc/htmlfooter.jsp" %><%
} }
}
%> %>
\ No newline at end of file
...@@ -98,7 +98,7 @@ ...@@ -98,7 +98,7 @@
<div class="m-user-icon"><img src="images/user-list-icon.png"></div> <div class="m-user-icon"><img src="images/user-list-icon.png"></div>
<div class="m-user-info"> <div class="m-user-info">
<div class="m-user-name"> <div class="m-user-name">
<oneit:toString value="<%= user.getName() %>" mode="EscapeHTML" /> <oneit:toString value="<%= SecUserToNameTransform.INSTANCE.transform(user) %>" mode="EscapeHTML" />
</div> </div>
<div class="m-user-email"> <div class="m-user-email">
<oneit:toString value="<%= user.getEmail() %>" mode="EscapeHTML" /> <oneit:toString value="<%= user.getEmail() %>" mode="EscapeHTML" />
......
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