Fix error message
This commit is contained in:
parent
2e8734a950
commit
5ccc5c9e1a
@ -120,7 +120,7 @@ if (empty($conf->global->MAIN_MODULE_API)) {
|
|||||||
// Test if explorer is not disabled
|
// Test if explorer is not disabled
|
||||||
if (preg_match('/api\/index\.php\/explorer/', $url) && !empty($conf->global->API_EXPLORER_DISABLED)) {
|
if (preg_match('/api\/index\.php\/explorer/', $url) && !empty($conf->global->API_EXPLORER_DISABLED)) {
|
||||||
$langs->load("admin");
|
$langs->load("admin");
|
||||||
dol_syslog("Call Dolibarr API interfaces with module REST disabled");
|
dol_syslog("Call Dolibarr API interfaces with module API REST disabled");
|
||||||
print $langs->trans("WarningAPIExplorerDisabled").'.<br><br>';
|
print $langs->trans("WarningAPIExplorerDisabled").'.<br><br>';
|
||||||
//session_destroy();
|
//session_destroy();
|
||||||
exit(0);
|
exit(0);
|
||||||
@ -153,6 +153,10 @@ preg_match('/index\.php\/([^\/]+)(.*)$/', $url, $reg);
|
|||||||
$refreshcache = (empty($conf->global->API_PRODUCTION_DO_NOT_ALWAYS_REFRESH_CACHE) ? true : false);
|
$refreshcache = (empty($conf->global->API_PRODUCTION_DO_NOT_ALWAYS_REFRESH_CACHE) ? true : false);
|
||||||
if (!empty($reg[1]) && $reg[1] == 'explorer' && ($reg[2] == '/swagger.json' || $reg[2] == '/swagger.json/root' || $reg[2] == '/resources.json' || $reg[2] == '/resources.json/root')) {
|
if (!empty($reg[1]) && $reg[1] == 'explorer' && ($reg[2] == '/swagger.json' || $reg[2] == '/swagger.json/root' || $reg[2] == '/resources.json' || $reg[2] == '/resources.json/root')) {
|
||||||
$refreshcache = true;
|
$refreshcache = true;
|
||||||
|
if (!is_writable($conf->api->dir_temp)) {
|
||||||
|
print 'Erreur temp dir api/temp not writable';
|
||||||
|
exit(0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$api = new DolibarrApi($db, '', $refreshcache);
|
$api = new DolibarrApi($db, '', $refreshcache);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user