Use explicit groupings when applying a subscription.
This commit is contained in:
parent
82f0f3df73
commit
a073ddec52
1 changed files with 1 additions and 8 deletions
|
|
@ -27,14 +27,7 @@ sub apply {
|
||||||
$groupId = $self->{_properties}{subscriptionGroup};
|
$groupId = $self->{_properties}{subscriptionGroup};
|
||||||
|
|
||||||
# Make user part of the right group
|
# Make user part of the right group
|
||||||
if (WebGUI::Grouping::isInGroup($groupId, $userId)) {
|
WebGUI::Grouping::addUsersToGroups([$userId], [$groupId], _getDuration($self->{_properties}{duration}));
|
||||||
# $expirationDate = WebGUI::Grouping::userGroupExpireDate($userId, $groupId) + $self->{_properties}{duration};
|
|
||||||
$expirationDate = WebGUI::Grouping::userGroupExpireDate($userId, $groupId) + _getDuration($self->{_properties}{duration});
|
|
||||||
|
|
||||||
WebGUI::Grouping::userGroupExpireDate($userId, $groupId, $expirationDate);
|
|
||||||
} else {
|
|
||||||
WebGUI::Grouping::addUsersToGroups([$userId], [$groupId], _getDuration($self->{_properties}{duration}));
|
|
||||||
}
|
|
||||||
|
|
||||||
# Add karma
|
# Add karma
|
||||||
WebGUI::User->new($userId)->karma($self->{_properties}{karma}, 'Subscription', 'Added for purchasing subscription '.$self->{_properties}{name});
|
WebGUI::User->new($userId)->karma($self->{_properties}{karma}, 'Subscription', 'Added for purchasing subscription '.$self->{_properties}{name});
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue