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

Adding extensions to support invited for voting feds

parent 7dea910c
Branches
Tags
1 merge request!42Adding extensions to support invited for voting feds
# Run this when updating from version 2.6.5 to 2.6.5.3
DROP VIEW `federation_v`;
CREATE VIEW `federation_v` AS select `federation`.`code` AS `code`,`mds_data`.`reg_auth` AS `reg_auth`,`mds_data`.`metadata_url` AS `metadata_url`,`mds_data`.`status` AS `status`,`federation`.`fed_id` AS `fed_id`,`federation`.`europe` AS `europe`,`federation`.`contact_email` AS `contact_email`,`federation`.`url` AS `url`,`federation`.`policy_english` AS `policy_english`,`federation`.`policy_hardcopy` AS `policy_hardcopy`,`federation`.`policy_date` AS `policy_date`,`federation`.`membership_date` AS `membership_date`, IF((`federation`.`production_date` IS NULL OR `federation`.`production_date` = '0000-00-00') AND `mds_data`.`status` = 2, '2050-01-01', `federation`.`production_date`) AS `production_date`,`federation`.`name` AS `name`,`federation`.`policy_version` AS `policy_version`,`federation`.`suspension_type` AS `suspension_type`,`federation_status`.`valid_until` AS `valid_until`,`federation_status`.`last_notification` AS `last_notification`,`federation_status`.`feed_problem` AS `feed_problem`,`federation_status`.`new_profile_status` AS `new_profile_status`,`federation_status`.`new_profile_modified` AS `new_profile_modified`, `mds_data`.`whitelist_idp` AS `whitelist_idp` from ((`federation` left join `mds_data` on(`mds_data`.`code` = `federation`.`code`)) left join `federation_status` on(`federation`.`code` = `federation_status`.`code`));
......@@ -837,7 +837,7 @@ CREATE TABLE `temporary_entity_sha1` (
/*!50001 SET collation_connection = utf8_general_ci */;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `federation_v` AS select `federation`.`code` AS `code`,`mds_data`.`reg_auth` AS `reg_auth`,`mds_data`.`metadata_url` AS `metadata_url`,`mds_data`.`status` AS `status`,`federation`.`fed_id` AS `fed_id`,`federation`.`europe` AS `europe`,`federation`.`contact_email` AS `contact_email`,`federation`.`url` AS `url`,`federation`.`policy_english` AS `policy_english`,`federation`.`policy_hardcopy` AS `policy_hardcopy`,`federation`.`policy_date` AS `policy_date`,`federation`.`membership_date` AS `membership_date`,`federation`.`production_date` AS `production_date`,`federation`.`name` AS `name`,`federation`.`policy_version` AS `policy_version`, federation.suspension_type AS suspension_type, `federation_status`.`valid_until` AS `valid_until`,`federation_status`.`last_notification` AS `last_notification`,`federation_status`.`feed_problem` AS `feed_problem`,`federation_status`.`new_profile_status` AS `new_profile_status`,`federation_status`.`new_profile_modified` AS `new_profile_modified` from ((`federation` left join `mds_data` on((`mds_data`.`code` = `federation`.`code`))) left join `federation_status` on((`federation`.`code` = `federation_status`.`code`))) */;
/*!50001 VIEW `federation_v` AS select `federation`.`code` AS `code`,`mds_data`.`reg_auth` AS `reg_auth`,`mds_data`.`metadata_url` AS `metadata_url`,`mds_data`.`status` AS `status`,`federation`.`fed_id` AS `fed_id`,`federation`.`europe` AS `europe`,`federation`.`contact_email` AS `contact_email`,`federation`.`url` AS `url`,`federation`.`policy_english` AS `policy_english`,`federation`.`policy_hardcopy` AS `policy_hardcopy`,`federation`.`policy_date` AS `policy_date`,`federation`.`membership_date` AS `membership_date`,if((`federation`.`production_date` is null or `federation`.`production_date` = '0000-00-00') and `mds_data`.`status` = 2,'2050-01-01',`federation`.`production_date`) AS `production_date`,`federation`.`name` AS `name`,`federation`.`policy_version` AS `policy_version`,`federation`.`suspension_type` AS `suspension_type`,`federation_status`.`valid_until` AS `valid_until`,`federation_status`.`last_notification` AS `last_notification`,`federation_status`.`feed_problem` AS `feed_problem`,`federation_status`.`new_profile_status` AS `new_profile_status`,`federation_status`.`new_profile_modified` AS `new_profile_modified`,`mds_data`.`whitelist_idp` AS `whitelist_idp` from ((`federation` left join `mds_data` on(`mds_data`.`code` = `federation`.`code`)) left join `federation_status` on(`federation`.`code` = `federation_status`.`code`)) */;
/*!50001 SET character_set_client = @saved_cs_client */;
/*!50001 SET character_set_results = @saved_cs_results */;
/*!50001 SET collation_connection = @saved_col_connection */;
......
......@@ -64,7 +64,7 @@ class eduGAIN_manage extends eduGAIN {
}
}
foreach ( ['url', 'metadata_url', 'reg_auth', 'security_contact_url_value',] as $key) {
foreach ( ['url', 'metadata_url', 'reg_auth', 'whitelist_idp', 'security_contact_url_value',] as $key) {
if(!empty($postInput[$key])) {
$output[$key] = filter_var($this->cleanInput($postInput[$key]), FILTER_SANITIZE_URL);
}
......@@ -153,6 +153,7 @@ class eduGAIN_manage extends eduGAIN {
Utils::debug(4, $table, "updateUniqueRecord: Table:", "\n");
Utils::debug(4, $fields, "updateUniqueRecord: Fields:", "\n");
Utils::debug(4, $this->changedFields, "updateUniqueRecord: Changed fields:", "\n");
Utils::debug(4, $this->args, "updateUniqueRecord: Args:", "\n");
$update_map = 0;
$noUpdates = true;
$U = [];
......@@ -184,13 +185,14 @@ class eduGAIN_manage extends eduGAIN {
private function updateMdsData($superadmin) {
if ($superadmin !== 1) {
if ($this->args['status'] > 4 || $this->args['fed_status'] > 4 || in_array('code', $this->changedFields) ||
in_array('metadata_url', $this->changedFields) || in_array('reg_auth', $this->changedFields)) {
in_array('metadata_url', $this->changedFields) || in_array('reg_auth', $this->changedFields) ||
in_array('whitelist_idp', $this->changedFields)) {
Utils::debug(4, "updateMdsData - updates not allowed without superadmin rights\n");
return;
}
}
Utils::debug(4, $this->args['status'], "MDS Status:", "\n");
$f = ['code', 'metadata_url', 'reg_auth', 'status'];
$f = ['code', 'metadata_url', 'reg_auth', 'status', 'whitelist_idp'];
$this->updateUniqueRecord('mds_data', $f);
if ($this->args['status'] != $this->args['fed_status'] && $this->updateMaps) {
$this->updateMaps = false;
......
......@@ -101,6 +101,7 @@ class eduGAIN_manage_gui {
$out .= '<select name="' . $id . '"' . $class . $statusDisabled . ' id="' . $id . '">
<option value="0" id="status_none" class="critical" selected>none</option>
<option value="1" class="critical">candidate</option>
<option value="2" class="critical">invited for vote</option>
<option value="4" class="critical">voting only</option>
<option value="5" class="critical, ot">suspended</option>
<option value="6" class="critical, ot">paricipant</option>
......
......@@ -235,6 +235,7 @@ $rows[] = $edugainGUI->row('Policy', 'POL', 'policy');
$rows[] = $edugainGUI->row('Policy in English', 'C', 'policy_english');
$rows[] = $edugainGUI->row('Metadata URL', 'I', 'metadata_url', '', 2,0,6);
$rows[] = $edugainGUI->row('Registration Authority', 'I', 'reg_auth', '', 2,0,6);
$rows[] = $edugainGUI->row('Whitelist IdP', 'I', 'whitelist_idp', '', 2,0,6);
$rows[] = $edugainGUI->row('Signing certificate', 'CERT', 'certificate');
$data['federations'] = $federations;
......
......@@ -5,6 +5,7 @@ require_once(eduGAIN_config . 'database_ro.php');
$statusMap = [0 => 'unknown', 1 => 'candidates', 2 => 'unknown', 4 => 'voting_only', 5 => 'participants', 6 => 'participants'];
$participants = [];
$votingOnly = [];
$invitedForSigning = [];
$candidates = [];
$fieldList = [];
$edugain = new eduGAIN();
......@@ -185,8 +186,10 @@ if ($singleFed) {
$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) {
if ($status == 1) {
$candidates[] = $processedFederation;
} else if ($status == 2) {
$invitedForSigning[] = $processedFederation;
} else if ($status > 3 && $status < 5) {
$votingOnly[] = $processedFederation;
} else if ($status == 6 || $status == 5) {
......@@ -196,6 +199,7 @@ if ($singleFed) {
}
$data['participants'] = $participants;
$data['votingOnly'] = $votingOnly;
$data['invitedForSigning'] = $invitedForSigning;
$data['candidates'] = $candidates;
if (isset($_GET['issues'])) {
$data['problem_switch'] = 1;
......
......@@ -15,6 +15,8 @@
<label for="include_participants">Participants ({{ participants | length }})</label>
<input type="checkbox" class="type_filter" id="include_voting_only" value="voting_only_group" checked="checked" />
<label for="include_voting_only">Voting-only members ({{ votingOnly | length }})</label>
<input type="checkbox" class="type_filter" id="include_invited" value="invited_group" checked="checked" />
<label for="include_candidates">In signing ({{ invitedForSigning | length }})</label>
<input type="checkbox" class="type_filter" id="include_candidates" value="candidates_group" checked="checked" />
<label for="include_candidates">Candidates ({{ candidates | length }})</label>
</div>
......@@ -32,10 +34,11 @@
<div id="filtered_results_div">
{% include 'status/status-members.html' with { 'group_name' : 'participants', 'federations' : participants } only %}
{% include 'status/status-members.html' with { 'group_name' : 'voting_only', 'federations' : votingOnly } only %}
{% include 'status/status-members.html' with { 'group_name' : 'invited_for_declaration_signing', 'federations' : invitedForSigning } only %}
{% include 'status/status-members.html' with { 'group_name' : 'candidates', 'federations' : candidates } only %}
</div>
</div>
</div>
<div class="col-2-1 alignment-3" style="position: relative;">
{% for federation in participants %}
{% include 'status/status-members-details.html' %}
......@@ -43,6 +46,9 @@
{% for federation in votingOnly %}
{% include 'status/status-members-details.html' %}
{% endfor %}
{% for federation in invitedForSigning %}
{% include 'status/status-members-details.html' %}
{% endfor %}
{% for federation in candidates %}
{% include 'status/status-members-details.html' %}
{% endfor %}
......@@ -53,7 +59,7 @@
<div>
<div style="display: inline-block; background-color: #d93; width: 1em; height: 1em"></div><span> Participants</span>
<div style="display: inline-block; background-color: #81d742; width: 1em; height: 1em"></div><span> Voting-only</span>
<div style="display: inline-block; background-color: #1e73be; width: 1em; height: 1em"></div><span> Candidate</span>
<div style="display: inline-block; background-color: #1e73be; width: 1em; height: 1em"></div><span> Candidate</span>
</div>
<h3>World</h3>
......@@ -91,7 +97,8 @@
var _participants = {{ participants|json_encode()|raw() }};
var _votingOnly = {{ votingOnly|json_encode()|raw() }};
var _candidates = {{ candidates|json_encode()|raw() }};
var _allMembers = _participants.concat(_votingOnly, _candidates);
var _invited = {{ invited|json_encode()|raw() }};
var _allMembers = _participants.concat(_votingOnly, _invited, _candidates);
function quickSearch(input) {
return _allMembers.filter(function(federation){
......
<div id="{{ group_name }}_group_div">
<h3>{{ group_name | capitalize | replace({'_': '-'}) }}</h3>
<h3>{{ group_name | capitalize | replace({'_': ' '}) }}</h3>
{% for federation in federations %}
{% set alert_icon = 'green_dot.png' %}
{% set alert_text = 'status OK' %}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment