Advertisements

Customizing Citrix StoreFront 2.6 including Pre-Login message page

Here are my StoreFront customizations for Citrix StoreFront 2.6.  Many are similar to previous version of SF, however some of the syntax changed.

There are some good improvements/features SF 2.6 brings, one that I like and works best where I currently work is the Web Folder View, which in the past had to be done by running StoreFront in lock down mode.  This new view can certainly help your users feel more comfortable when moving from Web Interface.

Fist take a look at the new features of StoreFront which are listed under this link from Citrix.

Secondly I would like to thank Sam Jacobs which provided some of his code he presented at Citrix Synergy 2014.  You can view the presentation here 

Environment:

  • Windows 2008 R2
  • Citrix XenApp 6.5 Hotfix Rollup Pack 2
  • PVS 6.1.16
  • StoreFront 2.6
  • Citrix NetScaler 10.1 build 122.17

Customizations: (All custom files will need to be created under the contrib folder is located under the SF site in the file system (typical location is C:inetpubwwwrootsitesCitrixStoreWebNamecontrib

The following customizations include the following

  • Pre-Login message page
  • Front Page with custom logo and title header
  • App/Desktop page with custom logo, user client IP (For NetScaler load balancing make sure to use X-Forwarded-For to load balance your StoreFront servers, utilizing CLIENT-IP for your VIP will return the SNIP of your NetScaler as the source IP for the user client IP module :P)
  • Apps/Desktop Tab on top with Disable user multiclick
  • Page footer

03-pre_login_screen

01-front_page_logo

02-apps_page_logo

Back up the original files under C:inetpubwwwrootsitesCitrixStoreWebNamecontrib

Steps:

1. Overwrite the following files

  • custom.wrstrings.en.js
  • custom.script.js
  • custom.style.css

2. Create new files

  • GetServerData.aspx
  • companylogo_whiteTrans.png
  • companylogo_whitetrans_small.png

Code:

custom.wrstrings.en.js

(function ($) {
$.localization.customStringBundle(‘en’, {
Disclaimer: ‘Authorized Use Only’,
DisclaimerStatement: ‘You must be assigned an account to access this system.’
+ ‘ The information on this system and network is the property of this organization and is protected by intellectual property rights.’
+ ‘ By clicking the button below, you are consenting to the monitoring of your activities on the system’,
Continue: ‘Continue’
});
})(jQuery);

custom.script.js (You can certainly change the way I am working with $(document).ready(function() { and clean it up a bit

// StoreFront customizations

// Replace title
document.title = ‘Remote Access’;

// Place Apps/Desktop Tab on top
$(document).ready(function() {
$(“#resources-switcher” ).detach().appendTo(“#resources-header” );
});

// Disable User Multi Click 😛
$(document).ready(function() {
CTXS.Resources.multiClickTimeout = 10;
});

// Display client IP and StoreFront server
$.ajax({
url: ‘contrib/GetServerData.aspx?serverData=clientIPandServerName’,
success: function(data) {
var $markup = $(‘<div id=”server-info”>’ + data + ‘</div>’);
$markup.insertBefore(‘#header-userinfo’);
}
});

// Logon page footer text

// $(document).ready(function() {
// var $footercontent = $(‘<div id=”authentication-footer”><div id=”authentication-copyrightfooter”> <p id=”authentication-copyrightFooterText”></p></div></div>’);
// $footercontent.insertAfter(‘#logonbelt-bottomshadow’);
// });

// $(document).ready(function() {
// $(‘#authentication-copyrightfooter’)[0].innerHTML =
// ‘<p>&copy;2014&nbsp; Access restricted to authorized users.</p>’;
// });

// application page footer text

$(document).ready(function() {
$(‘#copyrightfooter’)[0].innerHTML = ‘<p>&copy;2014&nbsp; Name of your company</p>’;
});

// Prelogin page

$(document).ready(function() {
CTXS.Application.preLoginHook = function () {
var _dialogTitle = ‘<h1’
+ ‘ class=”messagebox-title _ctxstxt_Disclaimer”></h1>’;
var _dialogBody = ‘<div class=”messagebox-body”>’ +
‘<p class=”_ctxstxt_DisclaimerStatement”></p></div>’;
var _dialogButton = ‘<div class=”messagebox-buttons”>’ +
‘<a href=”#” class=”button _ctxstxt_Continue”></a></div>’;
var dialog = _dialogTitle + _dialogBody + _dialogButton;
var $messagePane = CTXS.displayMessagePane(dialog).ctxsLocalize();
var $button = $messagePane.find(‘.button’);
$button.click(function () {
CTXS.Events.publish(CTXS.Events.preLogin.done);
return false;
}).ctxsHandleEscapeKeyInDialog().ctxsPlaceFocusOnFirstElement(
).ctxsBindFocusWithin();
};
});

 

custom.style.css

/*
StoreFront customizations
*/

#credentialupdate-logonimage, #logonbox-logoimage {
background-image: url(“companylogo_whiteTrans.png”);
height: 50px;
width: 283px;
}

#header-logo {
background-image: url(“companylogo_whitetrans_small.png”);
height: 31px;
margin: 8px 0 0 22px;
width: 179px;
}

#resources-header {
height: 84px;
}

#resources-switcher {
padding-top: 48px;
text-align: center;
}

/* Help Desk info */

/* Logon labels */
#logonbox-logonform label{
color:white;
display:table-cell;
font-size:14px;
height:20px;
vertical-align:bottom;
}

/* welcome message and username */
#resources-header #header-userinfo {
float:left;
margin-top:12px;
margin-right:100px;
vertical-align:middle;
color:white;
}

#header-username,
#header-userinfo A {
color:white;
font-size:12px;
}

/* for added server info */
#server-info {
color: white;
font-size:12px;
float: left;
margin-right: 40px;
margin-top: 12px;
position: relative;
vertical-align: middle;
}

