Skip to content
Snippets Groups Projects
Commit 7b52233c authored by Patrick Dawkins's avatar Patrick Dawkins Committed by Neil Drumm
Browse files

Issue #2480301 by pjcdawkins: Provide the parsed key to hook_sshkey_validate()

parent 2048a2cd
No related branches found
No related tags found
No related merge requests found
......@@ -118,7 +118,10 @@ function hook_sshkey_delete($key) {
* The form being used to edit the SSH key.
* @param $form_state
* The form state array.
* @param array $parsed
* The parsed key. This contains the elements 'algorithm', 'key',
* 'fingerprint', and 'comment'.
*/
function hook_sshkey_validate($key, $form, $form_state) {
function hook_sshkey_validate($key, $form, $form_state, array $parsed) {
}
......@@ -438,12 +438,13 @@ function sshkey_validate($key, $form, &$form_state) {
}
catch (SSHKeyParseException $e) {
form_set_error('value', $e->getMessage());
return;
}
// Allow other modules to validate the SSH public key.
foreach (module_implements('sshkey_validate') as $module) {
$function = $module . '_sshkey_validate';
$function($key, $form, $form_state);
$function($key, $form, $form_state, $parsed);
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment