diff options
author | stfwi <cerberos@atwillys.de> | 2011-06-24 13:46:54 +0100 |
---|---|---|
committer | stfwi <cerberos@atwillys.de> | 2011-06-24 13:46:54 +0100 |
commit | ee6fc493a9e9ca0997216c6df3acab99c2ab80c0 (patch) | |
tree | 22b089666260b609c423f4f48f6945388cde4cb4 | |
parent | a83028159c1e39c00224c61a076819a42c377e2f (diff) | |
download | drupal_htpasswdsync-ee6fc493a9e9ca0997216c6df3acab99c2ab80c0.tar.gz drupal_htpasswdsync-ee6fc493a9e9ca0997216c6df3acab99c2ab80c0.tar.bz2 drupal_htpasswdsync-ee6fc493a9e9ca0997216c6df3acab99c2ab80c0.zip |
BugFix: Checking password for hash when user form is submitted
-rw-r--r-- | HTPasswdSync.module | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/HTPasswdSync.module b/HTPasswdSync.module index f6fa48e..29a2e35 100644 --- a/HTPasswdSync.module +++ b/HTPasswdSync.module @@ -409,15 +409,20 @@ function htpasswdsync_user_delete($account) { * User insert/edit hook. Used instead of htpasswdsync_user_insert() and * htpasswdsync_user_update() because at these states the password is already * hashed. - * @param array &$edit - * @param object $account - * @param string $category + * @param string $entity_type + * @param object $entity + * @param array $form + * @param array $form_state * @return void */ function htpasswdsync_field_attach_submit($entity_type, $entity, $form, &$form_state) { if($entity_type != 'user') return; if(!empty($entity->name) && !empty($entity->pass)) { - _htpasswdsync_update($entity); + $r = db_query('SELECT pass FROM {users} WHERE uid=:uid', array(':uid' => $entity->uid)); + foreach($r as $v) { $r = $v->pass; break; } + if($r != $entity->pass) { + _htpasswdsync_update($entity); + } } } |