src/controllers/UserController.php
public function getShow($userId)
    {
        try {
            $user = Sentry::getUserProvider()->findById($userId);
            $throttle = Sentry::getThrottleProvider()->findByUserId($userId);
            $groups = Sentry::getGroupProvider()->findAll();

            // get user permissions
            $permissions = PermissionProvider::findAll();
            $userPermissions = array();
            foreach($user->getPermissions() as $permissionValue => $key) {
                try {
                    $p = PermissionProvider::findByValue($permissionValue);
                    foreach($permissions as $key => $permission) {
                        if($p->getId() === $permission->getId()) {
                            $userPermissions[] = $permission;
                            unset($permissions[$key]);
                        }
                    }
                } catch(\MrJuliuss\Syntara\Models\Permissions\PermissionNotFoundException $e){}
            }

            // ajax request : reload only content container
            if(Request::ajax()) {
                $html = View::make(Config::get('syntara::views.user-informations'), array('user' => $user, 'throttle' => $throttle))->render();

                return Response::json(array('html' => $html));
            }

            $this->layout = View::make(Config::get('syntara::views.user-profile'), array(
                'user' => $user,
                'throttle' => $throttle,
                'groups' => $groups,
                'ownPermissions' => $userPermissions,
                'permissions' => $permissions
            ));

            $this->layout->title = $user->username;
            $this->layout->breadcrumb = array(
                    array(
                        'title' => trans('syntara::breadcrumbs.users'),
                        'link' => URL::route('listUsers'),
                        'icon' => 'glyphicon-user'
                    ),
                    array(
                     'title' => $user->username,
                     'link' => URL::current(),
                     'icon' => ''
                    )
            );
        } catch (\Cartalyst\Sentry\Users\UserNotFoundException $e) {
            $this->layout = View::make(Config::get('syntara::views.error'), array('message' => trans('syntara::users.messages.not-found')));
        }
    }
public function getShow($userId)
    {
        try {
            $user = Sentry::getUserProvider()->findById($userId);
            $throttle = Sentry::getThrottleProvider()->findByUserId($userId);
            $groups = Sentry::getGroupProvider()->findAll();

            // get user permissions
            $permissions = PermissionProvider::findAll();
            $userPermissions = array();
            foreach($user->getPermissions() as $permissionValue => $key) {
                try {
                    $p = PermissionProvider::findByValue($permissionValue);
                    foreach($permissions as $key => $permission) {
                        if($p->getId() === $permission->getId()) {
                            $userPermissions[] = $permission;
                            unset($permissions[$key]);
                        }
                    }
                } catch(\MrJuliuss\Syntara\Models\Permissions\PermissionNotFoundException $e){}
            }

            // ajax request : reload only content container
            if(Request::ajax()) {
                $html = View::make(Config::get('syntara::views.user-informations'), array('user' => $user, 'throttle' => $throttle))->render();

                return Response::json(array('html' => $html));
            }

            $this->layout = View::make(Config::get('syntara::views.user-profile'), array(
                'user' => $user,
                'throttle' => $throttle,
                'groups' => $groups,
                'ownPermissions' => $userPermissions,
                'permissions' => $permissions
            ));

            $this->layout->title = $user->username;
            $this->layout->breadcrumb = array(
                    array(
                        'title' => trans('syntara::breadcrumbs.users'),
                        'link' => URL::route('listUsers'),
                        'icon' => 'glyphicon-user'
                    ),
                    array(
                     'title' => $user->username,
                     'link' => URL::current(),
                     'icon' => ''
                    )
            );
        } catch (\Cartalyst\Sentry\Users\UserNotFoundException $e) {
            $this->layout = View::make(Config::get('syntara::views.error'), array('message' => trans('syntara::users.messages.not-found')));
        }
    }
View user account
@param int $userId