';
- print '';
- // Api Name
- $label = $langs->trans($keyforsupportedoauth2array);
- print '| ';
- print img_picto('', $supportedoauth2array[$keyforsupportedoauth2array]['picto'], 'class="pictofixedwidth"');
- print $label;
- if ($keyforprovider) {
- print ' ('.$keyforprovider.')';
- } else {
- print ' ('.$langs->trans("NoName").')';
- }
- print ' | ';
- print '';
- if (!empty($supportedoauth2array[$keyforsupportedoauth2array]['urlforcredentials'])) {
- print $langs->trans("OAUTH_URL_FOR_CREDENTIAL", $supportedoauth2array[$keyforsupportedoauth2array]['urlforcredentials']);
- }
- print ' | ';
- print '
';
+ $i = 0;
- if ($supported) {
- $redirect_uri = $urlwithroot.'/core/modules/oauth/'.$supportedoauth2array[$keyforsupportedoauth2array]['callbackfile'].'_oauthcallback.php';
+ // $list is defined into oauth.lib.php to the list of supporter OAuth providers.
+ foreach ($listinsetup as $key) {
+ $supported = 0;
+ $keyforsupportedoauth2array = $key[0]; // May be OAUTH_GOOGLE_NAME or OAUTH_GOOGLE_xxx_NAME
+ $keyforsupportedoauth2array = preg_replace('/^OAUTH_/', '', $keyforsupportedoauth2array);
+ $keyforsupportedoauth2array = preg_replace('/_NAME$/', '', $keyforsupportedoauth2array);
+ if (preg_match('/^.*-/', $keyforsupportedoauth2array)) {
+ $keyforprovider = preg_replace('/^.*-/', '', $keyforsupportedoauth2array);
+ } else {
+ $keyforprovider = '';
+ }
+ $keyforsupportedoauth2array = preg_replace('/-.*$/', '', $keyforsupportedoauth2array);
+ $keyforsupportedoauth2array = 'OAUTH_'.$keyforsupportedoauth2array.'_NAME';
+
+ if (in_array($keyforsupportedoauth2array, array_keys($supportedoauth2array))) {
+ $supported = 1;
+ }
+ if (!$supported) {
+ continue; // show only supported
+ }
+
+ $i++;
+
+ print '';
+ // Api Name
+ $label = $langs->trans($keyforsupportedoauth2array);
+ print '| ';
+ print img_picto('', $supportedoauth2array[$keyforsupportedoauth2array]['picto'], 'class="pictofixedwidth"');
+ print $label;
+ if ($keyforprovider) {
+ print ' ('.$keyforprovider.')';
+ } else {
+ print ' ('.$langs->trans("NoName").')';
+ }
+ print ' | ';
+ print '';
+ if (!empty($supportedoauth2array[$keyforsupportedoauth2array]['urlforcredentials'])) {
+ print $langs->trans("OAUTH_URL_FOR_CREDENTIAL", $supportedoauth2array[$keyforsupportedoauth2array]['urlforcredentials']);
+ }
+ print ' | ';
+ print '
';
+
+ if ($supported) {
+ $redirect_uri = $urlwithroot.'/core/modules/oauth/'.$supportedoauth2array[$keyforsupportedoauth2array]['callbackfile'].'_oauthcallback.php';
+ print '';
+ print '| '.$langs->trans("UseTheFollowingUrlAsRedirectURI").' | ';
+ print '';
+ print ' |
';
+ } else {
+ print '';
+ print '| '.$langs->trans("UseTheFollowingUrlAsRedirectURI").' | ';
+ print ''.$langs->trans("FeatureNotYetSupported").' | ';
+ print '
';
+ }
+
+ // Api Id
print '';
- print '| '.$langs->trans("UseTheFollowingUrlAsRedirectURI").' | ';
- print '';
+ print ' | | ';
+ print '';
print ' |
';
- } else {
+
+ // Api Secret
print '';
- print '| '.$langs->trans("UseTheFollowingUrlAsRedirectURI").' | ';
- print ''.$langs->trans("FeatureNotYetSupported").' | ';
+ print ' | ';
+ print '';
print ' |
';
}
- // Api Id
- print '';
- print ' | ';
- print '';
- print ' |
';
+ print '