@@ -80,39 +80,39 @@ discard block |
||
| 80 | 80 | protected $cacheGenerated; |
| 81 | 81 | |
| 82 | 82 | |
| 83 | - /** |
|
| 84 | - * An array of entity IDs to exclude from the aggregate. |
|
| 85 | - * |
|
| 86 | - * @var string[]|null |
|
| 87 | - */ |
|
| 88 | - protected $excluded; |
|
| 89 | - |
|
| 90 | - |
|
| 91 | - /** |
|
| 92 | - * An indexed array of protocols to filter the aggregate by. keys can be any of: |
|
| 93 | - * |
|
| 94 | - * - urn:oasis:names:tc:SAML:1.1:protocol |
|
| 95 | - * - urn:oasis:names:tc:SAML:2.0:protocol |
|
| 96 | - * |
|
| 97 | - * Values will be true if enabled, false otherwise. |
|
| 98 | - * |
|
| 99 | - * @var string[]|null |
|
| 100 | - */ |
|
| 101 | - protected $protocols; |
|
| 102 | - |
|
| 103 | - |
|
| 104 | - /** |
|
| 105 | - * An array of roles to filter the aggregate by. Keys can be any of: |
|
| 106 | - * |
|
| 107 | - * - SAML2_XML_md_IDPSSODescriptor |
|
| 108 | - * - SAML2_XML_md_SPSSODescriptor |
|
| 109 | - * - SAML2_XML_md_AttributeAuthorityDescriptor |
|
| 110 | - * |
|
| 111 | - * Values will be true if enabled, false otherwise. |
|
| 112 | - * |
|
| 113 | - * @var string[]|null |
|
| 114 | - */ |
|
| 115 | - protected $roles; |
|
| 83 | + /** |
|
| 84 | + * An array of entity IDs to exclude from the aggregate. |
|
| 85 | + * |
|
| 86 | + * @var string[]|null |
|
| 87 | + */ |
|
| 88 | + protected $excluded; |
|
| 89 | + |
|
| 90 | + |
|
| 91 | + /** |
|
| 92 | + * An indexed array of protocols to filter the aggregate by. keys can be any of: |
|
| 93 | + * |
|
| 94 | + * - urn:oasis:names:tc:SAML:1.1:protocol |
|
| 95 | + * - urn:oasis:names:tc:SAML:2.0:protocol |
|
| 96 | + * |
|
| 97 | + * Values will be true if enabled, false otherwise. |
|
| 98 | + * |
|
| 99 | + * @var string[]|null |
|
| 100 | + */ |
|
| 101 | + protected $protocols; |
|
| 102 | + |
|
| 103 | + |
|
| 104 | + /** |
|
| 105 | + * An array of roles to filter the aggregate by. Keys can be any of: |
|
| 106 | + * |
|
| 107 | + * - SAML2_XML_md_IDPSSODescriptor |
|
| 108 | + * - SAML2_XML_md_SPSSODescriptor |
|
| 109 | + * - SAML2_XML_md_AttributeAuthorityDescriptor |
|
| 110 | + * |
|
| 111 | + * Values will be true if enabled, false otherwise. |
|
| 112 | + * |
|
| 113 | + * @var string[]|null |
|
| 114 | + */ |
|
| 115 | + protected $roles; |
|
| 116 | 116 | |
| 117 | 117 | |
| 118 | 118 | /** |
@@ -207,11 +207,11 @@ discard block |
||
| 207 | 207 | $this->cacheTag = sha1(serialize($config)); |
| 208 | 208 | } |
| 209 | 209 | |
| 210 | - // configure entity IDs excluded by default |
|
| 211 | - $this->excludeEntities($config->getArrayize('exclude', null)); |
|
| 210 | + // configure entity IDs excluded by default |
|
| 211 | + $this->excludeEntities($config->getArrayize('exclude', null)); |
|
| 212 | 212 | |
| 213 | - // configure filters |
|
| 214 | - $this->setFilters($config->getArrayize('filter', null)); |
|
| 213 | + // configure filters |
|
| 214 | + $this->setFilters($config->getArrayize('filter', null)); |
|
| 215 | 215 | |
| 216 | 216 | $this->validLength = $config->getInteger('valid.length', 7*24*60*60); |
| 217 | 217 | |
@@ -523,158 +523,158 @@ discard block |
||
| 523 | 523 | } |
| 524 | 524 | |
| 525 | 525 | |
| 526 | - /** |
|
| 527 | - * Recursively traverse the children of an EntitiesDescriptor, removing those entities listed in the $entities |
|
| 528 | - * property. Returns the EntitiesDescriptor with the entities filtered out. |
|
| 529 | - * |
|
| 530 | - * @param SAML2_XML_md_EntitiesDescriptor $descriptor The EntitiesDescriptor from where to exclude entities. |
|
| 531 | - * |
|
| 532 | - * @return SAML2_XML_md_EntitiesDescriptor The EntitiesDescriptor with excluded entities filtered out. |
|
| 533 | - */ |
|
| 534 | - protected function exclude(SAML2_XML_md_EntitiesDescriptor $descriptor) |
|
| 535 | - { |
|
| 536 | - if (empty($this->excluded)) { |
|
| 537 | - return $descriptor; |
|
| 538 | - } |
|
| 539 | - |
|
| 540 | - $filtered = array(); |
|
| 541 | - foreach ($descriptor->children as $child) { |
|
| 542 | - if ($child instanceof SAML2_XML_md_EntityDescriptor) { |
|
| 543 | - if (in_array($child->entityID, $this->excluded)) { |
|
| 544 | - continue; |
|
| 545 | - } |
|
| 546 | - $filtered[] = $child; |
|
| 547 | - } |
|
| 548 | - |
|
| 549 | - if ($child instanceof SAML2_XML_md_EntitiesDescriptor) { |
|
| 550 | - $filtered[] = $this->exclude($child); |
|
| 551 | - } |
|
| 552 | - } |
|
| 553 | - |
|
| 554 | - $descriptor->children = $filtered; |
|
| 555 | - return $descriptor; |
|
| 556 | - } |
|
| 557 | - |
|
| 558 | - |
|
| 559 | - /** |
|
| 560 | - * Recursively traverse the children of an EntitiesDescriptor, keeping only those entities with the roles listed in |
|
| 561 | - * the $roles property, and support for the protocols listed in the $protocols property. Returns the |
|
| 562 | - * EntitiesDescriptor containing only those entities. |
|
| 563 | - * |
|
| 564 | - * @param SAML2_XML_md_EntitiesDescriptor $descriptor The EntitiesDescriptor to filter. |
|
| 565 | - * |
|
| 566 | - * @return SAML2_XML_md_EntitiesDescriptor The EntitiesDescriptor with only the entities filtered. |
|
| 567 | - */ |
|
| 568 | - protected function filter(SAML2_XML_md_EntitiesDescriptor $descriptor) |
|
| 569 | - { |
|
| 570 | - if ($this->roles === null || $this->protocols === null) { |
|
| 571 | - return $descriptor; |
|
| 572 | - } |
|
| 573 | - |
|
| 574 | - $enabled_roles = array_keys($this->roles, true); |
|
| 575 | - $enabled_protos = array_keys($this->protocols, true); |
|
| 576 | - |
|
| 577 | - $filtered = array(); |
|
| 578 | - foreach ($descriptor->children as $child) { |
|
| 579 | - if ($child instanceof SAML2_XML_md_EntityDescriptor) { |
|
| 580 | - foreach ($child->RoleDescriptor as $role) { |
|
| 581 | - if (in_array(get_class($role), $enabled_roles)) { |
|
| 582 | - // we found a role descriptor that is enabled by our filters, check protocols |
|
| 583 | - if (array_intersect($enabled_protos, $role->protocolSupportEnumeration) !== array()) { |
|
| 584 | - // it supports some protocol we have enabled, add it |
|
| 585 | - $filtered[] = $child; |
|
| 586 | - break; |
|
| 587 | - } |
|
| 588 | - } |
|
| 589 | - } |
|
| 590 | - |
|
| 591 | - } |
|
| 592 | - |
|
| 593 | - if ($child instanceof SAML2_XML_md_EntitiesDescriptor) { |
|
| 594 | - $filtered[] = $this->filter($child); |
|
| 595 | - } |
|
| 596 | - } |
|
| 597 | - |
|
| 598 | - $descriptor->children = $filtered; |
|
| 599 | - return $descriptor; |
|
| 600 | - } |
|
| 601 | - |
|
| 602 | - |
|
| 603 | - /** |
|
| 604 | - * Set this aggregator to exclude a set of entities from the resulting aggregate. |
|
| 605 | - * |
|
| 606 | - * @param array|null $entities The entity IDs of the entities to exclude. |
|
| 607 | - */ |
|
| 608 | - public function excludeEntities($entities) |
|
| 609 | - { |
|
| 610 | - assert('is_array($entities) || is_null($entities)'); |
|
| 611 | - |
|
| 612 | - if ($entities === null) { |
|
| 613 | - return; |
|
| 614 | - } |
|
| 615 | - $this->excluded = $entities; |
|
| 616 | - sort($this->excluded); |
|
| 617 | - $this->cacheId = sha1($this->cacheId . serialize($this->excluded)); |
|
| 618 | - } |
|
| 619 | - |
|
| 620 | - |
|
| 621 | - /** |
|
| 622 | - * Set the internal filters according to one or more options: |
|
| 623 | - * |
|
| 624 | - * - 'saml2': all SAML2.0-capable entities. |
|
| 625 | - * - 'shib13': all SHIB1.3-capable entities. |
|
| 626 | - * - 'saml20-idp': all SAML2.0-capable identity providers. |
|
| 627 | - * - 'saml20-sp': all SAML2.0-capable service providers. |
|
| 628 | - * - 'saml20-aa': all SAML2.0-capable attribute authorities. |
|
| 629 | - * - 'shib13-idp': all SHIB1.3-capable identity providers. |
|
| 630 | - * - 'shib13-sp': all SHIB1.3-capable service providers. |
|
| 631 | - * - 'shib13-aa': all SHIB1.3-capable attribute authorities. |
|
| 632 | - * |
|
| 633 | - * @param array|null $set An array of the different roles and protocols to filter by. |
|
| 634 | - */ |
|
| 635 | - public function setFilters($set) |
|
| 636 | - { |
|
| 637 | - assert('is_array($set) || is_null($set)'); |
|
| 638 | - |
|
| 639 | - if ($set === null) { |
|
| 640 | - return; |
|
| 641 | - } |
|
| 642 | - |
|
| 643 | - // configure filters |
|
| 644 | - $this->protocols = array( |
|
| 645 | - SAML2_Const::NS_SAMLP => TRUE, |
|
| 646 | - 'urn:oasis:names:tc:SAML:1.1:protocol' => TRUE, |
|
| 647 | - ); |
|
| 648 | - $this->roles = array( |
|
| 649 | - 'SAML2_XML_md_IDPSSODescriptor' => TRUE, |
|
| 650 | - 'SAML2_XML_md_SPSSODescriptor' => TRUE, |
|
| 651 | - 'SAML2_XML_md_AttributeAuthorityDescriptor' => TRUE, |
|
| 652 | - ); |
|
| 653 | - |
|
| 654 | - // now translate from the options we have, to specific protocols and roles |
|
| 655 | - |
|
| 656 | - // check SAML 2.0 protocol |
|
| 657 | - $options = array('saml2', 'saml20-idp', 'saml20-sp', 'saml20-aa'); |
|
| 658 | - $this->protocols[SAML2_Const::NS_SAMLP] = (array_intersect($set, $options) !== array()); |
|
| 659 | - |
|
| 660 | - // check SHIB 1.3 protocol |
|
| 661 | - $options = array('shib13', 'shib13-idp', 'shib13-sp', 'shib13-aa'); |
|
| 662 | - $this->protocols['urn:oasis:names:tc:SAML:1.1:protocol'] = (array_intersect($set, $options) !== array()); |
|
| 663 | - |
|
| 664 | - // check IdP |
|
| 665 | - $options = array('saml2', 'shib13', 'saml20-idp', 'shib13-idp'); |
|
| 666 | - $this->roles['SAML2_XML_md_IDPSSODescriptor'] = (array_intersect($set, $options) !== array()); |
|
| 667 | - |
|
| 668 | - // check SP |
|
| 669 | - $options = array('saml2', 'shib13', 'saml20-sp', 'shib13-sp'); |
|
| 670 | - $this->roles['SAML2_XML_md_SPSSODescriptor'] = (array_intersect($set, $options) !== array()); |
|
| 671 | - |
|
| 672 | - // check AA |
|
| 673 | - $options = array('saml2', 'shib13', 'saml20-aa', 'shib13-aa'); |
|
| 674 | - $this->roles['SAML2_XML_md_AttributeAuthorityDescriptor'] = (array_intersect($set, $options) !== array()); |
|
| 675 | - |
|
| 676 | - $this->cacheId = sha1($this->cacheId . serialize($this->protocols) . serialize($this->roles)); |
|
| 677 | - } |
|
| 526 | + /** |
|
| 527 | + * Recursively traverse the children of an EntitiesDescriptor, removing those entities listed in the $entities |
|
| 528 | + * property. Returns the EntitiesDescriptor with the entities filtered out. |
|
| 529 | + * |
|
| 530 | + * @param SAML2_XML_md_EntitiesDescriptor $descriptor The EntitiesDescriptor from where to exclude entities. |
|
| 531 | + * |
|
| 532 | + * @return SAML2_XML_md_EntitiesDescriptor The EntitiesDescriptor with excluded entities filtered out. |
|
| 533 | + */ |
|
| 534 | + protected function exclude(SAML2_XML_md_EntitiesDescriptor $descriptor) |
|
| 535 | + { |
|
| 536 | + if (empty($this->excluded)) { |
|
| 537 | + return $descriptor; |
|
| 538 | + } |
|
| 539 | + |
|
| 540 | + $filtered = array(); |
|
| 541 | + foreach ($descriptor->children as $child) { |
|
| 542 | + if ($child instanceof SAML2_XML_md_EntityDescriptor) { |
|
| 543 | + if (in_array($child->entityID, $this->excluded)) { |
|
| 544 | + continue; |
|
| 545 | + } |
|
| 546 | + $filtered[] = $child; |
|
| 547 | + } |
|
| 548 | + |
|
| 549 | + if ($child instanceof SAML2_XML_md_EntitiesDescriptor) { |
|
| 550 | + $filtered[] = $this->exclude($child); |
|
| 551 | + } |
|
| 552 | + } |
|
| 553 | + |
|
| 554 | + $descriptor->children = $filtered; |
|
| 555 | + return $descriptor; |
|
| 556 | + } |
|
| 557 | + |
|
| 558 | + |
|
| 559 | + /** |
|
| 560 | + * Recursively traverse the children of an EntitiesDescriptor, keeping only those entities with the roles listed in |
|
| 561 | + * the $roles property, and support for the protocols listed in the $protocols property. Returns the |
|
| 562 | + * EntitiesDescriptor containing only those entities. |
|
| 563 | + * |
|
| 564 | + * @param SAML2_XML_md_EntitiesDescriptor $descriptor The EntitiesDescriptor to filter. |
|
| 565 | + * |
|
| 566 | + * @return SAML2_XML_md_EntitiesDescriptor The EntitiesDescriptor with only the entities filtered. |
|
| 567 | + */ |
|
| 568 | + protected function filter(SAML2_XML_md_EntitiesDescriptor $descriptor) |
|
| 569 | + { |
|
| 570 | + if ($this->roles === null || $this->protocols === null) { |
|
| 571 | + return $descriptor; |
|
| 572 | + } |
|
| 573 | + |
|
| 574 | + $enabled_roles = array_keys($this->roles, true); |
|
| 575 | + $enabled_protos = array_keys($this->protocols, true); |
|
| 576 | + |
|
| 577 | + $filtered = array(); |
|
| 578 | + foreach ($descriptor->children as $child) { |
|
| 579 | + if ($child instanceof SAML2_XML_md_EntityDescriptor) { |
|
| 580 | + foreach ($child->RoleDescriptor as $role) { |
|
| 581 | + if (in_array(get_class($role), $enabled_roles)) { |
|
| 582 | + // we found a role descriptor that is enabled by our filters, check protocols |
|
| 583 | + if (array_intersect($enabled_protos, $role->protocolSupportEnumeration) !== array()) { |
|
| 584 | + // it supports some protocol we have enabled, add it |
|
| 585 | + $filtered[] = $child; |
|
| 586 | + break; |
|
| 587 | + } |
|
| 588 | + } |
|
| 589 | + } |
|
| 590 | + |
|
| 591 | + } |
|
| 592 | + |
|
| 593 | + if ($child instanceof SAML2_XML_md_EntitiesDescriptor) { |
|
| 594 | + $filtered[] = $this->filter($child); |
|
| 595 | + } |
|
| 596 | + } |
|
| 597 | + |
|
| 598 | + $descriptor->children = $filtered; |
|
| 599 | + return $descriptor; |
|
| 600 | + } |
|
| 601 | + |
|
| 602 | + |
|
| 603 | + /** |
|
| 604 | + * Set this aggregator to exclude a set of entities from the resulting aggregate. |
|
| 605 | + * |
|
| 606 | + * @param array|null $entities The entity IDs of the entities to exclude. |
|
| 607 | + */ |
|
| 608 | + public function excludeEntities($entities) |
|
| 609 | + { |
|
| 610 | + assert('is_array($entities) || is_null($entities)'); |
|
| 611 | + |
|
| 612 | + if ($entities === null) { |
|
| 613 | + return; |
|
| 614 | + } |
|
| 615 | + $this->excluded = $entities; |
|
| 616 | + sort($this->excluded); |
|
| 617 | + $this->cacheId = sha1($this->cacheId . serialize($this->excluded)); |
|
| 618 | + } |
|
| 619 | + |
|
| 620 | + |
|
| 621 | + /** |
|
| 622 | + * Set the internal filters according to one or more options: |
|
| 623 | + * |
|
| 624 | + * - 'saml2': all SAML2.0-capable entities. |
|
| 625 | + * - 'shib13': all SHIB1.3-capable entities. |
|
| 626 | + * - 'saml20-idp': all SAML2.0-capable identity providers. |
|
| 627 | + * - 'saml20-sp': all SAML2.0-capable service providers. |
|
| 628 | + * - 'saml20-aa': all SAML2.0-capable attribute authorities. |
|
| 629 | + * - 'shib13-idp': all SHIB1.3-capable identity providers. |
|
| 630 | + * - 'shib13-sp': all SHIB1.3-capable service providers. |
|
| 631 | + * - 'shib13-aa': all SHIB1.3-capable attribute authorities. |
|
| 632 | + * |
|
| 633 | + * @param array|null $set An array of the different roles and protocols to filter by. |
|
| 634 | + */ |
|
| 635 | + public function setFilters($set) |
|
| 636 | + { |
|
| 637 | + assert('is_array($set) || is_null($set)'); |
|
| 638 | + |
|
| 639 | + if ($set === null) { |
|
| 640 | + return; |
|
| 641 | + } |
|
| 642 | + |
|
| 643 | + // configure filters |
|
| 644 | + $this->protocols = array( |
|
| 645 | + SAML2_Const::NS_SAMLP => TRUE, |
|
| 646 | + 'urn:oasis:names:tc:SAML:1.1:protocol' => TRUE, |
|
| 647 | + ); |
|
| 648 | + $this->roles = array( |
|
| 649 | + 'SAML2_XML_md_IDPSSODescriptor' => TRUE, |
|
| 650 | + 'SAML2_XML_md_SPSSODescriptor' => TRUE, |
|
| 651 | + 'SAML2_XML_md_AttributeAuthorityDescriptor' => TRUE, |
|
| 652 | + ); |
|
| 653 | + |
|
| 654 | + // now translate from the options we have, to specific protocols and roles |
|
| 655 | + |
|
| 656 | + // check SAML 2.0 protocol |
|
| 657 | + $options = array('saml2', 'saml20-idp', 'saml20-sp', 'saml20-aa'); |
|
| 658 | + $this->protocols[SAML2_Const::NS_SAMLP] = (array_intersect($set, $options) !== array()); |
|
| 659 | + |
|
| 660 | + // check SHIB 1.3 protocol |
|
| 661 | + $options = array('shib13', 'shib13-idp', 'shib13-sp', 'shib13-aa'); |
|
| 662 | + $this->protocols['urn:oasis:names:tc:SAML:1.1:protocol'] = (array_intersect($set, $options) !== array()); |
|
| 663 | + |
|
| 664 | + // check IdP |
|
| 665 | + $options = array('saml2', 'shib13', 'saml20-idp', 'shib13-idp'); |
|
| 666 | + $this->roles['SAML2_XML_md_IDPSSODescriptor'] = (array_intersect($set, $options) !== array()); |
|
| 667 | + |
|
| 668 | + // check SP |
|
| 669 | + $options = array('saml2', 'shib13', 'saml20-sp', 'shib13-sp'); |
|
| 670 | + $this->roles['SAML2_XML_md_SPSSODescriptor'] = (array_intersect($set, $options) !== array()); |
|
| 671 | + |
|
| 672 | + // check AA |
|
| 673 | + $options = array('saml2', 'shib13', 'saml20-aa', 'shib13-aa'); |
|
| 674 | + $this->roles['SAML2_XML_md_AttributeAuthorityDescriptor'] = (array_intersect($set, $options) !== array()); |
|
| 675 | + |
|
| 676 | + $this->cacheId = sha1($this->cacheId . serialize($this->protocols) . serialize($this->roles)); |
|
| 677 | + } |
|
| 678 | 678 | |
| 679 | 679 | /** |
| 680 | 680 | * Retrieve the complete, signed metadata as text. |
@@ -687,8 +687,8 @@ discard block |
||
| 687 | 687 | public function updateCachedMetadata() { |
| 688 | 688 | |
| 689 | 689 | $ed = $this->getEntitiesDescriptor(); |
| 690 | - $ed = $this->exclude($ed); |
|
| 691 | - $ed = $this->filter($ed); |
|
| 690 | + $ed = $this->exclude($ed); |
|
| 691 | + $ed = $this->filter($ed); |
|
| 692 | 692 | $this->addSignature($ed); |
| 693 | 693 | |
| 694 | 694 | $xml = $ed->toXML(); |
@@ -240,7 +240,7 @@ discard block |
||
| 240 | 240 | |
| 241 | 241 | $this->signAlg = $config->getString('sign.algorithm', XMLSecurityKey::RSA_SHA1); |
| 242 | 242 | if (!in_array($this->signAlg, self::$SUPPORTED_SIGNATURE_ALGORITHMS)) { |
| 243 | - throw new SimpleSAML_Error_Exception('Unsupported signature algorithm '. var_export($this->signAlg, TRUE)); |
|
| 243 | + throw new SimpleSAML_Error_Exception('Unsupported signature algorithm ' . var_export($this->signAlg, TRUE)); |
|
| 244 | 244 | } |
| 245 | 245 | |
| 246 | 246 | $this->sslCAFile = $config->getString('ssl.cafile', NULL); |
@@ -311,7 +311,7 @@ discard block |
||
| 311 | 311 | return; |
| 312 | 312 | } |
| 313 | 313 | |
| 314 | - $expireInfo = (string)$expires; |
|
| 314 | + $expireInfo = (string) $expires; |
|
| 315 | 315 | if ($tag !== NULL) { |
| 316 | 316 | $expireInfo .= ':' . $tag; |
| 317 | 317 | } |
@@ -354,7 +354,7 @@ discard block |
||
| 354 | 354 | |
| 355 | 355 | $expireData = explode(':', $expireData, 2); |
| 356 | 356 | |
| 357 | - $expireTime = (int)$expireData[0]; |
|
| 357 | + $expireTime = (int) $expireData[0]; |
|
| 358 | 358 | if ($expireTime <= time()) { |
| 359 | 359 | return FALSE; |
| 360 | 360 | } |
@@ -5,29 +5,29 @@ |
||
| 5 | 5 | |
| 6 | 6 | <?php |
| 7 | 7 | if (count($this->data['sources']) === 0) { |
| 8 | - echo " <p>".$this->t('{aggregator2:aggregator:no_aggregators}')."</p>\n"; |
|
| 8 | + echo " <p>".$this->t('{aggregator2:aggregator:no_aggregators}')."</p>\n"; |
|
| 9 | 9 | } else { |
| 10 | - echo " <ul>"; |
|
| 10 | + echo " <ul>"; |
|
| 11 | 11 | |
| 12 | - foreach ($this->data['sources'] as $id => $source) { |
|
| 13 | - $encId = urlencode($id); |
|
| 14 | - $params = array( |
|
| 15 | - 'id' => $encId, |
|
| 16 | - ); |
|
| 17 | - echo str_repeat(' ', 8)."<li>\n"; |
|
| 18 | - echo str_repeat(' ', 12).'<a href="'; |
|
| 19 | - echo SimpleSAML\Module::getModuleURL('aggregator2/get.php', $params).'">'.htmlspecialchars($id)."</a>\n"; |
|
| 20 | - echo str_repeat(' ', 12).'<a href="'; |
|
| 21 | - $params['mimetype'] = 'text/plain'; |
|
| 22 | - echo SimpleSAML\Module::getModuleURL('aggregator2/get.php', $params).'">['. |
|
| 23 | - $this->t('{aggregator2:aggregator:text}')."]</a>\n"; |
|
| 24 | - echo str_repeat(' ', 12).'<a href="'; |
|
| 25 | - $params['mimetype'] = 'application/xml'; |
|
| 26 | - echo SimpleSAML\Module::getModuleURL('aggregator2/get.php', $params)."\">[XML]</a>\n"; |
|
| 27 | - echo str_repeat(' ', 8)."</li>\n"; |
|
| 28 | - } |
|
| 12 | + foreach ($this->data['sources'] as $id => $source) { |
|
| 13 | + $encId = urlencode($id); |
|
| 14 | + $params = array( |
|
| 15 | + 'id' => $encId, |
|
| 16 | + ); |
|
| 17 | + echo str_repeat(' ', 8)."<li>\n"; |
|
| 18 | + echo str_repeat(' ', 12).'<a href="'; |
|
| 19 | + echo SimpleSAML\Module::getModuleURL('aggregator2/get.php', $params).'">'.htmlspecialchars($id)."</a>\n"; |
|
| 20 | + echo str_repeat(' ', 12).'<a href="'; |
|
| 21 | + $params['mimetype'] = 'text/plain'; |
|
| 22 | + echo SimpleSAML\Module::getModuleURL('aggregator2/get.php', $params).'">['. |
|
| 23 | + $this->t('{aggregator2:aggregator:text}')."]</a>\n"; |
|
| 24 | + echo str_repeat(' ', 12).'<a href="'; |
|
| 25 | + $params['mimetype'] = 'application/xml'; |
|
| 26 | + echo SimpleSAML\Module::getModuleURL('aggregator2/get.php', $params)."\">[XML]</a>\n"; |
|
| 27 | + echo str_repeat(' ', 8)."</li>\n"; |
|
| 28 | + } |
|
| 29 | 29 | |
| 30 | - echo " </ul>\n"; |
|
| 30 | + echo " </ul>\n"; |
|
| 31 | 31 | } |
| 32 | 32 | |
| 33 | 33 | $this->includeAtTemplateBase('includes/footer.php'); |
@@ -5,7 +5,7 @@ discard block |
||
| 5 | 5 | |
| 6 | 6 | <?php |
| 7 | 7 | if (count($this->data['sources']) === 0) { |
| 8 | - echo " <p>".$this->t('{aggregator2:aggregator:no_aggregators}')."</p>\n"; |
|
| 8 | + echo " <p>" . $this->t('{aggregator2:aggregator:no_aggregators}') . "</p>\n"; |
|
| 9 | 9 | } else { |
| 10 | 10 | echo " <ul>"; |
| 11 | 11 | |
@@ -14,17 +14,17 @@ discard block |
||
| 14 | 14 | $params = array( |
| 15 | 15 | 'id' => $encId, |
| 16 | 16 | ); |
| 17 | - echo str_repeat(' ', 8)."<li>\n"; |
|
| 18 | - echo str_repeat(' ', 12).'<a href="'; |
|
| 19 | - echo SimpleSAML\Module::getModuleURL('aggregator2/get.php', $params).'">'.htmlspecialchars($id)."</a>\n"; |
|
| 20 | - echo str_repeat(' ', 12).'<a href="'; |
|
| 17 | + echo str_repeat(' ', 8) . "<li>\n"; |
|
| 18 | + echo str_repeat(' ', 12) . '<a href="'; |
|
| 19 | + echo SimpleSAML\Module::getModuleURL('aggregator2/get.php', $params) . '">' . htmlspecialchars($id) . "</a>\n"; |
|
| 20 | + echo str_repeat(' ', 12) . '<a href="'; |
|
| 21 | 21 | $params['mimetype'] = 'text/plain'; |
| 22 | - echo SimpleSAML\Module::getModuleURL('aggregator2/get.php', $params).'">['. |
|
| 23 | - $this->t('{aggregator2:aggregator:text}')."]</a>\n"; |
|
| 24 | - echo str_repeat(' ', 12).'<a href="'; |
|
| 22 | + echo SimpleSAML\Module::getModuleURL('aggregator2/get.php', $params) . '">[' . |
|
| 23 | + $this->t('{aggregator2:aggregator:text}') . "]</a>\n"; |
|
| 24 | + echo str_repeat(' ', 12) . '<a href="'; |
|
| 25 | 25 | $params['mimetype'] = 'application/xml'; |
| 26 | - echo SimpleSAML\Module::getModuleURL('aggregator2/get.php', $params)."\">[XML]</a>\n"; |
|
| 27 | - echo str_repeat(' ', 8)."</li>\n"; |
|
| 26 | + echo SimpleSAML\Module::getModuleURL('aggregator2/get.php', $params) . "\">[XML]</a>\n"; |
|
| 27 | + echo str_repeat(' ', 8) . "</li>\n"; |
|
| 28 | 28 | } |
| 29 | 29 | |
| 30 | 30 | echo " </ul>\n"; |
@@ -5,12 +5,12 @@ |
||
| 5 | 5 | * @param array &$links The links on the frontpage, split into sections. |
| 6 | 6 | */ |
| 7 | 7 | function aggregator2_hook_frontpage(&$links) { |
| 8 | - assert('is_array($links)'); |
|
| 9 | - assert('array_key_exists("links", $links)'); |
|
| 8 | + assert('is_array($links)'); |
|
| 9 | + assert('array_key_exists("links", $links)'); |
|
| 10 | 10 | |
| 11 | - $links['federation'][] = array( |
|
| 12 | - 'href' => SimpleSAML\Module::getModuleURL('aggregator2/'), |
|
| 13 | - 'text' => '{aggregator2:aggregator:frontpage_link}', |
|
| 14 | - ); |
|
| 11 | + $links['federation'][] = array( |
|
| 12 | + 'href' => SimpleSAML\Module::getModuleURL('aggregator2/'), |
|
| 13 | + 'text' => '{aggregator2:aggregator:frontpage_link}', |
|
| 14 | + ); |
|
| 15 | 15 | |
| 16 | 16 | } |
@@ -1,18 +1,18 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | 3 | if (!isset($_REQUEST['id'])) { |
| 4 | - throw new SimpleSAML_Error_BadRequest('Missing required parameter "id".'); |
|
| 4 | + throw new SimpleSAML_Error_BadRequest('Missing required parameter "id".'); |
|
| 5 | 5 | } |
| 6 | 6 | $id = (string) $_REQUEST['id']; |
| 7 | 7 | |
| 8 | 8 | $set = null; |
| 9 | 9 | if (isset($_REQUEST['set'])) { |
| 10 | - $set = explode(',', $_REQUEST['set']); |
|
| 10 | + $set = explode(',', $_REQUEST['set']); |
|
| 11 | 11 | } |
| 12 | 12 | |
| 13 | 13 | $excluded_entities = null; |
| 14 | 14 | if (isset($_REQUEST['exclude'])) { |
| 15 | - $excluded_entities = explode(',', $_REQUEST['exclude']); |
|
| 15 | + $excluded_entities = explode(',', $_REQUEST['exclude']); |
|
| 16 | 16 | } |
| 17 | 17 | |
| 18 | 18 | $aggregator = sspmod_aggregator2_Aggregator::getAggregator($id); |
@@ -22,17 +22,17 @@ discard block |
||
| 22 | 22 | |
| 23 | 23 | $mimetype = 'application/samlmetadata+xml'; |
| 24 | 24 | $allowedmimetypes = array( |
| 25 | - 'text/plain', |
|
| 26 | - 'application/samlmetadata-xml', |
|
| 27 | - 'application/xml', |
|
| 25 | + 'text/plain', |
|
| 26 | + 'application/samlmetadata-xml', |
|
| 27 | + 'application/xml', |
|
| 28 | 28 | ); |
| 29 | 29 | |
| 30 | 30 | if (isset($_GET['mimetype']) && in_array($_GET['mimetype'], $allowedmimetypes)) { |
| 31 | - $mimetype = $_GET['mimetype']; |
|
| 31 | + $mimetype = $_GET['mimetype']; |
|
| 32 | 32 | } |
| 33 | 33 | |
| 34 | 34 | if ($mimetype === 'text/plain') { |
| 35 | - $xml = SimpleSAML_Utilities::formatXMLString($xml); |
|
| 35 | + $xml = SimpleSAML_Utilities::formatXMLString($xml); |
|
| 36 | 36 | } |
| 37 | 37 | |
| 38 | 38 | header('Content-Type: '.$mimetype); |
@@ -35,13 +35,13 @@ |
||
| 35 | 35 | $xml = SimpleSAML_Utilities::formatXMLString($xml); |
| 36 | 36 | } |
| 37 | 37 | |
| 38 | -header('Content-Type: '.$mimetype); |
|
| 38 | +header('Content-Type: ' . $mimetype); |
|
| 39 | 39 | header('Content-Length: ' . strlen($xml)); |
| 40 | 40 | |
| 41 | 41 | /* |
| 42 | 42 | * At this point, if the ID was forged, getMetadata() would |
| 43 | 43 | * have failed to find a valid metadata set, so we can trust it. |
| 44 | 44 | */ |
| 45 | -header('Content-Disposition: filename='.$id.'.xml'); |
|
| 45 | +header('Content-Disposition: filename=' . $id . '.xml'); |
|
| 46 | 46 | |
| 47 | 47 | echo $xml; |