Convert row

Convert row

mahammad_smahammad_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!

Answers

  • allanallan Posts: 61,743Questions: 1Answers: 10,111 Site admin

    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 :smile:).

    See this blog post for more details.

    Allan

  • rf1234rf1234 Posts: 2,808Questions: 85Answers: 406

    use a custom set formatter through a closure to do the md5 conversion with PHP.
    https://editor.datatables.net/manual/php/formatters#Formatter-methods

  • rf1234rf1234 Posts: 2,808Questions: 85Answers: 406

    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.

This discussion has been closed.