• Resolved MagnusCreed

    (@magnuscreed)


    Hi,
    I have installed the free version of Awesome Support as well as next active directory Integration. I have configured the both and have imported users from AD into wordpress. If i go to <website>/wp-admin, I get the login page and can use AD accounts or the builtin account to log in. From there, if i go to the submit ticket page, I can submit a ticket.

    However, if i try to go right to the tickets page, i am given a notice that i need to log in to submit a ticket. I enter the credentials of a support user and get this:

    ERROR: The password you entered for the username <username> is incorrect.

    I try another account. Same thing. Another account. Same thing. The local ADMIN account…also will not sign in. If I enter an account that is not in the user list, i get an invalid user notification. So somehow, it is assessing the user list, but is not allowing any credentials to sign in.

    • This topic was modified 7 years ago by MagnusCreed. Reason: spelling error
Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author awesomesupport

    (@awesomesupport)

    Hi:

    Unfortunately we don’t have any hands-on experience of our own with AD integration. Hopefully another user who has set this up can weigh in and guide you in what they’ve done.

    Thanks.

    I have the same issue. I’m using NADI from NeosIT, GmbH for my AD authentication. To workaround this, I had to go to the Advanced setting tab in Awesome Support and set the custom login page to the login page we use with Woffice. The second issue I ran into was that this setting is not respected on the page that clicking an email link takes the user to. I had to copy some code from the submit ticket login script to the view ticket login script. The ?redirect_to is supported by some code I added to WOffice’s login page. Not sure if WordPress has a standard QS parameter for login redirects.

    In wpas_single_ticket() from wp-content/plugins/awesome-support/includes/functions-templating.php:

    /* Check if the current user can view the ticket */
                    if ( ! wpas_can_view_ticket( $post->ID ) ) {
    
                            if ( is_user_logged_in() ) {
                                    return wpas_get_notification_markup( 'failure', __( 'You are not allowed to view this ticket.', 'awesome-support' ) );
                            } else {
    
                                    $output = '';
                                    $output .= wpas_get_notification_markup( 'failure', __( 'You are not allowed to view this ticket.', 'awesome-support' ) );
    
                                    ob_start();
    
                                    $registration = wpas_get_option( 'login_page', false );
    
                                    if ( false !== $registration && !empty( $registration ) && !is_null( get_post( intval( $registration ) ) ) ) {
                                            /* As the headers are already sent we can't use wp_redirect. */
                                            echo '<meta http-equiv="refresh" content="0; url=' . get_permalink( $registration ) . '?redirect_to=' . urlencode($_SERVER['REQUEST_URI']) . '" />';
                                            wpas_get_notification_markup( 'info', __( 'You are being redirected...', 'awesome-support' ) );
                                            exit;
                                    }
                                    wpas_get_template( 'registration' );
                                    $output .= ob_get_clean();
    
                                    return $output;
    
                            }
                    }

    I added this reply in case the user or others need it. I’m forking your github project and I’ll be working on why WOffice is able to pass the login correctly, but Awesome Support isn’t.

    I will work on a branch and issue a pull request for the login not being redirected when the user follows the link from email first.

    Just an update with what I’ve found.

    The WOffice theme POSTs its login form contents to /wp-login.php.

    NADI only loads its authentication filter if the location contains wp-login.php or xmlrpc.php. The end result is that NADI works with WOffice.

    Since Awesome support handles its authentication inline with the page you’ve embedded the tickets shortcode in or the view link that the user received in their email, NADI’s authentication filter doesn’t get loaded and login fails in Awesome Support.

    I updated line 217 in next-active-directory-integration/classes/Adi/Init.php as follows:

    if ($this->isOnLoginPage() || strpos($_SERVER['REQUEST_URI'], "helpdesk") > -1) {
        $this->registerLoginHooks();
    
        // further hooks must not be executed
        return false;
    }

    The next if clause in the code is to return false if the user is not logged in. It seems they’re doing this to avoid loading the profile and administration hooks.

    • This reply was modified 6 years, 10 months ago by villagerealty.

    Anyone having the same issue with NADI, can refer to the pull request I created. Change has been working well on my server.

    https://github.com/NeosIT/active-directory-integration2/pull/81

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Logins not working on Submit Ticket page’ is closed to new replies.