I have been trying to find out why and I found this :
core-facebook/Model/Service.php => file that handles the registration via FB (my assumption) :
$iFriendId = (int)Phpfox::getParam('user.on_register_privacy_setting');
if ($iFriendId > 0 && Phpfox::isModule('friend')) {
$iCheckFriend = db()->select('COUNT(*)')
->from(Phpfox::getT('friend'))
->where('user_id = ' . (int)$id . ' AND friend_user_id = ' . (int)$iFriendId)
->execute('getSlaveField');
if (!$iCheckFriend) {
db()->insert(Phpfox::getT('friend'), array(
'list_id' => 0,
'user_id' => $id,
'friend_user_id' => $iFriendId,
'time_stamp' => PHPFOX_TIME
)
);
db()->insert(Phpfox::getT('friend'), array(
'list_id' => 0,
'user_id' => $iFriendId,
'friend_user_id' => $id,
'time_stamp' => PHPFOX_TIME
)
);
if (!Phpfox::getParam('user.approve_users')) {
Phpfox::getService('friend.process')->updateFriendCount($id, $iFriendId);
Phpfox::getService('friend.process')->updateFriendCount($iFriendId, $id);
}
}
}
While for regular registration by email :
user/service/process.php
$iFriendId = (int)Phpfox::getParam('user.on_signup_new_friend');
if ($iFriendId > 0 && Phpfox::isModule('friend')) {
$iCheckFriend = $this->database()->select('COUNT(*)')
->from(Phpfox::getT('friend'))
->where('user_id = ' . (int)$iId . ' AND friend_user_id = ' . (int)$iFriendId)
->execute('getSlaveField');
if (!$iCheckFriend) {
$this->database()->insert(Phpfox::getT('friend'), [
'list_id' => 0,
'user_id' => $iId,
'friend_user_id' => $iFriendId,
'time_stamp' => PHPFOX_TIME
]
);
$this->database()->insert(Phpfox::getT('friend'), [
'list_id' => 0,
'user_id' => $iFriendId,
'friend_user_id' => $iId,
'time_stamp' => PHPFOX_TIME
]
);
Phpfox::getService('friend.process')->updateFriendCount($iId, $iFriendId);
Phpfox::getService('friend.process')->updateFriendCount($iFriendId, $iId);
}
}
if ($sPlugin = Phpfox_Plugin::get('user.service_process_add_check_1')) {
eval($sPlugin);
}
I think this is a bug.
Can anyone confirm this?
Thank you.