Skip to content

Commit 657fc91

Browse files
authored
N°8198 - ModuleInstallation now extends DBObject + better exception message
1 parent 5ae5221 commit 657fc91

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

setup/moduleinstallation.class.inc.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
* @license http://opensource.org/licenses/AGPL-3.0
2626
*/
2727

28-
class ModuleInstallation extends cmdbAbstractObject
28+
class ModuleInstallation extends DBObject
2929
{
3030
public static function Init()
3131
{

sources/Controller/Base/Layout/ObjectController.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,9 @@ public function OperationNew()
8282
{
8383
throw new ApplicationException(Dict::Format('UI:Error:1ParametersMissing', 'class'));
8484
}
85-
85+
if (!is_subclass_of($sClass, cmdbAbstractObject::class)) {
86+
throw new SecurityException('The class "'.$sClass.'" is not a subclass of cmdbAbstractObject so it can\'t be created by the user');
87+
}
8688
// If the specified class has subclasses, ask the user an instance of which class to create
8789
$aSubClasses = MetaModel::EnumChildClasses($sClass, ENUM_CHILD_CLASSES_ALL); // Including the specified class itself
8890
$aPossibleClasses = array();

0 commit comments

Comments
 (0)