X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Fwrapper-functions.php;h=c9f97c7b212f8f057c1dc78425d2b18761572cb5;hb=27fed6ed8bbc0d91404947d91db1a07e36c1ea60;hp=c7e4978ce06d380518dae021891ee4699ff816be;hpb=5408c1e4283b9ae9bc34d12e46a5fe6be2442d39;p=mailer.git diff --git a/inc/wrapper-functions.php b/inc/wrapper-functions.php index c7e4978ce0..c9f97c7b21 100644 --- a/inc/wrapper-functions.php +++ b/inc/wrapper-functions.php @@ -1,7 +1,7 @@ '; - debug_print_backtrace(); - die(' 1)); @@ -753,7 +764,7 @@ function setCurrentUserId ($userid) { // Getter for current userid function getCurrentUserId () { // Userid must be set before it can be used - if (!isset($GLOBALS['current_userid'])) { + if (!isCurrentUserIdSet()) { // Not set debug_report_bug('User id is not set.'); } // END - if @@ -762,5 +773,30 @@ function getCurrentUserId () { return $GLOBALS['current_userid']; } +// Checks if current userid is set +function isCurrentUserIdSet () { + return isset($GLOBALS['current_userid']); +} + +// Checks wether we are debugging template cache +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] ?>