Show
Ignore:
Timestamp:
06/16/03 13:59:09 (21 years ago)
Author:
jalet
Message:

More work on LDAP

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • pykota/trunk/bin/edpykota

    r1023 r1031  
    2323# 
    2424# $Log$ 
     25# Revision 1.46  2003/06/16 11:59:09  jalet 
     26# More work on LDAP 
     27# 
    2528# Revision 1.45  2003/06/11 19:32:00  jalet 
    2629# Severe bug wrt account balance setting should be corrected. 
     
    428431            else :    
    429432                if options["groups"] :     
    430                     allidnames = self.storage.getPrinterGroups(printerid) 
     433                    allidnames = self.storage.getPrinterGroups(printerid) or [] 
    431434                else :     
    432                     allidnames = self.storage.getPrinterUsers(printerid) 
     435                    allidnames = self.storage.getPrinterUsers(printerid) or [] 
    433436            for (ident, name) in [(i, n) for (i, n) in allidnames if self.matchString(n, names)]: 
    434437                if options["groups"] : 
    435                     if not gwaschanged.has_key(ident) : 
    436                         gwaschanged[ident] = {} 
     438                    if not gwaschanged.has_key(name) : 
     439                        gwaschanged[name] = {} 
    437440                    quota = self.storage.getGroupPQuota(ident, printerid) 
    438441                else : 
    439                     if not uwaschanged.has_key(ident) : 
    440                         uwaschanged[ident] = {"ingroups": []} 
     442                    if not uwaschanged.has_key(name) : 
     443                        uwaschanged[name] = {"ingroups": []} 
    441444                    quota = self.storage.getUserPQuota(ident, printerid) 
    442445                if quota is None : 
     
    474477                                self.storage.resetGroupPQuota(ident, printerid) 
    475478                            if limitby : 
    476                                 if gwaschanged[ident].get("limitby") is None : 
     479                                if gwaschanged[name].get("limitby") is None : 
    477480                                    self.storage.limitGroupBy(ident, limitby) 
    478                                     gwaschanged[ident]["limitby"] = limitby 
     481                                    gwaschanged[name]["limitby"] = limitby 
    479482                            self.warnGroupPQuota(name, printer)     
    480483                        else : 
     
    484487                                self.storage.resetUserPQuota(ident, printerid) 
    485488                            if limitby : 
    486                                 if uwaschanged[ident].get("limitby") is None : 
     489                                if uwaschanged[name].get("limitby") is None : 
    487490                                    self.storage.limitUserBy(ident, limitby) 
    488                                     uwaschanged[ident]["limitby"] = limitby 
     491                                    uwaschanged[name]["limitby"] = limitby 
    489492                            if balance : 
    490                                 if uwaschanged[ident].get("balance") is None : 
     493                                if uwaschanged[name].get("balance") is None : 
    491494                                    if balance.startswith("+") or balance.startswith("-") : 
    492495                                        self.storage.increaseUserBalance(ident, balancevalue) 
    493496                                    else : 
    494497                                        self.storage.setUserBalance(ident, balancevalue) 
    495                                     uwaschanged[ident]["balance"] = balance 
     498                                    uwaschanged[name]["balance"] = balance 
    496499                            for groupname in groupnames :         
    497                                 if groupname not in uwaschanged[ident]["ingroups"] : 
     500                                if groupname not in uwaschanged[name]["ingroups"] : 
    498501                                    groupid = self.storage.getGroupId(groupname) 
    499502                                    if groupid is not None : 
    500503                                        self.storage.addUserToGroup(ident, groupid) 
    501                                         uwaschanged[ident]["ingroups"].append(groupname) 
     504                                        uwaschanged[name]["ingroups"].append(groupname) 
    502505                                    else : 
    503506                                        self.logger.log_message(_("Group %s not found in the PyKota Storage.") % groupname)