Add token oauth for social network (#30813)

* Add token oauth for social network

* Fix phpstan errors

* Fix phpstan errors

* variable undeclared and phan errors

* variable undeclared and phan errors

---------

Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
This commit is contained in:
lamrani abdelwadoud 2024-09-29 22:36:08 +02:00 committed by GitHub
parent 4690f4aadb
commit 0ec1d2b750
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -295,8 +295,26 @@ print '<td>https://mastodon.social/api/v1/accounts/id_user</td>';
print '</tr>';
$vartosmtpstype = 'MAIN_MAIL_SMTPS_AUTH_TYPE_EMAILING';
print '<script>
$(document).ready(function() {
function toggleOAuthServiceDisplay() {
if ($("#radio_oauth").is(":checked")) {
$("#oauth_service_div").show();
} else {
$("#oauth_service_div").hide();
}
}
toggleOAuthServiceDisplay();
$("input[name=\"'.$vartosmtpstype.'\"]").change(function() {
toggleOAuthServiceDisplay();
});
});
</script>';
// Methods oauth
print '<td>'.$langs->trans("MAIN_MAIL_SMTPS_AUTH_TYPE").'</td>';
print '<tr><td>'.$langs->trans("MAIN_MAIL_SMTPS_AUTH_TYPE").'</td>';
print '<td>';
print '<input type="radio" id="radio_oauth" name="'.$vartosmtpstype.'" value="XOAUTH2"'.(getDolGlobalString($vartosmtpstype) == 'XOAUTH2' ? ' checked' : '').(isModEnabled('oauth') ? '' : ' disabled').'>';
print '<label for="radio_oauth">'.$form->textwithpicto($langs->trans("UseOauth"), $langs->trans("OauthNotAvailableForAllAndHadToBeCreatedBefore")).'</label>';