X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=sidebyside;f=inc%2Fwrapper-functions.php;h=dc9f9eff7c09fd8a28c2e4af41c3eae8198a0a38;hb=0a4b0f81eea5f4daf5e55e695d79a0ee2669bdd8;hp=b5fef6af950db2ab03a84681f2a083496886e60e;hpb=19188207e6802b82a134b340408cfa34b9b3a80f;p=mailer.git diff --git a/inc/wrapper-functions.php b/inc/wrapper-functions.php index b5fef6af95..dc9f9eff7c 100644 --- a/inc/wrapper-functions.php +++ b/inc/wrapper-functions.php @@ -14,8 +14,6 @@ * $Date:: $ * * $Tag:: 0.2.1-FINAL $ * * $Author:: $ * - * Needs to be in all Files and every File needs "svn propset * - * svn:keywords Date Revision" (autoprobset!) at least!!!!!! * * -------------------------------------------------------------------- * * Copyright (c) 2003 - 2009 by Roland Haeder * * Copyright (c) 2009, 2010 by Mailer Developer Team * @@ -276,13 +274,13 @@ function detectServerName () { // Check wether we are installing function isInstalling () { // Determine wether we are installing - if (!isset($GLOBALS[__FUNCTION__])) { + if (!isset($GLOBALS['mailer_installing'])) { // Check URL (css.php/js.php need this) - $GLOBALS[__FUNCTION__] = isGetRequestParameterSet('installing'); + $GLOBALS['mailer_installing'] = isGetRequestParameterSet('installing'); } // END - if // Return result - return $GLOBALS[__FUNCTION__]; + return $GLOBALS['mailer_installing']; } // Check wether this script is installed @@ -326,13 +324,13 @@ function isInstalled () { // Check wether an admin is registered function isAdminRegistered () { // Is cache set? - if (!isset($GLOBALS['is_admin_registered'])) { + if (!isset($GLOBALS[__FUNCTION__])) { // Simply check it - $GLOBALS['is_admin_registered'] = ((isConfigEntrySet('ADMIN_REGISTERED')) && (getConfig('ADMIN_REGISTERED') == 'Y')); + $GLOBALS[__FUNCTION__] = ((isConfigEntrySet('ADMIN_REGISTERED')) && (getConfig('ADMIN_REGISTERED') == 'Y')); } // END - if // Return it - return $GLOBALS['is_admin_registered']; + return $GLOBALS[__FUNCTION__]; } // Checks wether the reset mode is active @@ -666,13 +664,13 @@ function enableBlockMode ($enabled = true) { // Checks wether block-mode is enabled function isBlockModeEnabled () { // Abort if not set - if (!isset($GLOBALS[__FUNCTION__])) { + if (!isset($GLOBALS['block_mode'])) { // Needs to be fixed debug_report_bug(__FUNCTION__, __LINE__, 'Block_mode is not set.'); } // END - if // Return it - return $GLOBALS[__FUNCTION__]; + return $GLOBALS['block_mode']; } // Wrapper function for addPointsThroughReferalSystem() @@ -807,7 +805,7 @@ function initUserData () { // User id should not be zero if (!isValidUserId(getCurrentUserId())) { // Should be always valid - debug_report_bug(__FUNCTION__, __LINE__, 'User id is zero.'); + debug_report_bug(__FUNCTION__, __LINE__, 'Current user id is invalid: ' . getCurrentUserId()); } // END - if // Init the user @@ -819,7 +817,7 @@ function getUserData ($column) { // User id should not be zero if (!isValidUserId(getCurrentUserId())) { // Should be always valid - debug_report_bug(__FUNCTION__, __LINE__, 'User id is zero.'); + debug_report_bug(__FUNCTION__, __LINE__, 'Current user id is invalid: ' . getCurrentUserId()); } // END - if // Return the value @@ -834,7 +832,7 @@ function getUserDataArray () { // Is the current userid valid? if (!isValidUserId($userid)) { // Should be always valid - debug_report_bug(__FUNCTION__, __LINE__, 'User id is invalid.'); + debug_report_bug(__FUNCTION__, __LINE__, 'Current user id is invalid: ' . $userid); } // END - if // Get the whole array if found @@ -965,6 +963,9 @@ function getHttpStatus () { * @access private */ function sendRawRedirect ($url) { + // Send helping header + setHttpStatus('302 Found'); + // always close the session session_write_close(); @@ -1102,8 +1103,11 @@ function getYear ($timestamp = null) { function getMonth ($timestamp = null) { // Is it cached? if (!isset($GLOBALS[__FUNCTION__][$timestamp])) { - // null is time() - if (is_null($timestamp)) $timestamp = time(); + // If null is set, use time() + if (is_null($timestamp)) { + // Use time() which is current timestamp + $timestamp = time(); + } // END - if // Then create it $GLOBALS[__FUNCTION__][$timestamp] = date('m', $timestamp); @@ -1316,7 +1320,7 @@ function isRandomReferalIdEnabled () { // Do we have cache? if (!isset($GLOBALS[__FUNCTION__])) { // Determine it - $GLOBALS[__FUNCTION__] = (getConfig('select_user_zero_refid') == 'Y'); + $GLOBALS[__FUNCTION__] = ((isExtensionInstalledAndNewer('user', '0.3.4')) && (getConfig('select_user_zero_refid') == 'Y')); } // END - if // Return cache @@ -1335,6 +1339,18 @@ function getDefaultLanguage () { return $GLOBALS[__FUNCTION__]; } +// "Getter" for default referal id +function getDefRefid () { + // Do we have cache? + if (!isset($GLOBALS[__FUNCTION__])) { + // Determine it + $GLOBALS[__FUNCTION__] = getConfig('def_refid'); + } // END - if + + // Return cache + return $GLOBALS[__FUNCTION__]; +} + // "Getter" for path function getPath () { // Do we have cache? @@ -1492,11 +1508,11 @@ function getTitle () { } // "Getter" for curr_svn_revision -function getCurrSvnRevision () { +function getCurrentRepositoryRevision () { // Do we have cache? if (!isset($GLOBALS[__FUNCTION__])) { // Determine it - $GLOBALS[__FUNCTION__] = getConfig('CURR_SVN_REVISION'); + $GLOBALS[__FUNCTION__] = getConfig('CURRENT_REPOSITORY_REVISION'); } // END - if // Return cache @@ -1941,5 +1957,23 @@ function isRawOutputMode () { return (getScriptOutputMode() == -1); } +// Wrapper to generate a user email link +function generateWrappedUserEmailLink ($email) { + // Just call the inner function + return generateEmailLink($email, 'user_data'); +} + +// Wrapper to check if user points are locked +function ifUserPointsLocked ($userid) { + // Do we have cache? + if (!isset($GLOBALS[__FUNCTION__][$userid])) { + // Determine it + $GLOBALS[__FUNCTION__][$userid] = ((getFetchedUserData('userid', $userid, 'ref_payout') > 0) && (!isDirectPaymentEnabled())); + } // END - if + + // Return cache + return $GLOBALS[__FUNCTION__][$userid]; +} + // [EOF] ?>