diff --git a/plugin/advanced_subscription/src/AdvancedSubscriptionPlugin.php b/plugin/advanced_subscription/src/AdvancedSubscriptionPlugin.php index 403858b0a7..b5b69c910f 100644 --- a/plugin/advanced_subscription/src/AdvancedSubscriptionPlugin.php +++ b/plugin/advanced_subscription/src/AdvancedSubscriptionPlugin.php @@ -1087,6 +1087,17 @@ class AdvancedSubscriptionPlugin extends Plugin implements HookPluginInterface */ public function getOpenSessionUrl($userId, $params) { + $userIsSubscribed = SessionManager::isUserSubscribedAsStudent( + $params['session_id'], + $userId + ); + + if ($userIsSubscribed) { + return api_get_path(WEB_CODE_PATH) + . 'session/index.php?session_id=' + . intval($params['session_id']); + } + $params['secret_key'] = null; $params['user_id'] = null; $params['user_field'] = null;