Is it possible through programming to eliminate the button in Weblink. My customer is concerned that when a public user clicks the sign-out button they get a login screen that gives them the user name and he's concerned about hacks.
Thanks
Sandu
Is it possible through programming to eliminate the button in Weblink. My customer is concerned that when a public user clicks the sign-out button they get a login screen that gives them the user name and he's concerned about hacks.
Thanks
Sandu
Update July 14, 2022:
Updated instructions that work for WebLink 10.2 and WebLink 11 are in a reply lower in this thread.
---------------------------------------------------------------
Hi Sandy,
Yes, you can make a very simple addition to WebLink's style.css file to remove the Sign Out button.
Here are the steps for WebLink 10.1:
/* Remove Sign Out button from top bar */ .TopRightLinks #LogoffLink, .TopRightLinks .LinkSpacer3 { display: none; }
So that together they look like this:
CSS order of precedence means the new block that always removes the Sign Off button will take priority.
You'll also want to remove the "My WebLink" preferences option if you haven't already. Fortunately this one you can do in WebLink Designer.
You should end up with a WebLink top bar like this with no "My WebLink" or "Sign Out" links:
I tested these steps on Laserfiche WebLink Version 10.1.0.60 (10.1) and 10.1.0.151 (10.1 Update 1).
Hope that helps.
Cheers,
Sam
Excellent Sam - thank-you!
Hey Sam,
So myself and a customer tried this in our Weblink environments (Theirs 10.2 and Mine 11.0) and your steps do not work to remove the Sign Out option.
I know there have been some configuration changes with the later versions, so wanted to see if you might know what to check for in these versions.
I see where the element is for this on my WL 11 Webpage, but not sure where this sits in the CSS or Config files
Thanks for any advice you might have,
Jeff Curtis
Hey Jeff,
The HTML attribute tags for those elements are different in WebLink 10.2 and 11 so my earlier WebLink 10.1 CSS won't work for those later versions.
Instructions for WebLink 10.2 and 11:
(Tested on build 11.0.2111.777)
/* Sign Out link */ .topBarNavigation > a:nth-child(7) { display: none; } /* Link spacer before Sign Out link */ .topBarNavigation > span:nth-child(6) { display: none; }
So that together they look like this:
IMPORTANT: The new CSS snippets use an index-based selector. If you have used WebLink Designer to hide any of the other Top Bar Navigation links, it's possible the indexes for your site's Sign Out link and the adjacent link spacer will be different. Use browser DevTools to get the selector for the Sign Out link's "a" element (not the child span element):
The copied selector will look something like this:
#welcomePage > welcome-app > div.navbar.navbar-inverse.navbar-fixed-top.actionBar.dvActionBar > div > div.topBarNavigation > a:nth-child(7)
The number (n) on the end is the index number for the Sign Out link that should go in the first CSS selector. (n-1) is the index number for the link spacer and should go in the second CSS selector.
I don't have a WebLink 10.2 test system handy to check that version [Edit: Jeff Curtis verified the above instructions work for WebLink 10.2 as well]. I'd highly recommend upgrading this customer to WebLink 11 though as it contains quite a few security updates that are especially important for a pubic-facing website. Remember to use the WebLink Settings Bundler utility to export/backup the WebLink 10.2 configuration before upgrading so you can restore it after, as the upgrade process wipes the existing config.
Hey Sam,
Wanted to let you know that the steps you provided for WL 11, worked for the customers WL 10.2 install.
Thanks Again,
Jeff Curtis
Awesome, great to hear!
I have slightly different settings because I am not showing links on the navigation page for "Show Welcome Page Link" or "Show My WebLink Link". When I go to the copy the selector for following element <a href="javascript:void(0)"><span lflocalize="STR_LOGOUT">Sign Out</span></a>.
I get the following. #moreDropdown > ul > li:nth-child(3) > a . So if that is the case would I need to change your CSS to the following?
/* Sign Out link */ .topBarNavigation > li:nth-child(3) { display: none; } /* Link spacer before Sign Out link */ .topBarNavigation > span:nth-child(2) { display: none; }
Hey Sam,
Thanks for the update.
I pulled the Selector from my Weblink Elements setting (See below):
#welcomePage > welcome-app > div.navbar.navbar-inverse.navbar-fixed-top.actionBar.dvActionBar > div > div.topBarNavigation > a:nth-child(6)
With this I edited the styles.css adding your config change as the following:
Looks correct, right?
After I saved the css file, I restarted WeblinkAppPool, launched Weblink and the Sign Out option is still there.
Thanks again for the help,
Jeff Curtis
Hey Sam,
Looks like it took a minute or so to update once I recycled the App Pool.
Sign Out is now removed from my WL page.
Thanks again for the help,
Jeff Curtis