⚠ In case you've missed it, we have migrated to our new website, with a brand new forum. For more details about the migration you can read our blog post for website migration. This is an archived forum. ⚠

  •     

profile picture

Set Rules does not process sha1



ricardo

ricardo
  • profile picture
  • Member

Posted 14 April 2012 - 12:33 PM

I am trying to use the set_rules method to hash a user password, but it is not processing the sha1, the field is saved without being hashed. I saw in another post (Posted 15 January 2012 - 04:41 PM) that it would be fixed in version 1.1.8, I have version 1.2 installed.

the code I am using is:


$crud = new grocery_CRUD();
$crud ->set_table('user')
->set_subject('Usuario')
->columns('firstname','lastname','organizationid')
->add_fields("firstname", "initial", "lastname", "lastname2", "username", "password", "email", "phone", "organizationid", "accesslevel", "active", "themeid")
->set_relation("organizationid", "organization", "name")
->set_relation("themeid", "theme", "name")
->set_rules("firstname", "Nombre", "required")
->set_rules("lastname", "Apellido", "required")
->set_rules("username", "Usuario", "required")
->set_rules("organizationid", "Organización", "required")
->set_rules('email', 'Email', 'required|valid_email|is_unique[user.email]')
->set_rules('password', 'Contraseña', 'required|sha1');
$output = $crud->render();


It seems it that groceryCRUD does not take the filtered data from the codeigniter validator or I am missing something in the code.

Thanks in advance for your help.

web-johnny

web-johnny
  • profile picture
  • Administrator
  • 1,166 posts

Posted 14 April 2012 - 12:39 PM

Yes this is right , grocery CRUD only validates and not filter. This question has been answered at: /topic/168-answered-a-problem-in-validations-set-rules-doesnt-filter/page__view__findpost__p__612