Revision: 2166
Author: olavmrk
Date: Wed Feb 10 03:32:00 2010
Log: Move all organization info to Organization* metadata options.

This patch changes the metadata parsing and generation to use
OrganizationName, OrganizationDisplayName and OrganizationURL.

It also updates users of 'name' to check 'OrganizationDisplayName'
if 'name' is unset.
http://code.google.com/p/simplesamlphp/source/detail?r=2166

Modified:
 /trunk/docs/simplesamlphp-reference-idp-hosted.txt
 /trunk/docs/simplesamlphp-reference-idp-remote.txt
 /trunk/docs/simplesamlphp-reference-sp-hosted.txt
 /trunk/docs/simplesamlphp-reference-sp-remote.txt
 /trunk/lib/SimpleSAML/IdP.php
 /trunk/lib/SimpleSAML/Metadata/SAMLBuilder.php
 /trunk/lib/SimpleSAML/Metadata/SAMLParser.php
 /trunk/modules/adfs/www/idp/prp.php
 /trunk/modules/consent/templates/consentform.php
 /trunk/modules/consentAdmin/www/consentAdmin.php
 /trunk/modules/core/templates/frontpage_federation.tpl.php
 /trunk/modules/discopower/templates/disco-tpl.php
 /trunk/modules/saml/hooks/hook_metadata_hosted.php
 /trunk/templates/metadata.php
 /trunk/templates/selectidp-dropdown.php
 /trunk/templates/selectidp-links.php
 /trunk/www/admin/metadata.php
 /trunk/www/auth/login-feide.php
 /trunk/www/saml2/idp/metadata.php
 /trunk/www/saml2/sp/metadata.php
 /trunk/www/shib13/idp/metadata.php
 /trunk/www/shib13/sp/metadata.php

=======================================
--- /trunk/docs/simplesamlphp-reference-idp-hosted.txt Tue Jan 26 01:03:39 2010 +++ /trunk/docs/simplesamlphp-reference-idp-hosted.txt Wed Feb 10 03:32:00 2010
@@ -53,6 +53,35 @@
     set to `__DEFAULT__`, and that IdP will be used when no other
     entries in the metadata matches.

+`OrganizationName`
+:   The name of the organization responsible for this IdP.
+    This name does not need to be suitable for display to end users.
+
+: This option can be translated into multiple languages by specifying the value as an array of language-code to translated name:
+
+        'OrganizationName' => array(
+            'en' => 'Example organization',
+            'no' => 'Eksempel organisation',
+        ),
+
+: *Note*: If you specify this option, you must also specify the `OrganizationURL` option.
+
+`OrganizationDisplayName`
+:   The name of the organization responsible for this IdP.
+    This name must be suitable for display to end users.
+ If this option isn't specified, `OrganizationName` will be used instead.
+
+: This option can be translated into multiple languages by specifying the value as an array of language-code to translated name.
+
+: *Note*: If you specify this option, you must also specify the `OrganizationName` option.
+
+`OrganizationURL`
+: An URL the end user can access for more information about the organization.
+
+: This option can be translated into multiple languages by specifying the value as an array of language-code to translated URL.
+
+: *Note*: If you specify this option, you must also specify the `OrganizationName` option.
+
 `privacypolicy`
 :   This is an absolute URL for where an user can find a
     privacypolicy. If set, this will be shown on the consent page.
=======================================
--- /trunk/docs/simplesamlphp-reference-idp-remote.txt Tue Jan 5 05:52:11 2010 +++ /trunk/docs/simplesamlphp-reference-idp-remote.txt Wed Feb 10 03:32:00 2010
@@ -47,8 +47,39 @@
 `icon`
 :   A logo which will be shown next to this IdP in the discovery service.

+`OrganizationName`
+:   The name of the organization responsible for this SPP.
+    This name does not need to be suitable for display to end users.
+
+: This option can be translated into multiple languages by specifying the value as an array of language-code to translated name:
+
+        'OrganizationName' => array(
+            'en' => 'Example organization',
+            'no' => 'Eksempel organisation',
+        ),
+
+: *Note*: If you specify this option, you must also specify the `OrganizationURL` option.
+
+`OrganizationDisplayName`
+:   The name of the organization responsible for this IdP.
+    This name must be suitable for display to end users.
+ If this option isn't specified, `OrganizationName` will be used instead.
+
+: This option can be translated into multiple languages by specifying the value as an array of language-code to translated name.
+
+: *Note*: If you specify this option, you must also specify the `OrganizationName` option.
+
+`OrganizationURL`
+: An URL the end user can access for more information about the organization.
+
+: This option can be translated into multiple languages by specifying the value as an array of language-code to translated URL.
+
+: *Note*: If you specify this option, you must also specify the `OrganizationName` option.
+
 `name`
