diff --git a/htdocs/admin/oauth.php b/htdocs/admin/oauth.php index 456ce4858ca..3113bc6a9c4 100644 --- a/htdocs/admin/oauth.php +++ b/htdocs/admin/oauth.php @@ -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++; diff --git a/htdocs/includes/OAuth/Common/Http/Client/CurlClient.php b/htdocs/includes/OAuth/Common/Http/Client/CurlClient.php index eae1be3ed05..88d9d14a754 100644 --- a/htdocs/includes/OAuth/Common/Http/Client/CurlClient.php +++ b/htdocs/includes/OAuth/Common/Http/Client/CurlClient.php @@ -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);