? 486370-language-bug.patch ? 490846-admin.patch ? 490846-user-enable.patch ? 490846-user-management.patch ? domain_views/485762-views.patch Index: INSTALL.txt =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/domain/INSTALL.txt,v retrieving revision 1.21 diff -u -p -r1.21 INSTALL.txt --- INSTALL.txt 7 Jun 2009 19:03:10 -0000 1.21 +++ INSTALL.txt 14 Jun 2009 19:25:13 -0000 @@ -17,6 +17,7 @@ CONTENTS 2.2 Server Configuration 2.3 Setting DOMAIN_INSTALL_RULE 2.4 Setting DOMAIN_SITE_GRANT +2.5 Setting DOMAIN_ASSIGN_USERS 3. Installing the Module 3.1 After Installation 4. Configuring settings.php @@ -202,6 +203,29 @@ be viewable on all domains. Normally, you will not need to edit this value. ---- +2.5 Setting DOMAIN_ASSIGN_USERS + +At the top of the domain.module file, you will find this line: + + define('DOMAIN_ASSIGN_USERS', TRUE); + +After you install the Domain Access module, all new users who +register will automatically be assign to the domain from which +their account was created. This value is used to determine +advanced editing access and can be used by modules such as +Domain Strict. + +On install, setting this value to TRUE will assign all current users +to be members of the default domain. Set the value to FALSE +and the module will not assign users to any domains. + +Normally, you will not need to edit this value. + +After installation and configuration, users with the appropriate +permissions may batch assign users to domains from +Administer > User Management > Users. + +---- 3. Installing the Module After you have prepared your server and made any edits to the Index: README.txt =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/domain/README.txt,v retrieving revision 1.59 diff -u -p -r1.59 README.txt --- README.txt 13 Jun 2009 18:31:27 -0000 1.59 +++ README.txt 14 Jun 2009 19:25:14 -0000 @@ -56,6 +56,7 @@ CONTENTS 4.8.2 Domain Node Types 4.9 Batch Updating 4.10 Assigning Users to Domains +4.11 Batch Assignment of Users to Domains 5. Blocks 5.1 Block -- Domain Switcher 5.2 Block -- Domain Access Information @@ -931,6 +932,28 @@ Settings for the 'new user' are permanen See http://drupal.org/node/313629 for some background about this feature. ---- +4.11 Batch Assignment of Users to Domains + +In 6.x.2 and higher, users with the 'administer users' and 'assign domain +editors' permissions may use the User administration page to batch assign +users to domains. + +This feature is useful if you need to convert a group of editorial users to +become domain editors. + +To use this feature, navigate to Administer > User management > Users. +Look for the 'Assign users to domains' option in the 'Update options' select +form. Choose this operation and then use the 'Affiliate editor options' +fieldset to select the domains you wish to assgin users to. + +Select the desired users and hit the Update button. + +Note that this form also shows you a list of domains that a user is +currently assigned to. + +If these elements do not appear, you do not have the proper permissions. + +---- 5. Blocks The Domain Access module provides two blocks, which can be used to help you Index: domain.admin.inc =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/domain/domain.admin.inc,v retrieving revision 1.29 diff -u -p -r1.29 domain.admin.inc --- domain.admin.inc 13 Jun 2009 20:02:39 -0000 1.29 +++ domain.admin.inc 14 Jun 2009 19:25:16 -0000 @@ -818,6 +818,50 @@ function domain_batch_form($form_state, /** * FormsAPI */ +function theme_domain_admin_users_form($form) { + // Overview table: + $header = array( + theme('table_select_header_cell'), + array('data' => t('Username'), 'field' => 'u.name'), + array('data' => t('Status'), 'field' => 'u.status'), + t('Roles'), + t('Domains'), + array('data' => t('Member for'), 'field' => 'u.created', 'sort' => 'desc'), + array('data' => t('Last access'), 'field' => 'u.access'), + t('Operations') + ); + + $output = drupal_render($form['options']); + $output .= drupal_render($form['domain']); + if (isset($form['name']) && is_array($form['name'])) { + foreach (element_children($form['name']) as $key) { + $rows[] = array( + drupal_render($form['accounts'][$key]), + drupal_render($form['name'][$key]), + drupal_render($form['status'][$key]), + drupal_render($form['roles'][$key]), + drupal_render($form['user_domains'][$key]), + drupal_render($form['member_for'][$key]), + drupal_render($form['last_access'][$key]), + drupal_render($form['operations'][$key]), + ); + } + } + else { + $rows[] = array(array('data' => t('No users available.'), 'colspan' => '7')); + } + + $output .= theme('table', $header, $rows); + if ($form['pager']['#value']) { + $output .= drupal_render($form['pager']); + } + + $output .= drupal_render($form); + + return $output;} +/** + * FormsAPI + */ function theme_domain_batch_form($form) { $output = ''; $output = drupal_render($form['message']); Index: domain.module =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/domain/domain.module,v retrieving revision 1.110 diff -u -p -r1.110 domain.module --- domain.module 13 Jun 2009 20:02:39 -0000 1.110 +++ domain.module 14 Jun 2009 19:25:18 -0000 @@ -20,12 +20,18 @@ define('DOMAIN_INSTALL_RULE', TRUE); /** - * Defines whether to show affiliated content on all domains.. + * Defines whether to show affiliated content on all domains. * You may alter this variable before installing the module. See README.txt. */ define('DOMAIN_SITE_GRANT', TRUE); /** + * Defines whether to assign users to the default domain on install. + * You may alter this variable before installing the module. See README.txt. + */ +define('DOMAIN_ASSIGN_USERS', TRUE); + +/** * Adds the domain user data to the $user object. */ function domain_boot() { @@ -211,6 +217,10 @@ function domain_perm() { */ function domain_theme() { $themes = array( + 'domain_admin_users_form' => array( + 'arguments' => array('form' => array()), + 'file' => 'domain.admin.inc', + ), 'domain_batch_form' => array( 'arguments' => array('form' => array()), 'file' => 'domain.admin.inc', @@ -426,6 +436,112 @@ function domain_user($op, &$edit, &$acco } /** + * Implement hook_user_operations(). + */ +function domain_user_operations() { + if (!user_access('assign domain editors')) { + return; + } + return array( + 'domain' => array( + 'label' => t('Assign users to domains'), + 'callback' => 'domain_user_operation_assign', + ), + ); +} + +/** + * Implement hook_form_alter(). + */ +function domain_form_user_admin_account_alter(&$form, $form_state) { + if (!user_access('assign domain editors')) { + return; + } + $options = array(); + foreach (domain_domains() as $data) { + // Cannot pass zero in checkboxes. + ($data['domain_id'] == 0) ? $key = -1 : $key = $data['domain_id']; + // The domain must be valid. + if ($data['valid'] || user_access('administer domains')) { + $options[$key] = check_plain($data['sitename']); + } + } + $form['domain'] = array( + '#type' => 'fieldset', + '#title' => t('Affiliate editor options'), + '#collapsible' => TRUE, + '#collapsed' => TRUE, + '#prefix' => '