mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
Añadido campo de verficacion de contraseña y campo de notas
This commit is contained in:
@ -53,15 +53,12 @@ class Users extends \App\Controllers\GoBaseController
|
||||
|
||||
public function index()
|
||||
{
|
||||
|
||||
$this->viewData['usingClientSideDataTable'] = true;
|
||||
$this->viewData['pageSubTitle'] = lang('Basic.global.ManageAllRecords', [lang('Users.user')]);
|
||||
$this->viewData['user_model'] = $this->user_model;
|
||||
|
||||
$this->viewData['userList2'] = auth()->getProvider()->findAll();
|
||||
|
||||
parent::index();
|
||||
|
||||
}
|
||||
|
||||
public function add()
|
||||
@ -72,21 +69,24 @@ class Users extends \App\Controllers\GoBaseController
|
||||
$postData = $this->request->getPost();
|
||||
|
||||
// Obtener contraseña nueva si se ha introducido en texto plano
|
||||
if (empty($postData['password'])) {
|
||||
if (empty($postData['new_pwd'])) {
|
||||
$postData['password'] = 'Safekat2024'; // Contraseña por defecto
|
||||
}else{
|
||||
$postData['password'] = $postData['new_pwd'];
|
||||
}
|
||||
|
||||
// Obtener los grupos a los que pertenece
|
||||
$currentGroups = $postData['group'] ?? [];
|
||||
unset($postData['group']);
|
||||
|
||||
// Generar el nombre de usuario
|
||||
$postData['username'] = strstr($postData['email'], '@', true);
|
||||
$sanitizedData = $this->sanitized($postData, true);
|
||||
|
||||
$noException = true;
|
||||
|
||||
// Obtener proveedor de usuarios
|
||||
$users = auth()->getProvider();
|
||||
|
||||
if ($successfulResult = $this->canValidate()) : // if ($successfulResult = $this->validate($this->formValidationRules) ) :
|
||||
if ($successfulResult = $this->canValidate()) :
|
||||
if ($this->canValidate()) :
|
||||
try {
|
||||
|
||||
@ -179,8 +179,9 @@ class Users extends \App\Controllers\GoBaseController
|
||||
unset($postData['group']);
|
||||
|
||||
// Obtener contraseña nueva si se ha introducido en texto plano
|
||||
if (empty($postData['password'])) {
|
||||
unset($postData['password']);
|
||||
// Obtener contraseña nueva si se ha introducido en texto plano
|
||||
if (!empty($postData['new_pwd'])) {
|
||||
$postData['password'] = $postData['new_pwd'];
|
||||
}
|
||||
|
||||
$sanitizedData = $this->sanitized($postData, true);
|
||||
|
||||
Reference in New Issue
Block a user