@@ -903,15 +903,7 @@ function getSQL($record, $tab, $action = 'INSERT', $primary_id = 0, $sql_ext_whe
903903 if ($ field ['formtype ' ] == 'PASSWORD ' ) {
904904 $ sql_insert_key .= "` $ key`, " ;
905905 if ($ field ['encryption ' ] == 'CRYPT ' ) {
906- $ salt ="$1$ " ;
907- $ base64_alphabet ='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/ ' ;
908- for ($ n =0 ;$ n <8 ;$ n ++) {
909- //$salt.=chr(mt_rand(64,126));
910- $ salt .=$ base64_alphabet [mt_rand (0 ,63 )];
911- }
912- $ salt .="$ " ;
913- // $salt = substr(md5(time()),0,2);
914- $ record [$ key ] = crypt (stripslashes ($ record [$ key ]),$ salt );
906+ $ record [$ key ] = $ app ->auth ->crypt_password (stripslashes ($ record [$ key ]));
915907 $ sql_insert_val .= "' " .$ app ->db ->quote ($ record [$ key ])."', " ;
916908 } elseif ($ field ['encryption ' ] == 'MYSQL ' ) {
917909 $ sql_insert_val .= "PASSWORD(' " .$ app ->db ->quote ($ record [$ key ])."'), " ;
@@ -938,15 +930,7 @@ function getSQL($record, $tab, $action = 'INSERT', $primary_id = 0, $sql_ext_whe
938930 } else {
939931 if ($ field ['formtype ' ] == 'PASSWORD ' ) {
940932 if (isset ($ field ['encryption ' ]) && $ field ['encryption ' ] == 'CRYPT ' ) {
941- $ salt ="$1$ " ;
942- $ base64_alphabet ='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/ ' ;
943- for ($ n =0 ;$ n <8 ;$ n ++) {
944- //$salt.=chr(mt_rand(64,126));
945- $ salt .=$ base64_alphabet [mt_rand (0 ,63 )];
946- }
947- $ salt .="$ " ;
948- // $salt = substr(md5(time()),0,2);
949- $ record [$ key ] = crypt (stripslashes ($ record [$ key ]),$ salt );
933+ $ record [$ key ] = $ app ->auth ->crypt_password (stripslashes ($ record [$ key ]));
950934 $ sql_update .= "` $ key` = ' " .$ app ->db ->quote ($ record [$ key ])."', " ;
951935 } elseif (isset ($ field ['encryption ' ]) && $ field ['encryption ' ] == 'MYSQL ' ) {
952936 $ sql_update .= "` $ key` = PASSWORD(' " .$ app ->db ->quote ($ record [$ key ])."'), " ;
0 commit comments