Change dashboard

This commit is contained in:
Frederic Guillot
2015-07-01 17:36:21 -04:00
parent 3f084916e3
commit 109a2a2e25
25 changed files with 276 additions and 290 deletions

View File

@@ -306,4 +306,25 @@ abstract class Base extends \Core\Base
return $project;
}
/**
* Common method to get the user
*
* @access protected
* @return array
*/
protected function getUser()
{
$user = $this->user->getById($this->request->getIntegerParam('user_id', $this->userSession->getId()));
if (empty($user)) {
$this->notfound();
}
if (! $this->userSession->isAdmin() && $this->userSession->getId() != $user['id']) {
$this->forbidden();
}
return $user;
}
}