Remove $_SESSION calls

pull/2487/head
jmontoyaa 8 years ago
parent 4ef5fb21bd
commit d59fa038e1
  1. 5
      main/dashboard/index.php
  2. 6
      main/exercise/exercise_reminder.php
  3. 2
      main/exercise/exercise_result.php
  4. 2
      main/exercise/exercise_show.php
  5. 5
      main/gradebook/gradebook_display_summary.php
  6. 13
      main/gradebook/index.php
  7. 8
      main/gradebook/lib/fe/gradebooktable.class.php
  8. 11
      main/inc/ajax/sequence.ajax.php
  9. 9
      main/inc/lib/api.lib.php
  10. 6
      main/inc/lib/javascript/svgedit/svg-editor.php

@ -1,5 +1,8 @@
<?php
/* For licensing terms, see /license.txt */
use ChamiloSession as Session;
/**
* Template (front controller in MVC pattern) used for distpaching to
* the controllers depend on the current action
@ -20,7 +23,7 @@ api_block_anonymous_users();
// current section
$this_section = SECTION_DASHBOARD;
unset($_SESSION['this_section']); //for hmtl editor repository
Session::erase('this_section'); //for hmtl editor repository
// get actions
$actions = array('listing', 'store_user_block', 'disable_block');

@ -95,12 +95,10 @@ if ($time_control) {
$exe_id = 0;
if (isset($_GET['exe_id'])) {
$exe_id = (int) $_GET['exe_id'];
$_SESSION['exe_id'] = $exe_id;
Session::write('exe_id', $exe_id);
}
if (isset($_SESSION['exe_id'])) {
$exe_id = intval($_SESSION['exe_id']);
}
$exe_id = (int) Session::read('exe_id');
$exercise_stat_info = $objExercise->get_stat_track_exercise_info_by_exe_id($exe_id);
if (!empty($exercise_stat_info['data_tracking'])) {

@ -204,7 +204,7 @@ if ($origin != 'learnpath') {
}
Display::display_footer();
} else {
$lp_mode = isset($_SESSION['lp_mode']) ? $_SESSION['lp_mode'] : null;
$lp_mode = Session::read('lp_mode');
$url = '../lp/lp_controller.php?'.api_get_cidreq().'&action=view&lp_id='.$learnpath_id.'&lp_item_id='.$learnpath_item_id.'&exeId='.$exercise_stat_info['exe_id'].'&fb_type='.$objExercise->feedback_type.'#atoc_'.$learnpath_item_id;
$href = $lp_mode == 'fullscreen' ? ' window.opener.location.href="'.$url.'" ' : ' top.location.href="'.$url.'"';

@ -1068,7 +1068,7 @@ if ($origin != 'learnpath') {
Display::display_footer();
} else {
if (!isset($_GET['fb_type'])) {
$lp_mode = $_SESSION['lp_mode'];
$lp_mode = Session::read('lp_mode');
$url = '../lp/lp_controller.php?'.api_get_cidreq().'&';
$url .= http_build_url([
'action' => 'view',

@ -12,14 +12,11 @@ require_once __DIR__.'/../inc/global.inc.php';
$current_course_tool = TOOL_GRADEBOOK;
api_protect_course_script();
set_time_limit(0);
ini_set('max_execution_time', 0);
api_block_anonymous_users();
if (!api_is_allowed_to_edit()) {
api_not_allowed(true);
}
GradebookUtils::block_students();
$cat_id = isset($_GET['selectcat']) ? (int) $_GET['selectcat'] : null;
$action = isset($_GET['action']) && $_GET['action'] ? $_GET['action'] : null;

@ -122,13 +122,12 @@ if (empty($cats)) {
$selectCat = (int) $cats[0]->get_id();
$_GET['selectcat'] = $selectCat;
if (isset($_GET['isStudentView'])) {
if ($selectCat > 0 && (isset($_SESSION['studentview']) && $_SESSION['studentview'] == 'true')) {
$interbreadcrumb[] = array(
'url' => 'index.php'.'?selectcat=0&isStudentView=true',
'name' => get_lang('ToolGradebook'),
);
}
$isStudentView = api_is_student_view_active();
if ($selectCat > 0 && $isStudentView) {
$interbreadcrumb[] = array(
'url' => 'index.php?selectcat=0&isStudentView=true',
'name' => get_lang('ToolGradebook'),
);
}
// ACTIONS

@ -986,12 +986,10 @@ class GradebookTable extends SortableTable
// category
case 'C':
$prms_uri = '?selectcat='.$item->get_id().'&view='.$view;
if (isset($_GET['isStudentView'])) {
if (isset($is_student) || (isset($_SESSION['studentview']) && $_SESSION['studentview'] == 'studentview')) {
$prms_uri = $prms_uri.'&amp;isStudentView='.Security::remove_XSS($_GET['isStudentView']);
}
$isStudentView = api_is_student_view_active();
if (isset($is_student) || $isStudentView) {
$prms_uri = $prms_uri.'&amp;isStudentView=studentview';
}
$cat = new Category();
$show_message = $cat->show_message_resource_delete($item->get_course_code());

@ -1,6 +1,7 @@
<?php
/* For licensing terms, see /license.txt */
use ChamiloSession as Session;
use Chamilo\CoreBundle\Entity\Sequence;
use Chamilo\CoreBundle\Entity\SequenceResource;
use Fhaculty\Graph\Graph;
@ -146,7 +147,7 @@ switch ($action) {
}
if ($vertexFromTo && !$vertexToFrom) {
$_SESSION['sr_vertex'] = true;
Session::write('sr_vertex', true);
$vertex = $graph->getVertex($id);
$vertex->destroy();
$em->remove($sequenceResource);
@ -171,7 +172,7 @@ switch ($action) {
}
if (!$vertexToFrom && !$vertexFromTo) {
$_SESSION['sr_vertex'] = true;
Session::write('sr_vertex', true);
$vertexTo = $graph->getVertex($id);
$vertexFrom = $graph->getVertex($vertexId);
if ($vertexTo->getVerticesEdgeFrom()->count() > 1) {
@ -283,9 +284,9 @@ switch ($action) {
if (empty($sequence)) {
exit;
}
if (isset($_SESSION['sr_vertex']) && $_SESSION['sr_vertex']) {
unset($_SESSION['sr_vertex']);
$vertexFromSession = Session::read('sr_vertex');
if ($vertexFromSession) {
Session::erase('sr_vertex');
echo Display::return_message(get_lang('Saved'), 'success');
break;
}

@ -2675,9 +2675,7 @@ function api_is_coach($session_id = 0, $courseId = null, $check_student_view = t
}
// The student preview was on
if ($check_student_view &&
isset($_SESSION['studentview']) && $_SESSION['studentview'] == "studentview"
) {
if ($check_student_view && api_is_student_view_active()) {
return false;
}
@ -2956,10 +2954,7 @@ function api_is_allowed_to_edit(
// Admins can edit anything.
if (api_is_platform_admin(false)) {
//The student preview was on
if ($check_student_view &&
isset($_SESSION['studentview']) &&
$_SESSION['studentview'] == "studentview"
) {
if ($check_student_view && api_is_student_view_active()) {
return false;
} else {
return true;

@ -1,4 +1,7 @@
<?php
use ChamiloSession as Session;
/**
* Integrate svg-edit with Chamilo
* @author Juan Carlos Raña Trabado
@ -9,7 +12,8 @@ require_once '../../../../inc/global.inc.php';//hack for Chamilo
api_protect_course_script();
api_block_anonymous_users();
if (!isset($_SESSION['draw_dir'])) {
$drawDir = Session::read('draw_dir');
if (empty($drawDir)) {
die();
}
$svgEditPath = api_get_path(WEB_LIBRARY_PATH).'javascript/svgedit/';

Loading…
Cancel
Save