ILIAS  release_8 Revision v8.24
ilNICKeyStoredObjective Class Reference
+ Inheritance diagram for ilNICKeyStoredObjective:
+ Collaboration diagram for ilNICKeyStoredObjective:

Public Member Functions

 getHash ()
 
 getLabel ()
 
 isNotable ()
 
 getPreconditions (Setup\Environment $environment)
 
 achieve (Setup\Environment $environment)
 
 isApplicable (Setup\Environment $environment)
 @inheritDoc More...
 
- Public Member Functions inherited from ilSetupObjective
 __construct (Setup\Config $config)
 

Protected Member Functions

 generateNICKey ()
 

Additional Inherited Members

- Protected Attributes inherited from ilSetupObjective
Setup Config $config
 

Detailed Description

Definition at line 23 of file class.ilNICKeyStoredObjective.php.

Member Function Documentation

◆ achieve()

ilNICKeyStoredObjective::achieve ( Setup\Environment  $environment)

Definition at line 47 of file class.ilNICKeyStoredObjective.php.

47 : Setup\Environment
48 {
49 $factory = $environment->getResource(Setup\Environment::RESOURCE_SETTINGS_FACTORY);
50 $settings = $factory->settingsFor("common");
51
52 $nic_key = $this->generateNICKey();
53 $settings->set("nic_key", $nic_key);
54
55 return $environment;
56 }
$factory
Definition: metadata.php:75
array $settings
Setting values (LTI parameters, custom parameters and local parameters).
Definition: System.php:200

References $factory, ILIAS\LTI\ToolProvider\$settings, and generateNICKey().

+ Here is the call graph for this function:

◆ generateNICKey()

ilNICKeyStoredObjective::generateNICKey ( )
protected

Definition at line 69 of file class.ilNICKeyStoredObjective.php.

70 {
71 return md5(uniqid((string) $this->getClientId(), true));
72 }

Referenced by achieve().

+ Here is the caller graph for this function:

◆ getHash()

ilNICKeyStoredObjective::getHash ( )

Definition at line 25 of file class.ilNICKeyStoredObjective.php.

25 : string
26 {
27 return hash("sha256", self::class);
28 }

◆ getLabel()

ilNICKeyStoredObjective::getLabel ( )

Definition at line 30 of file class.ilNICKeyStoredObjective.php.

30 : string
31 {
32 return "A NIC key for the installation is generated and stored";
33 }

◆ getPreconditions()

ilNICKeyStoredObjective::getPreconditions ( Setup\Environment  $environment)

Definition at line 40 of file class.ilNICKeyStoredObjective.php.

40 : array
41 {
42 return [
43 new \ilSettingsFactoryExistsObjective()
44 ];
45 }

◆ isApplicable()

ilNICKeyStoredObjective::isApplicable ( Setup\Environment  $environment)

@inheritDoc

Definition at line 61 of file class.ilNICKeyStoredObjective.php.

61 : bool
62 {
63 $factory = $environment->getResource(Setup\Environment::RESOURCE_SETTINGS_FACTORY);
64 $settings = $factory->settingsFor("common");
65
66 return !(bool) $settings->get("nic_key");
67 }

References $factory, and ILIAS\LTI\ToolProvider\$settings.

◆ isNotable()

ilNICKeyStoredObjective::isNotable ( )

Definition at line 35 of file class.ilNICKeyStoredObjective.php.

35 : bool
36 {
37 return true;
38 }

The documentation for this class was generated from the following file: