Skip to content

Commit 4ccbad2

Browse files
committed
Careers: redirect to user/career_diagram BT#18720
1 parent f7f9357 commit 4ccbad2

File tree

1 file changed

+14
-5
lines changed

1 file changed

+14
-5
lines changed

main/admin/career_diagram.php

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,21 +14,30 @@
1414
$cidReset = true;
1515
require_once __DIR__.'/../inc/global.inc.php';
1616

17-
if (api_get_configuration_value('allow_career_diagram') == false) {
17+
if (false === api_get_configuration_value('allow_career_diagram')) {
1818
api_not_allowed(true);
1919
}
2020

21+
$careerId = isset($_GET['id']) ? (int) $_GET['id'] : 0;
22+
//$userId = isset($_GET['user_id']) ? $_GET['user_id'] : api_get_user_id();
23+
24+
if (empty($careerId)) {
25+
api_not_allowed(true);
26+
}
27+
28+
// Redirect to user/career_diagram.php if not admin/drh BT#18720
29+
if (!(api_is_platform_admin() || api_is_drh())) {
30+
$url = api_get_path(WEB_CODE_PATH).'user/career_diagram.php?career_id='.$careerId;
31+
api_location($url);
32+
}
33+
2134
$this_section = SECTION_PLATFORM_ADMIN;
2235

2336
$allowCareer = api_get_configuration_value('allow_session_admin_read_careers');
2437
api_protect_admin_script($allowCareer);
2538

2639
$htmlHeadXtra[] = api_get_js('jsplumb2.js');
2740

28-
$careerId = isset($_GET['id']) ? $_GET['id'] : 0;
29-
if (empty($careerId)) {
30-
api_not_allowed(true);
31-
}
3241

3342
$career = new Career();
3443
$careerInfo = $career->get($careerId);

0 commit comments

Comments
 (0)