Ejemplo n.º 1
0
 /**
  * Add or remove user from an ugroup
  *
  * @param int $groupId
  * @param int $ugroupId
  * @param array $user
  */
 private function editMembershipByUserId($groupId, $ugroupId, array $user)
 {
     list($userId, $action) = each($user);
     $userId = (int) $userId;
     if ($userId) {
         switch ($action) {
             case 'add':
                 ugroup_add_user_to_ugroup($groupId, $ugroupId, $userId);
                 break;
             case 'remove':
                 ugroup_remove_user_from_ugroup($groupId, $ugroupId, $userId);
                 break;
             default:
                 break;
         }
     }
 }
Ejemplo n.º 2
0
 public function addUserToUgroup($project_id, $ugroup_id, $user_id)
 {
     return ugroup_add_user_to_ugroup($project_id, $ugroup_id, $user_id);
 }
Ejemplo n.º 3
0
 /**
  * Add user to a static ugroup
  *
  * @param Integer $group_id  Id of the project
  * @param Integer $ugroup_id Id of the ugroup
  * @param Integer $user_id   Id of the user
  *
  * @return Void
  */
 protected function addUserToStaticGroup($group_id, $ugroup_id, $user_id)
 {
     include_once 'www/project/admin/ugroup_utils.php';
     ugroup_add_user_to_ugroup($group_id, $ugroup_id, $user_id);
 }
Ejemplo n.º 4
0
 protected function addUserToStaticGroup($group_id, $ugroup_id, $user_id)
 {
     ugroup_add_user_to_ugroup($group_id, $ugroup_id, $user_id);
 }
Ejemplo n.º 5
0
 /**
  * Object oriented wrapper for ugroup_add_user_to_ugroup
  *
  * @param Integer $ugroupId Codendi user group id
  * @param Integer $userId   Codendi user id
  * 
  * @return void
  */
 function addUserToGroup($ugroupId, $userId)
 {
     $row = $this->_getUgroupRow($ugroupId);
     return ugroup_add_user_to_ugroup($row['group_id'], $ugroupId, $userId);
 }
Ejemplo n.º 6
0
 protected function addUserToUserGroup($user, $project, $ugroup_id)
 {
     ugroup_add_user_to_ugroup($project->getId(), $ugroup_id, $user->getId());
 }
Ejemplo n.º 7
0
 $valid_begin->required();
 $valid_in_project = new Valid_UInt('in_project');
 $valid_in_project->required();
 $offset = $request->exist('browse') ? 0 : $request->getValidated('offset', 'uint', 0);
 $number_per_page = $request->exist('number_per_page') ? $request->getValidated('number_per_page', 'uint', 0) : 15;
 $search = $request->getValidated('search', 'string', '');
 $begin = $request->getValidated('begin', $valid_begin, '');
 $in_project = $request->getValidated('in_project', $valid_in_project, $group_id);
 $user = $request->get('user');
 if ($user && is_array($user)) {
     list($user_id, $action) = each($user);
     $user_id = (int) $user_id;
     if ($user_id) {
         switch ($action) {
             case 'add':
                 ugroup_add_user_to_ugroup($group_id, $ugroup_id, $user_id);
                 break;
             case 'remove':
                 ugroup_remove_user_from_ugroup($group_id, $ugroup_id, $user_id);
                 break;
             default:
                 break;
         }
         $GLOBALS['Response']->redirect('?group_id=' . (int) $group_id . '&ugroup_id=' . (int) $ugroup_id . '&offset=' . (int) $offset . '&number_per_page=' . (int) $number_per_page . '&search=' . urlencode($search) . '&begin=' . urlencode($begin) . '&in_project=' . (int) $in_project);
     }
 }
 //Display the page
 project_admin_header(array('title' => $Language->getText('project_admin_editugroup', 'edit_ug'), 'group' => $group_id, 'help' => 'UserGroups.html#UGroupCreation'));
 echo '<P><h2>' . $Language->getText('project_admin_editugroup', 'add_users_to') . ' ' . $hp->purify($ugroup_name, CODENDI_PURIFIER_CONVERT_HTML) . '</h2>';
 //Display the form
 $selected = 'selected="selected"';