--- password_change.original/password_change.module 2009-12-14 05:34:24.000000000 +0100 +++ password_change/password_change.module 2010-03-18 16:55:29.000000000 +0100 @@ -82,8 +82,14 @@ } function password_change_validate_password($element, $form_state) { - if (md5($element['#value']) !== $GLOBALS['user']->pass) { - form_error($element, 'Incorrect current password.'); + if (module_exists('phpass') && variable_get('user_hash_method', 'phpass') == 'phpass') { + if (_phpass_user_authenticate($GLOBALS['user']->name, $element['#value']) == NULL) + form_error($element, 'Incorrect current password.'); + } + else { + if (md5($element['#value']) !== $GLOBALS['user']->pass) { + form_error($element, 'Incorrect current password.'); + } } }