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

Merge branch 'master' into 'master'

Adding extensions to support invited for voting feds

See merge request !42
parents a628f30f b96692f8
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` ( ...@@ -837,7 +837,7 @@ CREATE TABLE `temporary_entity_sha1` (
/*!50001 SET collation_connection = utf8_general_ci */; /*!50001 SET collation_connection = utf8_general_ci */;
/*!50001 CREATE ALGORITHM=UNDEFINED */ /*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */ /*!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_client = @saved_cs_client */;
/*!50001 SET character_set_results = @saved_cs_results */; /*!50001 SET character_set_results = @saved_cs_results */;
/*!50001 SET collation_connection = @saved_col_connection */; /*!50001 SET collation_connection = @saved_col_connection */;
......
...@@ -64,7 +64,7 @@ class eduGAIN_manage extends eduGAIN { ...@@ -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])) { if(!empty($postInput[$key])) {
$output[$key] = filter_var($this->cleanInput($postInput[$key]), FILTER_SANITIZE_URL); $output[$key] = filter_var($this->cleanInput($postInput[$key]), FILTER_SANITIZE_URL);
} }
...@@ -153,6 +153,7 @@ class eduGAIN_manage extends eduGAIN { ...@@ -153,6 +153,7 @@ class eduGAIN_manage extends eduGAIN {
Utils::debug(4, $table, "updateUniqueRecord: Table:", "\n"); Utils::debug(4, $table, "updateUniqueRecord: Table:", "\n");
Utils::debug(4, $fields, "updateUniqueRecord: Fields:", "\n"); Utils::debug(4, $fields, "updateUniqueRecord: Fields:", "\n");
Utils::debug(4, $this->changedFields, "updateUniqueRecord: Changed fields:", "\n"); Utils::debug(4, $this->changedFields, "updateUniqueRecord: Changed fields:", "\n");
Utils::debug(4, $this->args, "updateUniqueRecord: Args:", "\n");
$update_map = 0; $update_map = 0;
$noUpdates = true; $noUpdates = true;
$U = []; $U = [];
...@@ -184,13 +185,14 @@ class eduGAIN_manage extends eduGAIN { ...@@ -184,13 +185,14 @@ class eduGAIN_manage extends eduGAIN {
private function updateMdsData($superadmin) { private function updateMdsData($superadmin) {
if ($superadmin !== 1) { if ($superadmin !== 1) {
if ($this->args['status'] > 4 || $this->args['fed_status'] > 4 || in_array('code', $this->changedFields) || 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"); Utils::debug(4, "updateMdsData - updates not allowed without superadmin rights\n");
return; return;
} }
} }
Utils::debug(4, $this->args['status'], "MDS Status:", "\n"); 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); $this->updateUniqueRecord('mds_data', $f);
if ($this->args['status'] != $this->args['fed_status'] && $this->updateMaps) { if ($this->args['status'] != $this->args['fed_status'] && $this->updateMaps) {
$this->updateMaps = false; $this->updateMaps = false;
......
...@@ -101,6 +101,7 @@ class eduGAIN_manage_gui { ...@@ -101,6 +101,7 @@ class eduGAIN_manage_gui {
$out .= '<select name="' . $id . '"' . $class . $statusDisabled . ' id="' . $id . '"> $out .= '<select name="' . $id . '"' . $class . $statusDisabled . ' id="' . $id . '">
<option value="0" id="status_none" class="critical" selected>none</option> <option value="0" id="status_none" class="critical" selected>none</option>
<option value="1" class="critical">candidate</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="4" class="critical">voting only</option>
<option value="5" class="critical, ot">suspended</option> <option value="5" class="critical, ot">suspended</option>
<option value="6" class="critical, ot">paricipant</option> <option value="6" class="critical, ot">paricipant</option>
......
...@@ -235,6 +235,7 @@ $rows[] = $edugainGUI->row('Policy', 'POL', 'policy'); ...@@ -235,6 +235,7 @@ $rows[] = $edugainGUI->row('Policy', 'POL', 'policy');
$rows[] = $edugainGUI->row('Policy in English', 'C', 'policy_english'); $rows[] = $edugainGUI->row('Policy in English', 'C', 'policy_english');
$rows[] = $edugainGUI->row('Metadata URL', 'I', 'metadata_url', '', 2,0,6); $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('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'); $rows[] = $edugainGUI->row('Signing certificate', 'CERT', 'certificate');
$data['federations'] = $federations; $data['federations'] = $federations;
......
...@@ -5,6 +5,7 @@ require_once(eduGAIN_config . 'database_ro.php'); ...@@ -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']; $statusMap = [0 => 'unknown', 1 => 'candidates', 2 => 'unknown', 4 => 'voting_only', 5 => 'participants', 6 => 'participants'];
$participants = []; $participants = [];
$votingOnly = []; $votingOnly = [];
$invitedForSigning = [];
$candidates = []; $candidates = [];
$fieldList = []; $fieldList = [];
$edugain = new eduGAIN(); $edugain = new eduGAIN();
...@@ -185,8 +186,10 @@ if ($singleFed) { ...@@ -185,8 +186,10 @@ if ($singleFed) {
$processedFederation = processFederation($federation); $processedFederation = processFederation($federation);
$processedFederation['status'] = $status; $processedFederation['status'] = $status;
if ($status) { // This will exclude federations with a status of 0 (lib/Status.php ln 124) 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; $candidates[] = $processedFederation;
} else if ($status == 2) {
$invitedForSigning[] = $processedFederation;
} else if ($status > 3 && $status < 5) { } else if ($status > 3 && $status < 5) {
$votingOnly[] = $processedFederation; $votingOnly[] = $processedFederation;
} else if ($status == 6 || $status == 5) { } else if ($status == 6 || $status == 5) {
...@@ -196,6 +199,7 @@ if ($singleFed) { ...@@ -196,6 +199,7 @@ if ($singleFed) {
} }
$data['participants'] = $participants; $data['participants'] = $participants;
$data['votingOnly'] = $votingOnly; $data['votingOnly'] = $votingOnly;
$data['invitedForSigning'] = $invitedForSigning;
$data['candidates'] = $candidates; $data['candidates'] = $candidates;
if (isset($_GET['issues'])) { if (isset($_GET['issues'])) {
$data['problem_switch'] = 1; $data['problem_switch'] = 1;
......
...@@ -15,6 +15,8 @@ ...@@ -15,6 +15,8 @@
<label for="include_participants">Participants ({{ participants | length }})</label> <label for="include_participants">Participants ({{ participants | length }})</label>
<input type="checkbox" class="type_filter" id="include_voting_only" value="voting_only_group" checked="checked" /> <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> <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" /> <input type="checkbox" class="type_filter" id="include_candidates" value="candidates_group" checked="checked" />
<label for="include_candidates">Candidates ({{ candidates | length }})</label> <label for="include_candidates">Candidates ({{ candidates | length }})</label>
</div> </div>
...@@ -32,10 +34,11 @@ ...@@ -32,10 +34,11 @@
<div id="filtered_results_div"> <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' : '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' : '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 %} {% include 'status/status-members.html' with { 'group_name' : 'candidates', 'federations' : candidates } only %}
</div> </div>
</div> </div>
<div class="col-2-1 alignment-3" style="position: relative;"> <div class="col-2-1 alignment-3" style="position: relative;">
{% for federation in participants %} {% for federation in participants %}
{% include 'status/status-members-details.html' %} {% include 'status/status-members-details.html' %}
...@@ -43,6 +46,9 @@ ...@@ -43,6 +46,9 @@
{% for federation in votingOnly %} {% for federation in votingOnly %}
{% include 'status/status-members-details.html' %} {% include 'status/status-members-details.html' %}
{% endfor %} {% endfor %}
{% for federation in invitedForSigning %}
{% include 'status/status-members-details.html' %}
{% endfor %}
{% for federation in candidates %} {% for federation in candidates %}
{% include 'status/status-members-details.html' %} {% include 'status/status-members-details.html' %}
{% endfor %} {% endfor %}
...@@ -53,7 +59,7 @@ ...@@ -53,7 +59,7 @@
<div> <div>
<div style="display: inline-block; background-color: #d93; width: 1em; height: 1em"></div><span> Participants</span> <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: #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> </div>
<h3>World</h3> <h3>World</h3>
...@@ -91,7 +97,8 @@ ...@@ -91,7 +97,8 @@
var _participants = {{ participants|json_encode()|raw() }}; var _participants = {{ participants|json_encode()|raw() }};
var _votingOnly = {{ votingOnly|json_encode()|raw() }}; var _votingOnly = {{ votingOnly|json_encode()|raw() }};
var _candidates = {{ candidates|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) { function quickSearch(input) {
return _allMembers.filter(function(federation){ return _allMembers.filter(function(federation){
......
<div id="{{ group_name }}_group_div"> <div id="{{ group_name }}_group_div">
<h3>{{ group_name | capitalize | replace({'_': '-'}) }}</h3> <h3>{{ group_name | capitalize | replace({'_': ' '}) }}</h3>
{% for federation in federations %} {% for federation in federations %}
{% set alert_icon = 'green_dot.png' %} {% set alert_icon = 'green_dot.png' %}
{% set alert_text = 'status OK' %} {% 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