function ctools_ajax_sample_login_success

Post-login processor: should we go to the user account or stay in place?

1 string reference to 'ctools_ajax_sample_login_success'
ctools_ajax_sample_menu in ctools_ajax_sample/ctools_ajax_sample.module
Implementation of hook_menu()

File

ctools_ajax_sample/ctools_ajax_sample.module, line 285

Code

function ctools_ajax_sample_login_success($js, $action) {
    if (!$js) {
        // We should never be here out of ajax context.
        return MENU_NOT_FOUND;
    }
    ctools_include('ajax');
    ctools_add_js('ajax-responder');
    $commands = array();
    if ($action == 'inplace') {
        // Stay here.
        $commands[] = ctools_ajax_command_reload();
    }
    else {
        // Bounce bounce.
        $commands[] = ctools_ajax_command_redirect('user');
    }
    print ajax_render($commands);
    exit;
}