diff --git a/admin/assignsample.php b/admin/assignsample.php index 36f35929..7d9eaa94 100644 --- a/admin/assignsample.php +++ b/admin/assignsample.php @@ -149,7 +149,8 @@ if (isset($_GET['questionnaire_id']) && isset($_GET['sample']) && isset($_GET[' foreach($rs as $r) { - add_case($r['sample_id'],$questionnaire_id,"NULL",$testing,41, true); + set_time_limit(30); + add_case($r['sample_id'],$questionnaire_id,"NULL",$testing,41, true); } $db->CompleteTrans(); diff --git a/admin/auth-admin.php b/admin/auth-admin.php index 325d28ce..f260abcb 100644 --- a/admin/auth-admin.php +++ b/admin/auth-admin.php @@ -39,14 +39,7 @@ include_once(dirname(__FILE__) . "/../config.inc.php"); */ include_once(dirname(__FILE__) . "/../db.inc.php"); - -//get session name from DB -// -$sql = "SELECT stg_value - FROM " . LIME_PREFIX . "settings_global - WHERE stg_name = 'SessionName'"; - -session_name($db->GetOne($sql)); +session_name(LS_SESSION_NAME); session_set_cookie_params(0,QUEXS_PATH); diff --git a/admin/new.php b/admin/new.php index 3f01adb9..70bed4dc 100644 --- a/admin/new.php +++ b/admin/new.php @@ -268,7 +268,19 @@ if (!empty($surveys)){?> if ($handle = opendir(dirname(__FILE__)."/../include/limesurvey/templates")) { while (false !== ($entry = readdir($handle))) { if ($entry != "." && $entry != ".." && is_dir(dirname(__FILE__)."/../include/limesurvey/templates/" . $entry)){ - echo ""; + $default = ""; + if ($entry == 'skeletonquest') $default = "selected=\"selected\""; + echo ""; + } + } + closedir($handle); + } + if ($handle = opendir(dirname(__FILE__)."/../include/limesurvey/upload/templates")) { + while (false !== ($entry = readdir($handle))) { + if ($entry != "." && $entry != ".." && is_dir(dirname(__FILE__)."/../include/limesurvey/upload/templates/" . $entry)){ + $default = ""; + if ($entry == 'skeletonquest') $default = "selected=\"selected\""; + echo ""; } } closedir($handle); diff --git a/admin/questionnairelist.php b/admin/questionnairelist.php index 18346f59..a869ea5d 100644 --- a/admin/questionnairelist.php +++ b/admin/questionnairelist.php @@ -430,6 +430,16 @@ if (isset($_GET['modify'])) } closedir($handle); } + if ($handle = opendir(dirname(__FILE__)."/../include/limesurvey/upload/templates")) { + while (false !== ($entry = readdir($handle))) { + if ($entry != "." && $entry != ".." && is_dir(dirname(__FILE__)."/../include/limesurvey/upload/templates/" . $entry)){ + echo ""; + } + } + closedir($handle); + } ?> diff --git a/auth-interviewer.php b/auth-interviewer.php index 4b3f0935..74089770 100644 --- a/auth-interviewer.php +++ b/auth-interviewer.php @@ -40,13 +40,7 @@ include_once("config.inc.php"); include_once("db.inc.php"); -//get session name from DB -// -$sql = "SELECT stg_value - FROM " . LIME_PREFIX . "settings_global - WHERE stg_name = 'SessionName'"; - -session_name($db->GetOne($sql)); +session_name(LS_SESSION_NAME); session_set_cookie_params(0,QUEXS_PATH); diff --git a/client/auth-client.php b/client/auth-client.php index deda7ff3..8d9db67a 100644 --- a/client/auth-client.php +++ b/client/auth-client.php @@ -39,14 +39,7 @@ include_once(dirname(__FILE__)."/../config.inc.php"); */ include_once(dirname(__FILE__)."/../db.inc.php"); - -//get session name from DB -// -$sql = "SELECT stg_value - FROM " . LIME_PREFIX . "settings_global - WHERE stg_name = 'SessionName'"; - -session_name($db->GetOne($sql)); +session_name(LS_SESSION_NAME); session_set_cookie_params(0,QUEXS_PATH); diff --git a/config.default.php b/config.default.php index e71f5f90..da5f8685 100644 --- a/config.default.php +++ b/config.default.php @@ -281,6 +281,11 @@ if (!defined('LDB_TYPE')) define('LDB_TYPE', DB_TYPE); if (!defined('COMPANY_NAME')) define ('COMPANY_NAME', 'queXS '); if (!defined('ADMIN_PANEL_NAME')) define ('ADMIN_PANEL_NAME',' Administration Panel'); +/** + * Session name + * - If changed must also be changed in the lime_settings_global table + */ +if (!defined('LS_SESSION_NAME')) define ('LS_SESSION_NAME', 'ls28629164789259281352'); /** * Debugging diff --git a/db.inc.php b/db.inc.php index fbacc33a..031b7909 100644 --- a/db.inc.php +++ b/db.inc.php @@ -47,10 +47,10 @@ if (!(include_once(ADODB_PATH . 'adodb.inc.php'))) /** * Include ADODB session handling functions */ -if (!(include_once(ADODB_PATH . 'session/adodb-session2.php'))) -{ - print "

ERROR: Please modify config.inc.php for ADODB_PATH to point to your ADODb installation

"; -} +//if (!(include_once(ADODB_PATH . 'session/adodb-session2.php'))) +//{ +// print "

ERROR: Please modify config.inc.php for ADODB_PATH to point to your ADODb installation

"; +//} define('ADODB_OUTP',"outputDebug"); @@ -75,7 +75,7 @@ if (DEBUG == true) $db->debug = true; $db->Execute("set names 'utf8'"); //store session in database (see sessions2 table) -ADOdb_Session::config(DB_TYPE, DB_HOST, DB_USER, DB_PASS, DB_NAME, array('table' => LIME_PREFIX . 'sessions')); +//ADOdb_Session::config(DB_TYPE, DB_HOST, DB_USER, DB_PASS, DB_NAME, array('table' => LIME_PREFIX . 'sessions')); /** diff --git a/functions/functions.operator.php b/functions/functions.operator.php index 40acf1de..ee056c3c 100644 --- a/functions/functions.operator.php +++ b/functions/functions.operator.php @@ -442,34 +442,34 @@ function add_case($sample_id,$questionnaire_id,$operator_id = "NULL",$testing = if ($lime_sid) { - $lfirstname = ''; - $llastname = ''; - $lemail = ''; + $lfirstname = "''"; + $llastname = "''"; + $lemail = "''"; if ($addlimeattributes) { - $lfirstname = $db->GetOne("SELECT sv.val + $lfirstname = $db->qstr($db->GetOne("SELECT sv.val FROM sample_var as sv, sample_import_var_restrict as s WHERE sv.var_id = s.var_id AND sv.sample_id = '$sample_id' - AND s.type = '6'"); + AND s.type = '6'")); - $llastname = $db->GetOne("SELECT sv.val + $llastname = $db->qstr($db->GetOne("SELECT sv.val FROM sample_var as sv, sample_import_var_restrict as s WHERE sv.var_id = s.var_id AND sv.sample_id = '$sample_id' - AND s.type = '7'"); + AND s.type = '7'")); - $lemail = $db->GetOne("SELECT sv.val + $lemail = $db->qstr($db->GetOne("SELECT sv.val FROM sample_var as sv, sample_import_var_restrict as s WHERE sv.var_id = s.var_id AND sv.sample_id = '$sample_id' - AND s.type = '8'"); + AND s.type = '8'")); } $sql = "INSERT INTO ".LIME_PREFIX."tokens_$lime_sid (tid,firstname,lastname,email,token,language,sent,completed,mpid) - VALUES (NULL,'$lfirstname','$llastname','$lemail','$token','".DEFAULT_LOCALE."','N','N',NULL)"; + VALUES (NULL,$lfirstname,$llastname,$lemail,'$token','".DEFAULT_LOCALE."','N','N',NULL)"; $db->Execute($sql); @@ -485,7 +485,6 @@ function add_case($sample_id,$questionnaire_id,$operator_id = "NULL",$testing = WHERE sid = '$lime_sid'"; $names = $db->GetOne($sql); - $attdescriptiondata=explode("\n",$names); $atts=array(); @@ -503,8 +502,10 @@ function add_case($sample_id,$questionnaire_id,$operator_id = "NULL",$testing = AND sv.sample_id = '$sample_id' AND s.var LIKE '$val'"); + $lval = $db->qstr($lval); + $sql = "UPDATE " . LIME_PREFIX . "tokens_$lime_sid - SET $key = '$lval' + SET $key = $lval WHERE tid = '$tid'"; $db->Execute($sql); diff --git a/include/limesurvey/admin/browse.php b/include/limesurvey/admin/browse.php index eae4d6e1..1ca82d81 100644 --- a/include/limesurvey/admin/browse.php +++ b/include/limesurvey/admin/browse.php @@ -81,6 +81,7 @@ else //SURVEY MATCHING $surveyid DOESN'T EXIST //OK. IF WE GOT THIS FAR, THEN THE SURVEY EXISTS AND IT IS ACTIVE, SO LETS GET TO WORK. $surveyinfo=getSurveyInfo($surveyid); +include_once("../quexs.php"); require_once(dirname(__FILE__).'/sessioncontrol.php'); // Set language for questions and labels to base language of this survey @@ -787,7 +788,6 @@ elseif ($subaction == "all") $quexsfilterstate = questionnaireSampleFilterstate(); //queXS Addition - include_once("../quexs.php"); $browseoutput .= " ".T_("Questionnaire and Sample selection:")."