Closed (fixed)
Project:
Drupal core
Version:
x.y.z
Component:
user.module
Priority:
Critical
Category:
Bug report
Assigned:
Reporter:
Created:
21 Jan 2006 at 23:26 UTC
Updated:
7 Feb 2006 at 10:31 UTC
Jump to comment: Most recent file
When a user changes its password (via ?q=user/'uid'/edit), the fields 'pass1' and 'pass2' of the form are saved in the 'data' field of the {users} table, and retrieved at any user_load...
OK, it doesn't make them printed in large letters on the frontpage, but It seemed to me that the whole point of the password management in drupal was that only the md5 was kept, so that you could never access the actual password. So I guess it's a kind of a hole...
| Comment | File | Size | Author |
|---|---|---|---|
| #18 | pass1_3.patch | 4.09 KB | chx |
| #17 | pass1_2.patch | 4.06 KB | chx |
| #15 | pass1_1.patch | 3.43 KB | chx |
| #8 | pass1_0.patch | 1.3 KB | chx |
| #7 | path.inc_5.patch | 15.31 KB | chx |
Comments
Comment #1
markus_petrux commentedI'm not sure if it happens in 4.6.5, but it happens in HEAD.
The attached patch is for HEAD.
Comment #2
markus_petrux commentedThough, the patch doesn't remove 'pass1' and 'pass2' if it was already there. Noit sure, how to fix that.
Comment #3
yched commentedI meant HEAD - just forgot to select the correct version. 4.6.5 seems OK, sorry if you spent time checking that...
Comment #4
chx commentedThe patch is totally wrong and I won't waste my time explaining why. Give me some time and I'll submit the correct one.
Comment #5
chx commentedThis patch is trivial :P we need to save the ref to really delete pass1 and pass2. This need lead to some really nice code :D
Comment #6
markus_petrux commentedWouldn't it be easier to use
unset($form_values['pass2'])instead of$form_values['pass2']['ref'] = NULL;What about those that already have plain passwords in their DBs? It could probably be fixed by unsetting the keys 'pass1' and 'pass2' from the array $data before this loop:
foreach ($array as $key => $value) {Offtopic: I tried to send you an email via contact form, but it seems emails from this site doesn't work (I didn't get my copy). I just wanted to tell you that you've been a bit rude. I'm not trying to tell anyone how to do anything, just trying to be of some help. Thanks for that.
Comment #7
chx commentedMuch nicer patch. Also corrects password_confirm_after_build to work at any tree level.
Comment #8
chx commentedEek! That's another issue's patch.
Comment #9
chx commentedmarkus sorry for being rude, I do notice that you are submitting lots of very useful patches and sorry if I were rude, I just wanted to stop a bad commit and as it's 2am I really did not want to explain what's wrong there. Sorry again.
Comment #10
chx commentedand for those who have plain passwords? Add
to
user_edit_submitand remove later.Comment #11
markus_petrux commentedNo problem.
Do you plan to fix the DB of those that have plain passwords in their DBs?
Comment #12
markus_petrux commentedrofl. ok
Comment #13
chx commentedNo. This is a developer version, you should always be prepared to zap your database, or even get your database zapped by Drupal. I will not waste any effort to fix something that's only in developer DBs. Because this was not so in 4.6.
Comment #14
chx commentedMarkus, it seems you are here :) care to review my patch?
Comment #15
chx commentedkilles asked me to set error on both. Well, here you are. Also, it further corrects password_confirm_after_build to work from any part of the tree with using form_error instead of form_set_error.
Comment #16
adrian commentedI still feel that this is validation, and it should be done within a _validate hook.
Validation happens after build by definition, and there's a phase specifically for this reason.
Comment #17
chx commentedWell. After a long, long debate I decided to move it to #validate but this is a very special case. If you can avoid, then do avoid changing stuff in #validate.
Comment #18
chx commentedRerolled and tested.
Comment #19
dries commentedCommitted to HEAD. Thanks.
Comment #20
(not verified) commented