Browse Source

[svn r10584] cleanup

Patrick Cool 18 years ago
parent
commit
d5591be9dc

+ 6 - 2
main/survey/create_new_group.php

@@ -20,7 +20,7 @@
 /**
 *	@package dokeos.survey
 * 	@author 
-* 	@version $Id: create_new_group.php 10583 2007-01-02 14:47:19Z pcool $
+* 	@version $Id: create_new_group.php 10584 2007-01-02 15:09:21Z pcool $
 */
 
 /*
@@ -31,8 +31,12 @@
 // name of the language file that needs to be included 
 $language_file = 'survey';
 
+// including the global dokeos file
 require_once ('../inc/global.inc.php');
-//api_protect_admin_script();
+
+// including additional libraries
+/** @todo check if these are all needed */
+/** @todo check if the starting / is needed. api_get_path probably ends with an / */
 require_once (api_get_path(LIBRARY_PATH).'/fileManage.lib.php');
 require_once (api_get_path(CONFIGURATION_PATH) ."/add_course.conf.php");
 require_once (api_get_path(LIBRARY_PATH)."/add_course.lib.inc.php");

+ 5 - 11
main/survey/create_new_survey.php

@@ -20,24 +20,18 @@
 /**
 *	@package dokeos.survey
 * 	@author 
-* 	@version $Id: create_new_survey.php 10583 2007-01-02 14:47:19Z pcool $
+* 	@version $Id: create_new_survey.php 10584 2007-01-02 15:09:21Z pcool $
 */
 
-/*
-==============================================================================
-		INIT SECTION
-==============================================================================
-*/
 // name of the language file that needs to be included 
 $language_file = 'survey';
 
-/*
------------------------------------------------------------
-	Including necessary files
------------------------------------------------------------
-*/
+// including the global dokeos file
 require_once ('../inc/global.inc.php');
 
+// including additional libraries
+/** @todo check if these are all needed */
+/** @todo check if the starting / is needed. api_get_path probably ends with an / */
 require_once (api_get_path(LIBRARY_PATH).'/fileManage.lib.php');
 require_once (api_get_path(CONFIGURATION_PATH) ."/add_course.conf.php");
 require_once (api_get_path(LIBRARY_PATH)."/add_course.lib.inc.php");

+ 26 - 2
main/survey/create_survey.php

@@ -20,7 +20,7 @@
 /**
 *	@package dokeos.survey
 * 	@author 
-* 	@version $Id: create_survey.php 10559 2006-12-27 10:52:50Z pcool $
+* 	@version $Id: create_survey.php 10584 2007-01-02 15:09:21Z pcool $
 */
 
 /*
@@ -31,12 +31,36 @@
 // name of the language file that needs to be included 
 $language_file = 'admin';
 
+// including the global dokeos file
 require_once ('../inc/global.inc.php');
-api_protect_admin_script();
+
+// including additional libraries
+/** @todo check if these are all needed */
+/** @todo check if the starting / is needed. api_get_path probably ends with an / */
 require_once (api_get_path(LIBRARY_PATH).'/fileManage.lib.php');
 require_once (api_get_path(CONFIGURATION_PATH) ."/add_course.conf.php");
 require_once (api_get_path(LIBRARY_PATH)."/add_course.lib.inc.php");
 require_once (api_get_path(LIBRARY_PATH)."/surveymanager.lib.php");
+
+/** @todo replace this with the correct code */
+/*
+$status = surveymanager::get_status();
+api_protect_course_script();
+if($status==5)
+{
+	api_protect_admin_script();
+}
+*/
+/** @todo this has to be moved to a more appropriate place (after the display_header of the code)*/
+if (!api_is_allowed_to_edit())
+{
+	Display :: display_header();
+	Display :: display_error_message(get_lang('NotAllowedHere'));
+	Display :: display_footer();
+	exit;
+}
+
+
 //$table_category = Database :: get_main_table(TABLE_MAIN_CATEGORY);
 $table_survey = Database :: get_main_table(MAIN_SURVEY_IFA_TABLE);
 $table_course = Database::get_main_table(TABLE_MAIN_COURSE);

+ 23 - 8
main/survey/create_survey_in_another_language.php

@@ -20,7 +20,7 @@
 /**
 *	@package dokeos.survey
 * 	@author 
-* 	@version $Id: create_survey_in_another_language.php 10549 2006-12-24 16:08:47Z pcool $
+* 	@version $Id: create_survey_in_another_language.php 10584 2007-01-02 15:09:21Z pcool $
 */
 
 /*
@@ -31,15 +31,12 @@
 // name of the language file that needs to be included 
 $language_file = 'survey';
 
+// including the global dokeos file
 require_once ('../inc/global.inc.php');
 
-api_protect_course_script();
-if(!api_is_allowed_to_edit())
-{
-	api_protect_admin_script();
-}
-
-
+// including additional libraries
+/** @todo check if these are all needed */
+/** @todo check if the starting / is needed. api_get_path probably ends with an / */
 require_once (api_get_path(LIBRARY_PATH)."/course.lib.php");
 require (api_get_path(LIBRARY_PATH)."/groupmanager.lib.php");
 require_once (api_get_path(LIBRARY_PATH).'/fileManage.lib.php');
@@ -47,6 +44,24 @@ require_once (api_get_path(CONFIGURATION_PATH) ."/add_course.conf.php");
 require_once (api_get_path(LIBRARY_PATH)."/add_course.lib.inc.php");
 require_once (api_get_path(LIBRARY_PATH)."/surveymanager.lib.php");
 
+/** @todo replace this with the correct code */
+/*
+$status = surveymanager::get_status();
+api_protect_course_script();
+if($status==5)
+{
+	api_protect_admin_script();
+}
+*/
+/** @todo this has to be moved to a more appropriate place (after the display_header of the code)*/
+if (!api_is_allowed_to_edit())
+{
+	Display :: display_header();
+	Display :: display_error_message(get_lang('NotAllowedHere'));
+	Display :: display_footer();
+	exit;
+}
+
 $cidReq = $_REQUEST['cidReq'];
 $id_survey = intval($_GET['id_survey']);
 

+ 9 - 1
main/survey/default.php

@@ -20,10 +20,18 @@
 /**
 *	@package dokeos.survey
 * 	@author 
-* 	@version $Id: default.php 10223 2006-11-27 14:45:59Z pcool $
+* 	@version $Id: default.php 10584 2007-01-02 15:09:21Z pcool $
 */
 
