ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
hook_sanitycheck.php File Reference

Go to the source code of this file.

Functions

 core_hook_sanitycheck (&$hookinfo)
 Hook to do sanitycheck. More...
 

Function Documentation

◆ core_hook_sanitycheck()

core_hook_sanitycheck ( $hookinfo)

Hook to do sanitycheck.

Parameters
array&$hookinfohookinfo

Definition at line 7 of file hook_sanitycheck.php.

References $config, $hookinfo, $i, $info, SimpleSAML\Module\callHooks(), SimpleSAML_Configuration\getInstance(), and SimpleSAML\Module\getModules().

7  {
8  assert(is_array($hookinfo));
9  assert(array_key_exists('errors', $hookinfo));
10  assert(array_key_exists('info', $hookinfo));
11 
13 
14  if($config->getString('auth.adminpassword', '123') === '123') {
15  $hookinfo['errors'][] = '[core] Password in config.php is not set properly';
16  } else {
17  $hookinfo['info'][] = '[core] Password in config.php is set properly';
18  }
19 
20  if($config->getString('technicalcontact_email', 'na@example.org') === 'na@example.org') {
21  $hookinfo['errors'][] = '[core] In config.php technicalcontact_email is not set properly';
22  } else {
23  $hookinfo['info'][] = '[core] In config.php technicalcontact_email is set properly';
24  }
25 
26  if (version_compare(phpversion(), '5.4', '>=')) {
27  $hookinfo['info'][] = '[core] You are running a PHP version suitable for SimpleSAMLphp.';
28  } else {
29  $hookinfo['errors'][] = '[core] You are running an old PHP installation. Please check the requirements for your SimpleSAMLphp version and upgrade.';
30  }
31 
32  $info = array();
33  $mihookinfo = array(
34  'info' => &$info,
35  );
36  $availmodules = SimpleSAML\Module::getModules();
37  SimpleSAML\Module::callHooks('moduleinfo', $mihookinfo);
38  foreach($info AS $mi => $i) {
39  if (isset($i['dependencies']) && is_array($i['dependencies'])) {
40  foreach ($i['dependencies'] AS $dep) {
41  if (!in_array($dep, $availmodules, true)) {
42  $hookinfo['errors'][] = '[core] Module dependency not met: ' . $mi . ' requires ' . $dep;
43  }
44  }
45  }
46  }
47 
48 }
$config
Definition: bootstrap.php:15
static getModules()
Get available modules.
Definition: Module.php:121
static callHooks($hook, &$data=null)
Call a hook in all enabled modules.
Definition: Module.php:281
$i
Definition: disco.tpl.php:19
$info
Definition: index.php:5
$hookinfo
Definition: index.php:7
static getInstance($instancename='simplesaml')
Get a configuration file by its instance name.
+ Here is the call graph for this function: