FIX_User Creation Password Not Stored
This commit is contained in:
parent
178be6ddaa
commit
8b14b1a8bf
@ -339,9 +339,8 @@ class Users extends BaseController
|
||||
'branch_id' => $this->request->getPost('branch'),
|
||||
'isactive' => 1 // Assuming this is a default value or handled separately
|
||||
];
|
||||
$user_id = $this->request->getPost('user_id');
|
||||
|
||||
if($user_id == 0){
|
||||
$user_id = trim($this->request->getPost('user_id')); // get and trim
|
||||
if (empty($user_id) || $user_id == 0) {
|
||||
// Hash the password
|
||||
$password = $this->request->getPost('password');
|
||||
$hashedPassword = password_hash($password, PASSWORD_DEFAULT); // Use PASSWORD_DEFAULT for bcrypt hashing
|
||||
@ -354,7 +353,7 @@ class Users extends BaseController
|
||||
// Get user_id from the form
|
||||
|
||||
// Check if user_id is provided
|
||||
if (!empty($user_id)) {
|
||||
if (!empty($user_id) && $user_id != 0) {
|
||||
// Update existing user
|
||||
$UsersModel->update($user_id, $data);
|
||||
} else {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user