Skip to content

Commit

Permalink
Block page for unauthorized users.
Browse files Browse the repository at this point in the history
  • Loading branch information
jmontoyaa committed Apr 18, 2018
1 parent fdc6933 commit 76fbb2b
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 5 deletions.
8 changes: 8 additions & 0 deletions main/inc/ajax/myspace.ajax.php
Expand Up @@ -7,6 +7,14 @@
require_once __DIR__.'/../global.inc.php';
$action = $_GET['a'];

// Access restrictions.
$is_allowedToTrack = api_is_platform_admin(true, true) ||
api_is_allowed_to_create_course() || api_is_course_tutor();

if (!$is_allowedToTrack) {
exit;
}

switch ($action) {
// At this date : 23/02/2017, a minor review can't determine where is used this case 'access_detail'
case 'access_detail':
Expand Down
11 changes: 11 additions & 0 deletions main/mySpace/access_details.php
Expand Up @@ -18,6 +18,17 @@

api_block_anonymous_users();


// Access restrictions.
$is_allowedToTrack = api_is_platform_admin(true, true) ||
api_is_allowed_to_create_course() || api_is_course_tutor();

if (!$is_allowedToTrack) {
api_not_allowed(true);
exit;
}


// the section (for the tabs)
$this_section = SECTION_TRACKING;

Expand Down
2 changes: 2 additions & 0 deletions main/social/vcard_export.php
Expand Up @@ -14,6 +14,8 @@

api_block_anonymous_users();

api_protect_admin_script();

if (isset($_REQUEST['userId'])) {
$userId = intval($_REQUEST['userId']);
} else {
Expand Down
3 changes: 1 addition & 2 deletions main/tracking/courseLog.php
Expand Up @@ -380,7 +380,6 @@ function(index) {

$all_datas = [];
$course_code = $_course['id'];

$user_ids = array_keys($a_students);

$table = new SortableTable(
Expand All @@ -390,7 +389,7 @@ function(index) {
(api_is_western_name_order() xor api_sort_by_first_name()) ? 3 : 2
);

$parameters['cidReq'] = Security::remove_XSS($_GET['cidReq']);
$parameters['cidReq'] = isset($_GET['cidReq']) ? Security::remove_XSS($_GET['cidReq']) : '';
$parameters['id_session'] = $session_id;
$parameters['from'] = isset($_GET['myspace']) ? Security::remove_XSS($_GET['myspace']) : null;

Expand Down
7 changes: 4 additions & 3 deletions main/tracking/course_log_tools.php
Expand Up @@ -22,11 +22,12 @@
}

// Access restrictions.
$is_allowedToTrack = api_is_platform_admin() || api_is_allowed_to_create_course() ||
api_is_session_admin() || api_is_drh() || api_is_course_tutor();
$is_allowedToTrack = api_is_platform_admin(true, true) ||
api_is_allowed_to_create_course() ||
api_is_course_tutor();

if (!$is_allowedToTrack) {
api_not_allowed();
api_not_allowed(true);
exit;
}

Expand Down

0 comments on commit 76fbb2b

Please sign in to comment.