diff --git a/htdocs/api/class/api_access.class.php b/htdocs/api/class/api_access.class.php index d453d141546..f4aba956817 100644 --- a/htdocs/api/class/api_access.class.php +++ b/htdocs/api/class/api_access.class.php @@ -50,7 +50,7 @@ class DolibarrApiAccess implements iAuthenticate * @return bool * @throws RestException */ - public function __isAllowed() + public function _isAllowed() { global $db; @@ -113,7 +113,7 @@ class DolibarrApiAccess implements iAuthenticate * @example Digest * @example OAuth */ - public function __getWWWAuthenticateString() + public function _getWWWAuthenticateString() { return ''; } diff --git a/htdocs/public/api/index.php b/htdocs/public/api/index.php index 352849af15c..17b691675c5 100644 --- a/htdocs/public/api/index.php +++ b/htdocs/public/api/index.php @@ -28,7 +28,7 @@ if (! defined("NOLOGIN")) define("NOLOGIN",'1'); $res=0; -if (! $res && file_exists("../../main.inc.php")) $res=@include '../../main.inc.php'; +if (! $res && file_exists("../../main.inc.php")) $res=@include '../../main.inc.php'; if (! $res && file_exists("../../../dolibarr/htdocs/main.inc.php")) $res=@include '../../../dolibarr/htdocs/main.inc.php'; // For custom directory if (! $res) die("Include of main fails"); @@ -48,7 +48,7 @@ if (empty($conf->global->MAIN_MODULE_API)) } use \Luracast\Restler\Defaults; -Defaults::setProperty('authenticationMethod','__isAllowed'); +Defaults::setProperty('authenticationMethod','_isAllowed'); $api = new DolibarrApi($db); @@ -64,7 +64,7 @@ foreach ($modulesdir as $dir) * Search available module */ dol_syslog("Scan directory ".$dir." for API modules"); - + $handle=@opendir(dol_osencode($dir)); if (is_resource($handle)) { @@ -81,7 +81,7 @@ foreach ($modulesdir as $dir) if ($module == 'societe') { $obj = 'thirdparty'; } - if ($module == 'categorie') { + if ($module == 'categorie') { $part = 'categories'; $obj = 'category'; } @@ -90,7 +90,7 @@ foreach ($modulesdir as $dir) $obj = 'facture'; } if (empty($conf->$module->enabled)) $enabled=false; - + if ($enabled) { /* @@ -102,7 +102,7 @@ foreach ($modulesdir as $dir) * @todo : use getElementProperties() function ? */ $dir_part = DOL_DOCUMENT_ROOT.'/'.$part.'/class/'; - + $handle_part=@opendir(dol_osencode($dir_part)); if (is_resource($handle_part)) {