def objectclasses(self):
return self._get_strings("objectClass")
+ @staticmethod
+ def _parse_date(s):
+ return datetime.datetime.strptime(s.decode(), "%Y%m%d%H%M%SZ")
+
class Accounts(Object):
def init(self):
return Account(self.backend, dn, attrs)
+ @staticmethod
+ def _format_date(t):
+ return t.strftime("%Y%m%d%H%M%SZ")
+
def get_created_after(self, ts):
- t = ts.strftime("%Y%m%d%H%M%SZ")
+ return self._search("(&(objectClass=person)(createTimestamp>=%s))" % self._format_date(ts))
- return self._search("(&(objectClass=person)(createTimestamp>=%s))" % t)
+ def count_created_after(self, ts):
+ return self._count("(&(objectClass=person)(createTimestamp>=%s))" % self._format_date(ts))
def search(self, query):
accounts = self._search("(&(objectClass=person)(|(cn=*%s*)(uid=*%s*)(displayName=*%s*)(mail=*%s*)))" \
return {}
- @staticmethod
- def _parse_date(s):
- return datetime.datetime.strptime(s.decode(), "%Y%m%d%H%M%SZ")
-
@property
def last_successful_authentication(self):
try: