Пример #1
0
      }
      $display['msg'] .= display_ok_msg("$nb $l_user_added");
    } else {
      $display['msg'] .= display_err_msg($l_no_user_added);
    }
  } else {
    $display['msg'] .= display_warn_msg($err['msg']);
  }
  $display['detail'] = dis_group_consult($params, $obm['uid']);

} elseif ($action == 'user_del') {
///////////////////////////////////////////////////////////////////////////////
  if (check_group_update_rights($params)) {
    if ($params['user_nb'] > 0) {
      $g = get_group_info($params['group_id']);
      $nb = run_query_group_usergroup_delete($params, $g['domain_id']);
      // Set update state only if updated group is public
      if ($g['privacy'] == 0) {
	set_update_state();
      }
      $display['msg'] .= display_ok_msg("$nb $l_user_removed");
    } else {
      $display['msg'] .= display_err_msg($l_no_user_deleted);
    }
  } else {
    $display['msg'] .= display_warn_msg($err['msg']);
  }
  $display['detail'] = dis_group_consult($params, $obm['uid']);

} elseif ($action == 'contact_add') {
///////////////////////////////////////////////////////////////////////////////
Пример #2
0
  /**
   * Remove a user in a group.
   * @param $user_id The user identifier.
   * @param $group_id A group identifier.
   * @param $domain_id A domain identifier.
   * @return boolean True if succeed.
   */
  function removeUserFromGroup ($user_id, $group_id, $domain_id)
  {
    global $obm;

    $backup['obm_domain_id'] = $obm['domain_id'];
    $obm['domain_id'] = $domain_id;

    $data = Array();
    $data['user_nb'] = 1;
    $data['user1'] = $user_id;
    $data['group_id'] = $group_id;

    $c = run_query_group_usergroup_delete($data, null);

    $obm['domain_id'] = $backup['obm_domain_id'];
    unset($backup);

    if ($c > 0)
      return true;

    return false;
  }