[dev] Framework Auth :: customsql fix

Joel Vandal jvandal at infoteck.qc.ca
Tue Feb 3 13:54:07 PST 2004


Change _encryptPassword() to getCryptedPassword() in customsql.php.

Also the Cyrus SQL backend need also these change (framework/Auth/Auth/cyrsql.php)

-- 
Joel Vandal                                    Infoteck Internet
http://www.infoteck.qc.ca            Tel.  819-370-3232
jvandal at infoteck.qc.ca                 Fax. 819-370-3624
-------------- next part --------------
Index: customsql.php
===================================================================
RCS file: /repository/framework/Auth/Auth/customsql.php,v
retrieving revision 1.11
diff -u -r1.11 customsql.php
--- customsql.php       28 Jan 2004 00:34:00 -0000      1.11
+++ customsql.php       3 Feb 2004 21:49:33 -0000
@@ -113,8 +113,11 @@
         /* Build a custom query, based on the config file. */
         $query = $this->_params['query_auth'];
         $query = str_replace("\L", $this->_db->quote($userId), $query);
-        $query = str_replace("\P", $this->_db->quote($this->_encryptPassword($credentials['password'])), $query);
-
+        $query = str_replace("\P", $this->_db->quote($this->getCryptedPassword($credentials['password'],
+                                                                               '',
+                                                                               $this->_params['encryption'],
+                                                                               $this->_params['show_encryption'])), $query);
+
         $result = $this->_db->query($query);
         if (!is_a($result, 'PEAR_Error')) {
             $row = $result->fetchRow(DB_GETMODE_ASSOC);
@@ -151,7 +154,10 @@
         /* Build a custom query, based on the config file. */
         $query = $this->_params['query_add'];
         $query = str_replace("\L", $this->_db->quote($userId), $query);
-        $query = str_replace("\P", $this->_db->quote($this->_encryptPassword($credentials['password'])), $query);
+        $query = str_replace("\P", $this->_db->quote($this->getCryptedPassword($credentials['password'],
+                                                                               '',
+                                                                               $this->_params['encryption'],
+                                                                               $this->_params['show_encryption'])), $query);

         $result = $this->_db->query($query);
         if (is_a($result, 'PEAR_Error')) {
@@ -181,7 +187,10 @@
         $query = $this->_params['query_update'];
         $query = str_replace("\O", $this->_db->quote($oldId), $query);
         $query = str_replace("\L", $this->_db->quote($newId), $query);
-        $query = str_replace("\P", $this->_db->quote($this->_encryptPassword($credentials['password'])), $query);
+        $query = str_replace("\P", $this->_db->quote($this->getCryptedPassword($credentials['password'],
+                                                                               '',
+                                                                               $this->_params['encryption'],
+                                                                               $this->_params['show_encryption'])), $query);

         $result = $this->_db->query($query);
         if (is_a($result, 'PEAR_Error')) {


More information about the dev mailing list