Bug #7341
closedLogin blocking does not function with custom usergroups
Description
If you've a custom usergroup under Registered and the user logs in with an expired subscription while free subscriptions are not allowed it will not block their login. It will if they are assigned to Registered usergroup though. Example structure as follows.
Public
- Registered
- - Custom
Registered works for this functionality while Custom does not.
Updated by krileon about 6 years ago
If the user has both Registered AND Custom the functionality also appears to fail. It only works if they have ONLY Registered.
Updated by beat about 6 years ago
- Status changed from New to Assigned
- Assignee set to beat
Issue is as follows:
It all happens in cbpaidsubscriptions::onDuringLogin() at begin calling $paidsubsManager->checkExpireMe() that calls checkUserSubscriptions().
If a user belongs to other groups that are not managed by CBSubs in a plan that is accessible to the user, then the user will be blocked (see below), but not presented with possible upgrade plans (that is a bug) because (in cbpaidUserExtension::checkUserSubscriptions() line 296):
if ( ( ! self::_allValuesOfArrayInArray( (array) $user->gids, $oldPotentialPlansGids ) )
|| in_array( $_CB_framework->acl->mapGroupNamesToValues( 'Superadministrator' ), (array) $user->gids ) )
{
// Do not block a user that has a gid in his gids that is not controlled by a plan that was accessible to him after downgrade:
// This avoids blocking e.g. super admins if there is no super-admin plan.
// But also if there is a Super-admin plan by configuration error, it still should not get blocked:
$block = 0;
}
If a user does not belong to any group managed by CBSubs, it won't be blocked because in cbpaidUserExtension::checkUserSubscriptions() calling cbpaidUserExtension::_adjustUserAclBlock() checks:
if ( self::_anyValueOfArrayInArray( (array) $user->gids, $oldChldGids ) ) {
to block anything. But if "Registered" is not in the gids of the user, he will not get blocked there (and then of course with the issue above, not be presented with upgrade plans possibilites, which is expected in this case.
Updated by beat about 6 years ago
- Status changed from Assigned to Closed
- % Done changed from 0 to 100
Fixed in commit commit 6436fbca5eb82d148bf070b5b9c069eefbef92f3
Updated by beat almost 6 years ago
- Project changed from 2 to CB Paid Subscriptions
Updated by beat almost 6 years ago
- Target version changed from CbSubs 4.4.1 to 4.3.1