예제 #1
0
def user(user):
    """Get ldap info for a single user by username."""
    results = search(exact=True, uid=user)
    if results:
        return jsonify(results[0])
    else:
        return 'User not found', 404
예제 #2
0
def ugkthid(ugkthid):
    """Get ldap info for a single user by ugKthid."""
    results = search(exact=True, ugKthid=ugkthid)
    if results:
        return jsonify(results[0])
    else:
        return 'User not found', 404
예제 #3
0
def users(query):
    """Perform an ldap search for multiple users."""
    return jsonify(results=sorted(search(cn=query, uid=query), key=get_prio(query)))