mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
Arreglado bug añadir usuarios
This commit is contained in:
@ -9,8 +9,6 @@ use App\Models\Usuarios\UserModel;
|
||||
use App\Models\Usuarios\GroupsUsersModel;
|
||||
use App\Models\Collection;
|
||||
|
||||
use CodeIgniter\Shield\Entities\User;
|
||||
use function PHPUnit\Framework\isNull;
|
||||
|
||||
class Users extends \App\Controllers\GoBaseController
|
||||
{
|
||||
@ -89,9 +87,7 @@ class Users extends \App\Controllers\GoBaseController
|
||||
|
||||
// Marcar el username como NULL
|
||||
$sanitizedData = $this->sanitized($postData, true);
|
||||
$email = $sanitizedData['email'];
|
||||
unset($sanitizedData['email']);
|
||||
|
||||
|
||||
$noException = true;
|
||||
|
||||
// Obtener proveedor de usuarios
|
||||
@ -102,7 +98,7 @@ class Users extends \App\Controllers\GoBaseController
|
||||
try {
|
||||
|
||||
// The Email is unique
|
||||
if ($this->user_model->isEmailUnique($email)) {
|
||||
if ($this->user_model->isEmailUnique($sanitizedData['email'])) {
|
||||
|
||||
// Crear el usuario si pasa la validación
|
||||
$user = new \CodeIgniter\Shield\Entities\User([
|
||||
@ -111,6 +107,8 @@ class Users extends \App\Controllers\GoBaseController
|
||||
'last_name' => $sanitizedData['last_name'],
|
||||
'cliente_id' => $sanitizedData['cliente_id'],
|
||||
'comments' => $sanitizedData['comments'],
|
||||
'email' => $sanitizedData['email'],
|
||||
'password' => $sanitizedData['password'],
|
||||
'status' => $sanitizedData['status'] ?? 0,
|
||||
'active' => $sanitizedData['active'] ?? 0,
|
||||
]);
|
||||
|
||||
Reference in New Issue
Block a user