https://bugzilla.wikimedia.org/show_bug.cgi?id=28419

--- Comment #29 from Tyler Romeo <tylerro...@gmail.com> 2012-03-30 20:28:39 UTC 
---
I don't mean to be offensive, but this is a really bad way to implement
password checking. The object-based method in the linked branch blatantly
abuses OOP (static functions are not meant to be used that way). Also it's
unnecessarily complicated.

My recommendation would be to simply have one Password class. A hook would
allow the registering of new password types. (The hook signature would be
passfunc($password, $options=array()).)

This class would optionally take a hash as its constructor and parse the hash.
Then the object would have a crypt() function, which would determine the hash
type (or choose the preferred type if no original hash was given) and pass the
password (and optionally any options if a hash was given to the constructor) to
a hook function. Then there would be a compare() function that simply calls the
crypt() function on a given password and compares it to the original hash.

-- 
Configure bugmail: https://bugzilla.wikimedia.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.

_______________________________________________
Wikibugs-l mailing list
Wikibugs-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l

Reply via email to