Como enviar/save senha codificada SHA1 (How Submit/Save password SHA1 in to database)
Como enviar/save senha codificada SHA1 (How Submit/Save password SHA1 in to database)
freemaster
Posts: 3Questions: 2Answers: 0
Olá, criei o campo senha na inclusão de usuários....eu preciso que o usuário digite a senha (sem codificação), e quando for salvar o banco da dados essa senha seja convertida para SHA1. Como posso fazer isso?
Hello, I created the password field in adding users .... I need the user to enter the password (no coding), and when you save into database that password be converted to SHA1. How can I do this?
This discussion has been closed.
Answers
Hi,
There is an explanation of how this might be done in the DataTables blog. It uses Editor's server-side events to make this possible.
Allan
You'll also want to use a set formatter to SHA1 encode the password.
Allan
understand...
I need to do this !?
'Password' => sha1($password)
(in preCreat and preEdit , correct!?)
You would do that part in the set formatter. You would use the events to decide if the set formatter should be applied at all. For example you don't want to set the user's password to
sha1("")
if they submit an empty string (i.e. no change)!Allan