dolibarr 20.0.0
oauth.php
Go to the documentation of this file.
1<?php
2/* Copyright (C) 2015-2018 Frederic France <frederic.france@netlogic.fr>
3 * Copyright (C) 2016 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
4 * Copyright (C) 2022 Laurent Destailleur <eldy@users.sourceforge.net>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 3 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <https://www.gnu.org/licenses/>.
18 */
19
27// Load Dolibarr environment
28require '../main.inc.php';
29require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
30require_once DOL_DOCUMENT_ROOT.'/core/lib/oauth.lib.php';
31
32$supportedoauth2array = getSupportedOauth2Array();
33
34// Define $urlwithroot
35$urlwithouturlroot = preg_replace('/'.preg_quote(DOL_URL_ROOT, '/').'$/i', '', trim($dolibarr_main_url_root));
36$urlwithroot = $urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain name found into config file
37//$urlwithroot=DOL_MAIN_URL_ROOT; // This is to use same domain name than current
38
39// Load translation files required by the page
40$langs->loadLangs(array('admin', 'oauth', 'modulebuilder'));
41
42// Security check
43if (!$user->admin) {
45}
46
47$action = GETPOST('action', 'aZ09');
48$provider = GETPOST('provider', 'aZ09');
49$label = GETPOST('label', 'aZ09');
50
51$servicetoeditname = GETPOST('servicetoeditname', 'aZ09');
52
53$error = 0;
54
55
56/*
57 * Actions
58 */
59
60if ($action == 'add') { // $provider is OAUTH_XXX
61 if ($provider && $provider != '-1') {
62 $constname = strtoupper($provider).($label ? '-'.$label : '').'_ID';
63
64 if (getDolGlobalString($constname)) {
65 setEventMessages($langs->trans("AOAuthEntryForThisProviderAndLabelAlreadyHasAKey"), null, 'errors');
66 $error++;
67 } else {
68 dolibarr_set_const($db, $constname, $langs->trans('ToComplete'), 'chaine', 0, '', $conf->entity);
69 setEventMessages($langs->trans("OAuthProviderAdded"), null);
70 }
71 }
72}
73if ($action == 'update') {
74 foreach ($conf->global as $key => $val) {
75 if (!empty($val) && preg_match('/^OAUTH_.+_ID$/', $key)) {
76 $constvalue = str_replace('_ID', '', $key);
77 $newconstvalue = $constvalue;
78 if (GETPOSTISSET($constvalue.'_NAME')) {
79 $newconstvalue = preg_replace('/-.*$/', '', $constvalue).'-'.GETPOST($constvalue.'_NAME');
80 }
81
82 if (GETPOSTISSET($constvalue.'_ID')) {
83 if (!dolibarr_set_const($db, $newconstvalue.'_ID', GETPOST($constvalue.'_ID'), 'chaine', 0, '', $conf->entity)) {
84 $error++;
85 }
86 }
87 // If we reset this provider, we also remove the secret
88 if (GETPOSTISSET($constvalue.'_SECRET')) {
89 if (!dolibarr_set_const($db, $newconstvalue.'_SECRET', GETPOST($constvalue.'_ID') ? GETPOST($constvalue.'_SECRET') : '', 'chaine', 0, '', $conf->entity)) {
90 $error++;
91 }
92 }
93 if (GETPOSTISSET($constvalue.'_URLAUTHORIZE')) {
94 if (!dolibarr_set_const($db, $newconstvalue.'_URLAUTHORIZE', GETPOST($constvalue.'_URLAUTHORIZE'), 'chaine', 0, '', $conf->entity)) {
95 $error++;
96 }
97 }
98 if (GETPOSTISSET($constvalue.'_TENANT')) {
99 if (!dolibarr_set_const($db, $constvalue.'_TENANT', GETPOST($constvalue.'_TENANT'), 'chaine', 0, '', $conf->entity)) {
100 $error++;
101 }
102 }
103 if (GETPOSTISSET($constvalue.'_SCOPE')) {
104 if (is_array(GETPOST($constvalue.'_SCOPE'))) {
105 $scopestring = implode(',', GETPOST($constvalue.'_SCOPE'));
106 } else {
107 $scopestring = GETPOST($constvalue.'_SCOPE');
108 }
109 if (!dolibarr_set_const($db, $newconstvalue.'_SCOPE', $scopestring, 'chaine', 0, '', $conf->entity)) {
110 $error++;
111 }
112 } elseif ($newconstvalue !== $constvalue) {
113 if (!dolibarr_set_const($db, $newconstvalue.'_SCOPE', '', 'chaine', 0, '', $conf->entity)) {
114 $error++;
115 }
116 }
117
118 // If name changed, we have to delete old const and proceed few other changes
119 if ($constvalue !== $newconstvalue) {
120 dolibarr_del_const($db, $constvalue.'_ID', $conf->entity);
121 dolibarr_del_const($db, $constvalue.'_SECRET', $conf->entity);
122 dolibarr_del_const($db, $constvalue.'_URLAUTHORIZE', $conf->entity);
123 dolibarr_del_const($db, $constvalue.'_SCOPE', $conf->entity);
124
125 // Update name of token
126 $oldname = preg_replace('/^OAUTH_/', '', $constvalue);
127 $oldprovider = ucfirst(strtolower(preg_replace('/-.*$/', '', $oldname)));
128 $oldlabel = preg_replace('/^.*-/', '', $oldname);
129 $newlabel = preg_replace('/^.*-/', '', $newconstvalue);
130
131
132 $sql = "UPDATE ".MAIN_DB_PREFIX."oauth_token";
133 $sql.= " SET service = '".$db->escape($oldprovider."-".$newlabel)."'";
134 $sql.= " WHERE service = '".$db->escape($oldprovider."-".$oldlabel)."'";
135
136
137 $resql = $db->query($sql);
138 if (!$resql) {
139 $error++;
140 }
141
142 // Update const where the token was used, might not be exhaustive
143 if (getDolGlobalString('MAIN_MAIL_SMTPS_OAUTH_SERVICE') == $oldname) {
144 if (!dolibarr_set_const($db, 'MAIN_MAIL_SMTPS_OAUTH_SERVICE', strtoupper($oldprovider).'-'.$newlabel, 'chaine', 0, '', $conf->entity)) {
145 $error++;
146 }
147 }
148 }
149 }
150 }
151
152
153 if (!$error) {
154 setEventMessages($langs->trans("SetupSaved"), null);
155 } else {
156 setEventMessages($langs->trans("Error"), null, 'errors');
157 }
158}
159
160if ($action == 'confirm_delete') {
161 $provider = GETPOST('provider', 'aZ09');
162 $label = GETPOST('label');
163
164 $globalkey = empty($provider) ? $label : $label.'-'.$provider;
165
166 if (getDolGlobalString($globalkey.'_ID') && getDolGlobalString($globalkey.'_SECRET')) { // If ID and secret exist, we delete first the token
167 $backtourl = DOL_URL_ROOT.'/admin/oauth.php?action=delete_entry&provider='.$provider.'&label='.$label.'&token='.newToken();
168 $urlwithouturlroot = preg_replace('/'.preg_quote(DOL_URL_ROOT, '/').'$/i', '', trim($dolibarr_main_url_root));
169 $urlwithroot = $urlwithouturlroot.DOL_URL_ROOT;
170 $callbacktodel = $urlwithroot;
171 if ($label == 'OAUTH_GOOGLE') {
172 $callbacktodel .= '/core/modules/oauth/google_oauthcallback.php?action=delete&keyforprovider='.$provider.'&token='.newToken().'&backtourl='.urlencode($backtourl);
173 } elseif ($label == 'OAUTH_GITHUB') {
174 $callbacktodel .= '/core/modules/oauth/github_oauthcallback.php?action=delete&keyforprovider='.$provider.'&token='.newToken().'&backtourl='.urlencode($backtourl);
175 } elseif ($label == 'OAUTH_STRIPELIVE') {
176 $callbacktodel .= '/core/modules/oauth/stripelive_oauthcallback.php?action=delete&keyforprovider='.$provider.'&token='.newToken().'&backtourl='.urlencode($backtourl);
177 } elseif ($label == 'OAUTH_STRIPETEST') {
178 $callbacktodel .= '/core/modules/oauth/stripetest_oauthcallback.php?action=delete&keyforprovider='.$provider.'&token='.newToken().'&backtourl='.urlencode($backtourl);
179 } elseif ($label == 'OAUTH_MICROSOFT') {
180 $callbacktodel .= '/core/modules/oauth/microsoft_oauthcallback.php?action=delete&keyforprovider='.$provider.'&token='.newToken().'&backtourl='.urlencode($backtourl);
181 } elseif ($label == 'OAUTH_MICROSOFT2') {
182 $callbacktodel .= '/core/modules/oauth/microsoft2_oauthcallback.php?action=delete&keyforprovider='.$provider.'&token='.newToken().'&backtourl='.urlencode($backtourl);
183 } elseif ($label == 'OAUTH_GENERIC') {
184 $callbacktodel .= '/core/modules/oauth/generic_oauthcallback.php?action=delete&keyforprovider='.$provider.'&token='.newToken().'&backtourl='.urlencode($backtourl);
185 }
186 header("Location: ".$callbacktodel);
187 exit;
188 } else {
189 $action = 'delete_entry';
190 }
191}
192
193if ($action == 'delete_entry') {
194 $provider = GETPOST('provider', 'aZ09');
195 $label = GETPOST('label');
196
197 $globalkey = empty($provider) ? $label : $label.'-'.$provider;
198
199 if (!dolibarr_del_const($db, $globalkey.'_NAME', $conf->entity) || !dolibarr_del_const($db, $globalkey.'_ID', $conf->entity) || !dolibarr_del_const($db, $globalkey.'_SECRET', $conf->entity) || !dolibarr_del_const($db, $globalkey.'_URLAUTHORIZE', $conf->entity) || !dolibarr_del_const($db, $globalkey.'_SCOPE', $conf->entity)) {
200 setEventMessages($langs->trans("ErrorInEntryDeletion"), null, 'errors');
201 $error++;
202 } else {
203 setEventMessages($langs->trans("EntryDeleted"), null);
204 }
205}
206
207/*
208 * View
209 */
210
211$form = new Form($db);
212
213$title = $langs->trans('ConfigOAuth');
214$help_url = 'EN:Module_OAuth|FR:Module_OAuth_FR|ES:Módulo_OAuth_ES';
215
216llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-admin page-oauth');
217
218// Confirmation of action process
219if ($action == 'delete') {
220 $formquestion = array();
221 $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?provider='.GETPOST('provider').'&label='.GETPOST('label'), $langs->trans('OAuthServiceConfirmDeleteTitle'), $langs->trans('OAuthServiceConfirmDeleteMessage'), 'confirm_delete', $formquestion, 0, 1, 220);
222 print $formconfirm;
223}
224
225
226$linkback = '<a href="'.DOL_URL_ROOT.'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans("BackToModuleList").'</a>';
227print load_fiche_titre($title, $linkback, 'title_setup');
228
229print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
230print '<input type="hidden" name="token" value="'.newToken().'">';
231print '<input type="hidden" name="action" value="add">';
232
234
235print dol_get_fiche_head($head, 'services', '', -1, '');
236
237
238print '<span class="opacitymedium">'.$langs->trans("ListOfSupportedOauthProviders").'</span><br><br>';
239
240
241$list = getAllOauth2Array();
242
243
244print '<select name="provider" id="provider" class="minwidth150">';
245print '<option name="-1" value="-1">'.$langs->trans("OAuthProvider").'</option>';
246// TODO Make a loop directly on getSupportedOauth2Array() and remove getAllOauth2Array()
247foreach ($list as $key) {
248 $supported = 0;
249 $keyforsupportedoauth2array = $key[0];
250
251 if (in_array($keyforsupportedoauth2array, array_keys($supportedoauth2array))) {
252 $supported = 1;
253 }
254 if (!$supported) {
255 continue; // show only supported
256 }
257
258 print '<option name="'.$keyforsupportedoauth2array.'" value="'.str_replace('_NAME', '', $keyforsupportedoauth2array).'">'.$supportedoauth2array[$keyforsupportedoauth2array]['name'].'</option>'."\n";
259}
260print '</select>';
261print ajax_combobox('provider');
262print ' <input type="text" name="label" value="" placeholder="'.$langs->trans("Label").'" pattern="^\S+$" title="'.$langs->trans("SpaceOrSpecialCharAreNotAllowed").'">';
263print ' <input type="submit" class="button small" name="add" value="'.$langs->trans("Add").'">';
264
265print '<br>';
266print '<br>';
267
268print dol_get_fiche_end();
269
270print '</form>';
271
272$listinsetup = [];
273// Define $listinsetup
274foreach ($conf->global as $key => $val) {
275 if (!empty($val) && preg_match('/^OAUTH_.*_ID$/', $key)) {
276 $provider = preg_replace('/_ID$/', '', $key);
277 $listinsetup[] = array(
278 $provider.'_NAME',
279 $provider.'_ID',
280 $provider.'_SECRET',
281 $provider.'_URLAUTHORIZE', // For custom oauth links
282 $provider.'_SCOPE' // For custom oauth links
283 );
284 }
285}
286
287
288if (count($listinsetup) > 0) {
289 print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
290 print '<input type="hidden" name="token" value="'.newToken().'">';
291 print '<input type="hidden" name="action" value="update">';
292
293 print '<div class="div-table-responsive-no-min">';
294
295 $i = 0;
296
297 // $list is defined into oauth.lib.php to the list of supporter OAuth providers.
298 foreach ($listinsetup as $key) {
299 $supported = 0;
300 $keyforsupportedoauth2array = $key[0]; // May be OAUTH_GOOGLE_NAME or OAUTH_GOOGLE_xxx_NAME
301 $keyforsupportedoauth2array = preg_replace('/^OAUTH_/', '', $keyforsupportedoauth2array);
302 $keyforsupportedoauth2array = preg_replace('/_NAME$/', '', $keyforsupportedoauth2array);
303 if (preg_match('/^.*-/', $keyforsupportedoauth2array)) {
304 $keybeforeprovider = preg_replace('/-.*$/', '', $keyforsupportedoauth2array);
305 $keyforprovider = preg_replace('/^.*-/', '', $keyforsupportedoauth2array);
306 } else {
307 $keybeforeprovider = $keyforsupportedoauth2array;
308 $keyforprovider = '';
309 }
310 $keyforsupportedoauth2array = preg_replace('/-.*$/', '', $keyforsupportedoauth2array);
311 $keyforsupportedoauth2array = 'OAUTH_'.$keyforsupportedoauth2array.'_NAME';
312
313 if (in_array($keyforsupportedoauth2array, array_keys($supportedoauth2array))) {
314 $supported = 1;
315 }
316 if (!$supported) {
317 continue; // show only supported
318 }
319
320 $i++;
321
322 print '<table class="noborder centpercent">';
323
324 // OAUTH service name
325 $label = $langs->trans($keyforsupportedoauth2array);
326 print '<tr class="liste_titre'.($i > 1 ? ' liste_titre_add' : '').'">';
327 print '<td class="titlefieldcreate">';
328 print img_picto('', $supportedoauth2array[$keyforsupportedoauth2array]['picto'], 'class="pictofixedwidth"');
329 if ($label == $keyforsupportedoauth2array) {
330 print $supportedoauth2array[$keyforsupportedoauth2array]['name'];
331 } else {
332 print $label;
333 }
334 if ($servicetoeditname == $key[0]) {
335 print ' (<input style="width: 20%" type="text" name="'.$key[0].'" value="'.$keyforprovider.'" >)';
336 } elseif ($keyforprovider) {
337 print ' (<b>'.$keyforprovider.'</b>)';
338 } else {
339 print ' (<b>'.$langs->trans("NoName").'</b>)';
340 }
341 if (!($servicetoeditname == $key[0])) {
342 print '<a class="editfielda reposition" href="'.$_SERVER["PHP_SELF"].'?token='.newToken().'&servicetoeditname='.urlencode($key[0]).'">'.img_edit($langs->transnoentitiesnoconv('Edit'), 1).'</a>';
343 }
344 print '</td>';
345 print '<td>';
346 if (!empty($supportedoauth2array[$keyforsupportedoauth2array]['urlforcredentials'])) {
347 print $langs->trans("OAUTH_URL_FOR_CREDENTIAL", $supportedoauth2array[$keyforsupportedoauth2array]['urlforcredentials']);
348 }
349 print '</td>';
350
351 // Delete
352 print '<td>';
353 $label = preg_replace('/_NAME$/', '', $keyforsupportedoauth2array);
354 print '<a href="'.$_SERVER["PHP_SELF"].'?action=delete&token='.newToken().'&provider='.urlencode($keyforprovider).'&label='.urlencode($label).'">';
355 print img_picto('', 'delete');
356 print '</a>';
357
358 print '</form>';
359 print '</td>';
360
361 print '</tr>';
362
363 if ($supported) {
364 $redirect_uri = $urlwithroot.'/core/modules/oauth/'.$supportedoauth2array[$keyforsupportedoauth2array]['callbackfile'].'_oauthcallback.php';
365 print '<tr class="oddeven value">';
366 print '<td>'.$form->textwithpicto($langs->trans("RedirectURL"), $langs->trans("UseTheFollowingUrlAsRedirectURI")).'</td>';
367 print '<td><input style="width: 80%" type="text" name="uri'.$keyforsupportedoauth2array.'" id="uri'.$keyforsupportedoauth2array.$keyforprovider.'" value="'.$redirect_uri.'" disabled>';
368 print ajax_autoselect('uri'.$keyforsupportedoauth2array.$keyforprovider);
369 print '</td>';
370 print '<td></td>';
371 print '</tr>';
372
373 if ($keyforsupportedoauth2array == 'OAUTH_GENERIC_NAME') {
374 print '<tr class="oddeven value">';
375 print '<td>'.$langs->trans("URLOfServiceForAuthorization").'</td>';
376 print '<td><input style="width: 80%" type="text" name="'.$key[3].'" value="'.getDolGlobalString($key[3]).'" >';
377 print '</td>';
378 print '<td></td>';
379 print '</tr>';
380 }
381 } else {
382 print '<tr class="oddeven value">';
383 print '<td>'.$langs->trans("UseTheFollowingUrlAsRedirectURI").'</td>';
384 print '<td>'.$langs->trans("FeatureNotYetSupported").'</td>';
385 print '</td>';
386 print '<td></td>';
387 print '</tr>';
388 }
389
390 // Api Id
391 print '<tr class="oddeven value">';
392 print '<td><label for="'.$key[1].'">'.$langs->trans("OAUTH_ID").'</label></td>';
393 print '<td><input type="text" size="100" id="'.$key[1].'" name="'.$key[1].'" value="'.getDolGlobalString($key[1]).'">';
394 print '</td>';
395 print '<td></td>';
396 print '</tr>';
397
398 // Api Secret
399 print '<tr class="oddeven value">';
400 print '<td><label for="'.$key[2].'">'.$langs->trans("OAUTH_SECRET").'</label></td>';
401 print '<td><input type="password" size="100" id="'.$key[2].'" name="'.$key[2].'" value="'.getDolGlobalString($key[2]).'">';
402 print '</td>';
403 print '<td></td>';
404 print '</tr>';
405
406 // Tenant
407 if ($keybeforeprovider == 'MICROSOFT' || $keybeforeprovider == 'MICROSOFT2') {
408 print '<tr class="oddeven value">';
409 print '<td><label for="'.$key[2].'">'.$langs->trans("OAUTH_TENANT").'</label></td>';
410 print '<td><input type="text" size="100" id="OAUTH_'.$keybeforeprovider.($keyforprovider ? '-'.$keyforprovider : '').'_TENANT" name="OAUTH_'.$keybeforeprovider.($keyforprovider ? '-'.$keyforprovider : '').'_TENANT" value="'.getDolGlobalString('OAUTH_'.$keybeforeprovider.($keyforprovider ? '-'.$keyforprovider : '').'_TENANT').'">';
411 print '</td>';
412 print '<td></td>';
413 print '</tr>';
414 }
415
416 // TODO Move this into token generation ?
417 if ($supported) {
418 if ($keyforsupportedoauth2array == 'OAUTH_GENERIC_NAME') {
419 print '<tr class="oddeven value">';
420 print '<td>'.$langs->trans("Scopes").'</td>';
421 print '<td>';
422 print '<input style="width: 80%" type"text" name="'.$key[4].'" value="'.getDolGlobalString($key[4]).'" >';
423 print '</td>';
424 print '<td></td>';
425 print '</tr>';
426 } else {
427 $availablescopes = array_flip(explode(',', $supportedoauth2array[$keyforsupportedoauth2array]['availablescopes']));
428 $currentscopes = explode(',', getDolGlobalString($key[4]));
429 $scopestodispay = array();
430 foreach ($availablescopes as $keyscope => $valscope) {
431 if (in_array($keyscope, $currentscopes)) {
432 $scopestodispay[$keyscope] = 1;
433 } else {
434 $scopestodispay[$keyscope] = 0;
435 }
436 }
437 // Api Scope
438 print '<tr class="oddeven value">';
439 print '<td>'.$langs->trans("Scopes").'</td>';
440 print '<td>';
441 foreach ($scopestodispay as $scope => $val) {
442 print '<input type="checkbox" id="'.$keyforprovider.$scope.'" name="'.$key[4].'[]" value="'.$scope.'"'.($val ? ' checked' : '').'>';
443 print '<label style="margin-right: 10px" for="'.$keyforprovider.$scope.'">'.$scope.'</label>';
444 }
445 print '</td>';
446 print '<td></td>';
447 print '</tr>';
448 }
449 } else {
450 print '<tr class="oddeven value">';
451 print '<td>'.$langs->trans("UseTheFollowingUrlAsRedirectURI").'</td>';
452 print '<td>'.$langs->trans("FeatureNotYetSupported").'</td>';
453 print '</td>';
454 print '<td></td>';
455 print '</tr>';
456 }
457
458 print '</table>'."\n";
459
460 print '<br>';
461 }
462
463 print '</div>';
464
465 print $form->buttonsSaveCancel("Save", '');
466
467 print '</form>';
468}
469
470// End of page
471llxFooter();
472$db->close();
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).
dolibarr_del_const($db, $name, $entity=1)
Delete a constant.
ajax_combobox($htmlname, $events=array(), $minLengthToAutocomplete=0, $forcefocus=0, $widthTypeOfAutocomplete='resolve', $idforemptyvalue='-1', $morecss='')
Convert a html select field into an ajax combobox.
Definition ajax.lib.php:456
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader()
Empty header.
Definition wrapper.php:55
llxFooter()
Empty footer.
Definition wrapper.php:69
Class to manage generation of HTML components Only common components must be here.
load_fiche_titre($title, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limittoshow=0, $moretabssuffix='', $dragdropfile=0)
Show tabs of a record.
dol_get_fiche_end($notab=0)
Return tab footer of a card.
ajax_autoselect($htmlname, $addlink='', $textonlink='Link')
Make content of an input box selected when we click into input field.
newToken()
Return the value of token currently saved into session with name 'newtoken'.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0)
Set event messages in dol_events session object.
getDolGlobalString($key, $default='')
Return dolibarr global constant string value.
img_edit($titlealt='default', $float=0, $other='')
Show logo edit/modify fiche.
getAllOauth2Array()
Return array of possible OAUTH2 services.
Definition oauth.lib.php:33
getSupportedOauth2Array()
Return array of tabs to used on pages to setup cron module.
oauthadmin_prepare_head()
Return array of tabs to used on pages to setup cron module.
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.