From 6c6abc6590e9e80830952279fcd680010d37c90d Mon Sep 17 00:00:00 2001 From: wangchunsheng Date: Tue, 28 Aug 2012 01:06:23 +0000 Subject: [PATCH] * when identify a user, fetch groups of him thus when check priv of projects, use groups stored in session. --- module/user/control.php | 1 + module/user/model.php | 2 ++ 2 files changed, 3 insertions(+) diff --git a/module/user/control.php b/module/user/control.php index 8a0dca1c31..b654906533 100644 --- a/module/user/control.php +++ b/module/user/control.php @@ -360,6 +360,7 @@ class user extends control { /* Authorize him and save to session. */ $user->rights = $this->user->authorize($account); + $user->groups = $this->user->getGroups($account); $this->session->set('user', $user); $this->app->user = $this->session->user; $this->loadModel('action')->create('user', $user->id, 'login'); diff --git a/module/user/model.php b/module/user/model.php index 8ceea6a03a..2e8590717f 100644 --- a/module/user/model.php +++ b/module/user/model.php @@ -305,6 +305,7 @@ class userModel extends model if(!$user) return false; $user->rights = $this->authorize($account); + $user->groups = $this->user->getGroups($account); $this->session->set('user', $user); $this->app->user = $this->session->user; $this->loadModel('action')->create('user', $user->id, 'login'); @@ -324,6 +325,7 @@ class userModel extends model if(!$user) return false; $user->rights = $this->authorize($account); + $user->groups = $this->user->getGroups($account); $this->session->set('user', $user); $this->app->user = $this->session->user; $this->loadModel('action')->create('user', $user->id, 'login');