public function send_invitation($username, $password, $userfriend_id, $content_message = '') { global $charset; if ($this->verifyUserPass($username, $password) == "valid") { $user_id = UserManager::get_user_id_from_username($username); $message_title = get_lang('Invitation'); $count_is_true = SocialManager::send_invitation_friend($user_id, $userfriend_id, $message_title, $content_message); if ($count_is_true) { return Display::display_normal_message(api_htmlentities(get_lang('InvitationHasBeenSent'), ENT_QUOTES, $charset), false); } else { return Display::display_error_message(api_htmlentities(get_lang('YouAlreadySentAnInvitation'), ENT_QUOTES, $charset), false); } } return get_lang('InvalidId'); }