• Resolved miguelcalderons

    (@miguelcalderons)


    On load it supposed to load users but the Ajax its redirecting to home and I’m sure its pilot press plugin because when I disable it, gets fixed. What hook or where in the code it’s blocking all the Ajax?

    The page I need help with: [log in to see the link]

Viewing 5 replies - 1 through 5 (of 5 total)
  • Sorry for the delay in responding – I just received the notification of this post. Let me check and see if I can get one of our Devs to take a look at it; that will probably be tomorrow now.

    Is the form on that page from a plugin or custom coded? I only see SEO and PilotPress as plugins in the page source.

    Thread Starter miguelcalderons

    (@miguelcalderons)

    Hi Frank,

    I found the problem, is in line 1387 inside the function user_lockout() the problem here is that when you call an Ajax function without admin permission or non logged in, it will redirect you.

    I added the conditional if(!current_user_can('manage_options') && $this->get_setting("wp_userlockout") && !isset($_POST["action"]) && !wp_doing_ajax()) { that will be false so won’t redirect any Ajax call

    Thanks for updating us!

    I wouldn’t actually consider this a resolved issue until this change is merged into the core source code. This is still an issue – pilotpress breaks anything else that needs to make calls to ajax.

    Justin

    This particular issue is resolved, Justin. Here is the current function user_lockout in pilotpress.php:

     function user_lockout() {
                global $current_user;
                if(!current_user_can('manage_options') && $this->get_setting("wp_userlockout") && !isset($_POST["action"])) {
                    
                    $customer = $this->get_setting("pilotpress_customer_plr");
                    if(!empty($customer) && $customer != "-1") {
                        self::redirect(get_permalink($customer));
                    } else {
                        self::redirect($this->homepage_url);
                    }
                    die;
                }
            }
    
Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Ajax redirect 302 with non logged in’ is closed to new replies.