Skip to content
Snippets Groups Projects
Select Git revision
  • 773ce8d975a6fbf2c7b5562f045d6785f00d0e0a
  • master default protected
  • cesnet_simplesamlphp-1.19.8
  • elixir_simplesamlphp-1.19.8
  • simplesamlphp-1.19.8
  • cesnet_simplesamlphp-1.19.5
  • simplesamlphp-2.0
  • feature/assets
  • feature/rac-source-selector
  • cleanup/remove-base64-attributes
  • simplesamlphp-1.19
  • elixir_simplesamlphp-1.19.5
  • aarc_idp_hinting
  • feature/validate-authstate-before-processing
  • feature/build-two-tarballs
  • dependabot/composer/twig/twig-3.4.3
  • tvdijen-patch-1
  • unchanged-acs-url-no-www-script
  • feature/translation-improvements
  • symfony6
  • move_tests
  • v1.19.9
  • v2.1.3
  • v2.0.10
  • v2.1.2
  • v2.0.9
  • v2.1.1
  • v2.0.8
  • v2.1.0
  • v2.0.7
  • v2.1.0-rc1
  • v2.0.6
  • v2.0.5
  • 2.0.4-alpha.1
  • v2.0.4-alpha.1
  • v2.0.4
  • v2.0.3
  • v2.0.2
  • v2.0.1-alpha.1
  • v2.0.1
  • v1.19.8
41 results

index.php

Blame
  • user avatar
    Andreas Åkre Solberg authored
    git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@519 44740490-163a-0410-bde0-09ae8108e29a
    773ce8d9
    History
    Code owners
    Assign users and groups as approvers for specific file changes. Learn more.
    index.php 5.55 KiB
    <?php
    
    require_once('_include.php');
    
    require_once((isset($SIMPLESAML_INCPREFIX)?$SIMPLESAML_INCPREFIX:'') . 'SimpleSAML/Utilities.php');
    require_once((isset($SIMPLESAML_INCPREFIX)?$SIMPLESAML_INCPREFIX:'') . 'SimpleSAML/Session.php');
    require_once((isset($SIMPLESAML_INCPREFIX)?$SIMPLESAML_INCPREFIX:'') . 'SimpleSAML/XHTML/Template.php');
    require_once((isset($SIMPLESAML_INCPREFIX)?$SIMPLESAML_INCPREFIX:'') . 'SimpleSAML/Metadata/MetaDataStorageHandler.php');
    
    
    /* Load simpleSAMLphp, configuration */
    $config = SimpleSAML_Configuration::getInstance();
    $session = SimpleSAML_Session::getInstance(true);
    
    /* Check if valid local session exists.. */
    if ($config->getValue('admin.protectindexpage', false)) {
    	if (!isset($session) || !$session->isValid('login-admin') ) {
    		SimpleSAML_Utilities::redirect('/' . $config->getBaseURL() . 'auth/login-admin.php',
    			array('RelayState' => SimpleSAML_Utilities::selfURL())
    		);
    	}
    }
    
    $warnings = array();
    
    if (SimpleSAML_Utilities::getSelfProtocol() != 'https') {
    	$warnings[] = 'warnings_https';
    }
    
    	
    $links = array();
    
    
    if ($config->getValue('enable.saml20-sp') === true)
    	$links[] = array(
    		'href' => 'example-simple/saml2-example.php', 
    		'text' => 'link_saml2example');
    
    if ($config->getValue('enable.shib13-sp') === true)
    	$links[] = array(
    		'href' => 'example-simple/shib13-example.php', 
    		'text' => 'link_shib13example');
    
    if ($config->getValue('enable.openid-provider') === true)
    	$links[] = array(
    		'href' => 'openid/provider/server.php', 
    		'text' => 'link_openidprovider');
    
    $links[] = array(
    	'href' => 'example-simple/hostnames.php?dummy=1', 
    	'text' => 'link_diagnostics');
    
    $links[] = array(
    	'href' => 'admin/phpinfo.php', 
    	'text' => 'link_phpinfo');
    
    
    
    $linksmeta = array();
    
    $linksmeta[] = array(
    	'href' => 'admin/metadata.php', 
    	'text' => 'link_meta_overview');
    
    if ($config->getValue('enable.saml20-sp') === true)
    	$linksmeta[] = array(
    		'href' => 'saml2/sp/metadata.php?output=xhtml', 
    		'text' => 'link_meta_saml2sphosted');
    
    if ($config->getValue('enable.saml20-idp') === true)
    	$linksmeta[] = array(
    		'href' => 'saml2/idp/metadata.php?output=xhtml', 
    		'text' => 'link_meta_saml2idphosted');
    
    if ($config->getValue('enable.shib13-sp') === true)
    	$linksmeta[] = array(
    		'href' => 'shib13/sp/metadata.php?output=xhtml', 
    		'text' => 'link_meta_shib13sphosted');
    
    if ($config->getValue('enable.shib13-idp') === true)
    	$linksmeta[] = array(
    		'href' => 'shib13/idp/metadata.php?output=xhtml', 
    		'text' => 'link_meta_shib13idphosted');
    
    
    $linksmeta[] = array(
    	'href' => 'admin/metadata-converter.php',
    	'text' => 'link_xmlconvert',
    	);
    
    
    
    $linksdoc = array();
    
    $linksdoc[] = array(
    	'href' => 'http://rnd.feide.no/content/installing-simplesamlphp', 
    	'text' => 'link_doc_install');
    
    if ($config->getValue('enable.saml20-sp', false ) || $config->getValue('enable.shib13-sp', false))
    	$linksdoc[] = array(
    		'href' => 'http://rnd.feide.no/content/using-simplesamlphp-service-provider', 
    		'text' => 'link_doc_sp');
    
    if ($config->getValue('enable.saml20-idp', false ) || $config->getValue('enable.shib13-idp', false))
    	$linksdoc[] = array(
    		'href' => 'http://rnd.feide.no/content/using-simplesamlphp-identity-provider', 
    		'text' => 'link_doc_idp');
    
    if ($config->getValue('enable.shib13-idp', false))
    	$linksdoc[] = array(
    		'href' => 'http://rnd.feide.no/content/configure-shibboleth-13-sp-work-simplesamlphp-idp', 
    		'text' => 'link_doc_shibsp');
    
    if ($config->getValue('enable.saml20-idp', false ))
    	$linksdoc[] = array(
    		'href' => 'http://rnd.feide.no/content/simplesamlphp-idp-google-apps-education', 
    		'text' => 'link_doc_googleapps');
    
    $linksdoc[] = array(
    	'href' => 'http://rnd.feide.no/content/simplesamlphp-advanced-features', 
    	'text' => 'link_doc_advanced',
    );
    
    
    
    $linksdoc[] = array(
    	'href' => 'http://rnd.feide.no/content/simplesamlphp-maintenance-and-configuration', 
    	'text' => 'link_doc_maintenance');
    
    $enablematrix = array(
    	'saml20-sp' => $config->getValue('enable.saml20-sp', false),
    	'saml20-idp' => $config->getValue('enable.saml20-idp', false),
    	'shib13-sp' => $config->getValue('enable.shib13-sp', false),
    	'shib13-idp' => $config->getValue('enable.shib13-idp', false),
    );
    
    
    $functionchecks = array(
    	'hash'             => array('required',  'Hashing function'),
    	'gzinflate'        => array('required',  'ZLib'),
    	'openssl_sign'     => array('required',  'OpenSSL'),
    	'simplexml_import_dom' => array('required', 'SimpleXML'),
    	'dom_import_simplexml' => array('required', 'XML DOM'),
    	'preg_match'       => array('required',  'RegEx support'),
    	'ldap_bind'        => array('required_ldap',  'LDAP Extension'),
    	'radius_auth_open' => array('required_radius',  'Radius Extension'),
    	'mcrypt_module_open'=> array('optional',  'MCrypt'),
    );
    $funcmatrix = array();
    $funcmatrix[] = array(
    	'required' => 'required', 
    	'descr' => 'PHP Version >= 5.1.2. You run: ' . phpversion(), 
    	'enabled' => version_compare(phpversion(), '5.1.2', '>='));
    $funcmatrix[] = array(
    	'required' => 'reccomended', 
    	'descr' => 'PHP Version >= 5.2 (Required for Shibboleth 1.3 SP)', 
    	'enabled' => version_compare(phpversion(), '5.2', '>='));
    foreach ($functionchecks AS $func => $descr) {
    	$funcmatrix[] = array('descr' => $descr[1], 'required' => $descr[0], 'enabled' => function_exists($func));
    }
    
    
    $t = new SimpleSAML_XHTML_Template($config, 'frontpage.php', 'frontpage.php');
    $t->data['header'] = 'simpleSAMLphp installation page';
    $t->data['icon'] = 'compass_l.png';
    $t->data['warnings'] = $warnings;
    $t->data['links'] = $links;
    $t->data['links_meta'] = $linksmeta;
    $t->data['links_doc'] = $linksdoc;
    $t->data['enablematrix'] = $enablematrix;
    $t->data['funcmatrix'] = $funcmatrix;
    
    $t->show();
    
    
    
    ?>