Jump to content
Welcome to our new Citrix community!

Netscaler 12.1 Add footer to logon page


Recommended Posts

Hi All,

 

Hope this is the right spot for this.  I'm trying to add a footer to the below of the /vpn/index.html page when hitting the Citrix site.

 

I'm using 12.1 latest firmware, custom portal theme based off of green bubble.

 

I've followed an article on how to add in a rewrite like below:

 

add rewrite action rw_act_insert_loginfooter insert_after_all "HTTP.RES.BODY(120000).SET_TEXT_MODE(IGNORECASE)" q{"var login_footer=$(\"<div style='color:yellow;font-size:15px;'>My Text</div>\").appendTo(logonbelt_bottomshadow);"} -pattern ".attr('id','logonbelt-bottomshadow');"

 

add rewrite policy rw_pol_insert_loginfooter "HTTP.REQ.URL.CONTAINS(\"gateway_login_form_view.js\")" rw_act_insert_loginfooter 

 

bind vpn vserver ThemeTest -policy rw_pol_insert_loginfooter -priority 100 -gotoPriorityExpression END -type RESPONSE

 

It's bound to the vserver, and when I refresh the page I see hits on the policy and they are counting, but nothing is showing on the screen.

 

I've cleared the browser cache, tried different browsers, rebooted the Netscaler and it never shows.....

 

 

 

I've tried tried changing the rewrite pattern to box_view.prepare_view(); since I see that in the index.html but that doesn't work either.

 

Correct me if I'm wrong, but when I go to the site and it generates a new hit on the policy and I inspect the webpage and lookup the index.html, should I at least see my var login_footer=$(\"<div style='color:yellow;font-size:15px;'>My Text</div>\").appendTo(logonbelt_bottomshadow); code in there ? (if using pattern box_view.prepare_view(); )

 

Just at a loss as I see the hits but not the code inserted anywhere...I would at least expect to see the code in there and maybe an error generated.

 

There's not really a lot out there on this, so any help would be appreciated.

 

Thanks,

Steve

 

 

Link to comment
Share on other sites

Thanks Sam, that is what I started following but I don't know where to inject the div.  The below snippet from that article says the below and I'd much rather follow this process, I just couldn't find where to add the <div>.

 

 I could inject a <div> called footer (following our "Keep It Small" rule, the added code would simply be <div id='footer' />), and then add <String id="footer">myCUGC.org - All Rights Reserved. to en.xml, and the following to custom.css:

#footer {
   position: absolute;
   bottom: 5px;
   height: 30px;
   font-size: 12px;
   color: white;
   font-weight: bold;
   text-align: center;
   width: 100%;
   background-color: black;
   padding-top: 5px;
}

 

 

Do you know where that should be placed ?

Link to comment
Share on other sites

Make a copy of gateway_login_view.js (e.g. footer_login_view.js).

Look for the following line:

this._parent.append(authentication);

Modify the line above to read:

this._parent.append(authentication,footer);

Add this line before it:

var footer = "<div id='footer' />";

(Note: this is plain JavaScript ... you could also use jQuery if you wish).
Save the file.

 

Then create the following rewrite action and policy:

add rewrite action act_login_view_replace replace_all "HTTP.RES.BODY(120000)" q{"/vpn/js/footer_login_view.js"} -search q{text("/vpn/js/gateway_login_view.js")}
add rewrite policy pol_login_view_replace "HTTP.REQ.URL.EQ(\"/vpn/index.html\")" act_login_view_replace

Finally, bind the policy to your gateway vServer:

bind vpn vserver "<gateway vServer name>" -policy pol_login_view_replace  -priority 250 -gotoPriorityExpression NEXT -type RESPONSE

You will need to change the priority if you already have one with that priority.

Also make sure that any rewrite policies with a lower number have their -gotoPriorityExpression set to NEXT and not END (or your policy may not get executed).

 

As the article says, make sure to copy the modified .js file to /var/vpn/vpn/js in order to survive a reboot.

  • Like 1
Link to comment
Share on other sites

  • 1 year later...

Not sure if it applies here, but I was trying to get a similar rewrite to work on our Citrix Gateway login page (13.0 with RfWebUI theme) but my changes would never show up in the client browser.  I failed over to the other HA node on a lark to see if that would cause the updates to kick in and that worked.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...