Replacing "l" (link) with "i" (item) see #5851

skala
Julio Montoya 12 years ago
parent 29d5312491
commit 199d41dccc
  1. 11
      main/survey/link.php
  2. 6
      main/survey/survey.lib.php

@ -8,20 +8,17 @@ if (!api_is_allowed_to_edit(false, true)) {
api_not_allowed(true);
}*/
$survey_id = isset($_REQUEST['l']) ? intval($_REQUEST['l']) : null;
$survey_id = isset($_REQUEST['i']) ? intval($_REQUEST['i']) : null;
if (empty($survey_id)) {
api_not_allowed(true);
}
//Display::display_header(get_lang('Survey'), 'Survey');
if (!survey_manager::survey_generation_hash_available()) {
api_not_allowed(true);
}
$course_info = api_get_course_info_by_id($_REQUEST['c']);
$hash_is_valid = survey_manager::validate_survey_hash($_REQUEST['l'], $_REQUEST['c'], $_REQUEST['s'], $_REQUEST['g'], $_REQUEST['h']);
$hash_is_valid = survey_manager::validate_survey_hash($survey_id, $_REQUEST['c'], $_REQUEST['s'], $_REQUEST['g'], $_REQUEST['h']);
if ($hash_is_valid && $course_info) {
$survey_data = survey_manager::get_survey($survey_id, null, $course_info['code']);
@ -41,11 +38,7 @@ if ($hash_is_valid && $course_info) {
$link = api_get_path(WEB_CODE_PATH).'survey/fillsurvey.php?invitationcode='.$invitation_code.'&course='.$course_info['code'];
header('Location: '.$link);
exit;
//echo Display::url(get_lang('Go'), $link, array('class' => 'btn btn-primary btn-large'));
//echo ' '.Display::url(get_lang('Regenerate'), $link, array('class' => 'btn btn-primary btn-large'));
//echo "<pre>$link</pre>";
}
} else {
api_not_allowed(true);
}

@ -1279,11 +1279,7 @@ class survey_manager {
static function generate_survey_link($survey_id, $course_id, $session_id, $group_id) {
$code = self::generate_survey_hash($survey_id, $course_id, $session_id, $group_id);
return api_get_path(WEB_CODE_PATH).'survey/link.php?h='.$code.'&l='.$survey_id.'&c='.intval($course_id).'&s='.intval($session_id).'&g='.$group_id;
}
static function hash_is_valid($hash) {
return api_get_path(WEB_CODE_PATH).'survey/link.php?h='.$code.'&i='.$survey_id.'&c='.intval($course_id).'&s='.intval($session_id).'&g='.$group_id;
}
}

Loading…
Cancel
Save