Commit 539f7b80 authored by Hugh Davenport's avatar Hugh Davenport

Add button to delete current public key

This will delete the current mnet key and regenerate a new one

Bug #890583

Change-Id: Ic07fc3f2e772fc26c959cd00a74bd88da9277a92
Signed-off-by: default avatarHugh Davenport <hugh@catalyst.net.nz>
parent 08f7826d
......@@ -107,6 +107,11 @@ $networkingform = pieform(
'submit' => array(
'type' => 'submit',
'value' => get_string('savechanges','admin')
),
'deletesubmit' => array(
'type' => 'submit',
'title' => get_string('deletekey', 'admin'),
'value' => get_string('delete')
)
)
)
......@@ -122,6 +127,17 @@ function networkingform_fail(Pieform $form) {
function networkingform_submit(Pieform $form, $values) {
$reply = '';
if (isset($values['deletesubmit'])) {
global $SESSION;
$openssl = OpenSslRepo::singleton();
$openssl->get_keypair(true);
$SESSION->add_info_msg(get_string('keydeleted', 'admin'));
// Using cancel here as a hack to get it to redirect so it shows the new keys
$form->reply(PIEFORM_CANCEL, array(
'location' => get_config('wwwroot') . 'admin/site/networking.php'
));
}
if (get_config('enablenetworking') != $values['enablenetworking']) {
if (!set_config('enablenetworking', $values['enablenetworking'])) {
networkingform_fail($form);
......
......@@ -394,6 +394,8 @@ $string['promiscuousmodeenabled'] = 'Auto-register has been enabled. ';
$string['promiscuousmodedescription'] = 'Create an institution record for any host that connects to you, and allow its users to log on to Mahara';
$string['wwwroot'] = 'WWW Root';
$string['wwwrootdescription'] = 'This is the URL at which your users access this Mahara installation, and the URL the SSL keys are generated for';
$string['deletekey'] = 'Delete this key';
$string['keydeleted'] = 'Public key has been deleted and regenerated';
$string['proxysettings'] = 'Proxy settings';
$string['proxyaddress'] = 'Proxy address';
$string['proxyaddressdescription'] = 'If your site uses a proxy server to access the internet, specify the proxies in <em>hostname:portnumber</em> notation';
......
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