RE: [Phplib-users] convert passwords submitted to phplib to upper case
Brought to you by:
nhruby,
richardarcher
From: Brian P. <bp...@ct...> - 2002-07-16 17:19:52
|
What you have should work if the database is setup right. Also, make sure that you are modifying the auth_validatelogin() function. Put an echo statement in there somewhere to make sure your changes are getting executed when you think they are (if at all). By the way, you should be able to glue the two functions together like so: $this->db->query(sprintf("select user_id, perms ". " from %s ". " where username = '%s' ". " and password = '%s'", $this->database_table, addslashes(strtoupper($username)), addslashes($password))); I try not to get carried away with this, though, because it makes the code a little hard to read. In fact, I don't really like the way PHPLib forms their SQL statements (with sprintf). I think the following is a little more readable and much easier to modify: $username = addslashes ( $username ); $password = addslashes ( $password ); $sql = "SELECT * "; $sql .= "FROM $this->database_table "; $sql .= "WHERE username='$username' "; $sql .= "AND password='$password' "; $db->query ( $sql ); ... -bpopp (www.bpopp.net) -----Original Message----- From: Chris Johnson [mailto:ch...@ch...] Sent: Tuesday, July 16, 2002 12:02 PM To: Robert Van Overmeiren; Php...@li... Subject: Re: [Phplib-users] convert passwords submitted to phplib to upper case In what way does this not work? Have you ensured that the passwords were originally stored as being in upper case? ..chris ----- Original Message ----- From: "Robert Van Overmeiren" <van...@un...> I would like to convert passwords submitted to phplib to upper case. I tried adding the 'strtoupper' function to our auth class, right before it queries the dbase: $password = strtoupper($password); $this->db->query(sprintf("select user_id, perms ". " from %s ". " where username = '%s' ". " and password = '%s'", $this->database_table, addslashes($username), addslashes($password))); This doesn't work. It would be nice to do the addslashes () and the strtoupper () all at the same time. Can the two functions be glued together so they both operate on the $password at the same time? If not is there a better way or place to do the conversion? Bob Van UDI IS ------------------------------------------------------- This sf.net email is sponsored by: Jabber - The world's fastest growing real-time communications platform! Don't just IM. Build it in! http://www.jabber.com/osdn/xim _______________________________________________ Phplib-users mailing list Php...@li... https://lists.sourceforge.net/lists/listinfo/phplib-users |