+// including the global dokeos file
 require_once ('../inc/global.inc.php');
+
+// including additional libraries
+/** @todo check if these are all needed */
+/** @todo check if the starting / is needed. api_get_path probably ends with an / */
+
+
+
 $surveyid = $_GET['surveyid'];
 $groupid = $_GET['groupid'];
 $cidReq = $_GET['cidReq'];

+ 8 - 2
main/survey/group_add_question.php

@@ -20,7 +20,7 @@
 /**
 *	@package dokeos.survey
 * 	@author 
-* 	@version $Id: group_add_question.php 10549 2006-12-24 16:08:47Z pcool $
+* 	@version $Id: group_add_question.php 10584 2007-01-02 15:09:21Z pcool $
 */
 
 /*
@@ -31,13 +31,19 @@
 // name of the language file that needs to be included 
 $language_file = 'survey';
 
+// including the global dokeos file
 require_once ('../inc/global.inc.php');
-api_protect_admin_script();
+
+// including additional libraries
+/** @todo check if these are all needed */
+/** @todo check if the starting / is needed. api_get_path probably ends with an / */
 require_once (api_get_path(LIBRARY_PATH).'/fileManage.lib.php');
 require_once (api_get_path(CONFIGURATION_PATH) ."/add_course.conf.php");
 require_once (api_get_path(LIBRARY_PATH)."/add_course.lib.inc.php");
 require_once (api_get_path(LIBRARY_PATH)."/surveymanager.lib.php");
 require_once (api_get_path(LIBRARY_PATH)."/usermanager.lib.php");
+
+
 $cidReq=$_GET['cidReq'];
 $table_user = Database :: get_main_table(TABLE_MAIN_USER);
 //$table_survey = Database :: get_main_table(MAIN_SURVEY_IFA_TABLE);

+ 6 - 1
main/survey/group_edit.php

@@ -20,7 +20,7 @@
 /**
 *	@package dokeos.survey
 * 	@author 
-* 	@version $Id: group_edit.php 10583 2007-01-02 14:47:19Z pcool $
+* 	@version $Id: group_edit.php 10584 2007-01-02 15:09:21Z pcool $
 */
 
 /*
@@ -31,7 +31,12 @@
 // name of the language file that needs to be included 
 $language_file = 'survey';
 
+// including the global dokeos file
 require_once ('../inc/global.inc.php');
+
+// including additional libraries
+/** @todo check if these are all needed */
+/** @todo check if the starting / is needed. api_get_path probably ends with an / */
 require_once (api_get_path(LIBRARY_PATH).'/fileManage.lib.php');
 require_once (api_get_path(CONFIGURATION_PATH) ."/add_course.conf.php");
 require_once (api_get_path(LIBRARY_PATH)."/add_course.lib.inc.php");

+ 15 - 7
main/survey/mcma.php

@@ -20,19 +20,20 @@
 /**
 *	@package dokeos.survey
 * 	@author 
-* 	@version $Id: mcma.php 10583 2007-01-02 14:47:19Z pcool $
+* 	@version $Id: mcma.php 10584 2007-01-02 15:09:21Z pcool $
 */
 
 // name of the language file that needs to be included 
 $language_file = 'survey';
 
+// including the global dokeos file
 require_once ('../inc/global.inc.php');
-//api_protect_admin_script();
+
+// including additional libraries
+/** @todo check if these are all needed */
+/** @todo check if the starting / is needed. api_get_path probably ends with an / */
 require_once ("select_question.php");
-if(isset($_REQUEST['questtype']))
-$add_question12=$_REQUEST['questtype'];
-else
-$add_question12=$_REQUEST['add_question'];
+
 require_once (api_get_path(LIBRARY_PATH).'/fileManage.lib.php');
 require_once (api_get_path(CONFIGURATION_PATH) ."/add_course.conf.php");
 require_once (api_get_path(LIBRARY_PATH)."/add_course.lib.inc.php");
@@ -58,7 +59,14 @@ if (!api_is_allowed_to_edit())
 }
 
 
-
+if(isset($_REQUEST['questtype']))
+{
+	$add_question12=$_REQUEST['questtype'];
+}
+else
+{
+	$add_question12=$_REQUEST['add_question'];
+}
 $cidReq=$_GET['cidReq'];
 $curr_dbname = $_REQUEST['curr_dbname'];
 $add_question = $_REQUEST['add_question'];

+ 6 - 2
main/survey/mcma_edit.php

@@ -20,14 +20,18 @@
 /**
 *	@package dokeos.survey
 * 	@author 
-* 	@version $Id: mcma_edit.php 10583 2007-01-02 14:47:19Z pcool $
+* 	@version $Id: mcma_edit.php 10584 2007-01-02 15:09:21Z pcool $
 */
 
 // name of the language file that needs to be included 
 $language_file = 'survey';
 
+// including the global dokeos file
 require_once ('../inc/global.inc.php');
-//api_protect_admin_script();
+
+// including additional libraries
+/** @todo check if these are all needed */
+/** @todo check if the starting / is needed. api_get_path probably ends with an / */
 require_once ("select_question.php");
 require_once (api_get_path(LIBRARY_PATH).'/fileManage.lib.php');
 require_once (api_get_path(CONFIGURATION_PATH) ."/add_course.conf.php");

+ 15 - 6
main/survey/mcsa.php

@@ -20,18 +20,19 @@
 /**
 *	@package dokeos.survey
 * 	@author 
-* 	@version $Id: mcsa.php 10583 2007-01-02 14:47:19Z pcool $
+* 	@version $Id: mcsa.php 10584 2007-01-02 15:09:21Z pcool $
 */
 
 // name of the language file that needs to be included 
 $language_file = 'survey';
 
+// including the global dokeos file
 require_once ('../inc/global.inc.php');
-//api_protect_admin_script();
-if(isset($_REQUEST['questtype']))
-$add_question12=$_REQUEST['questtype'];
-else
-$add_question12=$_REQUEST['add_question'];
+
+// including additional libraries
+/** @todo check if these are all needed */
+/** @todo check if the starting / is needed. api_get_path probably ends with an / */
+
 require_once ("select_question.php");
 require_once (api_get_path(LIBRARY_PATH).'/fileManage.lib.php');
 require_once (api_get_path(CONFIGURATION_PATH) ."/add_course.conf.php");