/* EOF Help Desk info */

/* Logon page footer text
#copyrightfooter p,
#copyrightfooter a,
#authentication-copyrightfooter p,
#authentication-copyrightfooter a
{color:white;}

*/
/* turn off searchbox
#resources-searcharea {
display: none;
}
*/

GetServerData.aspx

<%@ Page Language=”C#” %>

<script runat=”server” language=”C#”>

private string GetClientIP()
{
string ips = Request.ServerVariables[“HTTP_X_FORWARDED_FOR”];

if (!string.IsNullOrEmpty(ips))
{
return ips.Split(‘,’)[0];
}

return Request.ServerVariables[“REMOTE_ADDR”];
}

private string GetServerName()
{
// for security purposes, only return the last 2 chars
string server = Environment.MachineName;
return server.Substring(server.Length-2);
}
</script>

<%
// what server data are we looking for?
string sData = Request[“serverData”]+””;

switch (sData)
{
case “clientIP”:
Response.Write(GetClientIP());
break;

case “serverName”:
Response.Write(GetServerName());
break;

case “clientIPandServerName”:
Response.Write(“Client IP: ” + GetClientIP() +
“&nbsp;&nbsp;&nbsp;&nbsp; Server: ” + GetServerName());
break;

default:
break;
}
%>

 

Hope this helps you 🙂

Advertisements

About CyberRuiz
Highly motivated with over 12 years experience on Citrix/VMWare/Microsoft/technologies. Exceptional communication skills and team player. CCIA – Citrix Certified Integration Architect. CCEA – Citrix Certified Enterprise Administrator. VCP – VMWare Certified Professional in ESX 2.x, VI3, VI4 MCSE – Microsoft Certified Systems Engineer

