Index: /pykota/trunk/pykota/storages/pgstorage.py
===================================================================
--- /pykota/trunk/pykota/storages/pgstorage.py (revision 1156)
+++ /pykota/trunk/pykota/storages/pgstorage.py (revision 1179)
@@ -22,4 +22,7 @@
 #
 # $Log$
+# Revision 1.21  2003/11/12 13:06:38  jalet
+# Bug fix wrt no user/group name command line argument to edpykota
+#
 # Revision 1.20  2003/10/09 21:25:26  jalet
 # Multiple printer names or wildcards can be passed on the command line
@@ -178,4 +181,20 @@
             typ = "text"
         return pg._quote(field, typ)
+        
+    def getAllUsersNames(self) :    
+        """Extracts all user names."""
+        usernames = []
+        result = self.doSearch("SELECT username FROM users;")
+        if result :
+            usernames = [record["username"] for record in result]
+        return usernames
+        
+    def getAllGroupsNames(self) :    
+        """Extracts all group names."""
+        groupnames = []
+        result = self.doSearch("SELECT groupname FROM groups;")
+        if result :
+            groupnames = [record["groupname"] for record in result]
+        return groupnames
         
     def getUserFromBackend(self, username) :    
Index: /pykota/trunk/pykota/storages/ldapstorage.py
===================================================================
--- /pykota/trunk/pykota/storages/ldapstorage.py (revision 1170)
+++ /pykota/trunk/pykota/storages/ldapstorage.py (revision 1179)
@@ -22,4 +22,7 @@
 #
 # $Log$
+# Revision 1.35  2003/11/12 13:06:37  jalet
+# Bug fix wrt no user/group name command line argument to edpykota
+#
 # Revision 1.34  2003/10/24 08:37:55  jalet
 # More complete messages in case of LDAP failure.
@@ -244,4 +247,20 @@
             return dn
             
+    def getAllUsersNames(self) :    
+        """Extracts all user names."""
+        usernames = []
+        result = self.doSearch("objectClass=pykotaAccount", ["pykotaUserName"], base=self.info["userbase"])
+        if result :
+            usernames = [record[1]["pykotaUserName"][0] for record in result]
+        return usernames
+        
+    def getAllGroupsNames(self) :    
+        """Extracts all group names."""
+        groupnames = []
+        result = self.doSearch("objectClass=pykotaGroup", ["pykotaGroupName"], base=self.info["groupbase"])
+        if result :
+            groupnames = [record[1]["pykotaGroupName"][0] for record in result]
+        return groupnames
+        
     def getUserFromBackend(self, username) :    
         """Extracts user information given its name."""
Index: /pykota/trunk/pykota/version.py
===================================================================
--- /pykota/trunk/pykota/version.py (revision 1178)
+++ /pykota/trunk/pykota/version.py (revision 1179)
@@ -22,5 +22,5 @@
 #
 
-__version__ = "1.16alpha5_unofficial"
+__version__ = "1.16alpha6_unofficial"
 
 __doc__ = """PyKota : a complete Printing Quota Solution for CUPS and LPRng."""
Index: /pykota/trunk/bin/edpykota
===================================================================
--- /pykota/trunk/bin/edpykota (revision 1156)
+++ /pykota/trunk/bin/edpykota (revision 1179)
@@ -24,4 +24,7 @@
 #
 # $Log$
+# Revision 1.61  2003/11/12 13:06:35  jalet
+# Bug fix wrt no user/group name command line argument to edpykota
+#
 # Revision 1.60  2003/10/09 21:25:24  jalet
 # Multiple printer names or wildcards can be passed on the command line
@@ -448,6 +451,9 @@
                 raise PyKotaToolError, _("There's no printer matching %s") % pname
         if not names :    
-            if options["add"] and not printeradded :
-                raise PyKotaToolError, _("You have to pass user or group names on the command line")
+            if options["add"] :
+                if not printeradded :
+                    raise PyKotaToolError, _("You have to pass user or group names on the command line")
+                else :    
+                    names = getattr(self.storage, "getAll%ssNames" % suffix)()
             else :    
                 names = [ "*" ] # all users
Index: /pykota/trunk/NEWS
===================================================================
--- /pykota/trunk/NEWS (revision 1178)
+++ /pykota/trunk/NEWS (revision 1179)
@@ -22,4 +22,10 @@
 PyKota NEWS :
 
+    - 1.16alpha6 :
+    
+        - Bug fixed : when edpykota was used to add a printer
+          with no user or group name, a bad user/group name "*" was
+          added to the database.
+          
     - 1.16alpha5 :
     