@@ -57,6 +58,14 @@ if (!api_is_allowed_to_edit())
 	exit;
 }
 
+if(isset($_REQUEST['questtype']))
+{
+	$add_question12=$_REQUEST['questtype'];
+}
+else
+{
+	$add_question12=$_REQUEST['add_question'];
+}
 $cidReq=$_GET['cidReq'];
 $curr_dbname = $_REQUEST['curr_dbname'];
 $add_question = $_REQUEST['add_question'];

+ 5 - 2
main/survey/mcsa_edit.php

@@ -20,15 +20,18 @@
 /**
 *	@package dokeos.survey
 * 	@author 
-* 	@version $Id: mcsa_edit.php 10583 2007-01-02 14:47:19Z pcool $
+* 	@version $Id: mcsa_edit.php 10584 2007-01-02 15:09:21Z pcool $
 */
 
 // name of the language file that needs to be included 
 $language_file = 'survey';
 
+// including the global dokeos file
 require_once ('../inc/global.inc.php');
 
-//api_protect_admin_script();
+// including additional libraries
+/** @todo check if these are all needed */
+/** @todo check if the starting / is needed. api_get_path probably ends with an / */
 require_once ("select_question.php");
 require_once (api_get_path(LIBRARY_PATH).'/fileManage.lib.php');
 require_once (api_get_path(CONFIGURATION_PATH) ."/add_course.conf.php");

+ 15 - 6
main/survey/numbered.php

@@ -20,18 +20,19 @@
 /**
 *	@package dokeos.survey
 * 	@author 
-* 	@version $Id: numbered.php 10583 2007-01-02 14:47:19Z pcool $
+* 	@version $Id: numbered.php 10584 2007-01-02 15:09:21Z pcool $
 */
 
 // name of the language file that needs to be included 
 $language_file = 'survey';
 
+// including the global dokeos file
 require_once ('../inc/global.inc.php');
-//api_protect_admin_script();
-if(isset($_REQUEST['questtype']))
-$add_question12=$_REQUEST['questtype'];
-else
-$add_question12=$_REQUEST['add_question'];
+
+// including additional libraries
+/** @todo check if these are all needed */
+/** @todo check if the starting / is needed. api_get_path probably ends with an / */
+
 require_once ("select_question.php");
 require_once (api_get_path(LIBRARY_PATH).'/fileManage.lib.php');
 require_once (api_get_path(CONFIGURATION_PATH) ."/add_course.conf.php");
@@ -57,6 +58,14 @@ if (!api_is_allowed_to_edit())
 	exit;
 }
 
+if(isset($_REQUEST['questtype']))
+{
+	$add_question12=$_REQUEST['questtype'];
+}
+else
+{
+	$add_question12=$_REQUEST['add_question'];
+}
 $cidReq=$_GET['cidReq'];
 $curr_dbname = $_REQUEST['curr_dbname'];
 $add_question = $_REQUEST['add_question'];

+ 6 - 2
main/survey/numbered_edit.php

@@ -20,14 +20,18 @@
 /**
 *	@package dokeos.survey
 * 	@author 
-* 	@version $Id: numbered_edit.php 10559 2006-12-27 10:52:50Z pcool $
+* 	@version $Id: numbered_edit.php 10584 2007-01-02 15:09:21Z pcool $
 */
 
 // name of the language file that needs to be included 
 $language_file = 'survey';
 
+// including the global dokeos file
 require_once ('../inc/global.inc.php');
-//api_protect_admin_script();
+
+// including additional libraries
+/** @todo check if these are all needed */
+/** @todo check if the starting / is needed. api_get_path probably ends with an / */
 require_once ("select_question.php");
 require_once (api_get_path(LIBRARY_PATH).'/fileManage.lib.php');
 require_once (api_get_path(CONFIGURATION_PATH) ."/add_course.conf.php");

+ 15 - 8
main/survey/open.php

@@ -20,19 +20,18 @@
 /**
 *	@package dokeos.survey
 * 	@author 
-* 	@version $Id: open.php 10583 2007-01-02 14:47:19Z pcool $
+* 	@version $Id: open.php 10584 2007-01-02 15:09:21Z pcool $
 */
 
 // name of the language file that needs to be included 
 $language_file = 'survey';
 
+// including the global dokeos file
 require_once ('../inc/global.inc.php');
-//api_protect_admin_script();
-if(isset($_REQUEST['questtype']))
-$add_question12=$_REQUEST['questtype'];
-else
-$add_question12=$_REQUEST['add_question'];
-$n=$_REQUEST['n'];
+
+// including additional libraries
+/** @todo check if these are all needed */
+/** @todo check if the starting / is needed. api_get_path probably ends with an / */
 require_once ("select_question.php");
 require_once (api_get_path(LIBRARY_PATH).'/fileManage.lib.php');
 require_once (api_get_path(CONFIGURATION_PATH) ."/add_course.conf.php");
@@ -57,7 +56,15 @@ if (!api_is_allowed_to_edit())
 	Display :: display_footer();
 	exit;
 }
-
+if(isset($_REQUEST['questtype']))
+{
+	$add_question12=$_REQUEST['questtype'];
+}
+else
+{
+	$add_question12=$_REQUEST['add_question'];
+}
+$n=$_REQUEST['n'];
 $interbreadcrumb[] = array ("url" => "survey_list.php?cidReq=$cidReq&n=$n", "name" => get_lang('Survey'));
 $cidReq=$_GET['cidReq'];
 $curr_dbname = $_REQUEST['curr_dbname'];

+ 17 - 8
main/survey/open_edit.php

@@ -20,20 +20,19 @@
 /**
 *	@package dokeos.survey
 * 	@author 
-* 	@version $Id: open_edit.php 10583 2007-01-02 14:47:19Z pcool $
+* 	@version $Id: open_edit.php 10584 2007-01-02 15:09:21Z pcool $
 */
 
 // name of the language file that needs to be included 
 $language_file = 'survey';
 
+// including the global dokeos file
 require_once ('../inc/global.inc.php');
-//api_protect_admin_script();
-if(isset($_REQUEST['questtype']))
-$add_question12=$_REQUEST['questtype'];
-else
-$add_question12=$_REQUEST['add_question'];
-//if(!$add_question12)
-//$add_question12=$_REQUEST['questtype'];
+
+// including additional libraries
+/** @todo check if these are all needed */
+/** @todo check if the starting / is needed. api_get_path probably ends with an / */
+
 require_once ("select_question.php");
 require_once (api_get_path(LIBRARY_PATH).'/fileManage.lib.php');
 require_once (api_get_path(CONFIGURATION_PATH) ."/add_course.conf.php");
