| @@ 1285-1307 (lines=23) @@ | ||
| 1282 | * |
|
| 1283 | * @param \DOMElement $root The assertion element we should add the subject to. |
|
| 1284 | */ |
|
| 1285 | private function addSubject(\DOMElement $root) |
|
| 1286 | { |
|
| 1287 | if ($this->nameId === null && $this->encryptedNameId === null) { |
|
| 1288 | /* We don't have anything to create a Subject node for. */ |
|
| 1289 | ||
| 1290 | return; |
|
| 1291 | } |
|
| 1292 | ||
| 1293 | $subject = $root->ownerDocument->createElementNS(Constants::NS_SAML, 'saml:Subject'); |
|
| 1294 | $root->appendChild($subject); |
|
| 1295 | ||
| 1296 | if ($this->encryptedNameId === null) { |
|
| 1297 | Utils::addNameId($subject, $this->nameId); |
|
| 1298 | } else { |
|
| 1299 | $eid = $subject->ownerDocument->createElementNS(Constants::NS_SAML, 'saml:' . 'EncryptedID'); |
|
| 1300 | $subject->appendChild($eid); |
|
| 1301 | $eid->appendChild($subject->ownerDocument->importNode($this->encryptedNameId, true)); |
|
| 1302 | } |
|
| 1303 | ||
| 1304 | foreach ($this->SubjectConfirmation as $sc) { |
|
| 1305 | $sc->toXML($subject); |
|
| 1306 | } |
|
| 1307 | } |
|
| 1308 | ||
| 1309 | ||
| 1310 | /** |
|
| @@ 775-796 (lines=22) @@ | ||
| 772 | * |
|
| 773 | * @param \DOMElement $root The assertion element we should add the subject to. |
|
| 774 | */ |
|
| 775 | private function addSubject(\DOMElement $root) |
|
| 776 | { |
|
| 777 | // If there is no nameId (encrypted or not) there is nothing to create a subject for |
|
| 778 | if ($this->nameId === null && $this->encryptedNameId === null) { |
|
| 779 | return; |
|
| 780 | } |
|
| 781 | ||
| 782 | $subject = $root->ownerDocument->createElementNS(Constants::NS_SAML, 'saml:Subject'); |
|
| 783 | $root->appendChild($subject); |
|
| 784 | ||
| 785 | if ($this->encryptedNameId === null) { |
|
| 786 | Utils::addNameId($subject, $this->nameId); |
|
| 787 | } else { |
|
| 788 | $eid = $subject->ownerDocument->createElementNS(Constants::NS_SAML, 'saml:EncryptedID'); |
|
| 789 | $eid->appendChild($subject->ownerDocument->importNode($this->encryptedNameId, true)); |
|
| 790 | $subject->appendChild($eid); |
|
| 791 | } |
|
| 792 | ||
| 793 | foreach ($this->subjectConfirmation as $sc) { |
|
| 794 | $sc->toXML($subject); |
|
| 795 | } |
|
| 796 | } |
|
| 797 | } |
|
| 798 | ||