Changeset 1027 for pykota/trunk/pykota/storages/ldapstorage.py
- Timestamp:
- 06/13/03 21:07:57 (21 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
pykota/trunk/pykota/storages/ldapstorage.py
r1021 r1027 21 21 # 22 22 # $Log$ 23 # Revision 1.6 2003/06/13 19:07:57 jalet 24 # Two big bugs fixed, time to release something ;-) 25 # 23 26 # Revision 1.5 2003/06/10 16:37:54 jalet 24 27 # Deletion of the second user which is not needed anymore. … … 134 137 135 138 def getJobHistoryId(self, jobid, userid, printerid) : 136 """Returns the history line's id given a (jobid, userid, printerid).""" 139 """Returns the history line's id given a (jobid, userid, printerid). 140 141 TODO : delete because shouldn't be needed by the LDAP backend 142 """ 137 143 raise PyKotaStorageError, "Not implemented !" 138 144 … … 344 350 def getPrinterPageCounter(self, printerid) : 345 351 """Returns the last page counter value for a printer given its id, also returns last username, last jobid and history line id.""" 346 return # TODO 347 result = self.doSearch("objectClass=pykotaPrinterJob", ["pykotaJobHistoryId", "pykotaJobId", "uid", "pykotaPrinterPageCounter", "pykotaJobSize", "pykotaAction", "pykotaJobDate"], base=printerid) 348 if result : 349 pass # TODO 352 result = self.doSearch("objectClass=pykotaPrinter", ["pykotaPrinterName", "cn"], base=printerid, scope=ldap.SCOPE_BASE) 353 if result : 354 fields = result[0][1] 355 printername = (fields.get("pykotaPrinterName") or fields.get("cn"))[0] 356 result = self.doSearch("(&(objectClass=pykotaLastjob)(|(pykotaPrinterName=%s)(cn=%s)))" % (printername, printername), ["pykotaLastJobIdent"]) 357 if result : 358 lastjobident = result[0][1]["pykotaLastJobIdent"][0] 359 result = self.doSearch("(&(objectClass=pykotaJob)(cn=%s))" % lastjobident, ["pykotaUserName", "pykotaPrinterName", "pykotaJobId", "pykotaPrinterPageCounter", "pykotaJobSize", "pykotaAction", "createTimestamp"]) 360 if result : 361 pass # TODO 350 362 351 363 def addUserToGroup(self, userid, groupid) :