@@ -59,6 +58,16 @@ if (!api_is_allowed_to_edit())
 	exit;
 }
 
+if(isset($_REQUEST['questtype']))
+{
+	$add_question12=$_REQUEST['questtype'];
+}
+else
+{
+	$add_question12=$_REQUEST['add_question'];
+}
+//if(!$add_question12)
+//$add_question12=$_REQUEST['questtype'];
 $interbreadcrumb[] = array ("url" => "survey_list.php?cidReq=$cidReq&n=$n", "name" => get_lang('Survey'));
 $cidReq=$_GET['cidReq'];
 $curr_dbname = $_REQUEST['curr_dbname'];

+ 9 - 4
main/survey/preview_mcma.php

@@ -20,7 +20,7 @@
 /**
 *	@package dokeos.survey
 * 	@author 
-* 	@version $Id: preview_mcma.php 10549 2006-12-24 16:08:47Z pcool $
+* 	@version $Id: preview_mcma.php 10584 2007-01-02 15:09:21Z pcool $
 */
 
 /*
@@ -31,8 +31,12 @@
 // name of the language file that needs to be included 
 $language_file = 'survey';
 
+// including the global dokeos file
 require_once ('../inc/global.inc.php');
-api_protect_admin_script();
+
+// including additional libraries
+/** @todo check if these are all needed */
+/** @todo check if the starting / is needed. api_get_path probably ends with an / */
 require_once (api_get_path(LIBRARY_PATH).'/fileManage.lib.php');
 require_once (api_get_path(CONFIGURATION_PATH) ."/add_course.conf.php");
 require_once (api_get_path(LIBRARY_PATH)."/add_course.lib.inc.php");
@@ -40,9 +44,10 @@ require_once (api_get_path(LIBRARY_PATH)."/surveymanager.lib.php");
 
 // Database table definitions
 $table_category = Database :: get_main_table(TABLE_MAIN_CATEGORY);
-$table_survey = Database :: get_main_table(TABLE_MAIN_SURVEY);
-$table_group =  Database :: get_main_table(TABLE_MAIN_GROUP);
+$table_survey 	= Database :: get_main_table(TABLE_MAIN_SURVEY);
+$table_group 	=  Database :: get_main_table(TABLE_MAIN_GROUP);
 $table_question = Database :: get_main_table(TABLE_MAIN_SURVEYQUESTION);
+
 $tool_name = get_lang('ViewQuestions');
 $header1 = get_lang('SurveyName');
 $header2 = get_lang('GroupName');

+ 6 - 2
main/survey/preview_open.php

@@ -20,7 +20,7 @@
 /**
 *	@package dokeos.survey
 * 	@author 
-* 	@version $Id: preview_open.php 10549 2006-12-24 16:08:47Z pcool $
+* 	@version $Id: preview_open.php 10584 2007-01-02 15:09:21Z pcool $
 */
 
 /*
@@ -31,8 +31,12 @@
 // name of the language file that needs to be included 
 $language_file = 'survey';
 
+// including the global dokeos file
 require_once ('../inc/global.inc.php');
-api_protect_admin_script();
+
+// including additional libraries
+/** @todo check if these are all needed */
+/** @todo check if the starting / is needed. api_get_path probably ends with an / */
 require_once (api_get_path(LIBRARY_PATH).'/fileManage.lib.php');
 require_once (api_get_path(CONFIGURATION_PATH) ."/add_course.conf.php");
 require_once (api_get_path(LIBRARY_PATH)."/add_course.lib.inc.php");

+ 6 - 2
main/survey/preview_yesno.php

@@ -20,7 +20,7 @@
 /**
 *	@package dokeos.survey
 * 	@author 
-* 	@version $Id: preview_yesno.php 10583 2007-01-02 14:47:19Z pcool $
+* 	@version $Id: preview_yesno.php 10584 2007-01-02 15:09:21Z pcool $
 */
 
 /*
@@ -31,8 +31,12 @@
 // name of the language file that needs to be included 
 $language_file = 'survey';
 
+// including the global dokeos file
 require_once ('../inc/global.inc.php');
-//api_protect_admin_script();
+
+// including additional libraries
+/** @todo check if these are all needed */
+/** @todo check if the starting / is needed. api_get_path probably ends with an / */
 require_once (api_get_path(LIBRARY_PATH).'/fileManage.lib.php');
 require_once (api_get_path(CONFIGURATION_PATH) ."/add_course.conf.php");
 require_once (api_get_path(LIBRARY_PATH)."/add_course.lib.inc.php");

+ 6 - 2
main/survey/question_type.php

@@ -20,7 +20,7 @@
 /**
 *	@package dokeos.survey
 * 	@author 
-* 	@version $Id: question_type.php 10549 2006-12-24 16:08:47Z pcool $
+* 	@version $Id: question_type.php 10584 2007-01-02 15:09:21Z pcool $
 */
 
 /*
@@ -32,8 +32,12 @@
 // name of the language file that needs to be included 
 $language_file = 'survey';
 
+// including the global dokeos file
 require_once ('../inc/global.inc.php');
-api_protect_admin_script();
+
+// including additional libraries
+/** @todo check if these are all needed */
+/** @todo check if the starting / is needed. api_get_path probably ends with an / */
 require_once (api_get_path(LIBRARY_PATH).'/fileManage.lib.php');
 require_once (api_get_path(CONFIGURATION_PATH) ."/add_course.conf.php");
 require_once (api_get_path(LIBRARY_PATH)."/add_course.lib.inc.php");

+ 6 - 1
main/survey/reporting.php

@@ -20,7 +20,7 @@
 /**
 *	@package dokeos.survey
 * 	@author 
-* 	@version $Id: reporting.php 10549 2006-12-24 16:08:47Z pcool $
+* 	@version $Id: reporting.php 10584 2007-01-02 15:09:21Z pcool $
 */
 
 /*
@@ -31,7 +31,12 @@
 // name of the language file that needs to be included 
 $language_file = 'survey';
 
+// including the global dokeos file
 require_once ('../inc/global.inc.php');
+
+// including additional libraries
+/** @todo check if these are all needed */
+/** @todo check if the starting / is needed. api_get_path probably ends with an / */
 require_once (api_get_path(LIBRARY_PATH)."/course.lib.php");
 require (api_get_path(LIBRARY_PATH)."/groupmanager.lib.php");
 