-: The name of this IdP. Will be used by various modules when they need to show a name of the SP to the user.</p> +: The name of this IdP. Will be used by various modules when they need to show a name of the SP to the user.
+
+: If this option is unset, the organization name will be used instead (if it is available).

: This option can be translated into multiple languages by specifying the value as an array of language-code to translated name:

=======================================
--- /trunk/docs/simplesamlphp-reference-sp-hosted.txt Fri Oct 9 03:39:25 2009 +++ /trunk/docs/simplesamlphp-reference-sp-hosted.txt Wed Feb 10 03:32:00 2010
@@ -53,6 +53,35 @@
 `idpdisco.url`
: Set which IdP discovery service this SP should use. If this is unset, the IdP discovery service specified in the global option `idpdisco.url.{saml20|shib13}` in `config/config.php` will be used. If that one is also unset, the builtin default discovery service will be used.

+`OrganizationName`
+:   The name of the organization responsible for this SPP.
+    This name does not need to be suitable for display to end users.
+
+: This option can be translated into multiple languages by specifying the value as an array of language-code to translated name:
+
+        'OrganizationName' => array(
+            'en' => 'Example organization',
+            'no' => 'Eksempel organisation',
+        ),
+
+: *Note*: If you specify this option, you must also specify the `OrganizationURL` option.
+
+`OrganizationDisplayName`
+:   The name of the organization responsible for this SPP.
+    This name must be suitable for display to end users.
+ If this option isn't specified, `OrganizationName` will be used instead.
+
+: This option can be translated into multiple languages by specifying the value as an array of language-code to translated name.
+
+: *Note*: If you specify this option, you must also specify the `OrganizationName` option.
+
+`OrganizationURL`
+: An URL the end user can access for more information about the organization.
+
+: This option can be translated into multiple languages by specifying the value as an array of language-code to translated URL.
+
+: *Note*: If you specify this option, you must also specify the `OrganizationName` option.
+
 `name`
 :   The name of this SP. Will be added to the generated metadata.

=======================================
--- /trunk/docs/simplesamlphp-reference-sp-remote.txt Tue Jan 26 01:03:39 2010 +++ /trunk/docs/simplesamlphp-reference-sp-remote.txt Wed Feb 10 03:32:00 2010
@@ -45,7 +45,9 @@

 `name`
 :   The name of this SP. Will be used by various modules when they need
-    to show a name of the SP to the user.</p>
+    to show a name of the SP to the user.
+
+: If this option is unset, the organization name will be used instead (if it is available).

 :   This option can be translated into multiple languages by specifying
     the value as an array of language-code to translated name:
@@ -55,6 +57,35 @@
             'no' => 'En tjeneste',
         ),

+`OrganizationName`
+:   The name of the organization responsible for this SPP.
+    This name does not need to be suitable for display to end users.
+
+: This option can be translated into multiple languages by specifying the value as an array of language-code to translated name:
+
+        'OrganizationName' => array(
+            'en' => 'Example organization',
+            'no' => 'Eksempel organisation',
+        ),
+
+: *Note*: If you specify this option, you must also specify the `OrganizationURL` option.
+
+`OrganizationDisplayName`
+:   The name of the organization responsible for this IdP.
+    This name must be suitable for display to end users.
+ If this option isn't specified, `OrganizationName` will be used instead.
+
+: This option can be translated into multiple languages by specifying the value as an array of language-code to translated name.
+
+: *Note*: If you specify this option, you must also specify the `OrganizationName` option.
+
+`OrganizationURL`
+: An URL the end user can access for more information about the organization.
+
+: This option can be translated into multiple languages by specifying the value as an array of language-code to translated URL.
+
+: *Note*: If you specify this option, you must also specify the `OrganizationName` option.
+
 `privacypolicy`
 :   This is an absolute URL for where an user can find a privacypolicy
     for this SP. If set, this will be shown on the consent page.
=======================================
--- /trunk/lib/SimpleSAML/IdP.php       Wed Jan 27 23:41:07 2010
+++ /trunk/lib/SimpleSAML/IdP.php       Wed Feb 10 03:32:00 2010
@@ -132,7 +132,13 @@
                        }
                }

