You are viewing limited content. For full access, please sign in.

Question

Question

Weblink - sign-out button

asked on January 24, 2020

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

0 0

Answer

SELECTED ANSWER
replied on January 30, 2020 Show version history

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:

  1. Find the styles.css file in the C:\Program Files\Laserfiche\WebLink\WebLink\Web Files\ directory
  2. Make a backup copy of that file. Call it "styles-backupcopy.css" or similar.
  3. Open up styles.css in a text editor
  4. Search it for "#LogoffLink". The first result should be a block that looks like this:

     
  5. Above that block, add the following lines:
    /* 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.

  6. Save styles.css
  7. Recycle the WebLinkAppPool in IIS and/or restart IIS to pick up the new configuration.

 

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.

  1. Go to WebLink Designer -> Navigation
  2. Set "Show My WebLink Link" to "No"
  3. Click "Save"

 

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

 

1 0
replied on January 30, 2020

Excellent Sam - thank-you!

1 0
replied on July 13, 2022

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

0 0
replied on July 14, 2022 Show version history

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)

  1. Find the styles.css file in the C:\Program Files\Laserfiche\WebLink\WebLink\Web Files\ directory
  2. Make a backup copy of that file. Call it "styles-backupcopy.css" or similar.
  3. Open up styles.css in a text editor
  4. Search it for ".topBarNavigation". The first result should be a block that looks like this:
  5. Above that block, add the following lines:
    /* 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.

  6. Save styles.css
  7. Recycle the WebLinkAppPool in IIS and/or restart IIS to pick up the new configuration. You will likely need to clear your browser cache to pick up the new stylesheet client-side.

 

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.

 

1 0
replied on July 19, 2022

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

1 0
replied on July 19, 2022

Awesome, great to hear!

0 0
replied on September 5, 2023

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;
}
0 0

Replies

replied on July 15, 2022

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

 

1 0
replied on July 15, 2022

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

1 0
You are not allowed to follow up in this post.

Sign in to reply to this post.