| Server IP : 195.130.67.5 / Your IP : 216.73.217.154 Web Server : Microsoft-IIS/10.0 System : Windows NT WEBSERVER1 10.0 build 17763 (Windows Server 2016) i586 User : IUSR ( 0) PHP Version : 7.4.19 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /Old Sites/modip/survey/classes/dTexts/dFunctions/ |
Upload File : |
<?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!');
}
}