- return $spMetadata->getLocalizedString('name', array('en' => $spEntityId));
+               if ($spMetadata->hasValue('name')) {
+                       return $spMetadata->getLocalizedString('name');
+               } elseif ($spMetadata->hasValue('OrganizationDisplayName')) {
+                       return 
$spMetadata->getLocalizedString('OrganizationDisplayName');
+               } else {
+                       return array('en' => $spEntityId);
+               }
        }


=======================================
--- /trunk/lib/SimpleSAML/Metadata/SAMLBuilder.php      Mon Feb  8 01:13:08 2010
+++ /trunk/lib/SimpleSAML/Metadata/SAMLBuilder.php      Wed Feb 10 03:32:00 2010
@@ -173,33 +173,30 @@
                $this->entityDescriptor->appendChild($org);
        }

-
-       public function addOrganizationInfo($metadata) {
-               if (array_key_exists('name', $metadata)) {
-
-                       if (is_array($metadata['name'])) {
-                               $name = $metadata['name'];
-                       } else {
-                               $name = array('en' => $metadata['name']);
-                       }
-
-
-                       if (!array_key_exists('url', $metadata)) {
-                               /*
-                                * The specification requires an 
OrganizationURL element, but
-                                * we haven't got an URL. Insert an empty 
element instead.
-                                */
-                               $url = array('en' => '');
-                       } elseif (is_array($metadata['url'])) {
-                               $url = $metadata['url'];
-                       } else {
-                               $url = array('en' => $metadata['url']);
-                       }
-
-                       $this->addOrganization($name, $name, $url);
-               }
-       }
-
+
+       /**
+        * Add organization element based on metadata array.
+        *
+ * @param array $metadata The metadata we should extract the organization information from.
+        */
+       public function addOrganizationInfo(array $metadata) {
+
+               if (
+                       empty($metadata['OrganizationName']) ||
+                       empty($metadata['OrganizationDisplayName']) ||
+                       empty($metadata['OrganizationURL'])
+                   ) {
+                       /* Empty or incomplete organization information. */
+                       return;
+               }
+
+ $orgName = SimpleSAML_Utilities::arrayize($metadata['OrganizationName'], 'en'); + $orgDisplayName = SimpleSAML_Utilities::arrayize($metadata['OrganizationDisplayName'], 'en'); + $orgURL = SimpleSAML_Utilities::arrayize($metadata['OrganizationURL'], 'en');
+
+               $this->addOrganization($orgName, $orgDisplayName, $orgURL);
+       }
+

        /**
         * Add endpoint list to metadata.
=======================================
--- /trunk/lib/SimpleSAML/Metadata/SAMLParser.php       Tue Jan  5 05:52:00 2010
+++ /trunk/lib/SimpleSAML/Metadata/SAMLParser.php       Wed Feb 10 03:32:00 2010
@@ -444,14 +444,13 @@
                 * Add organizational metadata
                 */
                if (!empty($this->organizationName)) {
-                       $ret['name'] = $this->organizationName;
-                       $ret['description'] = $this->organizationName;
+                       $ret['OrganizationName'] = $this->organizationName;
                }
                if (!empty($this->organizationDisplayName)) {
-                       $ret['name'] = $this->organizationDisplayName;
+                       $ret['OrganizationDisplayName'] = 
$this->organizationDisplayName;
                }
                if (!empty($this->organizationURL)) {
-                       $ret['url'] = $this->organizationURL;
+                       $ret['OrganizationURL'] = $this->organizationURL;
                }

                return $ret;
=======================================
--- /trunk/modules/adfs/www/idp/prp.php Thu Oct 22 05:38:05 2009
+++ /trunk/modules/adfs/www/idp/prp.php Wed Feb 10 03:32:00 2010
@@ -202,8 +202,6 @@
                }
                $spmetadata = SimpleSAML_Configuration::loadFromArray($arr);

-               $sp_name = $spmetadata->getValue('name', $spentityid);
-
SimpleSAML_Logger::info('ADFS - IdP.SSOService: Sending back AuthnResponse to ' . $spentityid);

                $attributes = $session->getAttributes();
=======================================
--- /trunk/modules/consent/templates/consentform.php Wed Oct 14 01:38:36 2009 +++ /trunk/modules/consent/templates/consentform.php Wed Feb 10 03:32:00 2010
@@ -31,21 +31,27 @@

 if (array_key_exists('name', $this->data['srcMetadata'])) {
        $srcName = $this->data['srcMetadata']['name'];
-       if (is_array($srcName)) {
-               $srcName = $this->t($srcName);
-       }
+} elseif (array_key_exists('OrganizationDisplayName', $this->data['srcMetadata'])) {
+       $srcName = $this->data['srcMetadata']['OrganizationDisplayName'];
 } else {
        $srcName = $this->data['srcMetadata']['entityid'];
 }
