Home › Forums › Calendar Products › Community Events › Forced site log in
- This topic has 4 replies, 2 voices, and was last updated 8 years, 1 month ago by
spiceyux.
-
AuthorPosts
-
March 13, 2018 at 12:16 pm #1478069
spiceyux
ParticipantIs it possible to:
Force the authentication to route through wordpress native login:
https://indivisiblenwi.org/wp-login.php
vs the Community Events implementation of it:
https://indivisiblenwi.org/events/community/addThe issue is that I have CAPTCHA enabled for the site and attempting to login through the events implementation always fails because the CAPTCHA is not present there. Currently using:
I basically want to route all authentication requests through the native mechanism
March 14, 2018 at 4:07 pm #1479561Victor
MemberHi Sam!
Thanks for reaching out to us! Let me help you with this topic.
There is no built-in option to disable the community login form, but you can use the snippet George shared in the following topic to achieve that > https://theeventscalendar.com/support/forums/topic/standardize-actions-on-community-event-login-forms/#dl_post-1204815
Let me also note that we have a built-in implementation of captcha for the event submission form > https://theeventscalendar.com/knowledgebase/setting-recaptcha-community-events/
I hope that helps. 🙂 Let me know if you have any follow up questions.
Best,
VictorMarch 16, 2018 at 6:12 am #1481104spiceyux
ParticipantThanks Victor,
I ended up doing something similar. I wasn’t aware of the wp_safe_redirect(). (My WP skills are a bit rusty).
One thing to add that I did:function tribe_ce_login_redirect( $post_id ) { global $wp; $current_url = home_url(add_query_arg(array(),$wp->request)); header("Location: /wp-login.php?cestate=required&redirect_to=" . urlencode($current_url) ); return; } add_action( 'tribe_community_before_login_form', 'tribe_ce_login_redirect' ); function the_tribe_ce_login_message( $message ) { $tribe_ce_login_messaging = htmlspecialchars($_GET["cestate"]); $cemessage; if(!empty($tribe_ce_login_messaging)){ if($tribe_ce_login_messaging='required'){ $cemessage = 'Events require an account to submit or edit.'; } return '<p class="message">' . $cemessage . '</p>'; } return; } add_filter( 'login_message', 'the_tribe_ce_login_message' );I grabbed the current url so that, after login, it would redirect back to the originating url.
Also, passing a query string param so I can message on the native login for that, “Events require an account.”I’ll make some updates to leverage the wp_safe_redirect() but wanted to share in case it helps anyone in the future.
March 19, 2018 at 5:26 am #1482826Victor
MemberHey Sam!
It’s great to know you could solve the issue!
Thanks for following up and for sharing the code. I’m sure other users will find it useful.
I’ll close this thread now, but feel free to open a new topic if anything comes up and we’ll be happy to help. 🙂
Cheers,
Victor -
AuthorPosts
- The topic ‘Forced site log in’ is closed to new replies.
