def get_user_byid(self, usr):
"""Populate RBUser object with data from user with given id in
user database. Raise RBFatalError if user does not exist."""
res = self.ldap.search_s(rbconfig.ldap_accounts_tree,
ldap.SCOPE_ONELEVEL, 'id=%s' % usr.id)
if res:
self.set_user(usr, res[0])
else:
raise RBFatalError("User with id '%s' does not exist" % usr.id)
评论列表
文章目录