我在搜索类似问题时遇到了这个问题:gavick 的 facebook 登录没有分配 k2 用户组。我怀疑解决方案是一样的。
编辑:/plugins/users/k2/k2.php
在函数“onLoginUser”中替换:
// Get the user id
$db = JFactory::getDBO();
$db->setQuery("SELECT id FROM #__users WHERE username = ".$db->Quote($user['username']));
$id = $db->loadResult();
和:
// Get the user id
$db = JFactory::getDBO();
$db->setQuery("SELECT id FROM #__users WHERE username = ".$db->Quote($user['username']));
$id = $db->loadResult();
$db->setQuery("SELECT username FROM #__users WHERE username = ".$db->Quote($user['username']));
$mytempusername = $db->loadResult();
并替换:
$row->set('userID', $id);
$row->set('userName', $mytempusername);
$row->set('group', $params->get('K2UserGroup', 1));
和:
$row->set('userID', $id);
//$row->set('userName', $user['fullname']);
$row->set('userName', $mytempusername);
$row->set('group', $params->get('K2UserGroup', 1));