villagerealty
Forum Replies Created
-
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
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.
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.