How to save md5 passwords on grid

QuestionsCategory: How TosHow to save md5 passwords on grid
Stalin Nunes asked 7 months ago

Hello, i would ask you how to convert when I input data on the grid as typing normal but to get result as md5?

As reference the code:

$col = array();
$col[“title”] = “Pass”;
$col[“name”] = “pass”;
$col[“width”] = “32”;
$col[“align”] = “left”;
$col[“editable”] = true; // this column is editable
$col[“formatter”] = “password”;
$cols[] = $col;

Thank you!

1 Answers
Stalin Nunes answered 6 years ago

Hello, I've found the solution as the below:

// Grid events
$e = array();
$e["on_insert"] = array("pass_md5", null, true);
$e["on_update"] = array("pass_md5", null, true);
$g->set_events($e);
function pass_md5($data)
{
$data["params"]["pass_field"] = md5($data["params"]["pass_field"]);
}

Thanks!

Your Answer

9 + 0 =

Login with your Social Id:

OR, enter

Attach code here and paste link in question.
Attach screenshot here and paste link in question.



How useful was this discussion?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate it.

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?