Override controllers, models and traits in cakedc users with cakephp 4.2

Is there a way to override the controllers, models and traits in cakedc users? How can I do that?

This is really just a PHP inheritance question. You would create your own controller, have it extend the CakeDC one, add whatever you need in yours, and create routes that override theirs. That last bit is the only part that is in any way Cake specific.

I have wampserver in my pc, the site is hosted in http://localhost/sindicato/, how do I have to override the routes in routes.php, how do I have to configure the $allowedRedirectHosts in users.php so that the redirect query param is established with http://localhost/sindicato/ and not only localhost, where do I have to put the line Configure::write(‘Users.config’, [‘users’]);
so that it uses the users.php in config directory and I have a controller MyUsersController and a table MyUsersTable, do I have to put MyUsers in table and controller in users.php?

If this is all just to get things working in your particular dev environment, might I suggest changing your setup so that sindicato isn’t part of the URL, because it can all come back to bite you when you deploy to a production site that doesn’t have that in it.

To have it use your MyUsersController for some user action, put things like this in your config/routes.php (not the one from the CakeDC plugin):

$routes->connect('/users', ['plugin' => false, 'controller' => 'MyUsers', 'action' => 'index']);
$routes->connect('/users/view/:id', ['plugin' => false, 'controller' => 'MyUsers', 'action' => 'view'], ['id' => '\d+', 'pass' => ['id']]);
$routes->connect('/users/add', ['plugin' => false, 'controller' => 'MyUsers', 'action' => 'add']);
$routes->connect('/users/edit/:id', ['plugin' => false, 'controller' => 'MyUsers', 'action' => 'edit'], ['id' => '\d+', 'pass' => ['id']]);