X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Fwrapper-functions.php;h=fda7b2a4c04a5ad6364d213f09f6be2162d49f63;hb=4fef71140a7d5faeaff256ab7c5bf4616c671f63;hp=47bf5c07afd39968bd7d9c40083e76f4a079d4da;hpb=100d6e44219585f66fead2eca33531fd7420d254;p=mailer.git diff --git a/inc/wrapper-functions.php b/inc/wrapper-functions.php index 47bf5c07af..fda7b2a4c0 100644 --- a/inc/wrapper-functions.php +++ b/inc/wrapper-functions.php @@ -997,9 +997,7 @@ function setCurrentUserId ($userid) { // Is the cache from below functions different? if (((isset($GLOBALS['getCurrentUserId'])) && ($GLOBALS['getCurrentUserId'] != $userid)) || ((!isset($GLOBALS['current_userid'])) && (isset($GLOBALS['isCurrentUserIdSet'])))) { // Then unset both - unset($GLOBALS['getCurrentUserId']); - unset($GLOBALS['isCurrentUserIdSet']); - unset($GLOBALS['isValidUserId'][$userid]); + unsetCurrentUserId(); } // END - if // Set userid @@ -1042,6 +1040,20 @@ function isCurrentUserIdSet () { return $GLOBALS[__FUNCTION__]; } +// Unsets current userid +function unsetCurrentUserId () { + // Do we have it set? + if (isset($GLOBALS['current_userid'])) { + // Unset this, too + unset($GLOBALS['isValidUserId'][$GLOBALS['current_userid']]); + } // END - if + + // Unset all cache entries + unset($GLOBALS['current_userid']); + unset($GLOBALS['getCurrentUserId']); + unset($GLOBALS['isCurrentUserIdSet']); +} + // Checks whether we are debugging template cache function isDebuggingTemplateCache () { // Do we have cache?