From a5aa68413c8e415e533c7841d5b802ae6daedd0b Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 3 Feb 2014 14:28:57 -0500 Subject: [PATCH 1/2] Fixing $token in mystudents.php -refs #6930 --- main/mySpace/myStudents.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/main/mySpace/myStudents.php b/main/mySpace/myStudents.php index a8a4643c78..f904e63c61 100644 --- a/main/mySpace/myStudents.php +++ b/main/mySpace/myStudents.php @@ -180,18 +180,17 @@ if (empty($session_id)) { $student_id = intval($_GET['student']); -$token = Security::get_token(); - // Action behaviour $check = Security::check_token('get'); if ($check) { switch ($_GET['action']) { case 'reset_lp' : - $course = isset($_GET['course']) ? $_GET['course']:""; + $course = isset($_GET['course']) ? $_GET['course']:""; $lp_id = isset($_GET['lp_id']) ? intval($_GET['lp_id']):""; if (api_is_allowed_to_edit() && !empty($course) && !empty($lp_id) && !empty($student_id)) { + $course_info = api_get_course_info($course); delete_student_lp_events($student_id, $lp_id, $course_info, $session_id); @@ -304,8 +303,9 @@ if (isset($message)) { echo $message; } +$token = Security::get_token(); if (!empty($student_id)) { - + // Actions bar echo '
'; echo ''.Display::return_icon('back.png', get_lang('Back'),'',ICON_SIZE_MEDIUM).''; From b1f90f524dddfffd5e5ac1cb06f0b77b5d9c2c90 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 3 Feb 2014 15:01:21 -0500 Subject: [PATCH 2/2] Indentation --- main/mySpace/myStudents.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/main/mySpace/myStudents.php b/main/mySpace/myStudents.php index f904e63c61..5fbcd94b2a 100644 --- a/main/mySpace/myStudents.php +++ b/main/mySpace/myStudents.php @@ -186,12 +186,11 @@ $check = Security::check_token('get'); if ($check) { switch ($_GET['action']) { case 'reset_lp' : - $course = isset($_GET['course']) ? $_GET['course']:""; + $course = isset($_GET['course']) ? $_GET['course']:""; $lp_id = isset($_GET['lp_id']) ? intval($_GET['lp_id']):""; if (api_is_allowed_to_edit() && !empty($course) && !empty($lp_id) && !empty($student_id)) { - - $course_info = api_get_course_info($course); + $course_info = api_get_course_info($course); delete_student_lp_events($student_id, $lp_id, $course_info, $session_id); //@todo delete the stats.track_e_exercices records. First implement this http://support.chamilo.org/issues/1334