fields select and radio / editor

fields select and radio / editor

ergunergun Posts: 12Questions: 3Answers: 0

hello,
sorry for my english , I'm french ...
now I'm trying datatables editor and am having a problem. I would like to show drop-down lists and insert radio button, but nothing appears ! however text field and time no problem .
Can someone help me ?

Answers

  • allanallan Posts: 63,538Questions: 1Answers: 10,476 Site admin

    Hi,

    Can you link to the page you are having problems with so I can take a look and help to resolve the issue?

    Thanks,
    Allan

  • ergunergun Posts: 12Questions: 3Answers: 0

    Thank you I found the solution.
    How to use the md5 function on a password field ? Why is the text entered in the field such as 'é' ou 'à' appears strangely in the database ?
    thank you for your help.

  • allanallan Posts: 63,538Questions: 1Answers: 10,476 Site admin

    How to use the md5 function on a password field ?

    You could use a set formatter. There is more information on formatters in the manual.

    Why is the text entered in the field such as 'é' ou 'à' appears strangely in the database ?

    Sounds like your database might be storing the data in a different character set from what you are editing it in.

    Allan

  • tsakaltsakal Posts: 15Questions: 6Answers: 0

    Hello Allan.

    In a table called "users" there is a field "password".

    In the Editor I use : Field::inst( 'password' )->validator( 'Validate::notEmpty' )->setFormatter( function ( $val, $data, $opts ) { return md5( $val );} ), to maintain encrypded passwords.

    But when I make edit in an other field, submited hole the line and as result I have to the password field the md5'ed value of previus md5'ed value. [original value : demo - encrypted value : fe01ce2a7fbac8fafaed7c982a04e229 - reEncrypted value : 6c5ac7b4d3bd3311f033f971196cfa75].

    Can you please gide me to right direction?

    Evangelos

  • allanallan Posts: 63,538Questions: 1Answers: 10,476 Site admin

    If you don't submit a value for a field Editor shouldn't be writing to the database - it sounds like you might be submitting the current hash which would cause it to pass through the formatter again.

    The best thing to do would be to simply not submit the password field if that is possible?

    It would be remiss of me if I didn't mention that md5 is really not a very good way to store passwords. With GPU power now it wouldn't take lot at all to crack the password. You would be better using password_hash or similar.

    Allan

    Allan

This discussion has been closed.