Go to the source code of this file.
◆ core_hook_sanitycheck()
core_hook_sanitycheck |
( |
& |
$hookinfo | ) |
|
Hook to do sanitycheck.
- Parameters
-
Definition at line 7 of file hook_sanitycheck.php.
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
33 $mihookinfo = array(
35 );
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}
static getModules()
Get available modules.
static callHooks($hook, &$data=null)
Call a hook in all enabled modules.
static getInstance($instancename='simplesaml')
Get a configuration file by its instance name.
References $config, $hookinfo, $i, $info, SimpleSAML\Module\callHooks(), SimpleSAML_Configuration\getInstance(), and SimpleSAML\Module\getModules().