diff --git a/setup/moduleinstallation.class.inc.php b/setup/moduleinstallation.class.inc.php index 81b68a55a..535f22daf 100644 --- a/setup/moduleinstallation.class.inc.php +++ b/setup/moduleinstallation.class.inc.php @@ -25,7 +25,7 @@ * @license http://opensource.org/licenses/AGPL-3.0 */ -class ModuleInstallation extends cmdbAbstractObject +class ModuleInstallation extends DBObject { public static function Init() { diff --git a/sources/Controller/Base/Layout/ObjectController.php b/sources/Controller/Base/Layout/ObjectController.php index 137d7827a..84db6f59e 100644 --- a/sources/Controller/Base/Layout/ObjectController.php +++ b/sources/Controller/Base/Layout/ObjectController.php @@ -82,7 +82,9 @@ class ObjectController extends AbstractController { throw new ApplicationException(Dict::Format('UI:Error:1ParametersMissing', 'class')); } - + if (!is_subclass_of($sClass, cmdbAbstractObject::class)) { + throw new SecurityException('The class "'.$sClass.'" is not a subclass of cmdbAbstractObject so it can\'t be created by the user'); + } // If the specified class has subclasses, ask the user an instance of which class to create $aSubClasses = MetaModel::EnumChildClasses($sClass, ENUM_CHILD_CLASSES_ALL); // Including the specified class itself $aPossibleClasses = array();