+
+if (is_array($srcName)) {
+       $srcName = $this->t($srcName);
+}

 if (array_key_exists('name', $this->data['dstMetadata'])) {
        $dstName = $this->data['dstMetadata']['name'];
-       if (is_array($dstName)) {
-               $dstName = $this->t($dstName);
-       }
+} elseif (array_key_exists('OrganizationDisplayName', $this->data['dstMetadata'])) {
+       $dstName = $this->data['dstMetadata']['OrganizationDisplayName'];
 } else {
        $dstName = $this->data['dstMetadata']['entityid'];
 }
+
+if (is_array($dstName)) {
+       $dstName = $this->t($dstName);
+}


 $attributes = $this->data['attributes'];
=======================================
--- /trunk/modules/consentAdmin/www/consentAdmin.php Fri Nov 6 02:59:11 2009 +++ /trunk/modules/consentAdmin/www/consentAdmin.php Wed Feb 10 03:32:00 2010
@@ -220,10 +220,12 @@
        }

        // Set name of SP
-       if(empty($sp_values['name']) || !is_array($sp_values['name'])) {
-               $sp_name = $sp_empty_name;
-       } else {
+       if(isset($sp_values['name']) && is_array($sp_values['name'])) {
                $sp_name = $sp_metadata['name'];
+ } elseif(isset($sp_values['OrganizationDisplayName']) && is_array($sp_values['OrganizationDisplayName'])) {
+               $sp_name = $sp_metadata['OrganizationDisplayName'];
+       } else {
+               $sp_name = $sp_empty_name;
        }

        // Set description of SP
=======================================
--- /trunk/modules/core/templates/frontpage_federation.tpl.php Wed Dec 16 06:09:00 2009 +++ /trunk/modules/core/templates/frontpage_federation.tpl.php Wed Feb 10 03:32:00 2010
@@ -82,6 +82,8 @@
                        '">');
                if (array_key_exists('name', $entry)) {
echo $this->getTranslation(SimpleSAML_Utilities::arrayize($entry['name'], 'en'));
+               } elseif (array_key_exists('OrganizationDisplayName', $entry)) {
+ echo $this->getTranslation(SimpleSAML_Utilities::arrayize($entry['OrganizationDisplayName'], 'en'));
                } else {
                        echo $entry['entityid'];
                }
=======================================
--- /trunk/modules/discopower/templates/disco-tpl.php Tue Oct 27 00:44:01 2009 +++ /trunk/modules/discopower/templates/disco-tpl.php Wed Feb 10 03:32:00 2010
@@ -108,6 +108,12 @@
                } else {
                        return $metadata['name'];
                }
+       } elseif (array_key_exists('OrganizationDisplayName', $metadata)) {
+               if (is_array($metadata['OrganizationDisplayName'])) {
+                       return 
$t->getTranslation($metadata['OrganizationDisplayName']);
+               } else {
+                       return $metadata['OrganizationDisplayName'];
+               }
        }
        return $metadata['entityid'];
 }
=======================================
--- /trunk/modules/saml/hooks/hook_metadata_hosted.php Thu Sep 3 03:38:02 2009 +++ /trunk/modules/saml/hooks/hook_metadata_hosted.php Wed Feb 10 03:32:00 2010
@@ -15,6 +15,9 @@
                $metadata = $source->getMetadata();

                $name = $metadata->getValue('name', NULL);
+               if ($name === NULL) {
+                       $name = $metadata->getValue('OrganizationDisplayName', 
NULL);
+               }
                if ($name === NULL) {
                        $name = $source->getAuthID();
                }
