diff --git a/CHANGELOG.md b/CHANGELOG.md index 0aaf438..92f1419 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/). ### Added - GLPI 12 compatibility +- Enable `sudo` mode for `Credential` and `DatabaseParam` ## [1.1.4] - 2026-08-03 diff --git a/front/credential.form.php b/front/credential.form.php index 5e36f42..6045e99 100644 --- a/front/credential.form.php +++ b/front/credential.form.php @@ -30,7 +30,7 @@ use Glpi\Event; -Session::checkRight(Config::$rightname, READ); +(new Config())->checkGlobal(READ); $_GET['id'] ??= ''; diff --git a/front/credential.php b/front/credential.php index d5cc3d3..e20cc89 100644 --- a/front/credential.php +++ b/front/credential.php @@ -28,7 +28,7 @@ * ------------------------------------------------------------------------- */ -Session::checkRight(Config::$rightname, UPDATE); +(new Config())->checkGlobal(UPDATE); Html::header( PluginDatabaseinventoryCredential::getTypeName(Session::getPluralNumber()), diff --git a/front/databaseparam.form.php b/front/databaseparam.form.php index 44c2b82..7faa226 100644 --- a/front/databaseparam.form.php +++ b/front/databaseparam.form.php @@ -30,7 +30,7 @@ use Glpi\Event; -Session::checkRight(Config::$rightname, READ); +(new Config())->checkGlobal(READ); $_GET['id'] ??= ''; diff --git a/front/databaseparam.php b/front/databaseparam.php index f4d456d..17c29b6 100644 --- a/front/databaseparam.php +++ b/front/databaseparam.php @@ -28,7 +28,7 @@ * ------------------------------------------------------------------------- */ -Session::checkRight(Config::$rightname, UPDATE); +(new Config())->checkGlobal(UPDATE); Html::header( PluginDatabaseinventoryDatabaseParam::getTypeName(Session::getPluralNumber()), diff --git a/inc/credential.class.php b/inc/credential.class.php index f3ccef0..44ecbab 100644 --- a/inc/credential.class.php +++ b/inc/credential.class.php @@ -132,6 +132,11 @@ public function rawSearchOptions() return $tab; } + protected static function itemTypeRequiresReauthentication(): bool + { + return true; + } + public function showForm($ID, array $options = []) { $this->initForm($ID, $options); diff --git a/inc/databaseparam.class.php b/inc/databaseparam.class.php index 7e52f67..7cc41a9 100644 --- a/inc/databaseparam.class.php +++ b/inc/databaseparam.class.php @@ -159,6 +159,11 @@ public function rawSearchOptions() return $tab; } + protected static function itemTypeRequiresReauthentication(): bool + { + return true; + } + public function getCredentialTypeLinked() { /** @var DBmysql $DB */