You are here

function kaltura_parse_crossdomain in Kaltura 6.2

Same name and namespace in other branches
  1. 7.3 includes/kaltura.admin.inc \kaltura_parse_crossdomain()
  2. 7.2 includes/kaltura.admin.inc \kaltura_parse_crossdomain()

helper function that checks if crossdomain.xml says the right things

1 call to kaltura_parse_crossdomain()
kaltura_test_crossdomain in includes/kaltura.admin.inc
helper function that checks if crossdomain.xml is in the right place

File

includes/kaltura.admin.inc, line 829

Code

function kaltura_parse_crossdomain($crossdomain_xml) {
  if (!function_exists('simplexml_load_string')) {
    return kaltura_alternate_xml_verification($filename);
  }
  $cd_xml_content = simplexml_load_string($crossdomain_xml);
  foreach ($cd_xml_content
    ->children() as $child) {
    $atts = $child
      ->attributes();
    if ($atts['domain'] == '*' || $atts['domain'] == '*.kaltura.com') {
      $kaltura_ok = TRUE;
    }
    if ($atts['headers'] == '*' && ($atts['domain'] == '*' || $atts['domain'] == '*.kaltura.com')) {
      $headers_ok = TRUE;
    }
  }
  if ($kaltura_ok && $headers_ok) {
    return array(
      TRUE,
      t('crossdomain.xml is in place and seems to be OK'),
    );
  }
  else {
    return array(
      FALSE,
      t('crossdomain.xml is in place, but it is probably not configured properly') . '<br />' . t('Please read ') . l('here', 'admin/help/kaltura'),
    );
  }
}