mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-02-20 13:46:52 +01:00
Add log into curl method for oauth
This commit is contained in:
parent
14dfe8a073
commit
8936b6ef8a
|
|
@ -139,7 +139,7 @@ if ($action == 'update') {
|
|||
$error++;
|
||||
}
|
||||
|
||||
// Update const where the token was used, might not be exhaustive
|
||||
// Update other const that was using the renamed key as token (might not be exhaustive)
|
||||
if (getDolGlobalString('MAIN_MAIL_SMTPS_OAUTH_SERVICE') == $oldname) {
|
||||
if (!dolibarr_set_const($db, 'MAIN_MAIL_SMTPS_OAUTH_SERVICE', strtoupper($oldprovider).'-'.$newlabel, 'chaine', 0, '', $conf->entity)) {
|
||||
$error++;
|
||||
|
|
|
|||
|
|
@ -122,6 +122,15 @@ class CurlClient extends AbstractClient
|
|||
curl_setopt($ch, CURLOPT_SSLVERSION, 3);
|
||||
}
|
||||
|
||||
// @CHANGE DOL_LDR Add log
|
||||
if (function_exists('getDolGlobalString') && getDolGlobalString('OAUTH_DEBUG')) {
|
||||
file_put_contents(DOL_DATA_ROOT . "/dolibarr_oauth.log", $endpoint->getAbsoluteUri()."\n", FILE_APPEND);
|
||||
file_put_contents(DOL_DATA_ROOT . "/dolibarr_oauth.log", $requestBody."\n", FILE_APPEND);
|
||||
file_put_contents(DOL_DATA_ROOT . "/dolibarr_oauth.log", $method."\n", FILE_APPEND);
|
||||
file_put_contents(DOL_DATA_ROOT . "/dolibarr_oauth.log", var_export($extraHeaders, true)."\n", FILE_APPEND);
|
||||
@chmod(DOL_DATA_ROOT . "/dolibarr_oauth.log", octdec(empty($conf->global->MAIN_UMASK)?'0664':$conf->global->MAIN_UMASK));
|
||||
}
|
||||
|
||||
$response = curl_exec($ch);
|
||||
$responseCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user