diff --git a/main/document/download.php b/main/document/download.php index 8cfe588620..81a82b4ac5 100755 --- a/main/document/download.php +++ b/main/document/download.php @@ -2,6 +2,8 @@ /* For licensing terms, see /license.txt */ +use ChamiloSession as Session; + /** * This file is responsible for passing requested documents to the browser. * Many functions updated and moved to lib/document.lib.php. @@ -49,6 +51,9 @@ if (substr($refer_script, 0, 15) === '/fillsurvey.php') { $course = isset($queryParts['course']) ? $queryParts['course'] : ''; $invitation = isset($queryParts['invitationcode']) ? $queryParts['invitationcode'] : ''; include '../survey/survey.download.inc.php'; + if ('auto' === $invitation && $queryParts['scode']) { + $invitation = Session::read('auto_invitation_code_'.$queryParts['scode']); + } $_course = check_download_survey($course, $invitation, $doc_url); $_course['path'] = $_course['directory']; } else { diff --git a/main/survey/fillsurvey.php b/main/survey/fillsurvey.php index e5c0c5630d..ded5d6b2c1 100755 --- a/main/survey/fillsurvey.php +++ b/main/survey/fillsurvey.php @@ -145,6 +145,7 @@ if ('auto' === $invitationcode && isset($_GET['scode'])) { } // From here we use the new invitationcode auto-userid-surveycode string $_GET['invitationcode'] = $autoInvitationcode; + Session::write('auto_invitation_code_'.$surveyCode, $autoInvitationcode); $invitationcode = $autoInvitationcode; } } @@ -574,6 +575,8 @@ if ( // The first thing we do is delete the session Session::erase('paged_questions'); Session::erase('page_questions_sec'); + Session::erase('auto_invitation_code_'.$survey_data['code']); + $paged_questions_sec = []; if (!empty($survey_data['survey_introduction'])) { echo '