Skip to main content
  • Subscribe by RSS
  • Ex Libris Knowledge Center

    How to configure Primo to force patrons to sign in

    • Article Type: General
    • Product: Primo
    • Product Version: 4.5

    Question

    How to configure Primo to force patrons to sign in?

    Answer

    Force all patrons and staff users to sign in prior to using Primo FE. This may be required by a local security policy.

    1. Go to Views Wizard > Home Page Tiles Configuration > Static HTML Tile
    2. Edit the customized header file specified in the All Pages: Header field. DO NOT edit the default file.
      1. If the default file is present (/static_htmls/header.html) a customized footer file MUST be created
      2. The File Uploader Tool can be used to upload the customized file
      3. Update the All Pages: Header field to reflect the new path and filename of the header file
    3. Add the following JavaScript section on a new line following any opening comments (e.g. <!-- header -->):
      <script type="text/javascript">
           document.getElementById("contentEXL").style.display = "none";
      </script>
    4. Edit the customized footer file specified in the All Pages: Footer field. DO NOT edit the default file.
      1. If the default file is present (/static_htmls/footer.html) a customized footer file MUST be created
      2. The File Uploader Tool can be used to upload the customized file
      3. Update the All Pages: Footer field to reflect the new path and filename of the footer file
    5. Add the following JavaScript section on a new line following any opening comments (e.g. <!-- footer -->):
      <script type="text/javascript">
           var userName = $('#exlidUserAreaRibbon li.EXLUserName').text();
           var userNameDisplay = $('#exlidUserAreaRibbon li.EXLUserName .EXLUserNameDisplay').text();
           var loginLink = $('#exlidSignIn > a');
           
           if (userName.trim() == "Guest" || userNameDisplay.trim().length <= 0) { 
                // This call has the advantage of logging the call into Primo Analytics, but may not be compatible with older browsers
                loginLink.get(0).click();
                // An alternative that should work in all browsers
                // window.location = loginLink.attr('href');
           } else {
                document.getElementById("contentEXL").style.display = "block";
           }
      </script>
    6. Deploy the view if any updates were made to in the Views Wizard

    Additional Information

    • This code is appropriate only for the Classic UI.
    • The JavaScript in the header will hide the page, causing it to appear blank while it is loading.
    • The JavaScript in the footer will use CSS tags to check the patron name and name length.
    • If the patron name is Guest or blank, the code will "click" the Primo login link; otherwise it will un-hide the page.

     

    Category: Front End - Primo

    Subject: Sign In - Primo


    • Article last edited: 28-Mar-2017