=======================================
--- /trunk/templates/metadata.php       Mon Jan 26 13:36:44 2009
+++ /trunk/templates/metadata.php       Wed Feb 10 03:32:00 2010
@@ -37,7 +37,9 @@
                                        <select name="sendtoidp">
                                        <?php
                                                foreach ($this->data['idpsend'] AS 
$entityid => $idpmeta) {
- $name = array_key_exists('name', $idpmeta) ? $idpmeta['name'] : $entityid;
+                                                       $name = 
array_key_exists('name', $idpmeta) ? $idpmeta['name'] :
+ array_key_exists('OrganizationDisplayName', $idpmeta) ? $idpmeta['OrganizationDisplayName'] :
+                                                               $entityid;
                                                        echo '<option value="' . 
htmlspecialchars($entityid) . '">';
                                                        if (is_array($name)) {
                                                                echo 
htmlspecialchars($this->t($name));
=======================================
--- /trunk/templates/selectidp-dropdown.php     Mon Jan 26 13:36:44 2009
+++ /trunk/templates/selectidp-dropdown.php     Wed Feb 10 03:32:00 2010
@@ -10,8 +10,11 @@
 $this->includeAtTemplateBase('includes/header.php');

 foreach ($this->data['idplist'] AS $idpentry) {
-       if (isset($idpentry['name']))
+       if (isset($idpentry['name'])) {
$this->includeInlineTranslation('idpname_' . $idpentry['entityid'], $idpentry['name']);
+       } elseif (isset($idpentry['OrganizationDisplayName'])) {
+ $this->includeInlineTranslation('idpname_' . $idpentry['entityid'], $idpentry['OrganizationDisplayName']);
+       }
        if (isset($idpentry['description']))
$this->includeInlineTranslation('idpdesc_' . $idpentry['entityid'], $idpentry['description']);
 }
=======================================
--- /trunk/templates/selectidp-links.php        Fri Jan 29 04:59:30 2010
+++ /trunk/templates/selectidp-links.php        Wed Feb 10 03:32:00 2010
@@ -10,8 +10,11 @@
 $this->includeAtTemplateBase('includes/header.php');

 foreach ($this->data['idplist'] AS $idpentry) {
-       if (isset($idpentry['name']))
+       if (isset($idpentry['name'])) {
$this->includeInlineTranslation('idpname_' . $idpentry['entityid'], $idpentry['name']);
+       } elseif (isset($idpentry['OrganizationDisplayName'])) {
+ $this->includeInlineTranslation('idpname_' . $idpentry['entityid'], $idpentry['OrganizationDisplayName']);
+       }
        if (isset($idpentry['description']))
$this->includeInlineTranslation('idpdesc_' . $idpentry['entityid'], $idpentry['description']);
 }
=======================================
--- /trunk/www/admin/metadata.php       Fri Oct  9 03:52:26 2009
+++ /trunk/www/admin/metadata.php       Wed Feb 10 03:32:00 2010
@@ -25,7 +25,7 @@
                foreach ($metalist AS $entityid => $mentry) {
$results[$entityid] = SimpleSAML_Utilities::checkAssocArrayRules($mentry,
                                array('entityid', 'host'),
- array('redirect.sign','redirect.validate','certificate','privatekey', 'privatekey_pass', 'NameIDFormat', 'ForceAuthn', 'AuthnContextClassRef', 'SPNameQualifier', 'attributes', 'metadata.sign.enable', 'metadata.sign.privatekey', 'metadata.sign.privatekey_pass', 'metadata.sign.certificate', 'idpdisco.url', 'authproc', 'certData') + array('redirect.sign','redirect.validate','certificate','privatekey', 'privatekey_pass', 'NameIDFormat', 'ForceAuthn', 'AuthnContextClassRef', 'SPNameQualifier', 'attributes', 'metadata.sign.enable', 'metadata.sign.privatekey', 'metadata.sign.privatekey_pass', 'metadata.sign.certificate', 'idpdisco.url', 'authproc', 'certData', 'OrganizationName', 'OrganizationDisplayName', 'OrganizationURL')
                        );
                }
                $et->data['metadata.saml20-sp-hosted'] = $results;
@@ -35,7 +35,7 @@
                foreach ($metalist AS $entityid => $mentry) {
$results[$entityid] = SimpleSAML_Utilities::checkAssocArrayRules($mentry, array('entityid', 'SingleSignOnService', 'SingleLogoutService', 'certFingerprint'), - array('name', 'description', 'base64attributes', 'certificate', 'hint.cidr', 'saml2.relaxvalidation', 'SingleLogoutServiceResponse', 'redirect.sign', 'redirect.validate', 'sharedkey', 'assertion.encryption', 'icon', 'authproc', 'certData', 'send_metadata_email') + array('name', 'description', 'base64attributes', 'certificate', 'hint.cidr', 'saml2.relaxvalidation', 'SingleLogoutServiceResponse', 'redirect.sign', 'redirect.validate', 'sharedkey', 'assertion.encryption', 'icon', 'authproc', 'certData', 'send_metadata_email', 'OrganizationName', 'OrganizationDisplayName', 'OrganizationURL')
                        );
$index = array_search('certFingerprint', $results[$entityid]['required.notfound']);
                        if ($index !== FALSE) {
@@ -54,7 +54,7 @@
                foreach ($metalist AS $entityid => $mentry) {
$results[$entityid] = SimpleSAML_Utilities::checkAssocArrayRules($mentry,
                                array('entityid', 'host', 'privatekey', 
'certificate', 'auth'),
- array('redirect.sign', 'redirect.validate', 'privatekey_pass', 'authority', 'userid.attribute', 'metadata.sign.enable', 'metadata.sign.privatekey', 'metadata.sign.privatekey_pass', 'metadata.sign.certificate', 'AttributeNameFormat', 'name', 'authproc', 'saml20.sign.assertion', 'saml20.sign.response', 'certData') + array('redirect.sign', 'redirect.validate', 'privatekey_pass', 'authority', 'userid.attribute', 'metadata.sign.enable', 'metadata.sign.privatekey', 'metadata.sign.privatekey_pass', 'metadata.sign.certificate', 'AttributeNameFormat', 'name', 'authproc', 'saml20.sign.assertion', 'saml20.sign.response', 'certData', 'OrganizationName', 'OrganizationDisplayName', 'OrganizationURL')
                        );
                }
                $et->data['metadata.saml20-idp-hosted'] = $results;
@@ -64,7 +64,7 @@
                foreach ($metalist AS $entityid => $mentry) {
$results[$entityid] = SimpleSAML_Utilities::checkAssocArrayRules($mentry,
                                array('entityid', 'AssertionConsumerService'),
- array('SingleLogoutService', 'NameIDFormat', 'SPNameQualifier', 'base64attributes', 'simplesaml.nameidattribute', 'simplesaml.attributes', 'attributes', 'name', 'description', 'redirect.sign', 'redirect.validate', 'certificate', 'ForceAuthn', 'sharedkey', 'assertion.encryption', 'userid.attribute', 'AttributeNameFormat', 'authproc', 'saml20.sign.assertion', 'saml20.sign.response', 'certData') + array('SingleLogoutService', 'NameIDFormat', 'SPNameQualifier', 'base64attributes', 'simplesaml.nameidattribute', 'simplesaml.attributes', 'attributes', 'name', 'description', 'redirect.sign', 'redirect.validate', 'certificate', 'ForceAuthn', 'sharedkey', 'assertion.encryption', 'userid.attribute', 'AttributeNameFormat', 'authproc', 'saml20.sign.assertion', 'saml20.sign.response', 'certData', 'OrganizationName', 'OrganizationDisplayName', 'OrganizationURL')
                        );
                }
                $et->data['metadata.saml20-sp-remote'] = $results;
@@ -81,7 +81,7 @@
                foreach ($metalist AS $entityid => $mentry) {
$results[$entityid] = SimpleSAML_Utilities::checkAssocArrayRules($mentry,
                                array('entityid', 'host'),
- array('NameIDFormat', 'ForceAuthn', 'metadata.sign.enable', 'metadata.sign.privatekey', 'metadata.sign.privatekey_pass', 'metadata.sign.certificate', 'idpdisco.url', 'authproc') + array('NameIDFormat', 'ForceAuthn', 'metadata.sign.enable', 'metadata.sign.privatekey', 'metadata.sign.privatekey_pass', 'metadata.sign.certificate', 'idpdisco.url', 'authproc', 'OrganizationName', 'OrganizationDisplayName', 'OrganizationURL')
                        );
                }
                $et->data['metadata.shib13-sp-hosted'] = $results;
@@ -91,7 +91,7 @@
                foreach ($metalist AS $entityid => $mentry) {
$results[$entityid] = SimpleSAML_Utilities::checkAssocArrayRules($mentry,
                                array('entityid', 'SingleSignOnService', 
'certFingerprint'),
-                               array('name', 'description', 
'base64attributes', 'icon', 'authproc')
+ array('name', 'description', 'base64attributes', 'icon', 'authproc', 'OrganizationName', 'OrganizationDisplayName', 'OrganizationURL')
                        );
                }
                $et->data['metadata.shib13-idp-remote'] = $results;
@@ -104,7 +104,7 @@
                foreach ($metalist AS $entityid => $mentry) {
$results[$entityid] = SimpleSAML_Utilities::checkAssocArrayRules($mentry,
                                array('entityid', 'host', 'privatekey', 
'certificate', 'auth'),
- array('name', 'authority', 'privatekey_pass', 'scopedattributes', 'authproc') + array('name', 'authority', 'privatekey_pass', 'scopedattributes', 'authproc', 'OrganizationName', 'OrganizationDisplayName', 'OrganizationURL')
                        );
                }
                $et->data['metadata.shib13-idp-hosted'] = $results;
@@ -114,7 +114,7 @@
                foreach ($metalist AS $entityid => $mentry) {
$results[$entityid] = SimpleSAML_Utilities::checkAssocArrayRules($mentry,
                                array('entityid', 'AssertionConsumerService'),
- array('base64attributes', 'audience', 'simplesaml.attributes', 'attributes', 'name', 'description', 'metadata.sign.enable', 'metadata.sign.privatekey', 'metadata.sign.privatekey_pass', 'metadata.sign.certificate', 'scopedattributes', 'authproc') + array('base64attributes', 'audience', 'simplesaml.attributes', 'attributes', 'name', 'description', 'metadata.sign.enable', 'metadata.sign.privatekey', 'metadata.sign.privatekey_pass', 'metadata.sign.certificate', 'scopedattributes', 'authproc', 'OrganizationName', 'OrganizationDisplayName', 'OrganizationURL')
                        );
                }
                $et->data['metadata.shib13-sp-remote'] = $results;
=======================================
--- /trunk/www/auth/login-feide.php     Wed Feb 25 23:19:00 2009
+++ /trunk/www/auth/login-feide.php     Wed Feb 10 03:32:00 2010
@@ -288,6 +288,8 @@
 }
 if(array_key_exists('name', $spmetadata)) {
        $t->data['spname'] = $spmetadata['name'];
+} elseif(array_key_exists('OrganizationDisplayName', $spmetadata)) {
+       $t->data['spname'] = $spmetadata['OrganizationDisplayName'];
 } else {
        $t->data['spname'] = NULL;
 }
=======================================
--- /trunk/www/saml2/idp/metadata.php   Wed Jan 27 01:29:19 2010
+++ /trunk/www/saml2/idp/metadata.php   Wed Feb 10 03:32:00 2010
@@ -50,15 +50,22 @@
        } else {
$metaArray['NameIDFormat'] = 'urn:oasis:names:tc:SAML:2.0:nameid-format:transient';
        }
-       if (array_key_exists('name', $idpmeta)) {
-               $metaArray['name'] = $idpmeta['name'];
-       }
-       if (array_key_exists('description', $idpmeta)) {
-               $metaArray['description'] = $idpmeta['description'];
-       }
-       if (array_key_exists('url', $idpmeta)) {
-               $metaArray['url'] = $idpmeta['url'];
-       }
+
+       if (!empty($idpmeta['OrganizationName'])) {
+               $metaArray['OrganizationName'] = $idpmeta['OrganizationName'];
+
+               if (!empty($idpmeta['OrganizationDisplayName'])) {
+ $metaArray['OrganizationDisplayName'] = $idpmeta['OrganizationDisplayName'];
+               } else {
+                       $metaArray['OrganizationDisplayName'] = 
$idpmeta['OrganizationName'];
+               }
+
+               if (empty($idpmeta['OrganizationURL'])) {
+ throw new SimpleSAML_Error_Exception('If OrganizationName is set, OrganizationURL must also be set.');
+               }
+               $metaArray['OrganizationURL'] = $idpmeta['OrganizationURL'];
+       }
+
        if (array_key_exists('scope', $idpmeta)) {
                $metaArray['scope'] = $idpmeta['scope'];
        }
@@ -69,6 +76,7 @@
        $metaArray['certData'] = $certInfo['certData'];
        $metaBuilder = new SimpleSAML_Metadata_SAMLBuilder($idpentityid);
        $metaBuilder->addMetadataIdP20($metaArray);
+       $metaBuilder->addOrganizationInfo($metaArray);
        $metaBuilder->addContact('technical', array(
                'emailAddress' => $config->getString('technicalcontact_email', 
NULL),
                'name' => $config->getString('technicalcontact_name', NULL),
=======================================
--- /trunk/www/saml2/sp/metadata.php    Mon Feb  8 01:12:42 2010
+++ /trunk/www/saml2/sp/metadata.php    Wed Feb 10 03:32:00 2010
@@ -34,15 +34,29 @@
        } else {
$metaArray['NameIDFormat'] = 'urn:oasis:names:tc:SAML:2.0:nameid-format:transient';
        }
+
+       if (!empty($spmeta['OrganizationName'])) {
+               $metaArray['OrganizationName'] = $spmeta['OrganizationName'];
+
+               if (!empty($spmeta['OrganizationDisplayName'])) {
+ $metaArray['OrganizationDisplayName'] = $spmeta['OrganizationDisplayName'];
+               } else {
+                       $metaArray['OrganizationDisplayName'] = 
$spmeta['OrganizationName'];
+               }
+
+               if (empty($spmeta['OrganizationURL'])) {
+ throw new SimpleSAML_Error_Exception('If OrganizationName is set, OrganizationURL must also be set.');
+               }
+               $metaArray['OrganizationURL'] = $spmeta['OrganizationURL'];
+       }
+
+
        if (array_key_exists('name', $spmeta)) {
                $metaArray['name'] = $spmeta['name'];
        }
        if (array_key_exists('description', $spmeta)) {
                $metaArray['description'] = $spmeta['description'];
        }
-       if (array_key_exists('url', $spmeta)) {
-               $metaArray['url'] = $spmeta['url'];
-       }

        $certInfo = SimpleSAML_Utilities::loadPublicKey($spmeta);
        if ($certInfo !== NULL && array_key_exists('certData', $certInfo)) {
=======================================
--- /trunk/www/shib13/idp/metadata.php  Thu Dec  3 02:01:16 2009
+++ /trunk/www/shib13/idp/metadata.php  Wed Feb 10 03:32:00 2010
@@ -40,14 +40,20 @@
        } else {
                $metaArray['NameIDFormat'] = 
'urn:mace:shibboleth:1.0:nameIdentifier';
        }
-       if (array_key_exists('name', $idpmeta)) {
-               $metaArray['name'] = $idpmeta['name'];
-       }
-       if (array_key_exists('description', $idpmeta)) {
-               $metaArray['description'] = $idpmeta['description'];
-       }
-       if (array_key_exists('url', $idpmeta)) {
-               $metaArray['url'] = $idpmeta['url'];
+
+       if (!empty($idpmeta['OrganizationName'])) {
+               $metaArray['OrganizationName'] = $idpmeta['OrganizationName'];
+
+               if (!empty($idpmeta['OrganizationDisplayName'])) {
+ $metaArray['OrganizationDisplayName'] = $idpmeta['OrganizationDisplayName'];
+               } else {
+                       $metaArray['OrganizationDisplayName'] = 
$idpmeta['OrganizationName'];
+               }
+
+               if (empty($idpmeta['OrganizationURL'])) {
+ throw new SimpleSAML_Error_Exception('If OrganizationName is set, OrganizationURL must also be set.');
+               }
+               $metaArray['OrganizationURL'] = $idpmeta['OrganizationURL'];
        }


@@ -56,6 +62,7 @@
        $metaArray['certData'] = $certInfo['certData'];
        $metaBuilder = new SimpleSAML_Metadata_SAMLBuilder($idpentityid);
        $metaBuilder->addMetadataIdP11($metaArray);
+       $metaBuilder->addOrganizationInfo($metaArray);
        $metaBuilder->addContact('technical', array(
                'emailAddress' => $config->getString('technicalcontact_email', 
NULL),
                'name' => $config->getString('technicalcontact_name', NULL),
=======================================
--- /trunk/www/shib13/sp/metadata.php   Mon Feb  8 01:12:42 2010
+++ /trunk/www/shib13/sp/metadata.php   Wed Feb 10 03:32:00 2010
@@ -39,15 +39,28 @@
        } else {
                $metaArray['NameIDFormat'] = 
'urn:mace:shibboleth:1.0:nameIdentifier';
        }
+
+       if (!empty($spmeta['OrganizationName'])) {
+               $metaArray['OrganizationName'] = $spmeta['OrganizationName'];
+
+               if (!empty($spmeta['OrganizationDisplayName'])) {
+ $metaArray['OrganizationDisplayName'] = $spmeta['OrganizationDisplayName'];
+               } else {
+                       $metaArray['OrganizationDisplayName'] = 
$spmeta['OrganizationName'];
+               }
+
+               if (empty($spmeta['OrganizationURL'])) {
+ throw new SimpleSAML_Error_Exception('If OrganizationName is set, OrganizationURL must also be set.');
+               }
+               $metaArray['OrganizationURL'] = $spmeta['OrganizationURL'];
+       }
+
        if (array_key_exists('name', $spmeta)) {
                $metaArray['name'] = $spmeta['name'];
        }
        if (array_key_exists('description', $spmeta)) {
                $metaArray['description'] = $spmeta['description'];
        }
-       if (array_key_exists('url', $spmeta)) {
-               $metaArray['url'] = $spmeta['url'];
-       }


$metaflat = '$metadata[' . var_export($spentityid, TRUE) . '] = ' . var_export($metaArray, TRUE) . ';';

--
You received this message because you are subscribed to the Google Groups 
"simpleSAMLphp commits" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/simplesamlphp-commits?hl=en.

Reply via email to