Commit eeef56f5 authored by Fabrice Gangler's avatar Fabrice Gangler 🎨 Committed by Matthieu FAURE
Browse files

FIX(new user): load information correctly in session

The user type is required for using ACLs in views
and the user type ID is not sufficient.

Refs: #869
parent 32658cae
Pipeline #9686 passed with stage
in 3 minutes and 23 seconds
......@@ -446,7 +446,12 @@ class UsersController extends AppController
$message = "Success";
$this->Flash->success(__d("Forms", "Your are registred on the Comptoir du Libre, welcome !"));
if (!$this->request->is('json')) {
$this->Auth->setUser($this->Auth->identify());
$currentUser = $this->Auth->identify();
$currentUser["user_type"] = $this->Users
->UserTypes
->get($currentUser["user_type_id"])->get("name");
$this->Auth->setUser($currentUser);
// REDIRECTS TO ---> /<lang>/users/<idUser>
$lang = $this->selectedLanguage;
return $this->redirect("/$lang/users/" . $user->get('id'));
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment