- Timestamp:
- 12/31/04 17:10:57 (20 years ago)
- Location:
- pykota/trunk
- Files:
-
- 3 modified
Legend:
- Unmodified
- Added
- Removed
-
pykota/trunk/NEWS
r1995 r1998 22 22 PyKota NEWS : 23 23 24 - 1.21alpha16 : 25 26 - fixed several recently introduced bugs in LDAP backend code, 27 thanks to Matt Hyclak. 28 24 29 - 1.21alpha15 : 25 30 -
pykota/trunk/pykota/storages/ldapstorage.py
r1995 r1998 22 22 # 23 23 # $Log$ 24 # Revision 1.93 2004/12/31 16:10:57 jalet 25 # Fixed recently introduced bugs due to extended userquotabase and groupquotabase 26 # directives. 27 # 24 28 # Revision 1.92 2004/12/26 14:50:51 jalet 25 29 # Normalized fields names in dumpykota's output so that an LDAP or PostgreSQL … … 702 706 if printer.Exists and user.Exists : 703 707 if self.info["userquotabase"].lower() == "user" : 704 result = self.doSearch("(&(objectClass=pykotaUserPQuota)(pykotaUserName=%s)(pykotaPrinterName=%s))" % (user.Name, printer.Name), ["pykotaPageCounter", "pykotaLifePageCounter", "pykotaSoftLimit", "pykotaHardLimit", "pykotaDateLimit"], base=user.ident)708 base = user.ident 705 709 else : 706 result = self.doSearch("(&(objectClass=pykotaUserPQuota)(pykotaUserName=%s)(pykotaPrinterName=%s))" % (user.Name, printer.Name), ["pykotaPageCounter", "pykotaLifePageCounter", "pykotaSoftLimit", "pykotaHardLimit", "pykotaDateLimit"], base=self.info["userquotabase"]) 710 base = self.info["userquotabase"] 711 result = self.doSearch("(&(objectClass=pykotaUserPQuota)(pykotaUserName=%s)(pykotaPrinterName=%s))" % (user.Name, printer.Name), ["pykotaPageCounter", "pykotaLifePageCounter", "pykotaSoftLimit", "pykotaHardLimit", "pykotaDateLimit"], base=base) 707 712 if result : 708 713 fields = result[0][1] … … 736 741 if group.Exists : 737 742 if self.info["groupquotabase"].lower() == "group" : 738 result = self.doSearch("(&(objectClass=pykotaGroupPQuota)(pykotaGroupName=%s)(pykotaPrinterName=%s))" % (group.Name, printer.Name), ["pykotaSoftLimit", "pykotaHardLimit", "pykotaDateLimit"], base=group.ident)743 base = group.ident 739 744 else : 740 result = self.doSearch("(&(objectClass=pykotaGroupPQuota)(pykotaGroupName=%s)(pykotaPrinterName=%s))" % (group.Name, printer.Name), ["pykotaSoftLimit", "pykotaHardLimit", "pykotaDateLimit"], base=self.info["groupquotabase"]) 745 base = self.info["groupquotabase"] 746 result = self.doSearch("(&(objectClass=pykotaGroupPQuota)(pykotaGroupName=%s)(pykotaPrinterName=%s))" % (group.Name, printer.Name), ["pykotaSoftLimit", "pykotaHardLimit", "pykotaDateLimit"], base=base) 741 747 if result : 742 748 fields = result[0][1] … … 765 771 if usernamesfilter : 766 772 usernamesfilter = "(|%s)" % usernamesfilter 767 result = self.doSearch("(&(objectClass=pykotaUserPQuota)(pykotaPrinterName=%s)%s)" % (printer.Name, usernamesfilter), ["pykotaPageCounter", "pykotaLifePageCounter"], base=self.info["userquotabase"]) 773 if self.info["userquotabase"].lower() == "user" : 774 base = self.info["userbase"] 775 else : 776 base = self.info["userquotabase"] 777 result = self.doSearch("(&(objectClass=pykotaUserPQuota)(pykotaPrinterName=%s)%s)" % (printer.Name, usernamesfilter), ["pykotaPageCounter", "pykotaLifePageCounter"], base=base) 768 778 if result : 769 779 for userpquota in result : … … 885 895 """Returns the list of users who uses a given printer, along with their quotas.""" 886 896 usersandquotas = [] 887 result = self.doSearch("(&(objectClass=pykotaUserPQuota)(pykotaPrinterName=%s)(|%s))" % (printer.Name, "".join(["(pykotaUserName=%s)" % uname for uname in names])), ["pykotaUserName", "pykotaPageCounter", "pykotaLifePageCounter", "pykotaSoftLimit", "pykotaHardLimit", "pykotaDateLimit"], base=self.info["userquotabase"]) 897 if self.info["userquotabase"].lower() == "user" : 898 base = self.info["userbase"] 899 else : 900 base = self.info["userquotabase"] 901 result = self.doSearch("(&(objectClass=pykotaUserPQuota)(pykotaPrinterName=%s)(|%s))" % (printer.Name, "".join(["(pykotaUserName=%s)" % uname for uname in names])), ["pykotaUserName", "pykotaPageCounter", "pykotaLifePageCounter", "pykotaSoftLimit", "pykotaHardLimit", "pykotaDateLimit"], base=base) 888 902 if result : 889 903 for (userquotaid, fields) in result : … … 920 934 """Returns the list of groups which uses a given printer, along with their quotas.""" 921 935 groupsandquotas = [] 922 result = self.doSearch("(&(objectClass=pykotaGroupPQuota)(pykotaPrinterName=%s)(|%s))" % (printer.Name, "".join(["(pykotaGroupName=%s)" % gname for gname in names])), ["pykotaGroupName"], base=self.info["groupquotabase"]) 936 if self.info["groupquotabase"].lower() == "group" : 937 base = self.info["groupbase"] 938 else : 939 base = self.info["groupquotabase"] 940 result = self.doSearch("(&(objectClass=pykotaGroupPQuota)(pykotaPrinterName=%s)(|%s))" % (printer.Name, "".join(["(pykotaGroupName=%s)" % gname for gname in names])), ["pykotaGroupName"], base=base) 923 941 if result : 924 942 for (groupquotaid, fields) in result : … … 1328 1346 for (ident, fields) in result : 1329 1347 todelete.append(ident) 1330 1331 result = self.doSearch("(&(objectClass=pykotaUserPQuota)(pykotaUserName=%s))" % user.Name, ["pykotaPrinterName", "pykotaUserName"], base=self.info["userquotabase"]) 1348 if self.info["userquotabase"].lower() == "user" : 1349 base = self.info["userbase"] 1350 else : 1351 base = self.info["userquotabase"] 1352 result = self.doSearch("(&(objectClass=pykotaUserPQuota)(pykotaUserName=%s))" % user.Name, ["pykotaPrinterName", "pykotaUserName"], base=base) 1332 1353 for (ident, fields) in result : 1333 1354 # ensure the user print quota entry will be deleted … … 1369 1390 def deleteGroup(self, group) : 1370 1391 """Completely deletes a group from the Quota Storage.""" 1371 result = self.doSearch("(&(objectClass=pykotaGroupPQuota)(pykotaGroupName=%s))" % group.Name, ["pykotaGroupName"], base=self.info["groupquotabase"]) 1392 if self.info["groupquotabase"].lower() == "group" : 1393 base = self.info["groupbase"] 1394 else : 1395 base = self.info["groupquotabase"] 1396 result = self.doSearch("(&(objectClass=pykotaGroupPQuota)(pykotaGroupName=%s))" % group.Name, ["pykotaGroupName"], base=base) 1372 1397 for (ident, fields) in result : 1373 1398 self.doDelete(ident) … … 1400 1425 for (ident, fields) in result : 1401 1426 self.doDelete(ident) 1402 result = self.doSearch("(&(objectClass=pykotaGroupPQuota)(pykotaPrinterName=%s))" % printer.Name, base=self.info["groupquotabase"]) 1427 if self.info["groupquotabase"].lower() == "group" : 1428 base = self.info["groupbase"] 1429 else : 1430 base = self.info["groupquotabase"] 1431 result = self.doSearch("(&(objectClass=pykotaGroupPQuota)(pykotaPrinterName=%s))" % printer.Name, base=base) 1403 1432 for (ident, fields) in result : 1404 1433 self.doDelete(ident) 1405 result = self.doSearch("(&(objectClass=pykotaUserPQuota)(pykotaPrinterName=%s))" % printer.Name, base=self.info["userquotabase"]) 1434 if self.info["userquotabase"].lower() == "user" : 1435 base = self.info["userbase"] 1436 else : 1437 base = self.info["userquotabase"] 1438 result = self.doSearch("(&(objectClass=pykotaUserPQuota)(pykotaPrinterName=%s))" % printer.Name, base=base) 1406 1439 for (ident, fields) in result : 1407 1440 self.doDelete(ident) -
pykota/trunk/pykota/version.py
r1993 r1998 22 22 # 23 23 24 __version__ = "1.21alpha1 5_unofficial"24 __version__ = "1.21alpha16_unofficial" 25 25 26 26 __doc__ = """PyKota : a complete Printing Quota Solution for CUPS and LPRng."""