8 if (
$config->getBoolean(
'admin.protectindexpage',
false)) {
18 $warnings[] =
'{core:frontpage:warnings_https}';
21 if (
$config->getValue(
'secretsalt') ===
'defaultsecretsalt') {
22 $warnings[] =
'{core:frontpage:warnings_secretsalt}';
25 if (extension_loaded(
'suhosin')) {
26 $suhosinLength = ini_get(
'suhosin.get.max_value_length');
27 if (empty($suhosinLength) || (
int)$suhosinLength < 2048) {
28 $warnings[] =
'{core:frontpage:warnings_suhosin_url_length}';
40 'text' =>
'{core:frontpage:link_diagnostics}' 45 'text' =>
'{core:frontpage:link_phpinfo}' 60 if (
$config->getBoolean(
'admin.checkforupdates',
true) &&
$current !==
'master') {
61 if (!function_exists(
'curl_init')) {
62 $warnings[] = [
'{core:frontpage:warnings_curlmissing}' ];
64 $latest =
$session->getData(
"core:latest_simplesamlphp_version",
"version");
67 $api_url =
'https://api.github.com/repos/simplesamlphp/simplesamlphp/releases';
68 $ch = curl_init($api_url.
'/latest');
69 curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
70 curl_setopt($ch, CURLOPT_USERAGENT,
'SimpleSAMLphp');
71 curl_setopt($ch, CURLOPT_TIMEOUT, 2);
72 curl_setopt($ch, CURLOPT_PROXY,
$config->getString(
'proxy', null));
73 curl_setopt($ch, CURLOPT_PROXYUSERPWD,
$config->getValue(
'proxy.auth', null));
76 if (curl_getinfo($ch, CURLINFO_HTTP_CODE) === 200) {
77 $latest = json_decode($response,
true);
78 $session->setData(
"core:latest_simplesamlphp_version",
"version", $latest);
83 if ($latest && version_compare(
$current, ltrim($latest[
'tag_name'],
'v'),
'lt')) {
86 '{core:frontpage:warnings_outdated}',
87 array(
'%LATEST_URL%' => $latest[
'html_url'])
94 'saml20-idp' =>
$config->getBoolean(
'enable.saml20-idp',
false),
95 'shib13-idp' =>
$config->getBoolean(
'enable.shib13-idp',
false),
100 'time' => array(
'required',
'Date/Time Extension'),
101 'hash' => array(
'required',
'Hashing function'),
102 'gzinflate' => array(
'required',
'ZLib'),
103 'openssl_sign' => array(
'required',
'OpenSSL'),
104 'dom_import_simplexml' => array(
'required',
'XML DOM'),
105 'preg_match' => array(
'required',
'RegEx support'),
106 'json_decode' => array(
'required',
'JSON support'),
107 'class_implements' => array(
'required',
'Standard PHP Library (SPL)'),
108 'mb_strlen' => array(
'required',
'Multibyte String Extension'),
109 'curl_init' => array(
'optional',
'cURL (required if automatic version checks are used, also by some modules.'),
110 'session_start' => array(
'optional',
'Session Extension (required if PHP sessions are used)'),
111 'pdo_drivers' => array(
'optional',
'PDO Extension (required if a database backend is used)'),
113 if (
SimpleSAML\Module::isModuleEnabled(
'ldap')) {
114 $functionchecks[
'ldap_bind'] = array(
'optional',
'LDAP Extension (required if an LDAP backend is used)');
116 if (
SimpleSAML\Module::isModuleEnabled(
'radius')) {
117 $functionchecks[
'radius_auth_open'] = array(
'optional',
'Radius Extension (required if a Radius backend is used)');
122 'required' =>
'required',
123 'descr' =>
'PHP Version >= 5.4. You run: ' . phpversion(),
124 'enabled' => version_compare(phpversion(),
'5.4',
'>=')
127 $funcmatrix[] = array(
'descr' => $descr[1],
'required' => $descr[0],
'enabled' => function_exists($func));
131 'required' =>
'optional',
132 'descr' =>
'predis/predis (required if the redis data store is used)',
133 'enabled' => class_exists(
'\Predis\Client'),
137 'required' =>
'optional',
138 'descr' =>
'Memcache or Memcached Extension (required if a Memcached backend is used)',
139 'enabled' => class_exists(
'Memcache') || class_exists(
'Memcached'),
144 if (
$config->getString(
'technicalcontact_email',
'na@example.org') ===
'na@example.org') {
150 'required' =>
'recommended',
151 'descr' =>
'technicalcontact_email option set',
152 'enabled' => $mail_ok
154 if (
$config->getString(
'auth.adminpassword',
'123') ===
'123') {
155 $password_ok =
false;
160 'required' =>
'required',
161 'descr' =>
'auth.adminpassword option set',
162 'enabled' => $password_ok
167 $t->data[
'pageid'] =
'frontpage_config';
182 $t->data[
'requiredmap'] = array(
183 'recommended' =>
$translator->noop(
'{core:frontpage:recommended}'),
184 'required' =>
$translator->noop(
'{core:frontpage:required}'),
185 'optional' =>
$translator->noop(
'{core:frontpage:optional}'),
188 $t->data[
'directory'] = dirname(dirname(dirname(dirname(__FILE__))));
static requireAdmin()
Require admin access to the current page.
static isAdmin()
Check whether the current user is admin.
static getAdminLoginURL($returnTo=null)
Retrieve a admin login URL.
static callHooks($hook, &$data=null)
Call a hook in all enabled modules.
if($config->getBoolean('admin.protectindexpage', false)) $loginurl
Attribute-related utility methods.
getBaseURL($t, $type='get', $key=null, $value=null)
if($config->getBoolean('admin.checkforupdates', true) && $current !=='master') $enablematrix
if(!\SimpleSAML\Utils\HTTP::isHTTPS()) if($config->getValue('secretsalt')==='defaultsecretsalt') if(extension_loaded('suhosin')) $links
static getSessionFromRequest()
Retrieves the current session.
static getInstance($instancename='simplesaml')
Get a configuration file by its instance name.
if(SimpleSAML\Module::isModuleEnabled('ldap')) if(SimpleSAML\Module::isModuleEnabled('radius')) $funcmatrix