Skip to content

Commit

Permalink
Course catalog: fix incoherence on user unsubscribe call so that it w…
Browse files Browse the repository at this point in the history
…orks in the catalog and also in other parts -refs BT#20594
  • Loading branch information
NicoDucou committed Apr 4, 2023
1 parent 6defb35 commit 51c72b2
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion main/auth/courses.php
Expand Up @@ -49,7 +49,7 @@

if (!empty($_GET['sec_token']) && $ctok == $_GET['sec_token']) {
$auth = new Auth();
$result = $auth->remove_user_from_course($_GET['unsubscribe']);
$result = $auth->remove_user_from_course($_GET['course_code']);
if ($result) {
Display::addFlash(
Display::return_message(get_lang('YouAreNowUnsubscribed'), 'success')
Expand Down
2 changes: 1 addition & 1 deletion main/auth/sort_my_courses.php
Expand Up @@ -223,7 +223,7 @@ function generateUnsubscribeForm(string $courseCode, string $secToken): string
);
$form->addHidden('action', 'unsubscribe');
$form->addHidden('sec_token', $secToken);
$form->addHidden('unsubscribe', $courseCode);
$form->addHidden('course_code', $courseCode);
$form->addButton('unsub', get_lang('Unsubscribe'));

return $form->returnForm();
Expand Down
2 changes: 1 addition & 1 deletion main/inc/lib/course.lib.php
Expand Up @@ -5425,7 +5425,7 @@ public static function processHotCourseItem($courses, $codeList = [])
$my_course['unsubscribe_button'] = Display::url(
get_lang('Unreg').' '.
Display::returnFontAwesomeIcon('sign-out'),
api_get_path(WEB_CODE_PATH).'auth/courses.php?action=unsubscribe&unsubscribe='.$courseCode
api_get_path(WEB_CODE_PATH).'auth/courses.php?action=unsubscribe&=course_code'.$courseCode
.'&sec_token='.$stok.'&category_code='.$categoryCode,
[
'class' => 'btn btn-danger btn-sm',
Expand Down

0 comments on commit 51c72b2

Please sign in to comment.