Changeset 2773 for pykota/trunk/pykota/storages/ldapstorage.py
- Timestamp:
- 03/02/06 12:37:52 (18 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
pykota/trunk/pykota/storages/ldapstorage.py
r2768 r2773 909 909 910 910 def addUser(self, user) : 911 """Adds a user to the quota storage, returns it.""" 911 """Adds a user to the quota storage, returns the old value if it already exists.""" 912 oldentry = self.getUser(user.Name) 913 if oldentry.Exists : 914 return oldentry # we return the existing entry 912 915 uname = self.userCharsetToDatabase(user.Name) 913 916 newfields = { … … 971 974 dn = "%s=%s,%s" % (self.info["balancerdn"], uname, self.info["balancebase"]) 972 975 self.doAdd(dn, fields) 973 974 return self.getUser(user.Name) 976 user.idbalance = dn 977 if user.PaymentsBacklog : 978 for (value, comment) in user.PaymentsBacklog : 979 self.writeNewPayment(user, value, comment) 980 user.PaymentsBacklog = [] 981 user.isDirty = False 982 return None # the entry created doesn't need further modification 975 983 976 984 def addGroup(self, group) : 977 """Adds a group to the quota storage, returns it.""" 985 """Adds a group to the quota storage, returns the old value if it already exists.""" 986 oldentry = self.getGroup(group.Name) 987 if oldentry.Exists : 988 return oldentry # we return the existing entry 978 989 gname = self.userCharsetToDatabase(group.Name) 979 990 newfields = { … … 1014 1025 dn = "%s=%s,%s" % (self.info["grouprdn"], gname, self.info["groupbase"]) 1015 1026 self.doAdd(dn, fields) 1016 return self.getGroup(group.Name) 1027 group.isDirty = False 1028 return None # the entry created doesn't need further modification 1017 1029 1018 1030 def addUserToGroup(self, user, group) :