} else {//User already exists, update info and login
} else {
// User already exists, update info and login
$chamilo_uid = $chamiloUinfo['user_id'];
$chamilo_uid = $chamiloUinfo['user_id'];
$u['user_id'] = $chamilo_uid;
$u['user_id'] = $chamilo_uid;
external_update_user($u);
external_update_user($u);
@ -110,7 +110,7 @@ function facebookConnect()
/**
/**
* Get facebook login url for the platform
* Get facebook login url for the platform
* @return mixed
* @return string
*/
*/
function facebookGetLoginUrl()
function facebookGetLoginUrl()
{
{
@ -123,8 +123,8 @@ function facebookGetLoginUrl()
}
}
/**
/**
* Return a valid Chamilo login
* Chamilo login only use characters lettres, des chiffres et les signes _ . -
* Chamilo login only use characters lettres, des chiffres et les signes _ . -
* return a string containing valid chamilo login characters
* @param $in_txt
* @param $in_txt
* @return mixed
* @return mixed
*/
*/
@ -138,13 +138,18 @@ function changeToValidChamiloLogin($in_txt)
* @param string $language
* @param string $language
* @return bool
* @return bool
*/
*/
function getLanguageForFacebook($language = 'en_US')
function facebookPluginGetLanguage($language = 'en_US')
{
{
$language = substr($language, 0, 2);
$language = substr($language, 0, 2);
$sqlResult = Database::query("SELECT english_name FROM ".Database::get_main_table(TABLE_MAIN_LANGUAGE)." WHERE available = 1 AND isocode = '$language'");