You are here

private function CasValidator::parseAttributes in CAS 8

Same name and namespace in other branches
  1. 2.x src/Service/CasValidator.php \Drupal\cas\Service\CasValidator::parseAttributes()

Parse the attributes list from the CAS Server into an array.

Parameters

\DOMNodeList $xml_list: An XML element containing attributes.

Return value

array An associative array of attributes.

1 call to CasValidator::parseAttributes()
CasValidator::validateVersion2 in src/Service/CasValidator.php
Validation of a service ticket for Version 2 of the CAS protocol.

File

src/Service/CasValidator.php, line 419

Class

CasValidator
Class CasValidator.

Namespace

Drupal\cas\Service

Code

private function parseAttributes(\DOMNodeList $xml_list) {
  $attributes = [];
  $node = $xml_list
    ->item(0);
  foreach ($node->childNodes as $child) {
    $name = $child->localName;
    $value = $child->nodeValue;
    $attributes[$name][] = $value;
  }
  $this->casHelper
    ->log(LogLevel::DEBUG, "Parsed the following attributes from the validation response: %attributes", [
    '%attributes' => print_r($attributes, TRUE),
  ]);
  return $attributes;
}