+ 5 - 2
main/survey/select_question.php

@@ -20,18 +20,21 @@
 /**
 *	@package dokeos.survey
 * 	@author 
-* 	@version $Id: select_question.php 10549 2006-12-24 16:08:47Z pcool $
+* 	@version $Id: select_question.php 10584 2007-01-02 15:09:21Z pcool $
 */
+// including the global dokeos file
+require_once ('../inc/global.inc.php');
 
 if(isset($_POST['add_question']))
 {
+	
 	$groupid=$_REQUEST['groupid'];
 	$surveyid=$_REQUEST['surveyid'];
 	$cidReq=$_REQUEST['cidReq'];
 	$curr_dbname = $_REQUEST['curr_dbname'];
 	// name of the language file that needs to be included 
 $language_file = 'survey';
-	require_once ('../inc/global.inc.php');
+	
     $add_question=$_REQUEST['add_question'];
 	switch ($_POST['add_question'])
 	{

+ 6 - 2
main/survey/select_question_group-uploaded.php

@@ -20,7 +20,7 @@
 /**
 *	@package dokeos.survey
 * 	@author 
-* 	@version $Id: select_question_group-uploaded.php 10583 2007-01-02 14:47:19Z pcool $
+* 	@version $Id: select_question_group-uploaded.php 10584 2007-01-02 15:09:21Z pcool $
 */
 
 
@@ -32,8 +32,12 @@
 // name of the language file that needs to be included 
 $language_file = 'survey';
 
+// including the global dokeos file
 require_once ('../inc/global.inc.php');
-//api_protect_admin_script();
+
+// including additional libraries
+/** @todo check if these are all needed */
+/** @todo check if the starting / is needed. api_get_path probably ends with an / */
 require_once (api_get_path(LIBRARY_PATH).'/fileManage.lib.php');
 require_once (api_get_path(CONFIGURATION_PATH) ."/add_course.conf.php");
 require_once (api_get_path(LIBRARY_PATH)."/add_course.lib.inc.php");

+ 6 - 2
main/survey/select_question_group.php

@@ -20,7 +20,7 @@
 /**
 *	@package dokeos.survey
 * 	@author 
-* 	@version $Id: select_question_group.php 10583 2007-01-02 14:47:19Z pcool $
+* 	@version $Id: select_question_group.php 10584 2007-01-02 15:09:21Z pcool $
 */
 
 
@@ -32,8 +32,12 @@
 // name of the language file that needs to be included 
 $language_file = 'survey';
 
+// including the global dokeos file
 require_once ('../inc/global.inc.php');
-//api_protect_admin_script();
+
+// including additional libraries
+/** @todo check if these are all needed */
+/** @todo check if the starting / is needed. api_get_path probably ends with an / */
 require_once (api_get_path(LIBRARY_PATH).'/fileManage.lib.php');
 require_once (api_get_path(CONFIGURATION_PATH) ."/add_course.conf.php");
 require_once (api_get_path(LIBRARY_PATH)."/add_course.lib.inc.php");

+ 25 - 20
main/survey/select_question_type.php

@@ -20,29 +20,34 @@
 /**
 *	@package dokeos.survey
 * 	@author 
-* 	@version $Id: select_question_type.php 10549 2006-12-24 16:08:47Z pcool $
+* 	@version $Id: select_question_type.php 10584 2007-01-02 15:09:21Z pcool $
 */
 
 // name of the language file that needs to be included 
 $language_file = 'survey';
 	
-	require_once ('../inc/global.inc.php');
-	api_protect_admin_script();
-	$add_question12=$_REQUEST['add_question'];
-	require_once ('select_question.php');
-	require_once (api_get_path(LIBRARY_PATH).'/fileManage.lib.php');
-	require_once (api_get_path(CONFIGURATION_PATH) ."/add_course.conf.php");
-	require_once (api_get_path(LIBRARY_PATH)."/add_course.lib.inc.php");
-	require_once (api_get_path(LIBRARY_PATH)."/surveymanager.lib.php");
-	$cidReq=$_GET['cidReq'];
-	$tool_name = get_lang('AddQuestion');
-	$interbreadcrumb[] = array ("url" => "survey.php", "name" => get_lang('CreateSurvey'));
-	$group_name=$_GET['groupname'];
-	$surveyid=$_REQUEST['surveyid'];
-	$groupid=$_REQUEST['groupid'];
-	$questtype=$_POST['add_question'];
-	Display::display_header($tool_name);
-	api_display_tool_title($tool_name);
-	select_question_type($add_question12,$groupid,$surveyid,$cidReq);
-	Display :: display_footer();
+// including the global dokeos file
+require_once ('../inc/global.inc.php');
+
+// including additional libraries
+/** @todo check if these are all needed */
+/** @todo check if the starting / is needed. api_get_path probably ends with an / */
+require_once ('select_question.php');
+require_once (api_get_path(LIBRARY_PATH).'/fileManage.lib.php');
+require_once (api_get_path(CONFIGURATION_PATH) ."/add_course.conf.php");
+require_once (api_get_path(LIBRARY_PATH)."/add_course.lib.inc.php");
+require_once (api_get_path(LIBRARY_PATH)."/surveymanager.lib.php");	
+	
+$add_question12=$_REQUEST['add_question'];
+$cidReq=$_GET['cidReq'];
+$tool_name = get_lang('AddQuestion');
+$interbreadcrumb[] = array ("url" => "survey.php", "name" => get_lang('CreateSurvey'));
+$group_name=$_GET['groupname'];
+$surveyid=$_REQUEST['surveyid'];
+$groupid=$_REQUEST['groupid'];
+$questtype=$_POST['add_question'];
+Display::display_header($tool_name);
+api_display_tool_title($tool_name);
+select_question_type($add_question12,$groupid,$surveyid,$cidReq);
+Display :: display_footer();
 ?>

+ 7 - 12
main/survey/survey.php

@@ -20,23 +20,18 @@
 /**
 *	@package dokeos.survey
 * 	@author 
-* 	@version $Id: survey.php 10583 2007-01-02 14:47:19Z pcool $
+* 	@version $Id: survey.php 10584 2007-01-02 15:09:21Z pcool $
 */
 
-
-/*
-==============================================================================
-		INIT SECTION
-==============================================================================
-*/
 // name of the language file that needs to be included 
 $language_file = 'survey';
-/*
------------------------------------------------------------
-	Including necessary files
------------------------------------------------------------
-*/
+
+// including the global dokeos file
 require_once ('../inc/global.inc.php');
+
+// including additional libraries
+/** @todo check if these are all needed */
+/** @todo check if the starting / is needed. api_get_path probably ends with an / */
 require_once (api_get_path(LIBRARY_PATH)."/course.lib.php");
 require_once (api_get_path(LIBRARY_PATH)."/groupmanager.lib.php");
 require_once (api_get_path(LIBRARY_PATH).'/fileManage.lib.php');

+ 7 - 11
main/survey/survey_all_courses.php

@@ -20,22 +20,18 @@
 /**
 *	@package dokeos.survey
 * 	@author 
-* 	@version $Id: survey_all_courses.php 10583 2007-01-02 14:47:19Z pcool $
+* 	@version $Id: survey_all_courses.php 10584 2007-01-02 15:09:21Z pcool $
 */
 
-/*
-==============================================================================
-		INIT SECTION
-==============================================================================
-*/
 // name of the language file that needs to be included 
 $language_file = 'survey';
-/*
------------------------------------------------------------
-	Including necessary files
------------------------------------------------------------
-*/
+
+// including the global dokeos file
 require_once ('../inc/global.inc.php');
+
+// including additional libraries
+/** @todo check if these are all needed */
+/** @todo check if the starting / is needed. api_get_path probably ends with an / */
 require_once (api_get_path(LIBRARY_PATH)."/surveymanager.lib.php");
 require_once (api_get_path(LIBRARY_PATH)."/course.lib.php");
 

+ 8 - 4
main/survey/survey_blank.php

@@ -20,19 +20,23 @@
 /**
 *	@package dokeos.survey
 * 	@author 
-* 	@version $Id: survey_blank.php 10559 2006-12-27 10:52:50Z pcool $
+* 	@version $Id: survey_blank.php 10584 2007-01-02 15:09:21Z pcool $
 */
 
 // name of the language file that needs to be included 
 $language_file='admin';
-$cidReset=true;
+
+// including the global dokeos file
 require_once ('../inc/global.inc.php');
-//api_protect_admin_script();
+
+// including additional libraries
+/** @todo check if these are all needed */
+/** @todo check if the starting / is needed. api_get_path probably ends with an / */
 require_once (api_get_path(LIBRARY_PATH).'/fileManage.lib.php');
 require_once (api_get_path(CONFIGURATION_PATH) ."/add_course.conf.php");
 require_once (api_get_path(LIBRARY_PATH)."/add_course.lib.inc.php");
 require_once (api_get_path(LIBRARY_PATH)."/course.lib.php");
-require (api_get_path(LIBRARY_PATH)."/groupmanager.lib.php");
+require_once (api_get_path(LIBRARY_PATH)."/groupmanager.lib.php");
 require_once (api_get_path(LIBRARY_PATH)."/surveymanager.lib.php");
 require_once (api_get_path(LIBRARY_PATH)."/usermanager.lib.php");
 

+ 8 - 3
main/survey/survey_report.php

@@ -20,7 +20,7 @@
 /**
 *	@package dokeos.survey
 * 	@author 
-* 	@version $Id: survey_report.php 10549 2006-12-24 16:08:47Z pcool $
+* 	@version $Id: survey_report.php 10584 2007-01-02 15:09:21Z pcool $
 */
 
 /*
@@ -31,10 +31,15 @@
 // name of the language file that needs to be included 
 $language_file = 'survey';
 
+// including the global dokeos file
 require_once ('../inc/global.inc.php');
+
+// including additional libraries
+/** @todo check if these are all needed */
+/** @todo check if the starting / is needed. api_get_path probably ends with an / */
 require_once (api_get_path(LIBRARY_PATH)."/course.lib.php");
-require (api_get_path(LIBRARY_PATH)."/groupmanager.lib.php");
-require (api_get_path(LIBRARY_PATH)."/surveymanager.lib.php");
+require_once (api_get_path(LIBRARY_PATH)."/groupmanager.lib.php");
+require_once (api_get_path(LIBRARY_PATH)."/surveymanager.lib.php");
 
 $table_survey = Database :: get_course_table('survey');
 

+ 8 - 4
main/survey/survey_white.php

@@ -20,19 +20,23 @@
 /**
 *	@package dokeos.survey
 * 	@author 
-* 	@version $Id: survey_white.php 10559 2006-12-27 10:52:50Z pcool $
+* 	@version $Id: survey_white.php 10584 2007-01-02 15:09:21Z pcool $
 */
 
 // name of the language file that needs to be included 
 $language_file='survey';
-$cidReset=true;
+
+// including the global dokeos file
 require_once ('../inc/global.inc.php');
-//api_protect_admin_script();
+
+// including additional libraries
+/** @todo check if these are all needed */
+/** @todo check if the starting / is needed. api_get_path probably ends with an / */
 require_once (api_get_path(LIBRARY_PATH).'/fileManage.lib.php');
 require_once (api_get_path(CONFIGURATION_PATH) ."/add_course.conf.php");
 require_once (api_get_path(LIBRARY_PATH)."/add_course.lib.inc.php");
 require_once (api_get_path(LIBRARY_PATH)."/course.lib.php");
-require (api_get_path(LIBRARY_PATH)."/groupmanager.lib.php");
+require_once (api_get_path(LIBRARY_PATH)."/groupmanager.lib.php");
 require_once (api_get_path(LIBRARY_PATH)."/surveymanager.lib.php");
 require_once (api_get_path(LIBRARY_PATH)."/usermanager.lib.php");
 

+ 6 - 3
main/survey/surveytemp_white.php

@@ -20,7 +20,7 @@
 /**
 *	@package dokeos.survey
 * 	@author 
-* 	@version $Id: surveytemp_white.php 10549 2006-12-24 16:08:47Z pcool $
+* 	@version $Id: surveytemp_white.php 10584 2007-01-02 15:09:21Z pcool $
 */
 
 // name of the language file that needs to be included 
@@ -29,14 +29,17 @@ $cidReset=true;
 session_start();
 $lang = $_REQUEST['lang'];
 $_SESSION["user_language_choice"]=$lang;
+// including the global dokeos file
 require_once ('../inc/global.inc.php');
 
-//api_protect_admin_script();
+// including additional libraries
+/** @todo check if these are all needed */
+/** @todo check if the starting / is needed. api_get_path probably ends with an / */
 require_once (api_get_path(LIBRARY_PATH).'/fileManage.lib.php');
 require_once (api_get_path(CONFIGURATION_PATH) ."/add_course.conf.php");
 require_once (api_get_path(LIBRARY_PATH)."/add_course.lib.inc.php");
 require_once (api_get_path(LIBRARY_PATH)."/course.lib.php");
-require (api_get_path(LIBRARY_PATH)."/groupmanager.lib.php");
+require_once (api_get_path(LIBRARY_PATH)."/groupmanager.lib.php");
 require_once (api_get_path(LIBRARY_PATH)."/surveymanager.lib.php");
 require_once (api_get_path(LIBRARY_PATH)."/usermanager.lib.php");
 

+ 8 - 7
main/survey/template1.php

@@ -20,22 +20,23 @@
 /**
 *	@package dokeos.survey
 * 	@author 
-* 	@version $Id: template1.php 10559 2006-12-27 10:52:50Z pcool $
+* 	@version $Id: template1.php 10584 2007-01-02 15:09:21Z pcool $
 */
 
 // name of the language file that needs to be included 
 $language_file='survey';
-$cidReset=true;
-session_start();
-$lang = addslashes($_REQUEST['lang']);
-$_SESSION["user_language_choice"]=$lang;
+
+// including the global dokeos file
 require_once ('../inc/global.inc.php');
-//api_protect_admin_script();
+
+// including additional libraries
+/** @todo check if these are all needed */
+/** @todo check if the starting / is needed. api_get_path probably ends with an / */
 require_once (api_get_path(LIBRARY_PATH).'/fileManage.lib.php');
 require_once (api_get_path(CONFIGURATION_PATH) ."/add_course.conf.php");
 require_once (api_get_path(LIBRARY_PATH)."/add_course.lib.inc.php");
 require_once (api_get_path(LIBRARY_PATH)."/course.lib.php");
-require (api_get_path(LIBRARY_PATH)."/groupmanager.lib.php");
+require_once (api_get_path(LIBRARY_PATH)."/groupmanager.lib.php");
 require_once (api_get_path(LIBRARY_PATH)."/surveymanager.lib.php");
 require_once (api_get_path(LIBRARY_PATH)."/usermanager.lib.php");
 

+ 7 - 4
main/survey/template_check.php

@@ -20,19 +20,22 @@
 /**
 *	@package dokeos.survey
 * 	@author 
-* 	@version $Id: template_check.php 10223 2006-11-27 14:45:59Z pcool $
+* 	@version $Id: template_check.php 10584 2007-01-02 15:09:21Z pcool $
 */
 
 // name of the language file that needs to be included 
 $language_file='survey';
-$cidReset=true;
+// including the global dokeos file
 require_once ('../inc/global.inc.php');
-//api_protect_admin_script();
+
+// including additional libraries
+/** @todo check if these are all needed */
+/** @todo check if the starting / is needed. api_get_path probably ends with an / */
 require_once (api_get_path(LIBRARY_PATH).'/fileManage.lib.php');
 require_once (api_get_path(CONFIGURATION_PATH) ."/add_course.conf.php");
 require_once (api_get_path(LIBRARY_PATH)."/add_course.lib.inc.php");
 require_once (api_get_path(LIBRARY_PATH)."/course.lib.php");
-require (api_get_path(LIBRARY_PATH)."/groupmanager.lib.php");
+require_once (api_get_path(LIBRARY_PATH)."/groupmanager.lib.php");
 require_once (api_get_path(LIBRARY_PATH)."/surveymanager.lib.php");
 require_once (api_get_path(LIBRARY_PATH)."/usermanager.lib.php");
 

+ 6 - 5
main/survey/thanks1.php

@@ -20,17 +20,18 @@
 /**
 *	@package dokeos.survey
 * 	@author 
-* 	@version $Id: thanks1.php 10559 2006-12-27 10:52:50Z pcool $
+* 	@version $Id: thanks1.php 10584 2007-01-02 15:09:21Z pcool $
 */
 
 // name of the language file that needs to be included 
 $language_file='survey_answer';
 
-$cidReset=true;
-$lang = $_REQUEST['lang'];
-$_SESSION["user_language_choice"]=$lang;
+// including the global dokeos file
 require_once ('../inc/global.inc.php');
-//api_protect_admin_script();
+
+// including additional libraries
+/** @todo check if these are all needed */
+/** @todo check if the starting / is needed. api_get_path probably ends with an / */
 require_once (api_get_path(LIBRARY_PATH).'/fileManage.lib.php');
 require_once (api_get_path(CONFIGURATION_PATH) ."/add_course.conf.php");
 require_once (api_get_path(LIBRARY_PATH)."/add_course.lib.inc.php");

+ 7 - 7
main/survey/welcome_1.php

@@ -20,23 +20,23 @@
 /**
 *	@package dokeos.survey
 * 	@author 
-* 	@version $Id: welcome_1.php 10559 2006-12-27 10:52:50Z pcool $
+* 	@version $Id: welcome_1.php 10584 2007-01-02 15:09:21Z pcool $
 */
 
 // name of the language file that needs to be included 
 $language_file='survey_answer';
 
-$cidReset=true;
-session_start();
-$lang = $_REQUEST['lang'];
-$_SESSION["user_language_choice"]=$lang;
+// including the global dokeos file
 require_once ('../inc/global.inc.php');
-//api_protect_admin_script();
+
+// including additional libraries
+/** @todo check if these are all needed */
+/** @todo check if the starting / is needed. api_get_path probably ends with an / */
 require_once (api_get_path(LIBRARY_PATH).'/fileManage.lib.php');
 require_once (api_get_path(CONFIGURATION_PATH) ."/add_course.conf.php");
 require_once (api_get_path(LIBRARY_PATH)."/add_course.lib.inc.php");
 require_once (api_get_path(LIBRARY_PATH)."/course.lib.php");
-require (api_get_path(LIBRARY_PATH)."/groupmanager.lib.php");
+require_once (api_get_path(LIBRARY_PATH)."/groupmanager.lib.php");
 require_once (api_get_path(LIBRARY_PATH)."/surveymanager.lib.php");
 require_once (api_get_path(LIBRARY_PATH)."/usermanager.lib.php");
 

+ 19 - 3
main/survey/white.php

@@ -20,7 +20,7 @@
 /**
 *	@package dokeos.survey
 * 	@author 
-* 	@version $Id: white.php 10223 2006-11-27 14:45:59Z pcool $
+* 	@version $Id: white.php 10584 2007-01-02 15:09:21Z pcool $
 */
 
 // name of the language file that needs to be included 
@@ -29,13 +29,29 @@ $language_file = 'survey';
 $temp = $_REQUEST['temp'];
 require ('../inc/global.inc.php');
 require_once (api_get_path(LIBRARY_PATH)."/surveymanager.lib.php");
+require_once (api_get_path(LIBRARY_PATH)."/course.lib.php");
+
+
+/** @todo replace this with the correct code */
+/*
 $status = surveymanager::get_status();
+api_protect_course_script();
 if($status==5)
 {
-api_protect_admin_script();
+	api_protect_admin_script();
+}
+*/
+/** @todo this has to be moved to a more appropriate place (after the display_header of the code)*/
+if (!api_is_allowed_to_edit())
+{
+	Display :: display_header();
+	Display :: display_error_message(get_lang('NotAllowedHere'));
+	Display :: display_footer();
+	exit;
 }
+
 $cidReq = $_REQUEST['cidReq'];
-require_once (api_get_path(LIBRARY_PATH)."/course.lib.php");
+
 $ques = $_REQUEST['ques'];
 $ans = $_REQUEST['ans'];
 $answers = explode("|",$ans);

+ 40 - 13
main/survey/yesno.php

@@ -20,34 +20,61 @@
 /**
 *	@package dokeos.survey
 * 	@author 
-* 	@version $Id: yesno.php 10559 2006-12-27 10:52:50Z pcool $
+* 	@version $Id: yesno.php 10584 2007-01-02 15:09:21Z pcool $
 */
 
 // name of the language file that needs to be included 
 $language_file = 'survey';
 
+// including the global dokeos file
 require_once ('../inc/global.inc.php');
-//api_protect_admin_script();
-$cidReq=$_GET['cidReq'];
-$curr_dbname = $_REQUEST['curr_dbname'];
-$add_question = $_REQUEST['add_question'];
-$groupid = $_REQUEST['groupid'];
-$surveyid = $_REQUEST['surveyid'];
-if(isset($_REQUEST['questtype']))
-$add_question12=$_REQUEST['questtype'];
-else
-$add_question12=$_REQUEST['add_question'];
+
+// including additional libraries
+/** @todo check if these are all needed */
+/** @todo check if the starting / is needed. api_get_path probably ends with an / */
 require_once ("select_question.php");
 require_once (api_get_path(LIBRARY_PATH).'/fileManage.lib.php');
 require_once (api_get_path(CONFIGURATION_PATH) ."/add_course.conf.php");
 require_once (api_get_path(LIBRARY_PATH)."/add_course.lib.inc.php");
 require_once (api_get_path(LIBRARY_PATH)."/surveymanager.lib.php");
+require_once (api_get_path(LIBRARY_PATH)."/usermanager.lib.php");
+
+/** @todo replace this with the correct code */
+/*
 $status = surveymanager::get_status();
+api_protect_course_script();
 if($status==5)
 {
-api_protect_admin_script();
+	api_protect_admin_script();
 }
-require_once (api_get_path(LIBRARY_PATH)."/usermanager.lib.php");
+*/
+/** @todo this has to be moved to a more appropriate place (after the display_header of the code)*/
+if (!api_is_allowed_to_edit())
+{
+	Display :: display_header();
+	Display :: display_error_message(get_lang('NotAllowedHere'));
+	Display :: display_footer();
+	exit;
+}
+
+$cidReq=$_GET['cidReq'];
+$curr_dbname = $_REQUEST['curr_dbname'];
+$add_question = $_REQUEST['add_question'];
+$groupid = $_REQUEST['groupid'];
+$surveyid = $_REQUEST['surveyid'];
+if(isset($_REQUEST['questtype']))
+{
+	$add_question12=$_REQUEST['questtype'];
+}
+else
+{
+	$add_question12=$_REQUEST['add_question'];
+}
+
+
+
+
+
 $interbreadcrumb[] = array ("url" => "survey_list.php?cidReq=$cidReq&n=$n", "name" => get_lang('Survey'));
 $table_question = Database :: get_course_table('questions');
 $Add = get_lang('AddNewQuestionType');

+ 22 - 3
main/survey/yesno_edit.php

@@ -20,25 +20,44 @@
 /**
 *	@package dokeos.survey
 * 	@author 
-* 	@version $Id: yesno_edit.php 10559 2006-12-27 10:52:50Z pcool $
+* 	@version $Id: yesno_edit.php 10584 2007-01-02 15:09:21Z pcool $
 */
 
 // name of the language file that needs to be included 
 $language_file = 'survey';
 
+// including the global dokeos file
 require_once ('../inc/global.inc.php');
-//api_protect_admin_script();
+
+// including additional libraries
+/** @todo check if these are all needed */
+/** @todo check if the starting / is needed. api_get_path probably ends with an / */
 require_once ("select_question.php");
 require_once (api_get_path(LIBRARY_PATH).'/fileManage.lib.php');
 require_once (api_get_path(CONFIGURATION_PATH) ."/add_course.conf.php");
 require_once (api_get_path(LIBRARY_PATH)."/add_course.lib.inc.php");
 require_once (api_get_path(LIBRARY_PATH)."/surveymanager.lib.php");
+require_once (api_get_path(LIBRARY_PATH)."/usermanager.lib.php");
+
+/** @todo replace this with the correct code */
+/*
 $status = surveymanager::get_status();
+api_protect_course_script();
 if($status==5)
 {
 	api_protect_admin_script();
 }
-require_once (api_get_path(LIBRARY_PATH)."/usermanager.lib.php");
+*/
+/** @todo this has to be moved to a more appropriate place (after the display_header of the code)*/
+if (!api_is_allowed_to_edit())
+{
+	Display :: display_header();
+	Display :: display_error_message(get_lang('NotAllowedHere'));
+	Display :: display_footer();
+	exit;
+}
+
+
 $n=$_REQUEST['n'];
 $interbreadcrumb[] = array ("url" => "survey_list.php?cidReq=$cidReq&n=$n", "name" => get_lang('Survey'));
 $cidReq = $_REQUEST['cidReq'];