From b72ed2ade6e4c515af212b9dd996a5d6af81da86 Mon Sep 17 00:00:00 2001
From: Mark Huang <mlhuang@cs.princeton.edu>
Date: Mon, 13 Nov 2006 18:43:37 +0000
Subject: [PATCH] - allow login_base to be updated

---
 PLC/Methods/UpdateSite.py | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/PLC/Methods/UpdateSite.py b/PLC/Methods/UpdateSite.py
index 776b0844..276d47f6 100644
--- a/PLC/Methods/UpdateSite.py
+++ b/PLC/Methods/UpdateSite.py
@@ -5,7 +5,7 @@ from PLC.Sites import Site, Sites
 from PLC.Auth import Auth
 
 can_update = lambda (field, value): field in \
-             ['name', 'abbreviated_name',
+             ['name', 'abbreviated_name', 'login_base',
               'is_public', 'latitude', 'longitude', 'url',
               'max_slices', 'max_slivers']
 
@@ -15,7 +15,7 @@ class UpdateSite(Method):
     updated, all other fields are left untouched.
 
     PIs can only update sites they are a member of. Only admins can 
-    update max_slices.
+    update max_slices, max_slivers, and login_base.
 
     Returns 1 if successful, faults otherwise.
     """
@@ -52,8 +52,9 @@ class UpdateSite(Method):
             if site['site_id'] not in self.caller['site_ids']:
                 raise PLCPermissionDenied, "Not allowed to modify specified site"
 
-            if 'max_slices' or 'max_slivers' in site_fields:
-                raise PLCInvalidArgument, "Only admins can update max_slices and max_slivers"
+            # Remove admin only fields
+            for key in 'max_slices', 'max_slivers', 'login_base':
+                del site_fields[key]
 
         site.update(site_fields)
 	site.sync()
-- 
2.47.0