-
Search Results
-
I have a custom redirection for a certain user group after login. It works fine except after password reset/update. It doesn’t matter I do, SMP always redirects me to a profile page instead of the page previously set up after password reset/update.
I would like to know if that would be a feature that comes with the plugin and if I could change that behavior.
Thanks.
P.S.
It seems the swpm_after_login action isn’t executed even adding a higher priority ( Lowest Number ) after password reset/update.
[Resolved]Topic: Logout Link Not working
I have used the suggested method ( https://simple-membership-plugin.com/creating-member-logout-link/ ) and have a login link on my site ( https://www.stiraallternatives.com/aviate/ ) but it’s not working.
The site is in a subfolder (which i seen noted on other threads/tickets; although none of the threads list any solution). And I see one cookie (swpm_session) is on Path: / while all others (swpm_in_use, simple_wp_membership…, wordpress_sec…, wordpress_logged_in…) are all on Path: /aviate/.
Clicking ‘Logout’ does the redirection, but doesn’t clear any cookies.
Ironically, I have this same setup on another server and it works fine.
Logs aren’t helpful:
log.txt
[02/07/2018 3:51 PM] – SUCCESS: After login redirection addon. Checking if member need to be redirected.
[02/07/2018 3:55 PM] – SUCCESS: After login redirection addon. Checking if member need to be redirected.
[02/07/2018 4:04 PM] – SUCCESS: After login redirection addon. Checking if member need to be redirected.
[02/07/2018 4:04 PM] – SUCCESS: After login redirection addon. Checking if member need to be redirected.
log-auth.txt
[02/07/2018 3:51 PM] – SUCCESS: Authentication request – Username: financial-pro
[02/07/2018 3:51 PM] – SUCCESS: Authentication successful for username: financial-pro. Executing swpm_login action hook.
[02/07/2018 3:51 PM] – SUCCESS: Trying wp_signon() with username: financial-pro
[02/07/2018 3:51 PM] – SUCCESS: Setting current WP user to: financial-pro
[02/07/2018 3:51 PM] – SUCCESS: Triggering swpm_after_login hook.
[02/07/2018 3:55 PM] – SUCCESS: Authentication request – Username: financial-pro
[02/07/2018 3:55 PM] – SUCCESS: Authentication successful for username: financial-pro. Executing swpm_login action hook.
[02/07/2018 3:55 PM] – SUCCESS: Trying wp_signon() with username: financial-pro
[02/07/2018 3:55 PM] – SUCCESS: Setting current WP user to: financial-pro
[02/07/2018 3:55 PM] – SUCCESS: Triggering swpm_after_login hook.
[02/07/2018 4:03 PM] – SUCCESS: login
[02/07/2018 4:03 PM] – SUCCESS: Authentication request – Username: AviateAdmin
[02/07/2018 4:04 PM] – SUCCESS: Authentication request – Username: financial-pro
[02/07/2018 4:04 PM] – SUCCESS: Authentication successful for username: financial-pro. Executing swpm_login action hook.
[02/07/2018 4:04 PM] – SUCCESS: Trying wp_signon() with username: financial-pro
[02/07/2018 4:04 PM] – SUCCESS: Setting current WP user to: financial-pro
[02/07/2018 4:04 PM] – SUCCESS: Triggering swpm_after_login hook.
[02/07/2018 4:04 PM] – SUCCESS: Authentication request – Username: financial-pro
[02/07/2018 4:04 PM] – SUCCESS: Authentication successful for username: financial-pro. Executing swpm_login action hook.
[02/07/2018 4:04 PM] – SUCCESS: Trying wp_signon() with username: financial-pro
[02/07/2018 4:04 PM] – SUCCESS: Setting current WP user to: financial-pro
[02/07/2018 4:04 PM] – SUCCESS: Triggering swpm_after_login hook.
[02/07/2018 4:05 PM] – SUCCESS: Authentication request – Username: financial-pro
[02/07/2018 4:05 PM] – SUCCESS: Authentication successful for username: financial-pro. Executing swpm_login action hook.
[02/07/2018 4:05 PM] – SUCCESS: static function swpm_login(). User is logged in. WP Username: financial-proAny ideas?
Topic: Custom redirect after login
I am trying to redirect the user after it logs in.
I run set_redirect() at the top of my header.php
/*
* ===============================
* SET SESSION REDIRECT
* ===============================
*/function set_redirect(){
if(isset($_GET[‘redirect’]) ){
$redirect_link = htmlspecialchars($_GET[‘redirect’]);
session_start();
$_SESSION[“redirect”] = $redirect_link;
}
}And this is my hook in function.php
/*
* ===============================
* AFTER LOGIN REDIRECTION
* ===============================
*/add_action(‘swpm_after_login’, ‘swpm_do_after_login_redirection’);
function swpm_do_after_login_redirection()
{
if(strpos($_SESSION[‘redirect’],’supplier’) > 0 || strpos($_SESSION[‘redirect’],’airport’) > 0 || strpos($_SESSION[‘redirect’],’operator’) > 0 || strpos($_SESSION[‘redirect’],’job’) > 0 ){
//session_start();
wp_redirect($_SESSION[‘redirect’]);
exit;
}else{
$member_profile_url = get_permalink(124);
wp_redirect($member_profile_url);
exit;
}}
What am I doing wrong?