Skip to Content Skip to Menu

[#7507] Redirect Away From Private Profile Acknowledged in URL

5 years 7 months ago - 5 years 7 months ago #311464 by royersolutions
Thank you for providing CB Auto Actions which will be hugely beneficial in this my first CB implementation. I’ve watched all of Nick’s videos on the topic. And I’ve attempted to create a trigger to do the redirect I desire but, so far, to no avail. Still have much to learn.

In the meantime, please help me “Redirect to a Page When Attempt to View Private Profile is Made” because I really don’t like that the guest/user can see /profile/username at the end of the URL when a guessed username has been manually typed in the address bar. If someone goes on a fishing expedition for a certain user who’s profile is private, I don’t want it known that the particular profile exists.

I’ll probably customize the UE_NOT_AUTHORIZED system message too but what can I do? The following does not work:

Global
Triggers: onBeforeUserProfileDisplay onBeforeUserProfileRequest
Conditions: Field privacy_profile Operator Equal To Value Private
Action: URL to page on which I want the Error message to land

If you know what I should use instead, great. Or if you can point me in the right direction, I will appreciate your help.
Last edit: 5 years 7 months ago by krileon. Reason: Added [#7507] tag to subject

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48541
  • Thanks: 8290
  • Karma: 1445
5 years 7 months ago #311468 by krileon
If it's the message for CB Privacy blocking profile access then you can complete customize that within CB Privacy > Parameters > Privacy > Profile using the "Access Denied Message" parameter. If you want to implement your own check you'll need to use the below usage in CB Auto Actions.

Global
Triggers: onBeforeUserProfileAccess
Type: Redirect
User: Automatic
Access: Non-Self
Conditions
1: [var2] Not Empty
Action
URL: index.php
Message: [var2]

The above should display the privacy access denied message and redirect to home page. The condition is checking of $msg has a value for that trigger. It only ever has a value if profile access is denied.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.
The following user(s) said Thank You: nant

Please Log in or Create an account to join the conversation.

5 years 7 months ago #311488 by royersolutions
Replied by royersolutions on topic Redirect Away From Private Profile Acknowledged in URL

krileon wrote: If it's the message for CB Privacy blocking profile access then you can complete customize that within CB Privacy > Parameters > Privacy > Profile using the "Access Denied Message" parameter.


Great custom message option, and it displays for logged in users, but I have yet get the redirect to work for logged in users attempting to access private profiles.

krileon wrote: Global
Triggers: onBeforeUserProfileAccess
Type: Redirect
User: Automatic
Access: Non-Self
Conditions
1: [var2] Not Empty
Action
URL: index.php
Message: [var2]


Thanks for the parameters. I got the above to work for guests with a slight change. Access: Everybody

I also made a hidden menu item /profiles for the redirect location, but the custom Access Denied Message did not work for guests. So I just made a language override for that case.

If you think of something else I can try to redirect logged in users to my hidden /profiles custom error landing page, great. Otherwise, I'll move on and keep exploring all the great things that can be done with the profiles and community sharing.

Thanks!

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48541
  • Thanks: 8290
  • Karma: 1445
5 years 7 months ago #311490 by krileon
With Access set to Everybody it should always redirect if there's an error that' prevent profile access. For it to pick up CB Privacy you'll likely have load order issues. Meaning if CB Auto Actions loads before CB Privacy then CB Auto Actions may not see the change to $msg. To try and workaround this ensure CB Auto Actions is ordered after CB Privacy in CB > Plugin Management and see if that'll help.

Have added a feature ticket to CB Privacy to allow you to specify a redirect URL in addition to the access denied message, which should help with your needs.

forge.joomlapolis.com/issues/7507


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48541
  • Thanks: 8290
  • Karma: 1445
5 years 7 months ago #311491 by krileon
Ok, latest build just released now has a parameter to specify a redirect URL to redirect away if profile privacy access is denied. You'll find this new parameter with the Access Denied Message parameter.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.
The following user(s) said Thank You: royersolutions

Please Log in or Create an account to join the conversation.

Moderators: beatnantkrileon
Powered by Kunena Forum