diff --git a/main/document/edit_draw.php b/main/document/edit_draw.php index 4f10c7f236..3ecafe8958 100755 --- a/main/document/edit_draw.php +++ b/main/document/edit_draw.php @@ -14,7 +14,7 @@ require_once '../inc/global.inc.php'; $_SESSION['whereami'] = 'document/editdraw'; $this_section = SECTION_COURSES; -api_protect_course_script(); +api_protect_course_script(true); api_block_anonymous_users(); $document_data = DocumentManager::get_document_data_by_id($_GET['id'], api_get_course_id(), true); diff --git a/main/document/edit_paint.php b/main/document/edit_paint.php index a175f55dfb..86a3db2254 100755 --- a/main/document/edit_paint.php +++ b/main/document/edit_paint.php @@ -14,7 +14,7 @@ require_once '../inc/global.inc.php'; $_SESSION['whereami'] = 'document/editpaint'; $this_section = SECTION_COURSES; -api_protect_course_script(); +api_protect_course_script(true); api_block_anonymous_users(); $groupId = api_get_group_id(); $document_data = DocumentManager::get_document_data_by_id( diff --git a/main/document/exit_pixlr.php b/main/document/exit_pixlr.php index a8e3bc6f0e..49b4724f7d 100755 --- a/main/document/exit_pixlr.php +++ b/main/document/exit_pixlr.php @@ -11,7 +11,7 @@ */ require_once '../inc/global.inc.php'; -api_protect_course_script(); +api_protect_course_script(true); api_block_anonymous_users(); //delete temporal file diff --git a/main/gradebook/gradebook_add_eval.php b/main/gradebook/gradebook_add_eval.php index ecd48a1a92..c3dd2395d6 100755 --- a/main/gradebook/gradebook_add_eval.php +++ b/main/gradebook/gradebook_add_eval.php @@ -8,7 +8,7 @@ require_once '../inc/global.inc.php'; $current_course_tool = TOOL_GRADEBOOK; -api_protect_course_script(); +api_protect_course_script(true); api_block_anonymous_users(); GradebookUtils::block_students(); diff --git a/main/gradebook/gradebook_add_link.php b/main/gradebook/gradebook_add_link.php index a49f5fe9dd..58e7a20957 100755 --- a/main/gradebook/gradebook_add_link.php +++ b/main/gradebook/gradebook_add_link.php @@ -9,7 +9,7 @@ require_once '../inc/global.inc.php'; require_once '../forum/forumfunction.inc.php'; $current_course_tool = TOOL_GRADEBOOK; -api_protect_course_script(); +api_protect_course_script(true); api_block_anonymous_users(); GradebookUtils::block_students(); diff --git a/main/gradebook/gradebook_add_link_select_course.php b/main/gradebook/gradebook_add_link_select_course.php index 1f03c162c7..b9a063e6a3 100755 --- a/main/gradebook/gradebook_add_link_select_course.php +++ b/main/gradebook/gradebook_add_link_select_course.php @@ -9,7 +9,7 @@ require_once '../inc/global.inc.php'; $current_course_tool = TOOL_GRADEBOOK; -api_protect_course_script(); +api_protect_course_script(true); api_block_anonymous_users(); GradebookUtils::block_students(); diff --git a/main/gradebook/gradebook_add_result.php b/main/gradebook/gradebook_add_result.php index 4233e6538f..f62f6c38ad 100755 --- a/main/gradebook/gradebook_add_result.php +++ b/main/gradebook/gradebook_add_result.php @@ -9,7 +9,7 @@ require_once '../inc/global.inc.php'; $current_course_tool = TOOL_GRADEBOOK; -api_protect_course_script(); +api_protect_course_script(true); api_block_anonymous_users(); GradebookUtils::block_students(); diff --git a/main/gradebook/gradebook_display_certificate.php b/main/gradebook/gradebook_display_certificate.php index b91350e250..c44f150c1b 100755 --- a/main/gradebook/gradebook_display_certificate.php +++ b/main/gradebook/gradebook_display_certificate.php @@ -9,7 +9,7 @@ require_once '../inc/global.inc.php'; $current_course_tool = TOOL_GRADEBOOK; if (!api_is_student_boss()) { - api_protect_course_script(); + api_protect_course_script(true); } set_time_limit(0); diff --git a/main/gradebook/gradebook_edit_all.php b/main/gradebook/gradebook_edit_all.php index f50e716a1b..7af15b4fd3 100755 --- a/main/gradebook/gradebook_edit_all.php +++ b/main/gradebook/gradebook_edit_all.php @@ -12,7 +12,7 @@ require_once '../inc/global.inc.php'; $this_section = SECTION_COURSES; $current_course_tool = TOOL_GRADEBOOK; -api_protect_course_script(); +api_protect_course_script(true); api_block_anonymous_users(); if (!api_is_allowed_to_edit()) { diff --git a/main/gradebook/gradebook_flatview.php b/main/gradebook/gradebook_flatview.php index 8cf81c034d..0beae31dae 100755 --- a/main/gradebook/gradebook_flatview.php +++ b/main/gradebook/gradebook_flatview.php @@ -8,7 +8,7 @@ require_once '../inc/global.inc.php'; $current_course_tool = TOOL_GRADEBOOK; -api_protect_course_script(); +api_protect_course_script(true); api_block_anonymous_users(); $isDrhOfCourse = CourseManager::isUserSubscribedInCourseAsDrh( @@ -199,7 +199,9 @@ if (isset($_GET['print'])) { exit; } -if (!empty($_GET['export_report']) && $_GET['export_report'] == 'export_report') { +if (!empty($_GET['export_report']) && + $_GET['export_report'] == 'export_report' +) { if (api_is_platform_admin() || api_is_course_admin() || api_is_course_coach() || $isDrhOfCourse) { $user_id = null; diff --git a/main/gradebook/index.php b/main/gradebook/index.php index 054bbfa58a..d851972784 100755 --- a/main/gradebook/index.php +++ b/main/gradebook/index.php @@ -12,7 +12,7 @@ $_in_course = true; require_once '../inc/global.inc.php'; $current_course_tool = TOOL_GRADEBOOK; -api_protect_course_script(); +api_protect_course_script(true); $course_code = api_get_course_id(); $stud_id = api_get_user_id(); diff --git a/main/user/class.php b/main/user/class.php index 766d282e21..7c75171b11 100755 --- a/main/user/class.php +++ b/main/user/class.php @@ -3,13 +3,11 @@ /** * @package chamilo.user */ -/** - * INIT SECTION - */ + require_once '../inc/global.inc.php'; $this_section = SECTION_COURSES; -api_protect_course_script(); +api_protect_course_script(true); if (api_get_setting('allow_user_course_subscription_by_course_admin') == 'false') { if (!api_is_platform_admin()) { @@ -34,7 +32,7 @@ $usergroup = new UserGroup(); if (api_is_allowed_to_edit()) { echo '
'; if ($type == 'registered') { - echo ''.Display::return_icon('add.png', get_lang("AddClassesToACourse"), array(), ICON_SIZE_MEDIUM).''; + echo ''.Display::return_icon('add.png', get_lang("AddClassesToACourse"), array(), ICON_SIZE_MEDIUM).''; } else { echo ''.Display::return_icon('empty_evaluation.png', get_lang("Classes"), array(), ICON_SIZE_MEDIUM).''; } @@ -53,7 +51,7 @@ if (api_is_allowed_to_edit()) { } break; case 'remove_class_from_course': - $id = $_GET['id']; + $id = $_GET['id']; if (!empty($id)) { $usergroup->unsubscribe_courses_from_usergroup($id, array(api_get_course_int_id())); } @@ -70,8 +68,8 @@ $columns = array(get_lang('Name'), get_lang('Users'), get_lang('Actions')); //Column config $column_model = array( - array('name'=>'name', 'index'=>'name', 'width'=>'35', 'align'=>'left'), - array('name'=>'users', 'index'=>'users', 'width'=>'15', 'align'=>'left'), + array('name'=>'name', 'index'=>'name', 'width'=>'35', 'align'=>'left'), + array('name'=>'users', 'index'=>'users', 'width'=>'15', 'align'=>'left'), array('name'=>'actions', 'index'=>'actions', 'width'=>'20', 'align'=>'left','sortable'=>'false'), ); //Autowidth @@ -83,7 +81,7 @@ $extra_params['height'] = 'auto'; //With this function we can add actions to the jgrid $action_links = 'function action_formatter (cellvalue, options, rowObject) { return \'' - .' ' + .' ' .' \'; }'; ?> @@ -97,4 +95,4 @@ $(function() { display_teacher_view(); -Display :: display_footer(); \ No newline at end of file +Display :: display_footer();