29 Responses to Customizing Citrix StoreFront 2.6 including Pre-Login message page

  1. Mark D. says:

    This is very helpful. That said, I’d love to see a similar write-up for customizing the Netscaler Gateway 10.5 login page. There is lots out there, but nothing that goes into such detail. Thanks for the post!

  2. John Knappers says:

    I used your previous blog about StoreFront 2.5.2 customization, as template for our customization. But when trying to migrate to 2.6.0 in ran into a problem.

    The Continue button does not work anymore.
    I created a test store, and started with you Customization as starting point.

    I do not understand this line:
    ‘;
    In 2.5.2.0 I used:
    ‘<a href="#" class=…
    But then the continue bottun doesn't work anymore
    ‘<a href=”https://link_to_your_site/&#8221 //(url replaced with our site gives server error)
    omitting the " after the url as in your example doesn't show the a "continue button at all.

    What do I Miss? Please advise.
    John

  3. John Knappers says:

    I see that the pasted line didn’t not make it well in the post. Trying to escape
    //” ‘;”

  4. John Knappers says:

    didn’t work.
    I mean the line with de “link_to_your_site”

    • CyberRuiz says:

      John,
      Below is what I used.

      “https://mylink.domain.net/Citrix/NameOfStore/”

      ‘<a href="#" class=…didnt work for me either so I hard coded the URL back to the home page.
      Let me know if this helps

      Send me an email @ danielruizorg@me.com and I will send you files if you need them. WordPress is messing up the code a bit.

      Daniel

  5. John Knappers says:

    Hi Daniel,
    Yes now it’s working! Thanx!
    Please Note I used “NameofStoreWeb” instead of “NameOfStore”

    We use the 2.5.2 “folder view” script add on combined with mandatory mode.
    I got the suggestion that that’s included in 2.6.0 and that the ” folder-view” option does not require mandatory mode.
    But I couldn’t find it in the documentation. Do you know where to find documentation about this feature? Or have some insights on this? The 2.5.2 Folder addon scripts also works in 2.6.0

    John

  6. John Knappers says:

    Thanx! I also noted that question regarding folder view is answered in
    http://blogs.citrix.com/2014/10/13/learn-how-storefront-2-6-administration-just-got-easier/

  7. Wendy says:

    Hi Daniel, thanks for the post, any idea how to make the text in the prelogin page black? I have a pale background and is hard to see

    • CyberRuiz says:

      Wendy,
      That is controlled by the .ctxsui-messagebox which is part of the default style css for storefront
      You can modify the color by modifying the custom.style.css under the contrib folder (C:\inetpub\wwwroot\Citrix\NameOfStoreWeb\contrib\

      Below is a sample

      /* Message box */
      .ctxsui-messagebox {
      height:142px;
      min-width:388px;
      max-height:300px;
      width:510px;
      display:table;
      color:black;
      }

      Hope this helps!

  8. Jeff Olive says:

    Our company compliance team requires that we display a pre-login message that the system is a private computer system. We support both XenApp published desktops and seamless apps. Is there any way to suppress the pre-login message for published apps, only when they are launched from within a published desktop (where the user has already accepted the pre-login disclaimer?

    • CyberRuiz says:

      Jeff,
      Thanks for visiting my blog.
      To answer your question, I would create the published Desktop with the Citrix Receiver Enterprise running with the legacy PNagent config in StoreFront.
      This means users will launch the desktops and once logged in, the XenApp appliactions would show inside the desktop session. This way the users no longer need to launch the storefront web interface to launch any published xenapp apps you have. Does that make sense? To make it even easier for users you can tell StoreFront to not display any published Apps.

      Does this help you? I can send you more details if needed.

      Daniel

  9. Wendy says:

    Hi Danial, Can I ask one other thing . Is it possible to change the transparent middle part of the logon screen in storefront to a solid colour?

    • CyberRuiz says:

      Wendy,
      Can you send me an email with a screenshot of what you need to change? Not exactly sure what you mean?

      Thank you
      Daniel

      • Michael Miller says:

        Also curious about this. There is a large horizontal background behind the login portion of storefront. It looks almost like a white rectangle from left edge to right edge with an opacity of 10% or something. Can we bump the opacity so it is less transparent that normal?

      • CyberRuiz says:

        Michael,
        Can you send me a screenshot to danielruizorg@me.com. Not entirely sure I understand what you are referring to.

        Thank you
        Daniel

  10. Pingback: Customizing Citrix NetScaler Gateway 10.5 logon page with Dual Factor Authentication | Daniel Ruiz - Blog

  11. TorneyBaba says:

    Hey,
    I tried the
    (document).ready(function() {
    CTXS.Application.preLoginHook = function () {
    var _dialogTitle = ”;
    var _dialogBody = ” +
    ”;
    var _dialogButton = ” +
    ‘;
    var dialog = _dialogTitle + _dialogBody + _dialogButton;
    var $messagePane = CTXS.displayMessagePane(dialog).ctxsLocalize();
    var $button = $messagePane.find(‘.button’);
    $button.click(function () {
    CTXS.Events.publish(CTXS.Events.preLogin.done);
    return false;
    }).ctxsHandleEscapeKeyInDialog().ctxsPlaceFocusOnFirstElement(
    ).ctxsBindFocusWithin();
    };
    });

    I’m not getting the the message just the continue button on prelogin page.

    • CyberRuiz says:

      There are several files that need changes for Prelogin to work.

      1. Update your custom.style.css under the contrib folder for your site.
      This controls the fonts etc of the message box which includes Pre-login


      /* Message box - Includes Prelogin screen*/
      .ctxsui-messagebox {
      height:142px;
      min-width:388px;
      max-height:300px;
      width:510px;
      display:table;
      color:white;
      }

      2. Update your custom.script.js
      This enables the preloginhook in StoreFront


      $(document).ready(function() {
      // Prelogin page
      CTXS.Application.preLoginHook = function () {
      var _dialogTitle = '

      ';
      var _dialogBody = '

      ' +
      '

      ';
      var _dialogButton = '

      ' +
      '

      ';
      var dialog = _dialogTitle + _dialogBody + _dialogButton;
      var $messagePane = CTXS.displayMessagePane(dialog).ctxsLocalize();
      var $button = $messagePane.find('.button');
      $button.click(function () {
      CTXS.Events.publish(CTXS.Events.preLogin.done);
      return false;
      }).ctxsHandleEscapeKeyInDialog().ctxsPlaceFocusOnFirstElement(
      ).ctxsBindFocusWithin();
      };
      });

      3. Update custom.wrstrings.en.js
      This controls the message you want to display in the prelogin screen


      (function ($) {
      $.localization.customStringBundle('en', {
      ActivateReceiver: 'Configure Receiver...',
      Disclaimer: 'Name of your company Authorized Use Only',
      DisclaimerStatement: 'You must be assigned an account to access this system.'
      + ' The information on this system and network is the property of this organization and is protected by intellectual property rights.'
      + ' By clicking the button below, you are consenting to the monitoring of your activities on the system',
      Continue: 'Continue'

      });
      })(jQuery);

    • CyberRuiz says:

      send me an email to danielruizorg@me.com and i will send you the code. WordPress is breaking the syntax.

      Thank you
      Daniel

  12. Derek Black says:

    Fantastic blog(s) and I’m a long time reader…..Thanks for helping me offline, so I thought I’d post my results in case anyone else finds them useful

    Had an issue with Pre-Login not working properly, the box would show, continue button worked, but no Text…..

    In case anyone else experiences this issue…. Here is what Daniel found:

    My custom.wrstrings.en.js file looked like this:

    (function ($) {
    $.localization.customStringBundle(‘en’, {
    Disclaimer: ‘EnvokeIT Legal Notice’,
    DisclaimerStatement: ‘These computer resources are provided for authorized users only.’
    + ‘ Your use of EnvokeIT computer resources constitutes your consent to EnvokeIT Policies and Directives.’
    + ‘ IF YOU ARE NOT AN AUTHORIZED USER, PLEASE EXIT IMMEDIATELY!’,
    Continue: ‘Continue’
    });
    })(jQuery);

    ****PAY ATTENTION TO THE SPACING****
    Using a tool such as Scite that is language/syntax aware makes it much easier.

    Daniel’s Modified/Working custom.wrstrings.en.js looks like:

    (function ($) {
    $.localization.customStringBundle(‘en’, {
    ActivateReceiver: ‘Configure Receiver…’,
    Disclaimer: ‘Name of your Company Authorized Use Only’,
    DisclaimerStatement: ‘You must be assigned an account to access this system.’
    + ‘ The information on this system and network is the property of this organization and is protected by intellectual property rights.’
    + ‘ By clicking the button below, you are consenting to the monitoring of your activities on the system’,
    Continue: ‘Continue’

    });
    })(jQuery);

    Again, BIG Thanks to Daniel for helping me w/ this offline and again keep up the good work w/ the awesome blogs!!!

    • Derek Black says:

      Word press strips the spaces and tabs, so here is a key to ensure you have the correct spacing. (Use Scite and save yourself a bunch of headache)

      * = space
      {tab} = tab

      (function ($) {
      ****$.localization.customStringBundle(‘en’, {
      {tab}{tab}ActivateReceiver: ‘Configure Receiver…’,
      {tab}{tab}Disclaimer: ‘Name of your Company Authorized Use Only’,
      {tab}{tab}DisclaimerStatement: ‘You must be assigned an account to access this system.’
      + ‘ The information on this system and network is the property of this organization and is protected by intellectual property rights.’
      + ‘ By clicking the button below, you are consenting to the monitoring of your activities on the system’,
      {tab}{tab}Continue: ‘Continue’

      });
      })(jQuery);

  13. Frank Aldridge says:

    Hi

    Is there some way to change the Continue Button to a button that redirects a user to a secure website where they can change their password if they have forgotten it, or have a URL on the Logon Page that redirects them to this page.

    Thanks

  14. Kev says:

    Am I missing something here, I have tried about every example here but still do not get the pre log on message. Does it appear instantly after refreshing web page or do I have to wait a while or is there a service I need to restart? Getting pretty frustrated as nothing seams to change.

    Thanks

  15. Pingback: Citrix NetScaler Gateway Client Choices branding | Daniel Ruiz - Blog

  16. vianneyjs says:

    Hi,

    I need to change the font size and bold the User Name and Password labels on StoreFront 3.0 logon page.

    Could you please assist me with that?

    Thank you

  17. diego says:

    Could you please post the details to customize a post-logon message in SF 2.6? I tried using several articles but none of them worked.

    See my post at http://discussions.citrix.com/topic/382963-issues-with-post-loging-message-in-sf-26/ where I describe the code I used without results.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: