Skip to content

Commit

Permalink
Careers: redirect to user/career_diagram BT#18720
Browse files Browse the repository at this point in the history
  • Loading branch information
jmontoyaa committed May 28, 2021
1 parent f7f9357 commit 4ccbad2
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions main/admin/career_diagram.php
Expand Up @@ -14,21 +14,30 @@
$cidReset = true;
require_once __DIR__.'/../inc/global.inc.php';

if (api_get_configuration_value('allow_career_diagram') == false) {
if (false === api_get_configuration_value('allow_career_diagram')) {
api_not_allowed(true);
}

$careerId = isset($_GET['id']) ? (int) $_GET['id'] : 0;
//$userId = isset($_GET['user_id']) ? $_GET['user_id'] : api_get_user_id();

if (empty($careerId)) {
api_not_allowed(true);
}

// Redirect to user/career_diagram.php if not admin/drh BT#18720
if (!(api_is_platform_admin() || api_is_drh())) {
$url = api_get_path(WEB_CODE_PATH).'user/career_diagram.php?career_id='.$careerId;
api_location($url);
}

$this_section = SECTION_PLATFORM_ADMIN;

$allowCareer = api_get_configuration_value('allow_session_admin_read_careers');
api_protect_admin_script($allowCareer);

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

$careerId = isset($_GET['id']) ? $_GET['id'] : 0;
if (empty($careerId)) {
api_not_allowed(true);
}

$career = new Career();
$careerInfo = $career->get($careerId);
Expand Down

0 comments on commit 4ccbad2

Please sign in to comment.