Notifications
Clear all

wpForo 1.x.x [Closed] Login Redirect

3 Posts
3 Users
0 Likes
1,001 Views
Posts: 1
Topic starter
(@sguillaume)
New Member
Joined: 5 years ago

Thanks for the wonderful plugin. It works great. I have a general question about the email sent from wpForo. I setup the forums for registered users only. This works great. The question is

1). The email that is sent has the link -> www.example.com/community/$topic['topicurl']

2). When a user that receives this email and clicks the link - 

  • if the user is logged in already - everything works fine - they go right to the topic
  • if the user is NOT logged in - they get the 404 page - saying that the page does not exist

3). My question is 

  • In wordpress or wpForo - is there a hook, filter that will allow me to check to see if the user is logged in - something like:

if (page == /community/)

if (!is_user_logged_in()

wp_redirect('example.com/login/')

  • then after the redirect - the user will go the the requested forum url
Any help would be great!

Thanks
2 Replies
VereK
Posts: 501
(@verek)
Honorable Member
Joined: 6 years ago

@sguillaume,

Basically you have forums where view permissions are denied to guests/not logged in members. IIRC Wpforo sessions expire after 7? days even if the "remember me" button is checked at login. After complaints from my members about this I installed this plugin: https://wordpress.org/plugins/wp-persistent-login/ ,it works really well with decent controls for member and admin alike.

Sofy
Posts: 4308
 Sofy
Admin
(@sofy)
Support Team
Joined: 6 years ago

Hi @sguillaume, @verek,

We're going to add a new feature that will redirect to the login page when the topic is private or not available for the current user.

This feature will be available in the next version release (no ETA).