X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Ffunctions.php;h=64fb5c3a211c466035b40e7898cdcc9ca7b6b207;hb=4de4188e5f00d6f7eb3762b69983a80e05b06851;hp=a285c70519303109e23f3e9d2f4c6f17d00a3b32;hpb=9afd6ec5878544a7982c50ed9c0dd7de37606d5b;p=mailer.git diff --git a/inc/functions.php b/inc/functions.php index a285c70519..64fb5c3a21 100644 --- a/inc/functions.php +++ b/inc/functions.php @@ -331,6 +331,9 @@ function loadTemplate ($template, $return=false, $content=array()) { // Prepare eval() command $eval = '$ret = "' . compileCode(smartAddSlashes($ret)) . '";'; + } elseif (substr($template, 0, 3) == 'js_') { + // JavaScripts don't like entities + $eval = '$ret = decodeEntities("' . compileCode(smartAddSlashes($GLOBALS['tpl_content'])) . '");'; } else { // Prepare eval() command $eval = '$ret = "' . compileCode(smartAddSlashes($GLOBALS['tpl_content'])) . '";'; @@ -2398,12 +2401,12 @@ function generateErrorCodeFromUserStatus ($status='') { $errorCode = getCode('UNKNOWN_STATUS'); // Generate constant name - $constantName = sprintf("ID_%s", $status); + $codeName = sprintf("ID_%s", $status); // Is the constant there? - if (isCodeSet($constantName)) { + if (isCodeSet($codeName)) { // Then get it! - $errorCode = getCode($constantName); + $errorCode = getCode($codeName); } else { // Unknown status logDebugMessage(__FUNCTION__, __LINE__, sprintf("Unknown error status %s detected.", $status)); @@ -2673,6 +2676,7 @@ function getMessageFromErrorCode ($code) { case getCode('WRONG_ID') : $message = getMessage('LOGIN_WRONG_ID'); break; case getCode('ID_LOCKED') : $message = getMessage('LOGIN_ID_LOCKED'); break; case getCode('ID_UNCONFIRMED') : $message = getMessage('LOGIN_ID_UNCONFIRMED'); break; + case getCode('ID_GUEST') : $message = getMessage('LOGIN_ID_GUEST'); break; case getCode('NO_COOKIES') : $message = getMessage('LOGIN_NO_COOKIES'); break; case getCode('COOKIES_DISABLED') : $message = getMessage('LOGIN_NO_COOKIES'); break; case getCode('BEG_SAME_AS_OWN') : $message = getMessage('BEG_SAME_UID_AS_OWN'); break; @@ -3182,6 +3186,9 @@ function determineReferalId () { // Default is not found $found = false; + // Set current userid here if no member + if (!isMember()) setCurrentUserId($GLOBALS['refid']); + // Do we have nickname or userid set? if (isNicknameUsed($GLOBALS['refid'])) { // Nickname in URL, so load the id