Fix "user not allowed" when checking user career diagram BT#18720

pull/3891/head
Julio Montoya 4 years ago
parent 1557d10434
commit 432443ee8b
  1. 8
      main/inc/lib/MyStudents.php
  2. 2
      main/user/career_diagram.php

@ -18,10 +18,10 @@ class MyStudents
$title = Display::page_subheader(get_lang('Careers'), null, 'h3', ['class' => 'section-title']);
return $title.self::getCareersTable($careers);
return $title.self::getCareersTable($careers, $studentId);
}
public static function getCareersTable(array $careers): string
public static function getCareersTable(array $careers, int $studentId): string
{
if (empty($careers)) {
return '';
@ -36,8 +36,8 @@ class MyStudents
];
$data = array_map(
function (array $careerInfo) use ($webCodePath, $iconDiagram) {
$url = $webCodePath.'user/career_diagram.php?career_id='.$careerInfo['id'];
function (array $careerInfo) use ($webCodePath, $iconDiagram, $studentId) {
$url = $webCodePath.'user/career_diagram.php?career_id='.$careerInfo['id'].'&user_id='.$studentId;
return [
$careerInfo['name'],

@ -13,7 +13,7 @@ ALTER TABLE extra_field_values modify column value longtext null;
require_once __DIR__.'/../inc/global.inc.php';
if (api_get_configuration_value('allow_career_diagram') == false) {
if (api_get_configuration_value('allow_career_diagram') === false) {
api_not_allowed(true);
}

Loading…
Cancel
Save