Skip to content

Commit 42b7d8c

Browse files
committed
Changed encrypt function from mysql to php code.
1 parent 1d81efd commit 42b7d8c

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

interface/lib/classes/tform.inc.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -672,7 +672,8 @@ function getSQL($record, $tab, $action = 'INSERT', $primary_id = 0, $sql_ext_whe
672672
if($field['formtype'] == 'PASSWORD') {
673673
$sql_insert_key .= "`$key`, ";
674674
if($field['encryption'] == 'CRYPT') {
675-
$sql_insert_val .= "encrypt('".$record[$key]."'), ";
675+
// $sql_insert_val .= "encrypt('".$record[$key]."'), ";
676+
$sql_insert_val .= "'".crypt($record[$key],substr(md5(time()),0,2))."', ";
676677
} else {
677678
$sql_insert_val .= "md5('".$record[$key]."'), ";
678679
}
@@ -690,7 +691,8 @@ function getSQL($record, $tab, $action = 'INSERT', $primary_id = 0, $sql_ext_whe
690691
} else {
691692
if($field['formtype'] == 'PASSWORD') {
692693
if($field['encryption'] == 'CRYPT') {
693-
$sql_update .= "`$key` = encrypt('".$record[$key]."'), ";
694+
// $sql_update .= "`$key` = encrypt('".$record[$key]."'), ";
695+
$sql_update .= "`$key` = '".crypt($record[$key],substr(md5(time()),0,2))."', ";
694696
} else {
695697
$sql_update .= "`$key` = md5('".$record[$key]."'), ";
696698
}

0 commit comments

Comments
 (0)