2
0
mirror of https://github.com/ACSPRI/queXS synced 2024-04-02 12:12:16 +00:00

Remove limesurvey!

Make session authentication work without limesurvey itself
This commit is contained in:
Adam Zammit
2017-01-09 16:16:15 +11:00
parent 7dde017c9a
commit d2f56f0a58
2438 changed files with 246 additions and 597734 deletions

View File

@@ -128,4 +128,42 @@ function set_setting($name,$value)
return $db->Execute($sql);
}
/**
* Get the IP address of the client
*/
function getIPAddress()
{
if (!empty($_SERVER['REMOTE_ADDR']))
{
return $_SERVER['REMOTE_ADDR'];
}
else
{
return '127.0.0.1';
}
}
/**
* Creates a random sequence of characters
*
* @param mixed $length Length of resulting string
* @param string $pattern To define which characters should be in the resulting string
*
* From Limesurvey
*/
function sRandomChars($length = 15,$pattern="23456789abcdefghijkmnpqrstuvwxyz")
{
$patternlength = strlen($pattern)-1;
for($i=0;$i<$length;$i++)
{
if(isset($key))
$key .= $pattern{mt_rand(0,$patternlength)};
else
$key = $pattern{mt_rand(0,$patternlength)};
}
return $key;
}
?>