Source

iredadmin-ose / libs / ldaplib / connUtils.py

Diff from to

File libs/ldaplib/connUtils.py

 
 import web
 import ldap
-import ldif
 from ldap.filter import escape_filter_chars
 from libs import iredutils
 from libs.ldaplib import core, ldaputils, decorators, attrs, deltree
             return (True, self.managedDomains)
         except Exception, e:
             return (False, ldaputils.getExceptionDesc(e))
+
+
+def deleteAccountFromUsedQuota(accounts):
+    # @accounts: must be list/tuple of email addresses.
+    if len(accounts) > 0:
+        try:
+            web.admindb.delete(
+                'used_quota',
+                where='username IN %s' % (web.sqlquote(accounts)),
+            )
+            return (True,)
+        except Exception, e:
+            return (False, str(e))
+    else:
+        return (True,)