Convert row
Convert row
mahammad_s
Posts: 4Questions: 2Answers: 1
Hello,
I want to user DataTable for my user table. I keep passwords in md5 format. When i'm trying "edit" data i want editor convert pass to md5 format and insert it to DB.
How can i do it ?
Thank you!
This discussion has been closed.
Answers
I would suggest instead that you have the password fields as write only and only set their values if a non-zero length string is submitted for the password (at which point you should use a set formatter to hash the value - ideally using bcrypt rather than md5 ).
See this blog post for more details.
Allan
use a custom set formatter through a closure to do the md5 conversion with PHP.
https://editor.datatables.net/manual/php/formatters#Formatter-methods
sorry, that was overlapping with Allan's reply ... @Allan, thanks for reminding me ... need to get rid of my SHA512 and replace it with bcrypt, too.