26 require
'../main.inc.php';
27 require_once DOL_DOCUMENT_ROOT.
'/core/lib/admin.lib.php';
28 require_once DOL_DOCUMENT_ROOT.
'/core/lib/oauth.lib.php';
32 $urlwithouturlroot = preg_replace(
'/'.preg_quote(DOL_URL_ROOT,
'/').
'$/i',
'', trim($dolibarr_main_url_root));
33 $urlwithroot = $urlwithouturlroot.DOL_URL_ROOT;
37 $langs->loadLangs(array(
'admin',
'oauth'));
43 $action =
GETPOST(
'action',
'aZ09');
50 if ($action ==
'update')
54 foreach ($list as $constname) {
55 $constvalue =
GETPOST($constname[1],
'alpha');
56 if (!
dolibarr_set_const($db, $constname[1], $constvalue,
'chaine', 0,
'', $conf->entity))
58 $constvalue =
GETPOST($constname[2],
'alpha');
59 if (!
dolibarr_set_const($db, $constname[2], $constvalue,
'chaine', 0,
'', $conf->entity))
77 $form =
new Form($db);
79 $linkback =
'<a href="'.DOL_URL_ROOT.
'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans(
"BackToModuleList").
'</a>';
82 print '<form action="'.$_SERVER[
"PHP_SELF"].
'" method="post">';
83 print '<input type="hidden" name="token" value="'.newToken().
'">';
84 print '<input type="hidden" name="action" value="update">';
91 print '<span class="opacitymedium">'.$langs->trans(
"ListOfSupportedOauthProviders").
'</span><br><br>';
93 print '<table class="noborder centpercent">';
98 foreach ($list as $key)
101 if (in_array($key[0], array_keys($supportedoauth2array))) $supported = 1;
102 if (!$supported)
continue;
106 print '<tr class="liste_titre'.($i > 1 ?
' liste_titre_add' :
'').
'">';
108 $label = $langs->trans($key[0]);
109 print '<td>'.$label.
'</td>';
111 if (!empty($key[3]))
print $langs->trans($key[3]);
117 $redirect_uri = $urlwithroot.
'/core/modules/oauth/'.$supportedoauth2array[$key[0]].
'_oauthcallback.php';
118 print '<tr class="oddeven value">';
119 print '<td>'.$langs->trans(
"UseTheFollowingUrlAsRedirectURI").
'</td>';
120 print '<td><input style="width: 80%" type"text" name="uri'.$key[0].
'" value="'.$redirect_uri.
'">';
123 print '<tr class="oddeven value">';
124 print '<td>'.$langs->trans(
"UseTheFollowingUrlAsRedirectURI").
'</td>';
125 print '<td>'.$langs->trans(
"FeatureNotYetSupported").
'</td>';
130 print '<tr class="oddeven value">';
131 print '<td><label for="'.$key[1].
'">'.$langs->trans($key[1]).
'</label></td>';
132 print '<td><input type="text" size="100" id="'.$key[1].
'" name="'.$key[1].
'" value="'.$conf->global->{$key[1]}.
'">';
136 print '<tr class="oddeven value">';
137 print '<td><label for="'.$key[2].
'">'.$langs->trans($key[2]).
'</label></td>';
138 print '<td><input type="password" size="100" id="'.$key[2].
'" name="'.$key[2].
'" value="'.$conf->global->{$key[2]}.
'">';
142 print '</table>'.
"\n";
146 print '<div class="center"><input type="submit" class="button" value="'.$langs->trans(
'Modify').
'" name="button"></div>';
GETPOST($paramname, $check= 'alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
dolibarr_set_const($db, $name, $value, $type= 'chaine', $visible=0, $note= '', $entity=1)
Insert a parameter (key,value) into database (delete old key then insert it again).
setEventMessages($mesg, $mesgs, $style= 'mesgs', $messagekey= '')
Set event messages in dol_events session object.
load_fiche_titre($titre, $morehtmlright= '', $picto= 'generic', $pictoisfullpath=0, $id= '', $morecssontable= '', $morehtmlcenter= '')
Load a title with picto.
accessforbidden($message= '', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program Calling this function terminate execution ...
oauthadmin_prepare_head()
Return array of tabs to used on pages to setup cron module.
dol_get_fiche_head($links=array(), $active= '', $title= '', $notab=0, $picto= '', $pictoisfullpath=0, $morehtmlright= '', $morecss= '', $limittoshow=0, $moretabssuffix= '')
Show tabs of a record.
print
Draft customers invoices.
dol_get_fiche_end($notab=0)
Return tab footer of a card.