$points = '0';
// Don't pay is the default...
- $pay = FALSE;
+ $isPayed = FALSE;
// Validate if it is not a number
if ((isExtensionActive('nickname')) && (isNicknameUsed(getRequestElement('userid')))) {
//* DEBUG: */ logDebugMessage(__FILE__, __LINE__, 'SQL_HASZERONUMS()=' . intval(SQL_HASZERONUMS($result)) . ',isAdmin()=' . intval(isAdmin()) . ',points=' . $points . ',isMember()=' . intval(isMember()) . ',getBegPayMode()=' . getBegPayMode());
if ((SQL_HASZERONUMS($result)) && ($points > 0) && (getBegPayMode() == 'NONE') && ((!isMember()) || (isAdmin()))) {
// Default is result from isAdmin(), mostly false
- $pay = isAdmin();
+ $isPayed = isAdmin();
// Admin is testing?
if (!isAdmin()) {
), __FILE__, __LINE__);
// Was is successfull?
- $pay = (!SQL_HASZEROAFFECTED());
+ $isPayed = (!SQL_HASZEROAFFECTED());
} // END - if
// Pay points?
- //* DEBUG: */ logDebugMessage(__FILE__, __LINE__, 'pay=' . intval($pay));
- if ($pay === TRUE) {
+ //* DEBUG: */ logDebugMessage(__FILE__, __LINE__, 'isPayed=' . intval($isPayed));
+ if ($isPayed === TRUE) {
// Add points to user or begging rallye account
if (addPointsBeg(getUserData('userid'), $points)) {
// Set 'done' message
} elseif (getBegPayMode() != 'NONE') { // Other pay-mode active!
// Load message template depending on pay-mode
$content['message'] = loadTemplate('beg_pay_mode_' . strtolower(getBegPayMode()), TRUE, $content);
- $pay = TRUE;
+ $isPayed = TRUE;
} else {
// Clicked received while reload lock is active
$content['message'] = loadTemplate('beg_failed', TRUE, $content);
loadTemplate('beg_link', FALSE, $content);
// Tracker code enabled? (We don't track users here!
- if ((getBegPayMode() != 'NONE') && ($pay === TRUE)) {
+ if ((getBegPayMode() != 'NONE') && ($isPayed === TRUE)) {
// Prepare content for template
// @TODO Opps, what is missing here???
$content = array(
// Include config-depending template
loadTemplate('beg_pay_code_' . strtolower(getBegPayMode()), FALSE, $content);
- } elseif (($pay === FALSE) && (!isset($content['message']))) {
+ } elseif (($isPayed === FALSE) && (!isset($content['message']))) {
// Cannot pay! :-(
$content['message'] = loadTemplate('beg_failed', TRUE);
}
// Private function to replace the code
function replaceExpressionCode ($data, $replacer) {
// Replace the code
- // @TODO is escapeQuotes() enougth for strings with single/double quotes?
+ // @TODO is escapeQuotes() enough for strings with single/double quotes?
return str_replace($data['matches'][0][$data['key']], $replacer, escapeQuotes($data['code']));
}
// And cache it
$GLOBALS['expression_function_available'][$entry] = FALSE;
}
- } elseif ($GLOBALS['expression_function_available'][$entry] == FALSE) {
- // Debug message
+ } elseif (($GLOBALS['expression_function_available'][$entry] == FALSE) && (isDebugModeEnabled())) {
+ // Debug message in debug mode
logDebugMessage(__FUNCTION__, __LINE__, 'Expression function for entry ' . $entry . ' requested but does not exist.');
}
// Getter for above expression function
function getExpressionFunction ($data) {
// Get the enty we need
- $entry = $data['matches'][4][$data['key']];
+ $entry = trim($data['matches'][4][$data['key']]);
// Return it
return $GLOBALS['expression_function_name'][$entry];
sendEmail($userid, '{--MEMBER_AUTOPURGE_SUBJECT--}', $message);
}
+// ----------------------------------------------------------------------------
+// Wrapper for configuration entries
+// ----------------------------------------------------------------------------
+
// Checks whether auto-purging is enabled
function isAutoPurgingActive () {
// Is there cache?
return $GLOBALS[__FUNCTION__];
}
+// "Getter" for ap_inactive_time
+function getApInactiveTime () {
+ // Is there cache?
+ if (!isset($GLOBALS[__FUNCTION__])) {
+ // Determine it
+ $GLOBALS[__FUNCTION__] = getConfig('ap_inactive_time');
+ } // END - if
+
+ // Return cache
+ return $GLOBALS[__FUNCTION__];
+}
+
+// "Getter" for ap_dm_timeout
+function getApDmTimeout () {
+ // Is there cache?
+ if (!isset($GLOBALS[__FUNCTION__])) {
+ // Determine it
+ $GLOBALS[__FUNCTION__] = getConfig('ap_dm_timeout');
+ } // END - if
+
+ // Return cache
+ return $GLOBALS[__FUNCTION__];
+}
+
+// "Getter" for ap_tasks_time
+function getApTasksTime () {
+ // Is there cache?
+ if (!isset($GLOBALS[__FUNCTION__])) {
+ // Determine it
+ $GLOBALS[__FUNCTION__] = getConfig('ap_tasks_time');
+ } // END - if
+
+ // Return cache
+ return $GLOBALS[__FUNCTION__];
+}
+
+// "Getter" for ap_unconfirmed_time
+function getApUnconfirmedTime () {
+ // Is there cache?
+ if (!isset($GLOBALS[__FUNCTION__])) {
+ // Determine it
+ $GLOBALS[__FUNCTION__] = getConfig('ap_unconfirmed_time');
+ } // END - if
+
+ // Return cache
+ return $GLOBALS[__FUNCTION__];
+}
+
// [EOF]
?>
// Load the include file
$inc = sprintf("inc/modules/admin/what-%s.php", getWhat());
-if (isIncludeReadable($inc)) {
+if (isIncludeReadable($inc)) {
// Ok, we finally load the admin action module
loadIncludeOnce($inc);
} else {
// Load the include file
$inc = sprintf("inc/modules/admin/what-%s.php", getWhat());
-if (isIncludeReadable($inc)) {
+if (isIncludeReadable($inc)) {
// Ok, we finally load the admin action module
loadIncludeOnce($inc);
} else {
// Load the include file
$inc = sprintf("inc/modules/admin/what-%s.php", getWhat());
-if (isIncludeReadable($inc)) {
+if (isIncludeReadable($inc)) {
// Ok, we finally load the admin action module
loadIncludeOnce($inc);
} else {
// Return cache
return $GLOBALS[__FUNCTION__];
}
-
-// "Getter" for auto_purge
-function getAutoPurge () {
- // Is there cache?
- if (!isset($GLOBALS[__FUNCTION__])) {
- // Determine it
- $GLOBALS[__FUNCTION__] = getConfig('auto_purge');
- } // END - if
-
- // Return cache
- return $GLOBALS[__FUNCTION__];
-}
-
-// "Getter" for bonus_userid
-function getBonusUserid () {
- // Is there cache?
- if (!isset($GLOBALS[__FUNCTION__])) {
- // Determine it
- $GLOBALS[__FUNCTION__] = getConfig('bonus_userid');
- } // END - if
-
- // Return cache
- return $GLOBALS[__FUNCTION__];
-}
-
-// "Getter" for ap_inactive_time
-function getApInactiveTime () {
- // Is there cache?
- if (!isset($GLOBALS[__FUNCTION__])) {
- // Determine it
- $GLOBALS[__FUNCTION__] = getConfig('ap_inactive_time');
- } // END - if
-
- // Return cache
- return $GLOBALS[__FUNCTION__];
-}
-
-// "Getter" for ap_dm_timeout
-function getApDmTimeout () {
- // Is there cache?
- if (!isset($GLOBALS[__FUNCTION__])) {
- // Determine it
- $GLOBALS[__FUNCTION__] = getConfig('ap_dm_timeout');
- } // END - if
-
- // Return cache
- return $GLOBALS[__FUNCTION__];
-}
-
-// "Getter" for ap_tasks_time
-function getApTasksTime () {
- // Is there cache?
- if (!isset($GLOBALS[__FUNCTION__])) {
- // Determine it
- $GLOBALS[__FUNCTION__] = getConfig('ap_tasks_time');
- } // END - if
-
- // Return cache
- return $GLOBALS[__FUNCTION__];
-}
-
-// "Getter" for ap_unconfirmed_time
-function getApUnconfirmedTime () {
- // Is there cache?
- if (!isset($GLOBALS[__FUNCTION__])) {
- // Determine it
- $GLOBALS[__FUNCTION__] = getConfig('ap_unconfirmed_time');
- } // END - if
-
- // Return cache
- return $GLOBALS[__FUNCTION__];
-}
-
// "Getter" for points
function getPoints () {
// Is there cache?
// Was that mail a valid one?
if ($isValid === TRUE) {
// If time is zero seconds we have a sponsor mail. 1 Second shall be set to avoid problems
- if (($time == '0') && ($payment > 0)) {
+ if (($time == '0') && ($payment > 0)) {
$url = getUrl();
$time = 1;
} // END - if