//* DEBUG: */ debugOutput(__FUNCTION__ . '(<font color="#0000aa">' . __LINE__ . '</font>):userid='.$userid.',points='.$points);
if (fetchUserData($userid)) {
// Determine wether the user has some mails to click before he/she gets the points
- $locked = ((getUserData('ref_payout') > 0) && (!isDirectPaymentEnabled()));
+ $locked = ifUserPointsLocked($userid);
// Default is 'normal' points
$data = 'points';
// Send email
sendEmail($userid, '{--THANX_REFERAL_ONE_SUBJECT--}', $message);
- } elseif (($sendNotify === true) && (getUserData('refid') == '0') && ($locked === false) && ($add_mode == 'direct')) {
+ } elseif (($sendNotify === true) && (!isValidUserId(getUserData('refid'))) && ($locked === false) && ($add_mode == 'direct')) {
// Prepare content
$content = array(
'reason' => '{--REASON_DIRECT_PAYMENT--}',