Commit 9e254365 authored by Cecilia Vela Gurovic's avatar Cecilia Vela Gurovic Committed by Robert Lyon
Browse files

Bug 1795096:confirmation dialogue when deleting IdP

behatnotneeded

Change-Id: Ice8e039ed2163e42f062c42ea90c335659cc6926
parent 840b1d04
......@@ -14,6 +14,7 @@ defined('INTERNAL') || die();
$string['attributemapfilenotamap'] = 'The attribute map file "%s" didn\'t define an attribute map.';
$string['attributemapfilenotfound'] = 'Could not find attribute map file or it is not writable: %s';
$string['certificate1'] = 'SAML Service Provider signing and encryption certificate';
$string['confirmdeleteidp'] = 'Are you sure you want to delete this identity provider?';
$string['spmetadata'] = 'Service Provider metadata';
$string['metadatavewlink'] = '<a href="%s">View metadata</a>';
$string['ssphpnotconfigured'] = 'SimpleSAMLPHP is not configured.';
......@@ -21,7 +22,6 @@ $string['manage_certificate2'] = 'This is the certificate generated as part of t
$string['nullprivatecert'] = "Could not generate or save the private key";
$string['nullpubliccert'] = "Could not generate or save the public certificate";
$string['defaultinstitution'] = 'Default institution';
$string['deleteidp'] = 'Delete IdP';
$string['description'] = 'Authenticate against a SAML 2.0 Identity Provider service';
$string['disco'] = 'Identity Provider discovery';
$string['errorbadinstitution'] = 'Institution for connecting user not resolved';
......
......@@ -757,7 +757,6 @@ class PluginAuthSaml extends PluginAuth {
'sort' => false
),
'delete' => array(
'name' => get_string('deleteidp', 'auth.saml'),
'template' => 'auth:saml:idpdelete.tpl',
'sort' => false
),
......
{if $r.delete}
<button type="button" onclick="deleteidp(this, '{$r.idpentityid}')" name="delete" value="{$r.idpentityid}" class="btn-link btn btn-xs pull-right" alt='{str tag=deletespecific section=mahara arg1=$r.name}'>
<button type="button" onclick="deleteidp(this, '{$r.idpentityid}')" name="delete" value="{$r.idpentityid}" class="deletebutton btn btn-default btn-xs" alt='{str tag=deletespecific section=mahara arg1=$r.name}'>
<span class="icon icon-trash text-danger icon-lg" role="presentation" aria-hidden="true"></span>
<span class="sr-only">
{str tag=delete section=mahara}
......
......@@ -16,14 +16,15 @@
function deleteidp(el, idp) {
var data = { 'idp' : idp };
var row = $(el).closest('tr');
sendjsonrequest(config.wwwroot + 'auth/saml/idpdelete.json.php', data, 'POST', function(data) {
if (data.data.error) {
alert(data.data.error);
}
else {
row.hide();
}
});
if (confirm("{get_string('confirmdeleteidp', 'auth.saml')}")) {
sendjsonrequest(config.wwwroot + 'auth/saml/idpdelete.json.php', data, 'POST', function(data) {
if (data.data.error) {
alert(data.data.error);
}
else {
row.hide();
}
});
}
}
</script>
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment