|
1 | 1 | <?php |
2 | 2 |
|
3 | 3 | /* Load simpleSAMLphp, configuration and metadata */ |
4 | | -$config = SimpleSAML_Configuration::getInstance(); |
| 4 | +$config = SimpleSAML\Configuration::getInstance(); |
5 | 5 | $metadata = SimpleSAML_Metadata_MetaDataStorageHandler::getMetadataHandler(); |
6 | 6 |
|
7 | 7 | /* Check if valid local session exists.. */ |
8 | 8 | if ($config->getBoolean('admin.protectmetadata', false)) { |
9 | | - SimpleSAML_Utilities::requireAdmin(); |
| 9 | + SimpleSAML\Utils\Auth::requireAdmin(); |
10 | 10 | } |
11 | 11 |
|
12 | 12 | try { |
|
16 | 16 | $availableCerts = array(); |
17 | 17 |
|
18 | 18 | $keys = array(); |
19 | | - $certInfo = SimpleSAML_Utilities::loadPublicKey($aameta, false, 'new_'); |
| 19 | + $certInfo = SimpleSAML\Utils\Crypto::loadPublicKey($aameta, false, 'new_'); |
20 | 20 | if ($certInfo !== null) { |
21 | 21 | $availableCerts['new_aa.crt'] = $certInfo; |
22 | 22 | $keys[] = array( |
|
30 | 30 | $hasNewCert = false; |
31 | 31 | } |
32 | 32 |
|
33 | | - $certInfo = SimpleSAML_Utilities::loadPublicKey($aameta, true); |
| 33 | + $certInfo = SimpleSAML\Utils\Crypto::loadPublicKey($aameta, true); |
34 | 34 | $availableCerts['aa.crt'] = $certInfo; |
35 | 35 | $keys[] = array( |
36 | 36 | 'type' => 'X509Certificate', |
|
40 | 40 | ); |
41 | 41 |
|
42 | 42 | if ($aameta->hasValue('https.certificate')) { |
43 | | - $httpsCert = SimpleSAML_Utilities::loadPublicKey($aameta, true, 'https.'); |
| 43 | + $httpsCert = SimpleSAML\Utils\Crypto::loadPublicKey($aameta, true, 'https.'); |
44 | 44 | assert('isset($httpsCert["certData"])'); |
45 | 45 | $availableCerts['https.crt'] = $httpsCert; |
46 | 46 | $keys[] = array( |
|
54 | 54 | $metaArray = array( |
55 | 55 | 'metadata-set' => 'attributeauthority-hosted', |
56 | 56 | 'entityid' => $aaentityid, |
57 | | - 'protocols' => array(SAML2_Const::NS_SAMLP), |
| 57 | + 'protocols' => array(SAML2\Constants::NS_SAMLP), |
58 | 58 | 'AttributeService' => array(0 => array( |
59 | | - 'Binding' => SAML2_Const::BINDING_SOAP, |
60 | | - 'Location' => SimpleSAML_Utilities::getBaseURL().'module.php/aa/attributeserver.php', |
| 59 | + 'Binding' => SAML2\Constants::BINDING_SOAP, |
| 60 | + 'Location' => SimpleSAML\Utils\HTTP::getBaseURL().'module.php/aa/attributeserver.php', |
61 | 61 | ), |
62 | 62 | ), |
63 | 63 | ); |
|
69 | 69 | } |
70 | 70 |
|
71 | 71 | $metaArray['NameIDFormat'] = array( |
72 | | - SAML2_Const::NAMEID_PERSISTENT, |
73 | | - SAML2_Const::NAMEID_TRANSIENT, |
| 72 | + SAML2\Constants::NAMEID_PERSISTENT, |
| 73 | + SAML2\Constants::NAMEID_TRANSIENT, |
74 | 74 | ); |
75 | 75 |
|
76 | 76 | if ($aameta->hasValue('OrganizationName')) { |
|
81 | 81 | ); |
82 | 82 |
|
83 | 83 | if (!$aameta->hasValue('OrganizationURL')) { |
84 | | - throw new SimpleSAML_Error_Exception('If OrganizationName is set, OrganizationURL must also be set.'); |
| 84 | + throw new SimpleSAML\Error\Exception('If OrganizationName is set, OrganizationURL must also be set.'); |
85 | 85 | } |
86 | 86 | $metaArray['OrganizationURL'] = $aameta->getLocalizedString('OrganizationURL'); |
87 | 87 | } |
|
115 | 115 | if (array_key_exists('output', $_GET) && $_GET['output'] == 'xhtml') { |
116 | 116 | $defaultaa = null; |
117 | 117 |
|
118 | | - $t = new SimpleSAML_XHTML_Template($config, 'metadata.php', 'admin'); |
| 118 | + $t = new SimpleSAML\XHTML\Template($config, 'metadata.php', 'admin'); |
119 | 119 |
|
120 | 120 | $t->data['header'] = 'saml20-aa'; |
121 | | - $t->data['metaurl'] = SimpleSAML_Utilities::selfURLNoQuery(); |
| 121 | + $t->data['metaurl'] = SimpleSAML\Utils\HTTP::getSelfURLNoQuery(); |
122 | 122 | $t->data['metadata'] = htmlspecialchars($metaxml); |
123 | 123 | $t->data['metadataflat'] = htmlspecialchars($metaflat); |
124 | 124 | $t->data['defaultaa'] = $defaultaa; |
|
130 | 130 | exit(0); |
131 | 131 | } |
132 | 132 | } catch (Exception $exception) { |
133 | | - throw new SimpleSAML_Error_Error('METADATA', $exception); |
| 133 | + throw new SimpleSAML\Error\Error('METADATA', $exception); |
134 | 134 | } |
0 commit comments