Index: og/og.css
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/og/Attic/og.css,v
retrieving revision 1.2.2.10
diff -u -p -r1.2.2.10 og.css
--- og/og.css	2 Apr 2008 21:37:54 -0000	1.2.2.10
+++ og/og.css	2 Dec 2008 05:19:21 -0000
@@ -49,5 +49,12 @@ td.og-picture-grid-item {
 td.og-picture-grid-item .group-role {
   font-style: italic;
 }
-
-
+ 
+/* let the description appear in the correct position */
+#og-invite-form .container-inline .description, #og-add-users .container-inline .description {
+  float: left;
+}
+ 
+#og-invite-form .form-item label, #og-add-users .form-item label {
+  clear: left;
+}
Index: og/og.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/og/og.module,v
retrieving revision 1.298.2.197.2.15
diff -u -p -r1.298.2.197.2.15 og.module
--- og/og.module	2 Nov 2008 20:30:45 -0000	1.298.2.197.2.15
+++ og/og.module	2 Dec 2008 05:19:25 -0000
@@ -18,6 +18,10 @@ define('OG_DIRECTORY_NEVER', 0);
 define('OG_DIRECTORY_ALWAYS', 1);
 define('OG_DIRECTORY_CHOOSE_TRUE', 2);
 define('OG_DIRECTORY_CHOOSE_FALSE', 3);
+ 
+// og forms where username helper is shown
+define('OG_INVITE_FORM', 'og-invite-form');
+define('OG_ADD_USERS', 'og-add-users');
 
 function og_help($section) {
   switch ($section) {
@@ -67,6 +71,13 @@ function og_menu($may_cache) {
       'access' => user_access('administer site configuration')
       );
     $items[] = array('path' => 'admin/og/og', 'callback' => 'drupal_get_form', 'callback arguments' => array('og_admin_settings'), 'title' => t('Organic groups configuration'), 'description' => t('Configure the main Organic groups module (og)'), 'weight' => -5,);
+    $items[] = array(
+      'path' => 'og/username_helper/autocomplete',
+      'callback' => 'user_autocomplete',
+      'access' => user_access('access og username helper'),
+      'type' => MENU_CALLBACK
+    );
+
   }
   else {
     drupal_add_css(drupal_get_path('module', 'og'). '/og.css');
@@ -201,7 +212,7 @@ function og_set_locale() {
  * Implementation of hook_perm().
  */
 function og_perm() {
-  return array('administer organic groups');
+  return array('administer organic groups', 'access og username helper');
 }
 
 /**
@@ -1533,6 +1544,26 @@ function og_form_alter($form_id, &$form)
       '#description' => t('Specify how organic groups should treat nodes of this type. Nodes may behave as a group, as group posts, or may not participate in organic groups at all.'),
     );
   }
+
+  if ($form['#id'] == OG_INVITE_FORM || $form['#id'] == OG_ADD_USERS) {
+   drupal_add_js(drupal_get_path('module', 'og') .'/og_username_helper.js');
+    $form['og_username_helper_text'] = array(
+      '#type' => 'textfield',
+      '#size' => 40,
+      '#maxlength' => 60,
+      '#autocomplete_path' => 'og/username_helper/autocomplete',
+      '#weight' => -2,
+      '#description' => t('Lookup a username and add it to the list below.'),
+      '#prefix' => '<div class="container-inline">',
+    );
+    $form['og_username_helper_add_button'] = array(
+      '#type' => 'button',
+      '#button_type' => 'add',
+      '#value' => t('Add'),
+      '#weight' => -1,
+      '#suffix' => '</div>',
+    );
+  }
 }
 
 // Rebuild node access if Usage has changed
Index: og/og_username_helper.js
===================================================================
RCS file: og/og_username_helper.js
diff -N og/og_username_helper.js
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ og/og_username_helper.js	2 Dec 2008 05:19:25 -0000
@@ -0,0 +1,25 @@
+/* Add usernames to the one of the fields supported */
+Drupal.og_username_helperAutoAttach = function() {
+
+  $("#edit-og-username-helper-add-button").click(function() {
+    if ( $("#edit-og-username-helper-text").val() != '' ) {
+      var coma=',';
+      if ( $("#edit-mails").val() != null) {
+        if ( $("#edit-mails").val() == '')
+          coma='';
+        $("#edit-mails").val($("#edit-mails").val()+coma+$("#edit-og-username-helper-text").val());
+      } else if ( $("#edit-og-names").val() != null ) {
+        if ($("#edit-og-names").val()=='')
+          coma='';
+        $("#edit-og-names").val($("#edit-og-names").val()+coma+$("#edit-og-username-helper-text").val());
+      }
+      $("#edit-og-username-helper-text").val('');
+    }
+    return false;
+  });
+
+}
+
+if (Drupal.jsEnabled) {
+  $(document).ready(Drupal.og_username_helperAutoAttach);
+}
