예제 #1
0
def manage_auth_methods(request):
    '''Manage the user's authentication methods using AJAX.'''
    from tardis.tardis_portal.auth.authentication import add_auth_method, \
        merge_auth_method, remove_auth_method, edit_auth_method, \
        list_auth_methods

    if request.method == 'POST':
        operation = request.POST['operation']
        if operation == 'addAuth':
            return add_auth_method(request)
        elif operation == 'mergeAuth':
            return merge_auth_method(request)
        elif operation == 'removeAuth':
            return remove_auth_method(request)
        return edit_auth_method(request)
    # if GET, we'll just give the initial list of auth methods for the user
    return list_auth_methods(request)
예제 #2
0
def manage_auth_methods(request):
    '''Manage the user's authentication methods using AJAX.'''
    from tardis.tardis_portal.auth.authentication import add_auth_method, \
        merge_auth_method, remove_auth_method, edit_auth_method, \
        list_auth_methods

    if request.method == 'POST':
        operation = request.POST['operation']
        if operation == 'addAuth':
            return add_auth_method(request)
        elif operation == 'mergeAuth':
            return merge_auth_method(request)
        elif operation == 'removeAuth':
            return remove_auth_method(request)
        return edit_auth_method(request)
    # if GET, we'll just give the initial list of auth methods for the user
    return list_auth_methods(request)
예제 #3
0
def manage_auth_methods(request):
    """Manage the user's authentication methods using AJAX."""
    from tardis.tardis_portal.auth.authentication import (
        add_auth_method,
        merge_auth_method,
        remove_auth_method,
        edit_auth_method,
        list_auth_methods,
    )

    if request.method == "POST":
        operation = request.POST["operation"]
        if operation == "addAuth":
            return add_auth_method(request)
        elif operation == "mergeAuth":
            return merge_auth_method(request)
        elif operation == "removeAuth":
            return remove_auth_method(request)
        else:
            return edit_auth_method(request)
    else:
        # if GET, we'll just give the initial list of auth methods for the user
        return list_auth_methods(request)