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

Extended support for membership suspension

parent 8957f4c6
Branches
Tags
1 merge request!38Extended support for membership suspension
......@@ -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_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`,`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 SET character_set_client = @saved_cs_client */;
/*!50001 SET character_set_results = @saved_cs_results */;
/*!50001 SET collation_connection = @saved_col_connection */;
......
......@@ -78,7 +78,7 @@ class eduGAIN_manage extends eduGAIN {
}
}
foreach ( ['status', 'fed_status', 'policy_version', 'policy_hardcopy'] as $key) {
foreach ( ['status', 'fed_status', 'policy_version', 'policy_hardcopy', 'suspension_type'] as $key) {
if(isset($postInput[$key]) && $postInput[$key] !== "") {
$output[$key] = filter_var($postInput[$key], FILTER_SANITIZE_NUMBER_INT);
}
......@@ -150,6 +150,7 @@ class eduGAIN_manage extends eduGAIN {
}
private function updateUniqueRecord($table, $fields) {
Utils::debug(4, $table, "updateUniqueRecord: Table:", "\n");
Utils::debug(4, $fields, "updateUniqueRecord: Fields:", "\n");
Utils::debug(4, $this->changedFields, "updateUniqueRecord: Changed fields:", "\n");
$update_map = 0;
......@@ -201,7 +202,7 @@ class eduGAIN_manage extends eduGAIN {
private function updateFederationTable() {
$f = ['fed_id', 'code', 'europe', 'contact_email', 'url', 'policy_english',
'policy_hardcopy', 'policy_date', 'membership_date', 'production_date', 'policy_version',
'name'];
'name', 'suspension_type'];
$this->updateUniqueRecord('federation', $f);
}
......
......@@ -104,6 +104,13 @@ class eduGAIN_manage_gui {
<option value="4" class="critical">voting only</option>
<option value="5" class="critical, ot">suspended</option>
<option value="6" class="critical, ot">paricipant</option>
</select>';
}
if ($type == 'SUSP') {
$out .= '<select name="' . $id . '"' . $class . $statusDisabled . ' id="' . $id . '">
<option value="0" id="susp_none" class="critical" selected>none</option>
<option value="1" class="critical">technical</option>
<option value="2" class="critical">automatic</option>
</select>';
}
if ($type == "SIRTFI") {
......
......@@ -223,6 +223,7 @@ $rows[] = $edugainGUI->row('Areas', 'AREAS', 'country_code');
$rows[] = $edugainGUI->row('Name', 'I', 'name', '', 0, 0, 0);
$rows[] = $edugainGUI->row('In Europe', 'C', 'europe');
$rows[] = $edugainGUI->row('Status', 'ST', 'status', '', 1);
$rows[] = $edugainGUI->row('Suspension Type', 'SUSP', 'suspension_type', '', 1, 1);
$rows[] = $edugainGUI->row('eduGAIN declaration', 'EDECL', 'edecl');
$rows[] = $edugainGUI->row('Federation URL', 'I', 'url', '', 0, 0, 4);
$rows[] = $edugainGUI->row('Registration practice', 'POL', 'registration');
......
......@@ -111,6 +111,7 @@
missing_fields = 0;
errors = new Array();
status = $("#status option:selected").val();
susp = $("#suspension_type option:selected").val();
if ($("#code").val() == "") {
alert("Missing federation identifier");
return(false);
......@@ -123,6 +124,10 @@
if (status == 6 && $("#certificate_0").text() == "") {
alert("You must upload the federation certificate first");
return(false);
}
if (status == 5 && susp == 0) {
alert("Please select suspension type");
return(false);
}
$("input[class*='nonempty_level_']").each(function(index) {
x = Number($(this).attr("class").substring(15,16));
......@@ -204,6 +209,11 @@
$("#status").addClass('ot');
$("#status").prop('disabled', true);
}
if (data.status == 5) {
$("#suspension_type").parent().parent().show();
} else {
$("#suspension_type").parent().parent().hide();
}
}, "json");
}
......@@ -245,6 +255,13 @@ jQuery(document).ready(function () {
$('#' + federation_code).show();
}
});
$('#status').on('change', function() {
if ($("#status option:selected").val() == 5) {
$("#suspension_type").parent().parent().show();
} else {
$("#suspension_type").parent().parent().hide();
}
});
$("#feds").change(loadFederation);
$("#main_fed_table").on('change', "select, input, file", function (event) {
changedFields.push($(this).attr("id"));
......
......@@ -21,8 +21,13 @@
<dt><hr><h2>SAML specific info</h2></dt><dd></dd>
{% if federation.fed.status == 5 %}
<div style="color: red">
<strong>Metadata refresh suspended</strong> (see <a href="https://wiki.geant.org/display/eduGAIN/Technical+participation+suspension" target="_blank">here</a> for explanation)
</div>
{% if federation.fed.suspension_type == 1 %}
<strong>Metadata refresh suspended</strong> (see <a href="https://wiki.geant.org/display/eduGAIN/Technical+participation+suspension" target="_blank">here</a> for explanation)
{% endif %}
{% if federation.fed.suspension_type == 2 %}
<strong>Federstion membership suspended</strong> (see <a href="https://wiki.geant.org/display/eduGAIN//Automatic+Suspension+process" target="_blank">here</a> for explanation)
{% endif %}
</div>
{% endif %}
{{ display.multiple_links(federation.field_properties.registration) }}
{{ display.metadata_url(federation.field_properties.metadata_url, federation.fed.code) }}
......
......@@ -31,6 +31,7 @@
{% endif %}
{% if federation.fed.status == 5 %}
{% set alert_icon = 'red_dot.png' %}
{% set alert_text = 'metadata handling skipped' %}
{% endif %}
<div id="{{ federation.fed.code }}_option_div" class="member-div{{ problem_class }}" style="padding-left: 1em;{%
......@@ -38,7 +39,7 @@ if federation.information_missing
%}color: red;{%
endif
%}" data_value="{{ federation.fed.code }}" title="{{ error_message }}"><span style="width:20px; display:inline-block">{% if group_name == 'participants' %}<img src="images/{{ alert_icon }}" TITLE="{{alert_text}}">
{% endif %} </span><span {% if group_name == 'participants' and federation.fed.valid_sec <= 0 %}style="text-decoration:line-through;"{% endif %}>{{ federation.fed.name }} {% if federation.fed.countries is defined %} ({{federation.fed.countries|join(', ')}}){% endif %}</span> {% if federation.fed.status == 5 %}<img src="images/warning-icon.png" style="height:18px; vertical-align:middle; border-width:0px" TITLE="suspended">{% endif %}</span>
{% endif %} </span><span {% if (group_name == 'participants' and federation.fed.valid_sec <= 0) or federation.fed.status == 5 %}style="text-decoration:line-through;"{% endif %}>{{ federation.fed.name }} {% if federation.fed.countries is defined %} ({{federation.fed.countries|join(', ')}}){% endif %}</span> {% if federation.fed.status == 5 %}<img src="images/warning-icon.png" style="height:18px; vertical-align:middle; border-width:0px" TITLE="suspended">{% endif %}</span>
</div>
{% endfor %}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment