Support Forum

Advanced Search
Forum Scope


Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
general-topic
Logout Redirect
Avatar
Rodrigo B Galluf
Member
Free Members
sp_UserOfflineSmall Offline
May 5, 2014 - 9:54 pm

Ok I'm right there.

I want to redirect to http://www.mysite.com after logout

I have this.. 

function sp_logout_redirect() {
sp_forum_api_support();
global $spThisUser;

$sflogin = sp_get_option('sflogin');
if (!empty($sflogin['sflogouturl'])) {
$sfadminoptions = sp_get_member_item($spThisUser->ID, 'admin_options');
if ($spThisUser->moderator && $sfadminoptions['bypasslogout']) {
$_REQUEST['redirect_to'] = esc_url(wp_login_url());
} else {
$_REQUEST['redirect_to'] = $sflogin['sflogouturl'];
}
}
$_REQUEST['redirect_to'] = apply_filters('sph_logout_redirect', $_REQUEST['redirect_to']);

Avatar
Rodrigo B Galluf
Member
Free Members
sp_UserOfflineSmall Offline
May 5, 2014 - 10:01 pm

Ok I loged in as a user and the redirect is working properly.

I believe the problem is with moderators only  

if ($spThisUser->moderator && $sfadminoptions['bypasslogout']) {

I believe being a moderator it bypass something

Avatar
Rodrigo B Galluf
Member
Free Members
sp_UserOfflineSmall Offline
May 5, 2014 - 10:06 pm

That's it!

bingo.jpgImage Enlarger

Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
May 5, 2014 - 10:36 pm

well, yes... if you said to bypass the logout in the options, that would be the case... sorry, forgot about that option and should have suggested checking it...

Forum Timezone: Europe/Stockholm
Most Users Ever Online: 1170
Currently Online:
Guest(s) 1
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Mr Papa: 19448
Ike: 2086
Brandon: 864
kvr28: 804
jim: 650
FidoSysop: 577
Conrad_Farlow: 531
fiddlerman: 358
Stefano Prete: 325
Member Stats:
Guest Posters: 619
Members: 17361
Moderators: 0
Admins: 4
Forum Stats:
Groups: 7
Forums: 17
Topics: 10127
Posts: 79625