CBSubs - By URL parts regex issue

6 years 9 months ago #295225 by webweaver.be
CBSubs - By URL parts regex issue was created by webweaver.be
Hello,

We want to limit access to dtregister registration to active members of two plans (view access is allowed for every one). We only have a few events per year. We solved this in the past by limiting CMS Extensions access using "By URL parts".
Since one of the latest upgrades, the regex does not work anymore (even if your membership is expired, you can register)
option=com_dtregister&Itemid=/[0-9]*/&eventId=/[0-9]*/&controller=event&task=individualRegister/(.*)?/
option=com_dtregister&itemid=/[0-9]*/&eventid=/[0-9]*/&controller=event&task=individualregister/(.*)?/
option=com_dtregister/(.*)?/&controller=event/(.*)?/

We even tried
option=com_dtregister&/.*/&task=individualRegister

The only thing that works is when we use "hardcoded" links (without the regex)
option=com_dtregister&eventId=197&Itemid=99999&task=register&controller=event
option=com_dtregister&Itemid=838&eventId=197&controller=event&task=individualRegister
Unfortunately the itemid in the second url is user based, so that one only works for my user.

We don't see any warnings in the logfiles.

PHP 7.0.20
Joomla: 3.7.2
CB: 2.1.2
CBSubs: 4.1.0+build.2017.05.19.15.39.30.520d1fe23
CBSubs Content: 4.1.0+build.2017.05.19.15.39.30.520d1fe23
cbpaidsubsbot : 4.0.1

Kind regards,
-Erik

Please Log in to join the conversation.

6 years 9 months ago #295230 by krileon
Replied by krileon on topic CBSubs - By URL parts regex issue
The regexp usage appears to still be working fine in my tests. Your usages are not valid though. You can not just insert regexp in the middle of a usage as that's not how it works. It only supports regexp for a variable value and only as a whole. I'm not sure how an update of CBSubs could've caused those to not work as they shouldn't have been working to begin with.

In addition to this depending on Itemid to be in the URL is unreliable as Itemid very well could be missing. I do not recommend checking for Itemid and if that's important you may want to use By Menu protection to cover the Itemid case. I recommend the below.

option=com_dtregister&eventId=/[0-9]*/&controller=event&task=/individualRegister(.*)?/
option=com_dtregister&eventid=/[0-9]*/&controller=event&task=/individualregister(.*)?/
option=/com_dtregister(.*)?/&controller=/event(.*)?/


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 to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.237 seconds

Facebook Twitter LinkedIn