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

fixing list_feds_full to work without the key

parent 74af575a
No related branches found
No related tags found
1 merge request!37Latest fixes
...@@ -799,24 +799,30 @@ class API { ...@@ -799,24 +799,30 @@ class API {
global $accessKeys; global $accessKeys;
$this->description([ $this->description([
'header' => "List full federation details incliding contact e-mails to federation representatives.", 'header' => "List full federation details incliding contact e-mails to federation representatives.",
'supportedFormats' => ['xml - this is set automatically and need not be specified'], 'supportedFormats' => ['print_r', 'json'],
'arguments' => [ 'arguments' => [
[ [
'arg' => 'key', 'arg' => 'key',
'required' => TRUE, 'required' => FALSE,
'values' => 'secret value provided by eduGAIN OT', 'values' => 'secret value provided by eduGAIN OT',
'description' => 'This method is resticted since it shows federation representatives e-mails even in cases where they have been declared not to be public.', 'description' => 'If this method is used without providing a registered key then it shows all publicly avaliable information (as can be seen on the status page) if used with a valid key it will additionaly show emails of delegate and deputy.',
], ],
$this->addStdArgument('format'), $this->addStdArgument('format'),
] ],
'examples' => [
['format' => 'print_r',
'title' => 'show full output'],
],
]); ]);
if ($this->opts['help'] == 1) { if ($this->opts['help'] == 1) {
return ""; return "";
} }
if (!in_array($this->key, $accessKeys)) $showEmail = 0;
return; if (in_array($this->key, $accessKeys)) {
$showEmail = 1;
}
$edugain = new eduGAIN(); $edugain = new eduGAIN();
$edugain->load_all(); $edugain->load_all('sha256', $showEmail);
$out = $edugain->FEDS; $out = $edugain->FEDS;
return $out; return $out;
} }
...@@ -915,7 +921,7 @@ class API { ...@@ -915,7 +921,7 @@ class API {
} }
private function action_show_entity_details() { private function action_show_entity_details() {
$this->description([ $this->description([
'header' => "Show the full entity info. This method is mostly for internal use.", 'header' => "Show the full entity info. This method is mostly for internal use.",
'supportedFormats' => ['json', 'html', 'print_r'], 'supportedFormats' => ['json', 'html', 'print_r'],
'arguments' => [ 'arguments' => [
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment