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

Status page for a single federation as requesed by ECCS

parent c3eafc3d
No related branches found
No related tags found
1 merge request!31Updates by twoln
......@@ -143,29 +143,64 @@ function dateMissingCheck($federation, $fieldName) {
return !isset($federation[$fieldName]) || $federation[$fieldName] == '0000-00-00 00:00:00';
}
foreach ($edugain->FEDS as $countryCode => $federation) {
$status = $federation['status'];
$processedFederation = processFederation($federation);
$processedFederation['status'] = $status;
if ($status) { // This will exclude federations with a status of 0 (lib/Status.php ln 124)
if ($status < 4 && $status != 2) {
$candidates[] = $processedFederation;
} else if ($status > 3 && $status < 5) {
$votingOnly[] = $processedFederation;
} else if ($status == 6 || $status == 5) {
$participants[] = $processedFederation;
}
$data = [];
$singleFed = false;
$reg_auth_safe = '';
if (!empty($_REQUEST['fed_id'])) {
$code = $_REQUEST['fed_id'];
if (!preg_match('/^:?([a-zA-Z]*-?[a-zA-Z]*)(:[a-aA-Z]*-?[a-zA-Z]*)*$/', $code)) {
exit;
}
$singleFed = true;
}
if (!empty($_REQUEST['reg_auth'])) {
$reg_auth = $_REQUEST['reg_auth'];
$reg_auth_safe = $edugain->cleanInput($reg_auth);
$singleFed = true;
// print $reg_auth_safe;
}
$data = [];
$data['participants'] = $participants;
$data['votingOnly'] = $votingOnly;
$data['candidates'] = $candidates;
if (isset($_GET['issues'])) {
$data['problem_switch'] = 1;
if ($singleFed) {
$my_federation = '';
foreach ($edugain->FEDS as $countryCode => $federation) {
if ($code !== $countryCode && ($reg_auth_safe === '' || $reg_auth_safe !== $federation['reg_auth'])) {
continue;
}
$status = $federation['status'];
if ($status === 0) {
exit;
}
$processedFederation['status'] = $status;
$my_federation = processFederation($federation);
}
if ($my_federation === '') {
exit;
}
$data['federation'] = $my_federation;
echo $twig->render('status/status-members-details.html', $data);
} else {
$data['problem_switch'] = 0;
foreach ($edugain->FEDS as $countryCode => $federation) {
$status = $federation['status'];
$processedFederation = processFederation($federation);
$processedFederation['status'] = $status;
if ($status) { // This will exclude federations with a status of 0 (lib/Status.php ln 124)
if ($status < 4 && $status != 2) {
$candidates[] = $processedFederation;
} else if ($status > 3 && $status < 5) {
$votingOnly[] = $processedFederation;
} else if ($status == 6 || $status == 5) {
$participants[] = $processedFederation;
}
}
}
$data['participants'] = $participants;
$data['votingOnly'] = $votingOnly;
$data['candidates'] = $candidates;
if (isset($_GET['issues'])) {
$data['problem_switch'] = 1;
} else {
$data['problem_switch'] = 0;
}
echo $twig->render('status.html', $data);
}
echo $twig->render('status.html', $data);
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment