Index: pykota/trunk/bin/edpykota
===================================================================
--- pykota/trunk/bin/edpykota (revision 1023)
+++ pykota/trunk/bin/edpykota (revision 1031)
@@ -23,4 +23,7 @@
 #
 # $Log$
+# Revision 1.46  2003/06/16 11:59:09  jalet
+# More work on LDAP
+#
 # Revision 1.45  2003/06/11 19:32:00  jalet
 # Severe bug wrt account balance setting should be corrected.
@@ -428,15 +431,15 @@
             else :   
                 if options["groups"] :    
-                    allidnames = self.storage.getPrinterGroups(printerid)
+                    allidnames = self.storage.getPrinterGroups(printerid) or []
                 else :    
-                    allidnames = self.storage.getPrinterUsers(printerid)
+                    allidnames = self.storage.getPrinterUsers(printerid) or []
             for (ident, name) in [(i, n) for (i, n) in allidnames if self.matchString(n, names)]:
                 if options["groups"] :
-                    if not gwaschanged.has_key(ident) :
-                        gwaschanged[ident] = {}
+                    if not gwaschanged.has_key(name) :
+                        gwaschanged[name] = {}
                     quota = self.storage.getGroupPQuota(ident, printerid)
                 else :
-                    if not uwaschanged.has_key(ident) :
-                        uwaschanged[ident] = {"ingroups": []}
+                    if not uwaschanged.has_key(name) :
+                        uwaschanged[name] = {"ingroups": []}
                     quota = self.storage.getUserPQuota(ident, printerid)
                 if quota is None :
@@ -474,7 +477,7 @@
                                 self.storage.resetGroupPQuota(ident, printerid)
                             if limitby :
-                                if gwaschanged[ident].get("limitby") is None :
+                                if gwaschanged[name].get("limitby") is None :
                                     self.storage.limitGroupBy(ident, limitby)
-                                    gwaschanged[ident]["limitby"] = limitby
+                                    gwaschanged[name]["limitby"] = limitby
                             self.warnGroupPQuota(name, printer)    
                         else :
@@ -484,20 +487,20 @@
                                 self.storage.resetUserPQuota(ident, printerid)
                             if limitby :
-                                if uwaschanged[ident].get("limitby") is None :
+                                if uwaschanged[name].get("limitby") is None :
                                     self.storage.limitUserBy(ident, limitby)
-                                    uwaschanged[ident]["limitby"] = limitby
+                                    uwaschanged[name]["limitby"] = limitby
                             if balance :
-                                if uwaschanged[ident].get("balance") is None :
+                                if uwaschanged[name].get("balance") is None :
                                     if balance.startswith("+") or balance.startswith("-") :
                                         self.storage.increaseUserBalance(ident, balancevalue)
                                     else :
                                         self.storage.setUserBalance(ident, balancevalue)
-                                    uwaschanged[ident]["balance"] = balance
+                                    uwaschanged[name]["balance"] = balance
                             for groupname in groupnames :        
-                                if groupname not in uwaschanged[ident]["ingroups"] :
+                                if groupname not in uwaschanged[name]["ingroups"] :
                                     groupid = self.storage.getGroupId(groupname)
                                     if groupid is not None :
                                         self.storage.addUserToGroup(ident, groupid)
-                                        uwaschanged[ident]["ingroups"].append(groupname)
+                                        uwaschanged[name]["ingroups"].append(groupname)
                                     else :
                                         self.logger.log_message(_("Group %s not found in the PyKota Storage.") % groupname)
