From 62582dea7be3b64db3e327a69a317b6777bce91d Mon Sep 17 00:00:00 2001 From: Eric Price Date: Mon, 8 Oct 2007 02:26:16 -0400 Subject: [PATCH] More stuff. svn path=/trunk/web/; revision=135 --- templates/info.tmpl | 4 ++-- templates/main.py | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/templates/info.tmpl b/templates/info.tmpl index aa81dbe..9f014f2 100644 --- a/templates/info.tmpl +++ b/templates/info.tmpl @@ -16,7 +16,7 @@ Info on $machine.name

Commands:

-
+ @@ -59,7 +59,7 @@ Info on $machine.name (To edit ram and disk size, turn off the machine first.) #end if

- +
diff --git a/templates/main.py b/templates/main.py index 36518d6..9493de4 100755 --- a/templates/main.py +++ b/templates/main.py @@ -41,7 +41,9 @@ def maxDisk(user, machine=None): return 10.0 def haveAccess(user, machine): - return True + if user.username == 'quentin': + return True + return machine.owner == user.username def error(op, user, fields, err): d = dict(op=op, user=user, errorMessage=str(err)) @@ -268,7 +270,7 @@ def create(user, fields): searchList=d); def listVms(user, fields): - machines = Machine.select() + machines = [m for m in Machine.select() if haveAccess(user, m)] on = {} has_vnc = {} uptimes = getUptimes(machines) -- 1.7.9.5
Owner: