Project

General

Profile

Actions

Feature proposal #8878

closed

Subscription plans have an additional parameter "Allow login" (default: true, available only if free registrations are not allowed)

Added by krileon almost 3 years ago. Updated over 2 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Target version:
Start date:
02 March 2022
Due date:
% Done:

100%

Estimated time:

Description

Currently if "Allow Free Registered Users (without subscriptions)" is set to "No" and the user is subscribed to Plan A (exclusive) and Plan B (non-exclusive), but Plan A expires they are still allowed access since Plan B satisfies the condition of not being a free registration. It could be useful to support requiring at least 1 active exclusive plan so you can use non-exclusive plans as feature add-ons to a group of exclusive plans.

https://www.joomlapolis.com/forum/153-professional-member-support/244764-exclusive-plans-needed-for-access

Actions #1

Updated by beat almost 3 years ago

  • Status changed from New to Assigned
  • Assignee set to beat

Here my thoughts about this feature-request:

CBSubs allows multiple exclusive subscriptions, grouped by parent plan. So can also be used among child plans.

E.g. non-exclusive top-level plans choice, and each non-exclusive plan having child-plans that are exclusive.

1. Using "exclusive plan" as a criteria would not take into account all scenarios.

2. A different, more flexible approach to the need-request, would be to select one of which subscription plans are needed, like in conditions for plans availability, promotions or taxes plugins.

3. And the most general approach would be to use same kind of conditions for that function too (which would imply a refactoring of conditions into core CBSubs.

Probably "2" would be a reasonable middle-ground ?

Actions #2

Updated by krileon almost 3 years ago

Given the check is already there it would seam easier to just extend it to only check if they've at least 1 active exclusive top level plan. This would just be a matter of adding 1 more option to the existing parameter. Shouldn't be too complicated to implement, but enableFreeRegisteredUser check probably should be extracted to a function since it's checked in about a dozen spots. This can be in addition to Option 2 in a future release, which should just be a simple dropdown to select required plans below "Allow Free Registered Users (without subscriptions)" when set to the new option. Example as follows.

Allow Free Registered Users (without subscriptions): No
Plans Required for Registered Users: Any | Exclusive Plans | Specific Plans
Specific Plans Required for Registered Users: SELECT_LIST_OF_PLANS

CBSubs allows multiple exclusive subscriptions, grouped by parent plan. So can also be used among child plans.

The problem with this is if you've a dozen non-exclusive addons that are not unique to a parent plan you then have to duplicate those plans to every single parent plan as child plans and if they change parent plans they lose that addon plan. It's just not an acceptable solution for global non-exclusive addon plans.

Actions #3

Updated by beat over 2 years ago

I have now reviewed all locations, and actually, it looks like it's doable by changes only in class `cbpaidUserRegistration` around `enableFreeRegisteredUser` uses.

Thus another idea that I actually like even better than "1" and "2", let's name it "4":

4. Subscription plans get a new setting, in Workflows tab, CB Login workflows fieldset: Allow login (default ON).

This setting would be available only if `enableFreeRegisteredUser` is not ON at general config,

A user wanting to disable logins with certain plans just switches this to OFF.

Advantage: No mixup with Exclusive, or different Exclusive settings, and maximum flexibility.

Thoughts ?

Actions #4

Updated by beat over 2 years ago

  • % Done changed from 0 to 50
Actions #5

Updated by beat over 2 years ago

  • Target version changed from 4.6.0 to 4.6.1
Actions #6

Updated by beat over 2 years ago

  • Subject changed from Implement support for checking if subscribed to exclusive plan for not allowing free registrations to If free registrations are not allowed, plans can have an additional parameter "Allow login" (default: True)
  • % Done changed from 50 to 90

Thoughts were positive on the chat last week.

So I'm changing subject to reflect new feature idea, which is now implemented, pending last tests.

Actions #7

Updated by beat over 2 years ago

  • Subject changed from If free registrations are not allowed, plans can have an additional parameter "Allow login" (default: True) to If free registrations are not allowed, subscription plans have an additional parameter "Allow login" (default: True)
Actions #8

Updated by beat over 2 years ago

  • Subject changed from If free registrations are not allowed, subscription plans have an additional parameter "Allow login" (default: True) to If free registrations are not allowed, subscription plans have an additional parameter "Allow login" (default: true)
Actions #9

Updated by beat over 2 years ago

  • Subject changed from If free registrations are not allowed, subscription plans have an additional parameter "Allow login" (default: true) to Subscription plans have an additional parameter "Allow login" (default: true, available only if free registrations are not allowed)
Actions #10

Updated by beat over 2 years ago

  • Status changed from Assigned to Resolved
  • % Done changed from 90 to 100

Implemented in commit 3cd27d3a5ea1d968ccc2f5451cdffd66a8142695

Actions #11

Updated by beat over 2 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF