diff --git a/htdocs/admin/modules.php b/htdocs/admin/modules.php index 5dbc6625ba2..68bec8431a7 100644 --- a/htdocs/admin/modules.php +++ b/htdocs/admin/modules.php @@ -4,7 +4,7 @@ * Copyright (C) 2004-2017 Laurent Destailleur * Copyright (C) 2004 Eric Seigne * Copyright (C) 2005-2017 Regis Houssin - * Copyright (C) 2011 Juanjo Menent + * Copyright (C) 2011-2023 Juanjo Menent * Copyright (C) 2015 Jean-François Ferry * Copyright (C) 2015 Raphaël Doursenaud * Copyright (C) 2018 Nicolas ZABOURI @@ -230,7 +230,10 @@ if ($action == 'install') { // Now we install the module if (!$error) { @dol_delete_dir_recursive($dirins.'/'.$modulenameval); // delete the target directory - $submodulenamedir = $conf->admin->dir_temp.'/'.$tmpdir.'/htdocs/'.$modulenameval; + $submodulenamedir = $conf->admin->dir_temp.'/'.$tmpdir.'/'.$modulenameval; + if (!dol_is_dir($modulenamedir)) { + $submodulenamedir = $conf->admin->dir_temp.'/'.$tmpdir.'/htdocs/'.$modulenameval; + } dol_syslog("We copy now directory ".$submodulenamedir." into target dir ".$dirins.'/'.$modulenameval); $result = dolCopyDir($submodulenamedir, $dirins.'/'.$modulenameval, '0444', 1); if ($result <= 0) { diff --git a/htdocs/includes/OAuth/Common/Storage/DoliStorage.php b/htdocs/includes/OAuth/Common/Storage/DoliStorage.php index e9cfb8d5dcc..61a4e53061a 100644 --- a/htdocs/includes/OAuth/Common/Storage/DoliStorage.php +++ b/htdocs/includes/OAuth/Common/Storage/DoliStorage.php @@ -238,8 +238,16 @@ class DoliStorage implements TokenStorageInterface */ public function clearAllTokens() { - // TODO - $this->conf->remove($this->key); + // TODO Remove token using a loop on each $service + /* + $servicepluskeyforprovider = $service; + if (!empty($this->keyforprovider)) { + // We clean the keyforprovider after the - to be sure it is not present + $servicepluskeyforprovider = preg_replace('/\-'.preg_quote($this->keyforprovider, '/').'$/', '', $servicepluskeyforprovider); + // Now we add the keyforprovider + $servicepluskeyforprovider .= '-'.$this->keyforprovider; + } + */ // allow chaining return $this; @@ -334,7 +342,6 @@ class DoliStorage implements TokenStorageInterface { // TODO // get previously saved tokens - //$states = $this->conf->get($this->stateKey); if (is_array($this->states) && array_key_exists($service, $this->states)) { unset($this->states[$service]); @@ -353,7 +360,6 @@ class DoliStorage implements TokenStorageInterface public function clearAllAuthorizationStates() { // TODO - //$this->conf->remove($this->stateKey); // allow chaining return $this;