TASK-237 Fix the login with AD users

This commit is contained in:
Brayan Pereyra
2025-09-22 22:29:47 +00:00
parent a777147d6f
commit 554b4ad14b
9 changed files with 926 additions and 65 deletions

View File

@@ -15,6 +15,42 @@ class RbacUsers extends Model
protected $table = 'RBAC_USERS';
public $timestamps = false;
public function show($filters = array())
{
try {
$query = static::query();
if (is_array($filters['fields'])) {
$query->select($filters['fields']);
}
if (is_array($filters['conditions'])) {
$query->where($filters['conditions']);
}
$total = $query->count();
if (is_array($filters['start']) || is_array($filters['limit'])) {
$start = $filters['start'] ?? 0;
$limit = $filters['limit'] ?? 25;
$query->offset($start)->limit($limit);
}
if (is_array($filters['orderBy'])) {
$query->orderBy($filters['orderBy'][0], $filters['orderBy'][1] ?? 'asc');
}
$data =$query->get()->toArray();
$result = [
'total' => $total,
'data' => $data
];
return $result;
} catch (Exception $exception) {
return $exception->getMessage();
}
}
/**
* Create a new user
*
@@ -49,6 +85,17 @@ class RbacUsers extends Model
return $data;
}
public static function updateData($userData, $conditions = [])
{
try {
$responseSave = self::where($conditions)
->update($userData);
return $responseSave;
} catch (Exception $exception) {
return $exception->getMessage();
}
}
/**
* Verify if username exists
*