我在搜索類似問題時遇到了這個問題: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));