Changeset 1023
- Timestamp:
- 06/11/03 21:32:00 (21 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
pykota/trunk/bin/edpykota
r975 r1023 23 23 # 24 24 # $Log$ 25 # Revision 1.45 2003/06/11 19:32:00 jalet 26 # Severe bug wrt account balance setting should be corrected. 27 # 25 28 # Revision 1.44 2003/04/29 22:03:38 jalet 26 29 # Better error handling. … … 388 391 groupnames = [] 389 392 393 uwaschanged = {} # tracks changed made at the user level 394 gwaschanged = {} # tracks changed made at the group level 390 395 for (printerid, printer) in printers : 391 396 if options["charge"] : … … 428 433 for (ident, name) in [(i, n) for (i, n) in allidnames if self.matchString(n, names)]: 429 434 if options["groups"] : 435 if not gwaschanged.has_key(ident) : 436 gwaschanged[ident] = {} 430 437 quota = self.storage.getGroupPQuota(ident, printerid) 431 438 else : 439 if not uwaschanged.has_key(ident) : 440 uwaschanged[ident] = {"ingroups": []} 432 441 quota = self.storage.getUserPQuota(ident, printerid) 433 442 if quota is None : … … 465 474 self.storage.resetGroupPQuota(ident, printerid) 466 475 if limitby : 467 self.storage.limitGroupBy(ident, limitby) 476 if gwaschanged[ident].get("limitby") is None : 477 self.storage.limitGroupBy(ident, limitby) 478 gwaschanged[ident]["limitby"] = limitby 468 479 self.warnGroupPQuota(name, printer) 469 480 else : … … 473 484 self.storage.resetUserPQuota(ident, printerid) 474 485 if limitby : 475 self.storage.limitUserBy(ident, limitby) 486 if uwaschanged[ident].get("limitby") is None : 487 self.storage.limitUserBy(ident, limitby) 488 uwaschanged[ident]["limitby"] = limitby 476 489 if balance : 477 if balance.startswith("+") or balance.startswith("-") : 478 self.storage.increaseUserBalance(ident, balancevalue) 479 else : 480 self.storage.setUserBalance(ident, balancevalue) 490 if uwaschanged[ident].get("balance") is None : 491 if balance.startswith("+") or balance.startswith("-") : 492 self.storage.increaseUserBalance(ident, balancevalue) 493 else : 494 self.storage.setUserBalance(ident, balancevalue) 495 uwaschanged[ident]["balance"] = balance 481 496 for groupname in groupnames : 482 groupid = self.storage.getGroupId(groupname) 483 if groupid is not None : 484 self.storage.addUserToGroup(ident, groupid) 485 else : 486 self.logger.log_message(_("Group %s not found in the PyKota Storage.") % groupname) 497 if groupname not in uwaschanged[ident]["ingroups"] : 498 groupid = self.storage.getGroupId(groupname) 499 if groupid is not None : 500 self.storage.addUserToGroup(ident, groupid) 501 uwaschanged[ident]["ingroups"].append(groupname) 502 else : 503 self.logger.log_message(_("Group %s not found in the PyKota Storage.") % groupname) 487 504 self.warnUserPQuota(name, printer) 488 505