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
ObjectTransaction objTran = process.getTransaction();
Company company = (Company) process.getAttribute("Company");
CompanyUser resendUser = (CompanyUser) request.getAttribute("ResendUser");
String email = company.getUserEmail().toLowerCase();
if(resendUser!=null)
{
......@@ -71,17 +70,13 @@ public class SendUserInvitationFP extends SaveFP
{
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)
{
secUser = SecUser.searchNAME(objTran, company.getUserEmail());
}
else
if(secUser == null)
{
secUser = SecUser.createSecUser(objTran);
secUser.setUserName(email);
secUser.setUserName(company.getUserEmail().toLowerCase());
}
CompanyUser newComUser = secUser.getExtensionOrCreate(CompanyUser.REFERENCE_CompanyUser);
......@@ -117,7 +112,7 @@ public class SendUserInvitationFP extends SaveFP
protected void sendInvitationMail(CompanyUser companyUser, HttpServletRequest request) throws BusinessException
{
if(companyUser.getIsAccountVerified()!=Boolean.TRUE)
if(!companyUser.isTrue(companyUser.getIsAccountVerified()))
{
try
{
......
......@@ -141,4 +141,18 @@ public class WebUtils
renderMode.equals(JOB_REVIEW) ||
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,22 +17,24 @@
<%@ include file="setuprequest.jsp" %>
<%
if(CollectionUtils.equals(portalName, WebUtils.ADMIN_PORTAL))
if(WebUtils.showHeaderFooter(objTran, article))
{
if(CollectionUtils.equals(portalName, WebUtils.ADMIN_PORTAL))
{
%>
<%@ include file="extensions/adminportal/inc/htmlheader.jsp" %>
<%@ include file="extensions/adminportal/inc/menuinclude.jsp" %>
<%@ include file="extensions/adminportal/inc/htmlheader.jsp" %>
<%@ include file="extensions/adminportal/inc/menuinclude.jsp" %>
<%
}
else if(CollectionUtils.equals(portalName, WebUtils.APPLICANT_PORTAL))
{
}
else if(CollectionUtils.equals(portalName, WebUtils.APPLICANT_PORTAL))
{
%>
<%@ include file="extensions/applicantportal/inc/htmlheader.jsp" %>
<%@ include file="extensions/applicantportal/inc/menuinclude.jsp" %>
<%@ include file="extensions/applicantportal/inc/htmlheader.jsp" %>
<%@ include file="extensions/applicantportal/inc/menuinclude.jsp" %>
<%
}
}
Map m = CollectionUtils.mapEntry(NavigationBarDF.NAV_BAR, navbar.getChildNavBarFor (article))
.mapEntry("StartLevel", new Integer (0))
.mapEntry("EndLevel", new Integer (0))
......@@ -41,12 +43,15 @@
%>
<oneit:dynInclude page="descendPageContent.jsp" data="<%= m %>"/>
<%
if(CollectionUtils.equals(portalName, WebUtils.ADMIN_PORTAL))
{
%><%@ include file="extensions/adminportal/inc/htmlfooter.jsp" %><%
}
else if(CollectionUtils.equals(portalName, WebUtils.APPLICANT_PORTAL))
if(WebUtils.showHeaderFooter(objTran, article))
{
%><%@ include file="extensions/applicantportal/inc/htmlfooter.jsp" %><%
if(CollectionUtils.equals(portalName, WebUtils.ADMIN_PORTAL))
{
%><%@ include file="extensions/adminportal/inc/htmlfooter.jsp" %><%
}
else if(CollectionUtils.equals(portalName, WebUtils.APPLICANT_PORTAL))
{
%><%@ include file="extensions/applicantportal/inc/htmlfooter.jsp" %><%
}
}
%>
\ No newline at end of file
......@@ -98,7 +98,7 @@
<div class="m-user-icon"><img src="images/user-list-icon.png"></div>
<div class="m-user-info">
<div class="m-user-name">
<oneit:toString value="<%= user.getName() %>" mode="EscapeHTML" />
<oneit:toString value="<%= SecUserToNameTransform.INSTANCE.transform(user) %>" mode="EscapeHTML" />
</div>
<div class="m-user-email">
<oneit:toString value="<%= user.getEmail() %>" mode="EscapeHTML" />
......
......@@ -106,14 +106,14 @@
</span>
<h2>Nearly There!</h2>
<p>Please confirm your password to finish updating your email.</p>
<oneit:ormInput obj="<%= companyUser %>" type="password" attributeName="ConfirmPassword" cssClass="form-control"/>
<oneit:ormInput obj="<%= companyUser %>" type="password" attributeName="ConfirmPassword" cssClass="form-control"/>
<div class="save-my-details">
<oneit:button value="Save" name="saveUserDetails" cssClass="btn btn-primary btn-orange save-my-details-btn"
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", nextPage)
.mapEntry("CompanyUser", companyUser)
.toMap() %>" />
</div>
<div class="save-my-details">
<oneit:button value="Save" name="saveUserDetails" cssClass="btn btn-primary btn-orange save-my-details-btn"
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", nextPage)
.mapEntry("CompanyUser", companyUser)
.toMap() %>" />
</div>
</div>
</div>
</div>
......
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