Download & Extend

Create a way to bulk assign assign user's default domain

Project:Domain User Default
Version:6.x-1.0
Component:Miscellaneous
Category:feature request
Priority:normal
Assigned:Unassigned
Status:active

Issue Summary

I want to know whether it is possible in Domain Access module to assign users to their respective domains. I have been looking at domain user default module lately and I can't say whether it is capable of doing this or not.

Does anyone have a clue?

Thank you.

Comments

#1

What do you mean with assign users to their respective domains? Domain User Default sets a single domain as user's default domain.

#2

Status:active» postponed (maintainer needs more info)

#3

Status:postponed (maintainer needs more info)» active

When registering, users choose a default domain.

After registration, is it possible for site admin to do a mass update on many users' default domains, instead of having to edit each account one by one?

And can we do a mass update on their Domain Access settings?

#4

Title:Assigning users to their respective domain» Create a way to bulk assign assign user's default domain
Category:support request» feature request
Priority:critical» normal

No, it is not possible at the moment. Changing this to feature request - ideally this would be similar to Domain Access' "Assign users to domains/Affiliate editor options".

#5

Thank you. This option would be very helpful.

#6

I use an "Add user to this domain" VBO action -- I am adding this to a custom site-specific module and the action assigns the selected users to the 'active' domain. This may need some expansion (a select list of available domains instead of assuming the active) to be fit for inclusion in the module.

<?php
/**
* Implementation of hook_user_operations().
*/
function MYMODULE_user_operations() {
  return array(
     
'MYMODULE_assign_default_domain' => array(
       
'label' => t('Assign to this domain'),
       
'callback' => 'MYMODULE_assign_default_domain',
      ),                                       
  );                                         
}

function
MYMODULE_assign_default_domain($users, $options) {
  global
$_domain;                       

 
module_load_include('inc', 'domain_user_default');

 
$edit = array('default_domain' => $_domain['domain_id']);      
  foreach(
$users as $uid) {                                                                 
     
$account = user_load($uid);
   
_domain_user_default_user_update(null, $edit, $account);
  }
}    
?>
nobody click here