475 | | if not printers.has_key(pname) : |
476 | | printer = StoragePrinter(self, pname) |
477 | | printer.ident = record.get("pid") |
478 | | printer.PricePerJob = record.get("priceperjob") or 0.0 |
479 | | printer.PricePerPage = record.get("priceperpage") or 0.0 |
480 | | printer.Description = self.databaseToUserCharset(record.get("pdesc") or "") |
481 | | printer.MaxJobSize = record.get("pmaxjobsize") or 0 |
482 | | printer.PassThrough = record.get("passthrough") or 0 |
483 | | if printer.PassThrough in (1, "1", "t", "true", "TRUE", "True") : |
484 | | printer.PassThrough = 1 |
485 | | else : |
486 | | printer.PassThrough = 0 |
487 | | printer.Exists = 1 |
488 | | printers[pname] = printer |
489 | | self.cacheEntry("PRINTERS", pname, printer) |
| 475 | printer = StoragePrinter(self, pname) |
| 476 | printer.ident = record.get("pid") |
| 477 | printer.PricePerJob = record.get("priceperjob") or 0.0 |
| 478 | printer.PricePerPage = record.get("priceperpage") or 0.0 |
| 479 | printer.Description = self.databaseToUserCharset(record.get("pdesc") or "") |
| 480 | printer.MaxJobSize = record.get("pmaxjobsize") or 0 |
| 481 | printer.PassThrough = record.get("passthrough") or 0 |
| 482 | if printer.PassThrough in (1, "1", "t", "true", "TRUE", "True") : |
| 483 | printer.PassThrough = 1 |
| 484 | else : |
| 485 | printer.PassThrough = 0 |
| 486 | printer.Exists = 1 |
| 487 | printers[pname] = printer |
| 488 | self.cacheEntry("PRINTERS", pname, printer) |
491 | | if not users.has_key(uname) : |
492 | | user = StorageUser(self, uname) |
493 | | user.ident = record.get("uid") |
494 | | user.LimitBy = record.get("limitby") or "quota" |
495 | | user.AccountBalance = record.get("balance") |
496 | | user.LifeTimePaid = record.get("lifetimepaid") |
497 | | user.Email = record.get("email") |
498 | | user.OverCharge = record.get("overcharge") |
499 | | user.Description = self.databaseToUserCharset(record.get("udesc")) |
500 | | user.Exists = 1 |
501 | | users[uname] = user |
502 | | self.cacheEntry("USERS", uname, user) |
| 490 | user = StorageUser(self, uname) |
| 491 | user.ident = record.get("uid") |
| 492 | user.LimitBy = record.get("limitby") or "quota" |
| 493 | user.AccountBalance = record.get("balance") |
| 494 | user.LifeTimePaid = record.get("lifetimepaid") |
| 495 | user.Email = record.get("email") |
| 496 | user.OverCharge = record.get("overcharge") |
| 497 | user.Description = self.databaseToUserCharset(record.get("udesc")) |
| 498 | user.Exists = 1 |
| 499 | users[uname] = user |
| 500 | self.cacheEntry("USERS", uname, user) |
505 | | if not upquotas.has_key(upqkey) : # NB : should always be verified. |
506 | | userpquota = StorageUserPQuota(self, users[uname], printers[pname]) |
507 | | userpquota.ident = record.get("id") |
508 | | userpquota.PageCounter = record.get("pagecounter") |
509 | | userpquota.LifePageCounter = record.get("lifepagecounter") |
510 | | userpquota.SoftLimit = record.get("softlimit") |
511 | | userpquota.HardLimit = record.get("hardlimit") |
512 | | userpquota.DateLimit = record.get("datelimit") |
513 | | userpquota.WarnCount = record.get("warncount") |
514 | | userpquota.Exists = 1 |
515 | | upquotas[upqkey] = userpquota |
516 | | self.cacheEntry("USERPQUOTAS", upqkey, userpquota) |
| 503 | userpquota = StorageUserPQuota(self, user, printer) |
| 504 | userpquota.ident = record.get("id") |
| 505 | userpquota.PageCounter = record.get("pagecounter") |
| 506 | userpquota.LifePageCounter = record.get("lifepagecounter") |
| 507 | userpquota.SoftLimit = record.get("softlimit") |
| 508 | userpquota.HardLimit = record.get("hardlimit") |
| 509 | userpquota.DateLimit = record.get("datelimit") |
| 510 | userpquota.WarnCount = record.get("warncount") |
| 511 | userpquota.Exists = 1 |
| 512 | upquotas[upqkey] = userpquota |
| 513 | self.cacheEntry("USERPQUOTAS", upqkey, userpquota) |