diff -r 5b37998e522e -r 162c1de6545a web/lib/Zend/InfoCard/Xml/Assertion.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/web/lib/Zend/InfoCard/Xml/Assertion.php Fri Mar 11 15:05:35 2011 +0100 @@ -0,0 +1,88 @@ +asXML(); + } else if (is_string($xmlData)) { + $strXmlData = $xmlData; + } else { + require_once 'Zend/InfoCard/Xml/Exception.php'; + throw new Zend_InfoCard_Xml_Exception("Invalid Data provided to create instance"); + } + + $sxe = simplexml_load_string($strXmlData); + + $namespaces = $sxe->getDocNameSpaces(); + + foreach($namespaces as $namespace) { + switch($namespace) { + case self::TYPE_SAML: + include_once 'Zend/InfoCard/Xml/Assertion/Saml.php'; + return simplexml_load_string($strXmlData, 'Zend_InfoCard_Xml_Assertion_Saml', null); + } + } + + require_once 'Zend/InfoCard/Xml/Exception.php'; + throw new Zend_InfoCard_Xml_Exception("Unable to determine Assertion type by Namespace"); + } +}