Ejemplo n.º 1
0
 /**
  * Display view with details for a specified group.
  * 
  * @param $groupname Name of the group to be displayed.
  */
 public function getSettings($groupname)
 {
     $sentryGroups = [];
     foreach (Roles::$PROJECT_ROLE_NAMES as $role) {
         $sentryGroups[$role] = Sentry::findGroupByName($groupname . ':' . $role);
     }
     $groupUsers = [];
     foreach (Roles::$PROJECT_ROLE_NAMES as $role) {
         // List userts with $role in this group -- make [] when none
         $users = $sentryGroups[$role]['user_agent_ids'];
         $groupUsers[$role] = is_null($users) ? [] : $users;
     }
     $groupInviteCodes = [];
     foreach (Roles::$PROJECT_ROLE_NAMES as $role) {
         $groupInviteCodes[$role] = $sentryGroups[$role]['invite_code'];
     }
     $canEditGroup = PermissionHandler::checkProject(Auth::user(), $groupname, Permissions::PROJECT_ADMIN);
     $credentials = ProjectHandler::getCredentials($groupname);
     return View::make('projects.settings')->with('project', $groupname)->with('users', $groupUsers)->with('inviteCodes', $groupInviteCodes)->with('canEditGroup', $canEditGroup)->with('credentials', $credentials);
 }