From 4ce9e31db6102ba0d2597e2e62d23c484450d85d Mon Sep 17 00:00:00 2001
From: Peter Iannucci <iannucci@mit.edu>
Date: Fri, 20 Feb 2009 22:09:34 -0500
Subject: [PATCH] Fixed the log in link for xvm-dev by using
 environ['HOSTNAME']

svn path=/trunk/packages/invirt-web/; revision=2182
---
 code/main.py               |    4 +++-
 code/templates/unauth.tmpl |    2 +-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/code/main.py b/code/main.py
index dd60e96..b6f7b7f 100755
--- a/code/main.py
+++ b/code/main.py
@@ -12,6 +12,7 @@ import simplejson
 import sys
 import time
 import urllib
+import os
 from StringIO import StringIO
 
 def revertStandardError():
@@ -606,7 +607,8 @@ def info(username, state, path, fields):
 
 def unauthFront(_, _2, _3, fields):
     """Information for unauth'd users."""
-    return templates.unauth(searchList=[{'simple' : True}])
+    return templates.unauth(searchList=[{'simple' : True, 
+            'hostname' : os.environ['HOSTNAME'] if 'HOSTNAME' in os.environ else 'xvm.mit.edu'}])
 
 def admin(username, state, path, fields):
     if path == '':
diff --git a/code/templates/unauth.tmpl b/code/templates/unauth.tmpl
index e8b21ea..0715f2c 100644
--- a/code/templates/unauth.tmpl
+++ b/code/templates/unauth.tmpl
@@ -18,7 +18,7 @@ to any Athena account holder.</p>
 
 <p>MIT users:</p>
 <blockquote><big><a
-href="https://xvm.mit.edu/"><strong><font color="green">&rarr;</font> Log in to XVM now</strong>
+href="https://$hostname/"><strong><font color="green">&rarr;</font> Log in to XVM now</strong>
 </a></big></blockquote>
 <p>You'll need an <a href="http://ca.mit.edu/">MIT personal
 certificate</a>.</p>
-- 
1.7.9.5