Think IPM

Tuesday, May 22, 2012

The Magic of CSS–Customizing Citrix Web Interface

Another great Tutorial post from Sam Jacobs!  Class is in session…

A poster in the Web Interface forum (http://forums.citrix.com/thread.jspa?messageID=1627343#1627343) asked how to make the following modifications to the Web Interface logon page:

  • Change the page background color,
  • Expand the logon window and change its background color,
  • Enlarge and center the Logon Button,
  • Remove the page footer and extra whitespace at the bottom of the page, and
  • Adding scrolling horizontal text (a “marquee”) above the logon box.

As always, we start with a default WI site:
clip_image002

Unless otherwise specified, all of the files we will be modifying are in the following directory:
..\XenApp\app_data\include

The first modification is to change the page background color.
Open fullStyle.inc with your favorite text editor, and make the following changes (click on each image to enlarge):
clip_image004

Our logon screen now looks as follows:
clip_image006

Let’s move on to the next two modifications – expanding the logon window, changing its background color, and enlarging and centering the logon button. We’ll need to modify two CSS files.

Open loginStyle.inc, and make the following changes:
clip_image008

clip_image010

Re-open fullStyle.inc, and make the following changes:
clip_image012 clip_image014 clip_image016

Our page now looks as follows:
clip_image018

Now, let’s remove the page footer and extra whitespace at the bottom of the page. While we’re at it, let’s change the Citrix logo to our own. We’ll need to first make some more modifications to fullStyle.inc:
clip_image020

clip_image022

Then, to change the logo, you’ll need to copy your logo to the /media directory, and we’ll need to make a modification to layout.ascx:
clip_image024

This brings our screen to:
clip_image026

If you are changing the background color, make sure that you use a transparent .gif (or .png) … otherwise, you will end up with something that looks like this:
clip_image027

Our final modification is to add a scrolling text area (marquee) above the logon box with, for example, system status information. First, add a new CSS tag to loginStyle.inc:

clip_image029

We will also need a change to layout.ascx to add the marquee:
clip_image031

Our final result:
clip_image033

Thanks Sam!

DISCLAIMER: Make sure that you make backup copies of any modified source files. Do NOT perform these modifications on a production site currently in use. These modifications are for Web Interface version 5.4 only.

Click Here to Continue Reading >>

Wednesday, May 16, 2012

How to Retrieve the Username from a PNAgent Site

New from Sam Jacobs!

Today, a user on the Citrix Web Interface forum asked how one goes about retrieving a user’s name. As this is something a Web Interface developer does on a daily basis, I was able to respond quite quickly with the answer. His next question was whether the username could be retrieved from a PNAgent site, as he wanted to perform some actions based on the logged in user.

That was another matter altogether, as the Authentication object which exists for a Web Interface site, does not exist for a PNAgent site. At the time I suggested that he use a cookie from the Netscaler logon screen to store the username (which I now realize would not have helped, since there isn’t any Netscaler logon screen for PNAgent). However, he was pretty insistent that there must be a way, and after giving it some more thought, I agreed with him.

So, after a few more hours of digging, I am happy to report that he was right, and it turns out to be quite simple to implement.

As with any development work, there is always more than one way to skin the proverbial cat, and the way I’ve done it is detailed below.

Make sure that you back up the original code before you begin. However, remember that all java modules in a directory will be compiled, so .java files need to either be backed up in a different directory, or be given a different extension.

Back up the file Enumeration.java in the directory \Inetpub\wwwroot\Citrix\PNAgent\app_code\PagesJava\com\citrix\wi\pna.

At line #111 you should see:

AccessToken accessToken = enumRequest.getAccessToken();
SIDBasedToken sidToken = null;
if (accessToken instanceof SIDBasedToken) {
   sidToken = (SIDBasedToken)accessToken;
}

Add the bolded lines (Lines 2, 3 & 4) where indicated:

AccessToken accessToken = enumRequest.getAccessToken();
// save the userID in a session variable so we can use it anywhere
getWebAbstraction().setSessionAttribute("PNAUser",
   accessToken.getShortUserName());

SIDBasedToken sidToken = null;
if (accessToken instanceof SIDBasedToken) {
   sidToken = (SIDBasedToken)accessToken;
}

This creates a session variable that can be used in any module of the site. For example, if you wished to perform some action for the user after applications have been enumerated, you can add the bolded line (Line 3) to the end of enum.aspx:

<%
(new com.citrix.wi.pna.Enumeration(pnaContext, null)).perform();
string userID = Session["PNAUser"] + "";
// perform other actions based on userID ...
%>

Thanks Sam!

Click Here to Continue Reading >>

Sunday, May 13, 2012

Dropbox 2012 Quest! Get an additional 1GB of space.

image

I like Dropbox.  It’s super easy to use, supports all the client devices I need and I’ve found a ton of enhancements that really make it work the way I want it to within my workflow.  For whatever reason, I haven’t ponied up the cash to get more space though.  Instead, I have been taking advantage of almost every possible way that Dropbox allows users to get more free space.  To the tune of 20GBs so far.  Yesterday, they released another one.  The Dropbox Quest challenge.  They did this last year and are back again.  This time offering up another Gigabyte of free space to users who complete the challenge.  The initial challenge was completed in about 5 hours and since then, all the answers are all over the place making this a pretty easy way to up your account limit without much hassle.

To join the challenge (before they close it down), head to http://blog.dropbox.com/?p=1194.

If you are not up for the Challenge and just want the space, you can find the answer key here: http://www.tumblr.com/tagged/dropboxquest2012 Have Fun!

image

Click Here to Continue Reading >>