* -------------------------------------------------------------------- *
* Copyright (c) 2003 - 2009 by Roland Haeder *
* Copyright (c) 2009 - 2011 by Mailer Developer Team *
- * For more information visit: http://www.mxchange.org *
+ * For more information visit: http://mxchange.org *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
}
// Encode strings
-// @TODO Implement $compress
-function encodeString ($str, $compress = true) {
+function encodeString ($str) {
$str = urlencode(base64_encode(compileUriCode($str)));
return $str;
}
// Decode strings encoded with encodeString()
-// @TODO Implement $decompress
-function decodeString ($str, $decompress = true) {
+function decodeString ($str) {
$str = compileUriCode(base64_decode(urldecode(compileUriCode($str))));
return $str;
}
// Do we have cache?
if (!isset($GLOBALS['file_readable'][$FQFN])) {
// Check all...
- $GLOBALS['file_readable'][$FQFN] = ((file_exists($FQFN)) && (is_file($FQFN)) && (is_readable($FQFN)));
+ $GLOBALS['file_readable'][$FQFN] = ((is_file($FQFN)) && (file_exists($FQFN)) && (is_readable($FQFN)));
} // END - if
// Return result
// Determine wether we are installing
if (!isset($GLOBALS['mailer_installing'])) {
// Check URL (css.php/js.php need this)
- $GLOBALS['mailer_installing'] = isGetRequestParameterSet('installing');
+ $GLOBALS['mailer_installing'] = isGetRequestElementSet('installing');
} // END - if
// Return result
// Wrapper for $_POST['sel']
function countPostSelection ($element = 'sel') {
// Is it set?
- if (isPostRequestParameterSet($element)) {
+ if (isPostRequestElementSet($element)) {
// Return counted elements
- return countSelection(postRequestParameter($element));
+ return countSelection(postRequestElement($element));
} else {
// Return zero if not found
return 0;
// Is the cache there
if (!isset($GLOBALS[__FUNCTION__][$userid])) {
// Determine it
- $GLOBALS[__FUNCTION__][$userid] = ((!empty($userid)) && (('' . round($userid) . '') != $userid));
+ $GLOBALS[__FUNCTION__][$userid] = ((!empty($userid)) && (('' . round($userid) . '') != $userid) && ($userid != 'NULL'));
} // END - if
// Return the result
// Getter for 'what' value
function getWhat () {
// Default is null
- $what = null;
+ $what = NULL;
// Is the value set?
if (isWhatSet(true)) {
// Getter for 'action' value
function getAction ($strict = true) {
// Default is null
- $action = null;
+ $action = NULL;
// Is the value set?
if (isActionSet(($strict) && (isHtmlOutputMode()))) {
// Getter for 'module' value
function getModule ($strict = true) {
// Default is null
- $module = null;
+ $module = NULL;
// Is the value set?
if (isModuleSet($strict)) {
// Do we have cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Default is null
- $output_mode = null;
+ $output_mode = NULL;
// Is the value set?
if (isOutputModeSet(true)) {
} // END - if
// Init the user
+ unset($GLOBALS['is_userdata_valid'][getCurrentUserId()]);
$GLOBALS['user_data'][getCurrentUserId()] = array();
}
} // END - if
// Default is empty
- $data = null;
+ $data = NULL;
if (isset($GLOBALS['user_data'][getCurrentUserId()][$column])) {
// Return the value
// in, but you should use isMember() if you want to find that out.
function isUserDataValid () {
// User id should not be zero so abort here
- if (!isCurrentUserIdSet()) return false;
+ if (!isCurrentUserIdSet()) {
+ return false;
+ } // END - if
// Is it cached?
if (!isset($GLOBALS['is_userdata_valid'][getCurrentUserId()])) {
// check if running on IIS < 6 with CGI-PHP
if ((isset($_SERVER['SERVER_SOFTWARE'])) && (isset($_SERVER['GATEWAY_INTERFACE'])) &&
- (strpos($_SERVER['GATEWAY_INTERFACE'], 'CGI') !== false) &&
+ (isInString('CGI', $_SERVER['GATEWAY_INTERFACE'])) &&
(preg_match('|^Microsoft-IIS/(\d)\.\d$|', trim($_SERVER['SERVER_SOFTWARE']), $matches)) &&
($matches[1] < 6)) {
// Send the IIS header
}
// "Getter" for date from patch_ctime
-function getDateFromPatchTime () {
+function getDateFromRepository () {
+ // Is it cached?
+ if (!isset($GLOBALS[__FUNCTION__])) {
+ // Then set it
+ $GLOBALS[__FUNCTION__] = generateDateTime(getConfig('CURRENT_REPOSITORY_DATE'), '5');
+ } // END - if
+
+ // Return cache
+ return $GLOBALS[__FUNCTION__];
+}
+
+// "Getter" for date/time from patch_ctime
+function getDateTimeFromRepository () {
// Is it cached?
if (!isset($GLOBALS[__FUNCTION__])) {
// Then set it
- $GLOBALS[__FUNCTION__] = generateDateTime(getConfig('patch_ctime'), '5');
+ $GLOBALS[__FUNCTION__] = generateDateTime(getConfig('CURRENT_REPOSITORY_DATE'), '2');
} // END - if
// Return cache
}
// Getter for current year (default)
-function getYear ($timestamp = null) {
+function getYear ($timestamp = NULL) {
// Is it cached?
if (!isset($GLOBALS[__FUNCTION__][$timestamp])) {
// null is time()
}
// Getter for current month (default)
-function getMonth ($timestamp = null) {
+function getMonth ($timestamp = NULL) {
// Is it cached?
if (!isset($GLOBALS[__FUNCTION__][$timestamp])) {
// If null is set, use time()
}
// Getter for current hour (default)
-function getHour ($timestamp = null) {
+function getHour ($timestamp = NULL) {
// Is it cached?
if (!isset($GLOBALS[__FUNCTION__][$timestamp])) {
// null is time()
}
// Getter for current day (default)
-function getDay ($timestamp = null) {
+function getDay ($timestamp = NULL) {
// Is it cached?
if (!isset($GLOBALS[__FUNCTION__][$timestamp])) {
// null is time()
}
// Getter for current week (default)
-function getWeek ($timestamp = null) {
+function getWeek ($timestamp = NULL) {
// Is it cached?
if (!isset($GLOBALS[__FUNCTION__][$timestamp])) {
// null is time()
}
// Getter for current short_hour (default)
-function getShortHour ($timestamp = null) {
+function getShortHour ($timestamp = NULL) {
// Is it cached?
if (!isset($GLOBALS[__FUNCTION__][$timestamp])) {
// null is time()
}
// Getter for current long_hour (default)
-function getLongHour ($timestamp = null) {
+function getLongHour ($timestamp = NULL) {
// Is it cached?
if (!isset($GLOBALS[__FUNCTION__][$timestamp])) {
// null is time()
}
// Getter for current second (default)
-function getSecond ($timestamp = null) {
+function getSecond ($timestamp = NULL) {
// Is it cached?
if (!isset($GLOBALS[__FUNCTION__][$timestamp])) {
// null is time()
}
// Getter for current minute (default)
-function getMinute ($timestamp = null) {
+function getMinute ($timestamp = NULL) {
// Is it cached?
if (!isset($GLOBALS[__FUNCTION__][$timestamp])) {
// null is time()
return $GLOBALS[__FUNCTION__];
}
+// "Getter" for title_left
+function getTitleLeft () {
+ // Do we have cache?
+ if (!isset($GLOBALS[__FUNCTION__])) {
+ // Determine it
+ $GLOBALS[__FUNCTION__] = getConfig('title_left');
+ } // END - if
+
+ // Return cache
+ return $GLOBALS[__FUNCTION__];
+}
+
+// "Getter" for title_right
+function getTitleRight () {
+ // Do we have cache?
+ if (!isset($GLOBALS[__FUNCTION__])) {
+ // Determine it
+ $GLOBALS[__FUNCTION__] = getConfig('title_right');
+ } // END - if
+
+ // Return cache
+ return $GLOBALS[__FUNCTION__];
+}
+
+// "Getter" for title_middle
+function getTitleMiddle () {
+ // Do we have cache?
+ if (!isset($GLOBALS[__FUNCTION__])) {
+ // Determine it
+ $GLOBALS[__FUNCTION__] = getConfig('title_middle');
+ } // END - if
+
+ // Return cache
+ return $GLOBALS[__FUNCTION__];
+}
+
+// Getter for 'check_double_email'
+function getCheckDoubleEmail () {
+ // Is the cache entry set?
+ if (!isset($GLOBALS[__FUNCTION__])) {
+ // No, so determine it
+ $GLOBALS[__FUNCTION__] = getConfig('check_double_email');
+ } // END - if
+
+ // Return cached entry
+ return $GLOBALS[__FUNCTION__];
+}
+
+// Checks wether 'check_double_email' is 'Y'
+function isCheckDoubleEmailEnabled () {
+ // Is the cache entry set?
+ if (!isset($GLOBALS[__FUNCTION__])) {
+ // No, so determine it
+ $GLOBALS[__FUNCTION__] = (getCheckDoubleEmail() == 'Y');
+ } // END - if
+
+ // Return cached entry
+ return $GLOBALS[__FUNCTION__];
+}
+
+// Getter for 'display_home_in_index'
+function getDisplayHomeInIndex () {
+ // Is the cache entry set?
+ if (!isset($GLOBALS[__FUNCTION__])) {
+ // No, so determine it
+ $GLOBALS[__FUNCTION__] = getConfig('display_home_in_index');
+ } // END - if
+
+ // Return cached entry
+ return $GLOBALS[__FUNCTION__];
+}
+
+// Checks wether 'display_home_in_index' is 'Y'
+function isDisplayHomeInIndexEnabled () {
+ // Is the cache entry set?
+ if (!isset($GLOBALS[__FUNCTION__])) {
+ // No, so determine it
+ $GLOBALS[__FUNCTION__] = (getDisplayHomeInIndex() == 'Y');
+ } // END - if
+
+ // Return cached entry
+ return $GLOBALS[__FUNCTION__];
+}
+
// Checks wether proxy configuration is used
function isProxyUsed () {
// Do we have cache?
// Do we have cache?
if (!isset($GLOBALS[__FUNCTION__][$element])) {
// Determine it
- $GLOBALS[__FUNCTION__][$element] = ((isPostRequestParameterSet($element)) && (countPostSelection($element) > 0));
+ $GLOBALS[__FUNCTION__][$element] = ((isPostRequestElementSet($element)) && (countPostSelection($element) > 0));
} // END - if
// Return cache
// Shortens converting of German comma to Computer's version in POST data
function convertCommaToDotInPostData ($postEntry) {
// Read and convert given entry
- $postValue = convertCommaToDot(postRequestParameter($postEntry));
+ $postValue = convertCommaToDot(postRequestElement($postEntry));
// ... and set it again
- setPostRequestParameter($postEntry, $postValue);
+ setPostRequestElement($postEntry, $postValue);
}
// Converts German commas to Computer's version in all entries
// Replace german decimal comma with computer decimal dot
foreach ($postEntries as $entry) {
// Is the entry there?
- if (isPostRequestParameterSet($entry)) {
+ if (isPostRequestElementSet($entry)) {
// Then convert it
convertCommaToDotInPostData($entry);
} // END - if
}
// Generates a YES/NO option list from given default
-function generateYesNoOptionList ($default = '') {
+function generateYesNoOptionList ($configValue = '') {
// Generate it
- return generateOptionList('/ARRAY/', array('Y', 'N'), array('{--YES--}', '{--NO--}'), $default);
+ return generateOptionList('/ARRAY/', array('Y', 'N'), array('{--YES--}', '{--NO--}'), $configValue);
}
// "Getter" for total available receivers
return $GLOBALS[__FUNCTION__][$userid];
}
-//-----------------------------------------------------------------------------
-// Configuration wrapper
-//-----------------------------------------------------------------------------
-
-// Getter for 'check_double_email'
-function getCheckDoubleEmail () {
- // Is the cache entry set?
- if (!isset($GLOBALS[__FUNCTION__])) {
- // No, so determine it
- $GLOBALS[__FUNCTION__] = getConfig('check_double_email');
- } // END - if
-
- // Return cached entry
- return $GLOBALS[__FUNCTION__];
-}
-
-// Checks wether 'check_double_email' is 'Y'
-function isCheckDoubleEmailEnabled () {
- // Is the cache entry set?
- if (!isset($GLOBALS[__FUNCTION__])) {
- // No, so determine it
- $GLOBALS[__FUNCTION__] = (getCheckDoubleEmail() == 'Y');
- } // END - if
-
- // Return cached entry
- return $GLOBALS[__FUNCTION__];
-}
-
// [EOF]
?>