예제 #1
0
 /**
  * Create/parse a mdrpi:RegistrationInfo element.
  *
  * @param \DOMElement|null $xml The XML element we should load.
  * @throws \Exception
  */
 public function __construct(\DOMElement $xml = null)
 {
     if ($xml === null) {
         return;
     }
     if (!$xml->hasAttribute('registrationAuthority')) {
         throw new \Exception('Missing required attribute "registrationAuthority" in mdrpi:RegistrationInfo element.');
     }
     $this->registrationAuthority = $xml->getAttribute('registrationAuthority');
     if ($xml->hasAttribute('registrationInstant')) {
         $this->registrationInstant = Utils::xsDateTimeToTimestamp($xml->getAttribute('registrationInstant'));
     }
     $this->RegistrationPolicy = Utils::extractLocalizedStrings($xml, Common::NS_MDRPI, 'RegistrationPolicy');
 }
예제 #2
0
 /**
  * Create/parse a mdrpi:PublicationInfo element.
  *
  * @param \DOMElement|null $xml The XML element we should load.
  * @throws \Exception
  */
 public function __construct(\DOMElement $xml = null)
 {
     if ($xml === null) {
         return;
     }
     if (!$xml->hasAttribute('publisher')) {
         throw new \Exception('Missing required attribute "publisher" in mdrpi:PublicationInfo element.');
     }
     $this->publisher = $xml->getAttribute('publisher');
     if ($xml->hasAttribute('creationInstant')) {
         $this->creationInstant = Utils::xsDateTimeToTimestamp($xml->getAttribute('creationInstant'));
     }
     if ($xml->hasAttribute('publicationId')) {
         $this->publicationId = $xml->getAttribute('publicationId');
     }
     $this->UsagePolicy = Utils::extractLocalizedStrings($xml, Common::NS_MDRPI, 'UsagePolicy');
 }
예제 #3
0
 /**
  * Initialize / parse an AttributeConsumingService.
  *
  * @param \DOMElement|null $xml The XML element we should load.
  * @throws \Exception
  */
 public function __construct(\DOMElement $xml = null)
 {
     if ($xml === null) {
         return;
     }
     if (!$xml->hasAttribute('index')) {
         throw new \Exception('Missing index on AttributeConsumingService.');
     }
     $this->index = (int) $xml->getAttribute('index');
     $this->isDefault = Utils::parseBoolean($xml, 'isDefault', null);
     $this->ServiceName = Utils::extractLocalizedStrings($xml, Constants::NS_MD, 'ServiceName');
     if (empty($this->ServiceName)) {
         throw new \Exception('Missing ServiceName in AttributeConsumingService.');
     }
     $this->ServiceDescription = Utils::extractLocalizedStrings($xml, Constants::NS_MD, 'ServiceDescription');
     foreach (Utils::xpQuery($xml, './saml_metadata:RequestedAttribute') as $ra) {
         $this->RequestedAttribute[] = new RequestedAttribute($ra);
     }
 }
예제 #4
0
 /**
  * Initialize an Organization element.
  *
  * @param \DOMElement|null $xml The XML element we should load.
  */
 public function __construct(\DOMElement $xml = null)
 {
     if ($xml === null) {
         return;
     }
     $this->Extensions = Extensions::getList($xml);
     $this->OrganizationName = Utils::extractLocalizedStrings($xml, Constants::NS_MD, 'OrganizationName');
     if (empty($this->OrganizationName)) {
         $this->OrganizationName = array('invalid' => '');
     }
     $this->OrganizationDisplayName = Utils::extractLocalizedStrings($xml, Constants::NS_MD, 'OrganizationDisplayName');
     if (empty($this->OrganizationDisplayName)) {
         $this->OrganizationDisplayName = array('invalid' => '');
     }
     $this->OrganizationURL = Utils::extractLocalizedStrings($xml, Constants::NS_MD, 'OrganizationURL');
     if (empty($this->OrganizationURL)) {
         $this->OrganizationURL = array('invalid' => '');
     }
 }
예제 #5
0
파일: UIInfo.php 프로젝트: SysBind/saml2
 /**
  * Create a UIInfo element.
  *
  * @param \DOMElement|null $xml The XML element we should load.
  */
 public function __construct(\DOMElement $xml = null)
 {
     if ($xml === null) {
         return;
     }
     $this->DisplayName = Utils::extractLocalizedStrings($xml, self::NS, 'DisplayName');
     $this->Description = Utils::extractLocalizedStrings($xml, self::NS, 'Description');
     $this->InformationURL = Utils::extractLocalizedStrings($xml, self::NS, 'InformationURL');
     $this->PrivacyStatementURL = Utils::extractLocalizedStrings($xml, self::NS, 'PrivacyStatementURL');
     foreach (Utils::xpQuery($xml, './*') as $node) {
         if ($node->namespaceURI === self::NS) {
             switch ($node->localName) {
                 case 'Keywords':
                     $this->Keywords[] = new Keywords($node);
                     break;
                 case 'Logo':
                     $this->Logo[] = new Logo($node);
                     break;
             }
         } else {
             $this->children[] = new Chunk($node);
         }
     }
 }