// Run a filter for must-fillout fields
function FILTER_REGISTER_MUST_FILLOUT ($filterData) {
// Get all fields for output
- die('!Ok');
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Called!');
$result = SQL_QUERY('SELECT `field_name`,`field_required` FROM `{?_MYSQL_PREFIX?}_must_register` ORDER BY `id` ASC',
__FUNCTION__, __LINE__);
// Secure userid
$value = bigintval($value);
- // Set it here
- setCurrentUserId($value);
-
// Don't look for invalid userids...
if (!isValidUserId($value)) {
// Invalid, so abort here
} // END - if
// Is the 'subject' there?
- if (((!ifSqlTableExist('points_data')) && ((getExtensionMode() == 'register') || (getExtensionMode() == 'update'))) || (countSumTotalData($subject, 'points_data', 'id', 'subject', true, $add) == 0)) {
+ if (((!ifSqlTableExists('points_data')) && ((getExtensionMode() == 'register') || (getExtensionMode() == 'update'))) || (countSumTotalData($subject, 'points_data', 'id', 'subject', true, $add) == 0)) {
// Not found so add an SQL query
addExtensionSql(sprintf("INSERT INTO `{?_MYSQL_PREFIX?}_points_data` (`subject`,`column_name`,`locked_mode`,`payment_method`) VALUES ('%s','%s','%s','%s')",
$subject,
function isUserDataValid () {
// User id should not be zero so abort here
if (!isCurrentUserIdSet()) {
+ // Debug message
+ /* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'isCurrentUserIdSet()=false - ABORTING!');
+
+ // Abort here
return false;
} // END - if
// Setter for current userid
function setCurrentUserId ($userid) {
- // Set userid
- $GLOBALS['current_userid'] = bigintval($userid);
-
- // Unset it to re-determine the actual state
- unset($GLOBALS['is_userdata_valid'][$userid]);
+ // Debug message
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'userid[' . gettype($userid) . ']=' . $userid . ' - ENTERED!');
// Is the cache from below functions different?
- if ((isset($GLOBALS['getCurrentUserId'])) && ($GLOBALS['getCurrentUserId'] != $userid)) {
+ 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]);
} // END - if
+
+ // Set userid
+ $GLOBALS['current_userid'] = bigintval($userid);
+
+ // Unset it to re-determine the actual state
+ unset($GLOBALS['is_userdata_valid'][$userid]);
+
+ // Debug message
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'userid[' . gettype($userid) . ']=' . $userid . ' - EXIT!');
}
// Getter for current userid
// Debug message
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'userid[' . gettype($userid) . ']=' . $userid);
- // Handle NULL
- if (is_null($userid)) {
- // Do not handle this as of below isset() will always return false
- return false;
- } // END - if
-
// Do we have cache?
if (!isset($GLOBALS[__FUNCTION__][$userid])) {
// Check it out
} // END - if
// Return cache
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'userid=' . $userid . ',result=' . intval($GLOBALS[__FUNCTION__][$userid]));
return $GLOBALS[__FUNCTION__][$userid];
}