From 59f17e9a1d1f6b1ef45a52cb59fa625551d3e357 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Thu, 26 Feb 2015 17:07:00 +0100 Subject: Stuff --- extras/import-idp.php | 19 +++++++++++++++---- .../java/org/openslx/imagemaster/db/DbSatellite.java | 1 + src/main/properties/log4j.properties | 5 +---- 3 files changed, 17 insertions(+), 8 deletions(-) diff --git a/extras/import-idp.php b/extras/import-idp.php index 6ea9cb6..0b9adf1 100644 --- a/extras/import-idp.php +++ b/extras/import-idp.php @@ -20,7 +20,12 @@ $db = new mysqli($settings['host'], $settings['user'], $settings['password'], $s if ($db->connect_errno) die("Could not connect to db: " . $db->connect_error . "\n"); $db->set_charset("utf8"); -$url = 'https://www.aai.dfn.de/fileadmin/metadata/DFN-AAI-metadata.xml'; +if ($argc > 2) { + $url = $argv[2]; +} else { + $url = 'https://www.aai.dfn.de/fileadmin/metadata/DFN-AAI-metadata.xml'; +} +echo "Using $url...\n"; curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_TIMEOUT, 10); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); @@ -34,9 +39,15 @@ preg_match_all('##s', $data, $out); foreach ($out[0] as $data) { $data = preg_replace('#<(/?)[a-zA-Z0-9]+:#', '<\1', $data); $xml = json_decode(json_encode(simplexml_load_string('' . $data)), true); - if (!isset($xml["Extensions"]["EntityAttributes"]["Attribute"]["AttributeValue"])) continue; - if (!isset($xml["IDPSSODescriptor"]["Extensions"]["Scope"])) continue; - if ($xml["Extensions"]["EntityAttributes"]["Attribute"]["AttributeValue"] !== 'http://aai.dfn.de/category/bwidm-member') continue; + //if (!isset($xml["Extensions"]["EntityAttributes"]["Attribute"]["AttributeValue"])) { + // echo "no EntityAttributes.Attribute.AttributeValue!\n"; + // continue; + //} + //if ($xml["Extensions"]["EntityAttributes"]["Attribute"]["AttributeValue"] !== 'http://aai.dfn.de/category/bwidm-member') continue; + if (!isset($xml["IDPSSODescriptor"]["Extensions"]["Scope"])) { + echo "No Extensions.Scope!\n"; + continue; + } $scope = $xml["IDPSSODescriptor"]["Extensions"]["Scope"]; if (!is_array($scope)) $scope = array($scope); $name = $xml["IDPSSODescriptor"]["Extensions"]["UIInfo"]["DisplayName"]; diff --git a/src/main/java/org/openslx/imagemaster/db/DbSatellite.java b/src/main/java/org/openslx/imagemaster/db/DbSatellite.java index 4f2576e..4f5a0c8 100644 --- a/src/main/java/org/openslx/imagemaster/db/DbSatellite.java +++ b/src/main/java/org/openslx/imagemaster/db/DbSatellite.java @@ -29,6 +29,7 @@ public class DbSatellite this.address = address; this.name = name; this.publickeyString = publickeyString; + this.authMethod = authMethod; } public static DbSatellite fromOrganizationId( String organizationId ) diff --git a/src/main/properties/log4j.properties b/src/main/properties/log4j.properties index 5452d52..881887e 100644 --- a/src/main/properties/log4j.properties +++ b/src/main/properties/log4j.properties @@ -8,7 +8,4 @@ log4j.appender.A1.layout.ConversionPattern=%d [%t] %-5p %F - %m%n log4j.logger.org.apache.directory=ERROR log4j.logger.org.apache.mina=ERROR -log4j.logger.org.apache.ftpserver=ERROR -log4j.logger.org.openslx.filetransfer=ERROR - -org.apache.thrift.server.AbstractNonblockingServer=ERROR \ No newline at end of file +log4j.logger.org.apache.thrift.server.AbstractNonblockingServer=ERROR -- cgit v1.2.3-55-g7522