Changeset 1969 for pykota/trunk/pykota/storages/ldapstorage.py
- Timestamp:
- 12/02/04 23:27:11 (19 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
pykota/trunk/pykota/storages/ldapstorage.py
r1968 r1969 22 22 # 23 23 # $Log$ 24 # Revision 1.89 2004/12/02 22:27:11 jalet 25 # Integrated and extended Stefan Wold's patch to store print quota entries 26 # directly below the user or the group object with the LDAP backend 27 # 24 28 # Revision 1.88 2004/12/02 22:01:58 jalet 25 29 # TLS is now supported with the LDAP backend … … 675 679 userpquota = StorageUserPQuota(self, user, printer) 676 680 if printer.Exists and user.Exists : 677 result = self.doSearch("(&(objectClass=pykotaUserPQuota)(pykotaUserName=%s)(pykotaPrinterName=%s))" % (user.Name, printer.Name), ["pykotaPageCounter", "pykotaLifePageCounter", "pykotaSoftLimit", "pykotaHardLimit", "pykotaDateLimit"], base=self.info["userquotabase"]) 681 if self.info["userquotabase"].lower() == "user" : 682 result = self.doSearch("(&(objectClass=pykotaUserPQuota)(pykotaUserName=%s)(pykotaPrinterName=%s))" % (user.Name, printer.Name), ["pykotaPageCounter", "pykotaLifePageCounter", "pykotaSoftLimit", "pykotaHardLimit", "pykotaDateLimit"], base=user.ident) 683 else : 684 result = self.doSearch("(&(objectClass=pykotaUserPQuota)(pykotaUserName=%s)(pykotaPrinterName=%s))" % (user.Name, printer.Name), ["pykotaPageCounter", "pykotaLifePageCounter", "pykotaSoftLimit", "pykotaHardLimit", "pykotaDateLimit"], base=self.info["userquotabase"]) 678 685 if result : 679 686 fields = result[0][1] … … 706 713 grouppquota = StorageGroupPQuota(self, group, printer) 707 714 if group.Exists : 708 result = self.doSearch("(&(objectClass=pykotaGroupPQuota)(pykotaGroupName=%s)(pykotaPrinterName=%s))" % (group.Name, printer.Name), ["pykotaSoftLimit", "pykotaHardLimit", "pykotaDateLimit"], base=self.info["groupquotabase"]) 715 if self.info["groupquotabase"].lower() == "group" : 716 result = self.doSearch("(&(objectClass=pykotaGroupPQuota)(pykotaGroupName=%s)(pykotaPrinterName=%s))" % (group.Name, printer.Name), ["pykotaSoftLimit", "pykotaHardLimit", "pykotaDateLimit"], base=group.ident) 717 else : 718 result = self.doSearch("(&(objectClass=pykotaGroupPQuota)(pykotaGroupName=%s)(pykotaPrinterName=%s))" % (group.Name, printer.Name), ["pykotaSoftLimit", "pykotaHardLimit", "pykotaDateLimit"], base=self.info["groupquotabase"]) 709 719 if result : 710 720 fields = result[0][1] … … 1028 1038 "pykotaLifePageCounter" : "0", 1029 1039 } 1030 dn = "cn=%s,%s" % (uuid, self.info["userquotabase"]) 1040 if self.info["userquotabase"].lower() == "user" : 1041 dn = "cn=%s,%s" % (uuid, user.ident) 1042 else : 1043 dn = "cn=%s,%s" % (uuid, self.info["userquotabase"]) 1031 1044 self.doAdd(dn, fields) 1032 1045 return self.getUserPQuota(user, printer) … … 1041 1054 "pykotaDateLimit" : "None", 1042 1055 } 1043 dn = "cn=%s,%s" % (uuid, self.info["groupquotabase"]) 1056 if self.info["groupquotabase"].lower() == "group" : 1057 dn = "cn=%s,%s" % (uuid, group.ident) 1058 else : 1059 dn = "cn=%s,%s" % (uuid, self.info["groupquotabase"]) 1044 1060 self.doAdd(dn, fields) 1045 1061 return self.getGroupPQuota(group, printer)