Changeset 1031 for pykota/trunk/bin
- Timestamp:
- 06/16/03 13:59:09 (21 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
pykota/trunk/bin/edpykota
r1023 r1031 23 23 # 24 24 # $Log$ 25 # Revision 1.46 2003/06/16 11:59:09 jalet 26 # More work on LDAP 27 # 25 28 # Revision 1.45 2003/06/11 19:32:00 jalet 26 29 # Severe bug wrt account balance setting should be corrected. … … 428 431 else : 429 432 if options["groups"] : 430 allidnames = self.storage.getPrinterGroups(printerid) 433 allidnames = self.storage.getPrinterGroups(printerid) or [] 431 434 else : 432 allidnames = self.storage.getPrinterUsers(printerid) 435 allidnames = self.storage.getPrinterUsers(printerid) or [] 433 436 for (ident, name) in [(i, n) for (i, n) in allidnames if self.matchString(n, names)]: 434 437 if options["groups"] : 435 if not gwaschanged.has_key( ident) :436 gwaschanged[ ident] = {}438 if not gwaschanged.has_key(name) : 439 gwaschanged[name] = {} 437 440 quota = self.storage.getGroupPQuota(ident, printerid) 438 441 else : 439 if not uwaschanged.has_key( ident) :440 uwaschanged[ ident] = {"ingroups": []}442 if not uwaschanged.has_key(name) : 443 uwaschanged[name] = {"ingroups": []} 441 444 quota = self.storage.getUserPQuota(ident, printerid) 442 445 if quota is None : … … 474 477 self.storage.resetGroupPQuota(ident, printerid) 475 478 if limitby : 476 if gwaschanged[ ident].get("limitby") is None :479 if gwaschanged[name].get("limitby") is None : 477 480 self.storage.limitGroupBy(ident, limitby) 478 gwaschanged[ ident]["limitby"] = limitby481 gwaschanged[name]["limitby"] = limitby 479 482 self.warnGroupPQuota(name, printer) 480 483 else : … … 484 487 self.storage.resetUserPQuota(ident, printerid) 485 488 if limitby : 486 if uwaschanged[ ident].get("limitby") is None :489 if uwaschanged[name].get("limitby") is None : 487 490 self.storage.limitUserBy(ident, limitby) 488 uwaschanged[ ident]["limitby"] = limitby491 uwaschanged[name]["limitby"] = limitby 489 492 if balance : 490 if uwaschanged[ ident].get("balance") is None :493 if uwaschanged[name].get("balance") is None : 491 494 if balance.startswith("+") or balance.startswith("-") : 492 495 self.storage.increaseUserBalance(ident, balancevalue) 493 496 else : 494 497 self.storage.setUserBalance(ident, balancevalue) 495 uwaschanged[ ident]["balance"] = balance498 uwaschanged[name]["balance"] = balance 496 499 for groupname in groupnames : 497 if groupname not in uwaschanged[ ident]["ingroups"] :500 if groupname not in uwaschanged[name]["ingroups"] : 498 501 groupid = self.storage.getGroupId(groupname) 499 502 if groupid is not None : 500 503 self.storage.addUserToGroup(ident, groupid) 501 uwaschanged[ ident]["ingroups"].append(groupname)504 uwaschanged[name]["ingroups"].append(groupname) 502 505 else : 503 506 self.logger.log_message(_("Group %s not found in the PyKota Storage.") % groupname)