Skip to content
Snippets Groups Projects
Commit c6548654 authored by Tomasz Wolniewicz's avatar Tomasz Wolniewicz
Browse files

an innitial implementation of the CSV dump of federations - to be polished

parent 72abd159
No related branches found
No related tags found
3 merge requests!3Align master branch with twoln-dev,!2Synchronising towards version 2.5,!1Twoln dev
This commit is part of merge request !1. Comments created here will be created in the context of that merge request.
......@@ -454,7 +454,7 @@ class API {
private function action_list_feds() {
$this->description([
'header' => "List federation details (code, name, contact email, registration authority string, status).",
'supportedFormats' => ['json', 'print_r'],
'supportedFormats' => ['json', 'csv', 'print_r'],
'arguments' => [
[
'arg' => 'opt',
......@@ -487,6 +487,17 @@ class API {
$edugain = new eduGAIN($this->opts['opt']);
$F = $edugain->FEDS;
ksort($F, SORT_STRING | SORT_FLAG_CASE);
if ($this->format == 'csv') {
$out = '';
foreach ($F as $fed => $A) {
$ln = $fed . "\t" . implode("\t", $A) . "\n";
$out .= $ln;
}
return($out);
}
foreach ($F as $fed => $A) {
$out[$fed] = ['name' => $A['name'],
'email' => $A['contact_email'],
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment