"""
machine = validation.Validate(username, state, machine_id=fields.getfirst('machine_id')).machine
- token = controls.remctl('control', machine.name, 'vnctoken').strip()
+ token = controls.vnctoken(machine)
host = controls.listHost(machine)
if host:
port = 10003 + [h.hostname for h in config.hosts].index(host)
session.save_or_update(machine)
if update_acl:
- print >> sys.stderr, machine, machine.administrator
cache_acls.refreshMachine(machine)
session.commit()
except:
help_mapping = {'ParaVM Console': """
ParaVM machines do not support local console access over VNC. To
access the serial console of these machines, you can SSH with Kerberos
-to console.%s, using the name of the machine as your
-username.""" % config.dns.domains[0],
+to %s, using the name of the machine as your
+username.""" % config.console.hostname,
'HVM/ParaVM': """
HVM machines use the virtualization features of the processor, while
ParaVM machines use Xen's emulation of virtualization features. You
def getUser(environ):
"""Return the current user based on the SSL environment variables"""
- return environ.get('REMOTE_USER', None)
+ user = environ.get('REMOTE_USER')
+ if user is None:
+ return
+
+ if environ.get('AUTH_TYPE') == 'Negotiate':
+ # Convert the krb5 principal into a krb4 username
+ if not user.endswith('@%s' % config.authn[0].realm):
+ return
+ else:
+ return user.split('@')[0].replace('/', '.')
+ else:
+ return user
def handler(username, state, path, fields):
operation, path = pathSplit(path)