mirror of
https://github.com/ACSPRI/queXS
synced 2024-04-02 12:12:16 +00:00
Merging the Limesurvey 1.91+ branch of queXS in to the trunk
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
class dFunctionToken implements dFunctionInterface
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
}
|
||||
|
||||
public function run($args)
|
||||
{
|
||||
global $surveyid;
|
||||
if (isset($_SESSION['token']) && $_SESSION['token'] != '')
|
||||
{
|
||||
//Gather survey data for tokenised surveys, for use in presenting questions
|
||||
$_SESSION['thistoken']=getTokenData($surveyid, $_SESSION['token']);
|
||||
}
|
||||
|
||||
if (isset($_SESSION['thistoken']))
|
||||
{
|
||||
if (!strcmp(strtolower($args[0]),'firstname')) return $_SESSION['thistoken']['firstname'];
|
||||
if (!strcmp(strtolower($args[0]),'lastname')) return $_SESSION['thistoken']['lastname'];
|
||||
if (!strcmp(strtolower($args[0]),'email')) return $_SESSION['thistoken']['email'];
|
||||
}
|
||||
else
|
||||
{
|
||||
return "";
|
||||
}
|
||||
|
||||
if(stripos($args[0],'attribute_')!==FALSE){
|
||||
$attr_no=(int)str_replace('ATTRIBUTE_','',$args[0]);
|
||||
if (isset($_SESSION['thistoken']['attribute_'.$attr_no])) return $_SESSION['thistoken']['attribute_'.$attr_no];
|
||||
}
|
||||
|
||||
throw new Exception('TOKEN incorrect!');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user