Index: pykota/trunk/pykota/storages/ldapstorage.py
===================================================================
--- pykota/trunk/pykota/storages/ldapstorage.py (revision 3056)
+++ pykota/trunk/pykota/storages/ldapstorage.py (revision 3086)
@@ -358,5 +358,5 @@
         user = StorageUser(self, username)
         username = self.userCharsetToDatabase(username)
-        result = self.doSearch("(&(objectClass=pykotaAccount)(|(pykotaUserName=%s)(%s=%s)))" % (username, self.info["userrdn"], username), ["pykotaUserName", "pykotaLimitBy", self.info["usermail"], "pykotaOverCharge", "description"], base=self.info["userbase"])
+        result = self.doSearch("(&(objectClass=pykotaAccount)(|(pykotaUserName=%s)(%s=%s)))" % (username, self.info["userrdn"], username), ["pykotaUserName", "pykotaLimitBy", self.info["usermail"], "description"], base=self.info["userbase"])
         if result :
             fields = result[0][1]
@@ -365,6 +365,5 @@
             user.Email = fields.get(self.info["usermail"], [None])[0]
             user.LimitBy = fields.get("pykotaLimitBy", ["quota"])[0]
-            user.OverCharge = float(fields.get("pykotaOverCharge", [1.0])[0])
-            result = self.doSearch("(&(objectClass=pykotaAccountBalance)(|(pykotaUserName=%s)(%s=%s)))" % (username, self.info["balancerdn"], username), ["pykotaBalance", "pykotaLifeTimePaid", "pykotaPayments"], base=self.info["balancebase"])
+            result = self.doSearch("(&(objectClass=pykotaAccountBalance)(|(pykotaUserName=%s)(%s=%s)))" % (username, self.info["balancerdn"], username), ["pykotaBalance", "pykotaLifeTimePaid", "pykotaPayments", "pykotaOverCharge"], base=self.info["balancebase"])
             if not result :
                 raise PyKotaStorageError, _("No pykotaAccountBalance object found for user %s. Did you create LDAP entries manually ?") % username
@@ -380,4 +379,5 @@
                 user.AccountBalance = user.AccountBalance or 0.0        
                 user.LifeTimePaid = fields.get("pykotaLifeTimePaid")
+                user.OverCharge = float(fields.get("pykotaOverCharge", [1.0])[0])
                 if user.LifeTimePaid is not None :
                     if user.LifeTimePaid[0].upper() == "NONE" :
@@ -725,5 +725,5 @@
         # see comment at the same place in pgstorage.py
         result = self.doSearch("objectClass=pykotaAccount", \
-                                  ["pykotaUserName", "pykotaLimitBy", self.info["usermail"], "pykotaOverCharge", "description"], \
+                                  ["pykotaUserName", "pykotaLimitBy", self.info["usermail"], "description"], \
                                   base=self.info["userbase"])
         if result :
@@ -743,10 +743,9 @@
                     user.Email = fields.get(self.info["usermail"], [None])[0]
                     user.LimitBy = fields.get("pykotaLimitBy", ["quota"])[0]
-                    user.OverCharge = float(fields.get("pykotaOverCharge", [1.0])[0])
                     user.Description = self.databaseToUserCharset(fields.get("description", [""])[0]) 
                     uname = self.userCharsetToDatabase(username)
                     result = self.doSearch("(&(objectClass=pykotaAccountBalance)(|(pykotaUserName=%s)(%s=%s)))" % \
                                               (uname, self.info["balancerdn"], uname), \
-                                              ["pykotaBalance", "pykotaLifeTimePaid", "pykotaPayments"], \
+                                              ["pykotaBalance", "pykotaLifeTimePaid", "pykotaPayments", "pykotaOverCharge"], \
                                               base=self.info["balancebase"])
                     if not result :
@@ -755,4 +754,5 @@
                         fields = result[0][1]
                         user.idbalance = result[0][0]
+                        user.OverCharge = float(fields.get("pykotaOverCharge", [1.0])[0])
                         user.AccountBalance = fields.get("pykotaBalance")
                         if user.AccountBalance is not None :
@@ -916,5 +916,4 @@
                        "pykotaUserName" : uname,
                        "pykotaLimitBy" : (user.LimitBy or "quota"),
-                       "pykotaOverCharge" : str(user.OverCharge),
                        "description" : self.userCharsetToDatabase(user.Description or ""),
                        self.info["usermail"] : user.Email or "",
@@ -937,4 +936,5 @@
                 fields.update(newfields)
                 fields.update({ "pykotaBalance" : str(user.AccountBalance or 0.0),
+                                "pykotaOverCharge" : str(user.OverCharge),
                                 "pykotaLifeTimePaid" : str(user.LifeTimePaid or 0.0), })   
                 self.doModify(dn, fields)
@@ -953,4 +953,5 @@
                            "cn" : uname,
                            "pykotaBalance" : str(user.AccountBalance or 0.0),
+                           "pykotaOverCharge" : str(user.OverCharge),
                            "pykotaLifeTimePaid" : str(user.LifeTimePaid or 0.0), 
                          } 
@@ -968,4 +969,5 @@
                            "cn" : uname,
                            "pykotaBalance" : str(user.AccountBalance or 0.0),
+                           "pykotaOverCharge" : str(user.OverCharge),
                            "pykotaLifeTimePaid" : str(user.LifeTimePaid or 0.0),  
                          } 
@@ -1120,5 +1122,4 @@
         newfields = {
                        "pykotaLimitBy" : (user.LimitBy or "quota"),
-                       "pykotaOverCharge" : str(user.OverCharge),
                        "description" : self.userCharsetToDatabase(user.Description or ""), 
                        self.info["usermail"] : user.Email or "",
@@ -1128,4 +1129,5 @@
         newfields = { "pykotaBalance" : str(user.AccountBalance or 0.0),
                       "pykotaLifeTimePaid" : str(user.LifeTimePaid or 0.0), 
+                      "pykotaOverCharge" : str(user.OverCharge),
                     }
         self.doModify(user.idbalance, newfields)
@@ -1591,7 +1593,7 @@
         entries = [u for u in [self.getUser(name) for name in self.getAllUsersNames(uname)] if u.Exists]
         if entries :
-            result = [ ("dn", "username", "balance", "lifetimepaid", "limitby", "email", "description") ]
+            result = [ ("dn", "username", "balance", "lifetimepaid", "limitby", "email", "description", "overcharge") ]
             for entry in entries :
-                result.append((entry.ident, entry.Name, entry.AccountBalance, entry.LifeTimePaid, entry.LimitBy, entry.Email, entry.Description))
+                result.append((entry.ident, entry.Name, entry.AccountBalance, entry.LifeTimePaid, entry.LimitBy, entry.Email, entry.Description, entry.OverCharge))
             return result 
         
