//
function generateRandomCode ($length, $code, $userid, $extraData = '') {
// Build server string
- $server = $_SERVER['PHP_SELF'] . getEncryptSeparator() . detectUserAgent() . getEncryptSeparator() . getenv('SERVER_SOFTWARE') . getEncryptSeparator() . detectRealIpAddress() . getEncryptSeparator() . detectRemoteAddr();
+ $server = $_SERVER['REQUEST_URI'] . getEncryptSeparator() . detectUserAgent() . getEncryptSeparator() . getenv('SERVER_SOFTWARE') . getEncryptSeparator() . detectRealIpAddress() . getEncryptSeparator() . detectRemoteAddr();
// Build key string
$keys = getSiteKey() . getEncryptSeparator() . getDateKey();
// When the salt is empty build a new one, else use the first x configured characters as the salt
if (empty($salt)) {
// Build server string for more entropy
- $server = $_SERVER['PHP_SELF'] . getEncryptSeparator() . detectUserAgent() . getEncryptSeparator() . getenv('SERVER_SOFTWARE') . getEncryptSeparator() . detectRealIpAddress() . getEncryptSeparator() . detectRemoteAddr();
+ $server = $_SERVER['REQUEST_URI'] . getEncryptSeparator() . detectUserAgent() . getEncryptSeparator() . getenv('SERVER_SOFTWARE') . getEncryptSeparator() . detectRealIpAddress() . getEncryptSeparator() . detectRemoteAddr();
// Build key string
$keys = getSiteKey() . getEncryptSeparator() . getDateKey() . getEncryptSeparator() . getFileHash() . getEncryptSeparator() . getMasterSalt();
if (isValidReferralId()) {
// Do not determine it, just return it
return getReferralId();
- } elseif ((!isHtmlOutputMode()) && (basename($_SERVER['PHP_SELF']) != 'ref.php')) {
+ } elseif ((!isHtmlOutputMode()) && (getModule() != 'ref')) {
// Skip this in non-html-mode and outside ref.php
return FALSE;
}
// Set refid=ref (the referral link uses such variable)
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Using ref from GET data (' . getRequestElement('ref') . ')');
setReferralId(getRequestElement('ref'));
- } elseif ((isGetRequestElementSet('user')) && (basename($_SERVER['PHP_SELF']) == 'click.php')) {
+ } elseif ((isGetRequestElementSet('user')) && (getModule() == 'click')) {
// The variable user comes from click.php
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Using user from GET data (' . getRequestElement('user') . ')');
setReferralId(bigintval(getRequestElement('user')));