$action = null;
// Is the value set?
- if (isActionSet(($strict) && (getScriptOutputMode() == 0))) {
+ if (isActionSet(($strict) && (isHtmlOutputMode()))) {
// Then use it
$action = $GLOBALS['action'];
} // END - if
// Init user data array
function initUserData () {
// User id should not be zero
- if (getCurrentUserId() < 1) debug_report_bug(__FUNCTION__, __LINE__, 'User id is zero.');
+ if (!isValidUserId(getCurrentUserId())) {
+ // Should be always valid
+ debug_report_bug(__FUNCTION__, __LINE__, 'User id is zero.');
+ } // END - if
// Init the user
$GLOBALS['user_data'][getCurrentUserId()] = array();
// Getter for user data
function getUserData ($column) {
// User id should not be zero
- if (getCurrentUserId() < 1) debug_report_bug(__FUNCTION__, __LINE__, 'User id is zero.');
+ if (!isValidUserId(getCurrentUserId())) {
+ // Should be always valid
+ debug_report_bug(__FUNCTION__, __LINE__, 'User id is zero.');
+ } // END - if
// Return the value
return $GLOBALS['user_data'][getCurrentUserId()][$column];
// Geter for whole user data array
function getUserDataArray () {
// Get user id
- $uid = getCurrentUserId();
+ $userid = getCurrentUserId();
- // User id should not be zero
- if ($uid < 1) debug_report_bug(__FUNCTION__, __LINE__, 'User id is zero.');
+ // Is the current userid valid?
+ if (!isValidUserId($userid)) {
+ // Should be always valid
+ debug_report_bug(__FUNCTION__, __LINE__, 'User id is invalid.');
+ } // END - if
// Get the whole array if found
- if (isset($GLOBALS['user_data'][$uid])) {
+ if (isset($GLOBALS['user_data'][$userid])) {
// Found, so return it
- return $GLOBALS['user_data'][$uid];
+ return $GLOBALS['user_data'][$userid];
} else {
// Return empty array
return array();
// check if running on IIS < 6 with CGI-PHP
if ((isset($_SERVER['SERVER_SOFTWARE'])) && (isset($_SERVER['GATEWAY_INTERFACE'])) &&
- (strpos($_SERVER['GATEWAY_INTERFACE'],'CGI') !== false) &&
+ (strpos($_SERVER['GATEWAY_INTERFACE'], 'CGI') !== false) &&
(preg_match('|^Microsoft-IIS/(\d)\.\d$|', trim($_SERVER['SERVER_SOFTWARE']), $matches)) &&
($matches[1] < 6)) {
// Send the IIS header
// Encodes entities
function encodeEntities ($str) {
// Secure it first
- $str = secureString($str);
+ $str = secureString($str, true, true);
// Encode dollar sign as well
$str = str_replace('$', '$', $str);
return $GLOBALS['index_home'];
}
+// "Getter" for one_day
+function getOneDay () {
+ // Do we have cache?
+ if (!isset($GLOBALS['one_day'])) {
+ // Determine it
+ $GLOBALS['one_day'] = getConfig('ONE_DAY');
+ } // END - if
+
+ // Return cache
+ return $GLOBALS['one_day'];
+}
+
// Checks wether proxy configuration is used
function isProxyUsed () {
// Do we have cache?
// Do we have cache?
if (!isset($GLOBALS['post_contains_selections'][$element])) {
// Determine it
- $GLOBALS['post_contains_selections'][$element] = (countPostSelection($element) > 0);
+ $GLOBALS['post_contains_selections'][$element] = ((isPostRequestParameterSet($element)) && (countPostSelection($element) > 0));
} // END - if
// Return cache
return $GLOBALS['is_direct_payment_allowed'];
}
+// Wrapper to check if current task is for extension (not update)
+function isExtensionTask ($content) {
+ // Do we have cache?
+ if (!isset($GLOBALS['is_extension_task'][$content['task_type'] . '_' . $content['infos']])) {
+ // Determine it
+ $GLOBALS['is_extension_task'][$content['task_type'] . '_' . $content['infos']] = (($content['task_type'] == 'EXTENSION') && (isExtensionNameValid($content['infos'])) && (!isExtensionInstalled($content['infos'])));
+ } // END - if
+
+ // Return cache
+ return $GLOBALS['is_extension_task'][$content['task_type'] . '_' . $content['infos']];
+}
+
+// Wrapper to check if output mode is CSS
+function isCssOutputMode () {
+ // Determine it
+ return (getScriptOutputMode() == 1);
+}
+
+// Wrapper to check if output mode is HTML
+function isHtmlOutputMode () {
+ // Determine it
+ return (getScriptOutputMode() == 0);
+}
+
+// Wrapper to check if output mode is RAW
+function isRawOutputMode () {
+ // Determine it
+ return (getScriptOutputMode() == -1);
+}
+
// [EOF]
?>