Skip to content

Commit

Permalink
SAK-29766 Are you sure you want to logout question when you are tryin…
Browse files Browse the repository at this point in the history
…g to login.
  • Loading branch information
juanjmerono committed Sep 8, 2015
1 parent fc36804 commit 1f36177
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 3 deletions.
1 change: 1 addition & 0 deletions portal/portal-impl/impl/src/bundle/sitenav.properties
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ log.ple = Please Log In
log.userid = user id:

sit_log = Log Out
sit_logout_warn = Are you sure you want to log out?
sit_more = All Sites
sit_more_tab = My Active Sites
sit_notermkey = Courses: No Term
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1798,6 +1798,7 @@ public void includeLogin(PortalRenderContext rcontext, HttpServletRequest req,
String logInOutUrl2 = null;
String message2 = null;
String image2 = null;
String logoutWarningMessage = "";

// for showing user display name and id next to logout (SAK-10492)
String loginUserDispName = null;
Expand Down Expand Up @@ -1877,8 +1878,11 @@ public void includeLogin(PortalRenderContext rcontext, HttpServletRequest req,

// since we are doing logout, cancel top.login
topLogin = false;

logoutWarningMessage = rloader.getString("sit_logout_warn");
}
rcontext.put("loginTopLogin", Boolean.valueOf(topLogin));
rcontext.put("logoutWarningMessage", logoutWarningMessage);

// display portal links - SAK-22983
String portalLinks = portalService.getPortalLinks();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
#if (${loginHasImage1})

<li role="menuitem" class="Mrphs-loginUser__menuitem">
<a href="${loginLogInOutUrl}" title="${loginMessage}" id="loginLink1" class="Mrphs-loginUser__image"><img src="${loginImage1}" alt="${loginMessage}"></a>
<a href="${loginLogInOutUrl}" title="${loginMessage}" id="loginLink1" class="Mrphs-loginUser__image" data-warning="${logoutWarningMessage}"><img src="${loginImage1}" alt="${loginMessage}"></a>
</li>

#else

<li role="menuitem" class="Mrphs-loginUser__menuitem">
<a href="${loginLogInOutUrl}" title="${loginMessage}" id="loginLink1" class="Mrphs-loginUser__message">
<a href="${loginLogInOutUrl}" title="${loginMessage}" id="loginLink1" class="Mrphs-loginUser__message" data-warning="${logoutWarningMessage}">
<i class="login-Icon"></i>
<span class="Mrphs-login-Message">${loginMessage}</span>
</a>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ function toggleUserNav(event){

// Logout Confirm
$PBJQ('#loginLink1').click(function(e){
if(!confirm("Are you sure you want to log out ?")){
if ($PBJQ(this).attr("data-warning") !== "" && !confirm($PBJQ(this).attr("data-warning"))){
e.preventDefault();
}
});
Expand Down

0 comments on commit 1f36177

Please sign in to comment.