users
users copied to clipboard
Password saved in plaintext after overriding the controler
I have problems to apply password hashing when adding new users after overriding the controller to use custom roles.
Function from my controller
public function add()
{
$myusers = $this->Myusers->newEmptyEntity();
if ($this->request->is('post')) {
$myusers = $this->Myusers->patchEntity($myusers, $this->request->getData());
$myusers->role = $this->request->getData('role');
if ($this->Myusers->save($myusers)) {
$this->Flash->success(__('Success msg.'));
return $this->redirect(['action' => 'index']);
}
$this->Flash->error(__('Error msg.'));
}
$company = $this->Myusers->Company->find('list',['order'=>['Company.Name' => 'ASC']]);
$roles = self::Roles;
$this->set(compact('myusers','company', 'roles'));
}
@biracsoftware I see that you have create a custom model Myusers
please check if you extended your table and entity classes correct, see https://github.com/CakeDC/users/blob/11.next-cake4/Docs/Documentation/Extending-the-Plugin.md#extending-the-model-tableentity
@biracsoftware have you tried suggestions? Can we close the issue?