The current implementation suggests predefined (and not editable through the Web) values for "Invitation limit" for a role. The page is http://www.example.com/admin/user/invite/settings

This patch will make the select box as a regular input text field, and allow you to enter any number you like. Proper description has been given also to insert a value that indicates "unlimited" invitations.

I hope to see this being part of new releases.

CommentFileSizeAuthor
#5 480646.patch2.14 KBBevan
#2 480646.patch1.28 KBBevan
invite_admin.patch1.04 KBcomrax

Comments

Bevan’s picture

Status: Active » Needs work

#377858: limit as textfield, instead of select list, Drupal 5 is a request for a backport of this. #196250: Invitation limit should not be an input field raises an issue that needs consideration before this can be marked RTBC. The patch is clean and works.

Bevan’s picture

Title: Patch to allow entering "Invitation limit" as a textfield, instead of drop-down box. » limit as textfield, instead of select list
Version: 6.x-2.0-alpha1 » 6.x-2.x-dev
StatusFileSize
new1.28 KB

Rerolling for dev branch. Still needs work due to issues raised in #196250: Invitation limit should not be an input field

Bevan’s picture

Assigned: Unassigned » Bevan
Bevan’s picture

Title: limit as textfield, instead of select list » Limit as textfield, instead of select list
Bevan’s picture

Assigned: Bevan » Unassigned
Status: Needs work » Needs review
StatusFileSize
new2.14 KB

This version of the patch addresses the issue raised in #196250: Invitation limit should not be an input field by validating the user input values for role limits. It needs review and some testing.

sun’s picture

Status: Needs review » Needs work

user_roles(0) looks scary. Why?

Bevan’s picture

It is not using user_roles(0) to set any values, just to find keys of values in the form submission ($form_state['values']). I copied this iteration technique from:

function invite_settings() {
  $roles = user_roles(0, 'send invitations');
  // ...

  foreach ($roles as $role) {
    $role_no_space = str_replace(' ', '_', $role);
    $form['role'][$role_no_space] = array(
      '#type' => 'fieldset',
      '#title' => t('@role settings', array('@role' => drupal_ucfirst($role))),
      '#collapsible' => TRUE,
      '#collapsed' => TRUE,
    );
    // ...
  }
  // ...
}

There are 5 other places in invite.module and invite.install that already use user_roles(0) in this way (and one that uses user_roles(1)).

Ideally they would use booleans FALSE and TRUE instead of integers, but that is a separate issue.

Also, in this case, passing any different parameters such as user_roles(1) would be an error, since users invited by anonymous users would not gain anonymous users' target role. Though implementing invite.module in this way would probably be an error of it's own (on the part of the configurator)!

comrax’s picture

Are you going to integrate this into 2.x-DEV?

avpaderno’s picture

Issue summary: View changes
Status: Needs work » Closed (outdated)

I am closing this issue, since it's for a Drupal version no longer supported.