سؤال

I would like to modify (encrypt) the login password in Drupal, before it sends it decrypted to server. I didn't find any module to do that (validation before submission), and I couldn't find a way of validate the fields before they are sent to server.

Is there a way to solve it?

Thank you!

هل كانت مفيدة؟

المحلول

this module will help you Encryption

نصائح أخرى

Create your custom module and use hook_form_alter to add a new custom validation and submission callbacks:

function YOUR_MODULE_form_alter(&$form, &$form_state, $form_id)
{
    if($form_id == "user_profile_form") {
        $form['#validate'][] = 'your_new_validation_callback';
        $form['#submit'][] = 'your_new_submission_callback';
    }
}

function your_new_validation_callback($form, &$form_state)
{
    // add your validation logic
}

function your_new_submission_callback($form, &$form_state)
{
    // add your submission logic
}

Hope this helps.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top