With phpass installed, calls to user_authenticate() fail. This is because user_authenticate() calls user_load() with an array of user information that includes a plaintext password, and user_load() has a hardcoded md5() call to resolve the password. pwolanin suggested a core patch to be shipped with phpass, which is the only solution I can think of as well.

Comments

ksenzee’s picture

Status: Active » Needs review
StatusFileSize
new1.07 KB

Not sure if this is the right idea or not. It looks like once phpass is installed it's there for good, so I didn't add a module_exists check. I also didn't write it in such a way as to be acceptable in the core queue - getting it into core doesn't seem like an achievable goal. But maybe I'm a pessimist.

gábor hojtsy’s picture

How did this not come up before?

pwolanin’s picture

It's not a facility used by core, only by external authentication modules using the password. I was aware it could be an issue, but didn't seem critical.

Patch looks reasonable to me - I think if you apply this patch you are not going to disable phpass. The only value I could see to a module_exists check would be that the patch could be applied prior to phpass being installed.

pwolanin’s picture

Priority: Normal » Critical

Ok, well discovered now that user_authenticate() *is* used by core when you have email verification disabled for user registration.

I think in addition to supplying this patch with the module, we need to make the module work around that problem absent the patch.

pwolanin’s picture

StatusFileSize
new1.4 KB

Here's a patch for the module itself that works around the authentication failure.

The core registration code flow is very wonky, but I think the logic here is both correct and minimal.

pwolanin’s picture

StatusFileSize
new1.41 KB

oops missed-used an undefined $form_values that should be $form_state['values']

pwolanin’s picture

StatusFileSize
new1.24 KB

we could perhaps add a define() to the core patch? That way we can 100% skip the extra submit function if the core patch is applied.

pwolanin’s picture

StatusFileSize
new1.3 KB

with code comment

pwolanin’s picture

StatusFileSize
new1.45 KB

corresponding module patch

pwolanin’s picture

StatusFileSize
new3.5 KB

full patch

pwolanin’s picture

Version: 6.x-2.x-dev » 5.x-2.x-dev
Status: Needs review » Patch (to be ported)

committed to 6.x

greggles’s picture

This seems like it could just be "won't fixed" as 5.x should no longer be supported.

drumm’s picture

Version: 5.x-2.x-dev » 6.x-2.x-dev
Status: Patch (to be ported) » Fixed

Yep.

pwolanin’s picture

Version: 6.x-2.x-dev » 5.x-2.x-dev
Status: Fixed » Patch (to be ported)

Well, I wanted to still support 5x for now - but this is low priority obviously

greggles’s picture

Priority: Critical » Normal

Updating priority to reflect #14.

pwolanin’s picture

Status: Patch (to be ported) » Needs review
StatusFileSize
new3.45 KB

If you want to test this D5 seems to only work with PHP 5.2, not 5.3.

I'm not sure why D5 user module doesn't have a session regenerate call in it, but as best I can tell this does the same as the D6 patch and code.