Browse Source

Adding anonymous survey link generation (disabling api_is_allowed_to_edit) see #5851

Julio Montoya 12 years ago
parent
commit
21af874ebc
2 changed files with 8 additions and 2 deletions
  1. 6 1
      main/survey/generate_link.php
  2. 2 1
      main/survey/link.php

+ 6 - 1
main/survey/generate_link.php

@@ -9,7 +9,7 @@ if (!api_is_allowed_to_edit(false, true)) {
 
 $survey_id = isset($_REQUEST['survey_id']) ? intval($_REQUEST['survey_id']) : null;
 
-if (empty($survey_id)) {
+if (empty($suvrey_id)) {
     api_not_allowed(true);
 }
 $survey_data = survey_manager::get_survey($survey_id);
@@ -30,5 +30,10 @@ echo '<div class="row">';
     echo '</div>';
     echo '<div class="span12">';
     echo get_lang('GenerateSurveyLinkExplanation');
+
+    echo '<pre>';
+    echo  $link;
+    echo '</pre>';
+
     echo '</div>';
 echo '</div>';

+ 2 - 1
main/survey/link.php

@@ -2,9 +2,10 @@
 
 require_once '../inc/global.inc.php';
 
+/*
 if (!api_is_allowed_to_edit(false, true)) {
     api_not_allowed(true);
-}
+}*/
 
 $survey_id = isset($_REQUEST['l']) ? intval($_REQUEST['l']) : null;