X-Git-Url: https://git.mxchange.org/?p=mailer.git;a=blobdiff_plain;f=inc%2Fwrapper-functions.php;h=1e36678f6f863f53110d5a1863b03301c988b8fa;hp=7e2856402937a850599a48ed7f7f3b9287be0fce;hb=039203d5428c9c6a3bed61fb3a9a16958c6fd44c;hpb=b8a6f8012aa3509d8e0f8fd078e044f20e80707a diff --git a/inc/wrapper-functions.php b/inc/wrapper-functions.php index 7e28564029..1e36678f6f 100644 --- a/inc/wrapper-functions.php +++ b/inc/wrapper-functions.php @@ -251,6 +251,17 @@ function detectReferer () { return $referer; } +// "Getter" for request URI +function detectRequestUri () { + // Return it + return (getenv('REQUEST_URI')); +} + +// "Getter" for query string +function detectQueryString () { + return str_replace('&', '&', (getenv('QUERY_STRING'))); +} + // Check wether we are installing function isInstalling () { // Determine wether we are installing @@ -373,14 +384,22 @@ function copyFileVerified ($source, $dest, $chmod = '') { // Wrapper function for header() // Send a header but checks before if we can do so function sendHeader ($header) { + // Send the header + $GLOBALS['header'][] = trim($header); +} + +// Flushes all headers +function flushHeaders () { // Is the header already sent? if (headers_sent()) { // Then abort here debug_report_bug('Headers already sent!'); } // END - if - // Send the header - header(trim($header)); + // Flush all headers + foreach ($GLOBALS['header'] as $header) { + header($header); + } // END - foreach } // Wrapper function for chmod() @@ -736,6 +755,7 @@ function isUserDataValid () { // Setter for current userid function setCurrentUserId ($userid) { + logDebugMessage(__FUNCTION__, __LINE__, 'userid='.$userid); $GLOBALS['current_userid'] = bigintval($userid); } @@ -761,5 +781,20 @@ function isDebuggingTemplateCache () { return (getConfig('DEBUG_TEMPLATE_CACHE') == 'Y'); } +// Wrapper for fetchUserData() and getUserData() calls +function getFetchedUserData ($keyColumn, $userId, $valueColumn) { + // Default is 'guest' + $data = getMessage('USERNAME_GUEST'); + + // Can we fetch the user data? + if (($userId > 0) && (fetchUserData($userId, $keyColumn))) { + // Now get the data back + $data = getUserData($valueColumn); + } // END - if + + // Return it + return $data; +} + // [EOF] ?>