Needs review
Project:
Subuser
Version:
6.x-1.x-dev
Component:
User interface
Priority:
Critical
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
27 May 2009 at 22:20 UTC
Updated:
9 May 2017 at 13:32 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
boombatower commentedThe profile fields could be done by copying the code that profile uses to add them (I believe hook_form_alter()). I would have used the core registration form, but it contains a permission check that screws everything up.
Not currently, but you should be able to implement hook_user() and on create check if user has a subuser table record with a parent and if so activate them.
Let me know if that works or you need more details.
Comment #2
z33k3r commentedWell the thing is that I need different criteria for these subusers... so different from the main registration. I guess this is a new area for me, if you could follow with a bit more specific detail (not necessarily line for line) but just more specific on what would be involved?
Comment #3
z33k3r commentedCould you at least include the basic fields by default (ie: First Name, Last Name)... I could customize the code to meet my needs, but I would rather see it done the right, communal/Drupal, way!
Comment #4
boombatower commentedCould add a bit of this into subuser, if you end up implementing something post back a patch and I'll review it and possibly commit.
You want to look at
user_register()in/modules/user/user.modulespecifically at the code that allows other modules to define form elements. Profile module defines them this way.The profile modules
/modules/profile/profile.moduleadds its elements to the default registration form viahook_user()[profile_user()] which returns the form generated by:The best solution would be to include the code above, from user.module, in subuser registration form [subuser_create_form()].
Good luck, let me know if you need any help and how it turns out.
Comment #5
Rosamunda commentedIt would be great if this could work with content_profile module, so the mandatory fields to be filled in inside the profile for role X could be inside the subuser form (for users that would be created and integrated to that role X).
Comment #6
boombatower commentedIt is really sad that the build in Drupal form is written so poorly and does an access check inside the form definition, otherwise I could use that and all these integrations would be automatic.
I think I'll look into changing that in D7.
Comment #7
dublin drupaller commented@rosamunda #5
Did you find a workaround for that? I'm facing the same problem..i.e. fields to be filled in inside the profile for role X could be inside the subuser form (for users that would be created and integrated to that role X).
Comment #8
Liembo-1 commentedHaving the ability for the admin of a subuser be able to populate the defined user profile fields would be a huge bonus for this module. Its very nearly a deal-breaker for me that it does not, unfortunately. I'm going to look through your suggestions above, however, and see if is possible to work around. I want to put the bulk of user set up (firstname/lastname/vitals/etc) where possible on the admin, rather than the potentially un-savvy end user, so any progress on this direction of work would be greatly appreciated.
Comment #9
rcharamella commentedHas there been any movement on this issue? I'm facing much the same problem as outlined above.
Comment #10
z33k3r commentedNo. There hasn't been. I haven't had any time to learn what needs to be written for this and it looks like the author doesn't care either... :(
Comment #11
stella commentedsubscribe
Comment #12
stella commentedAttached patch should do it. It's the same approach as described in comment #4 above. I've tested it and it seems to work quite well.
Comment #13
jeffreyvddb commentedPatch looks good: the fields are there.. But there is one thing: I've got two dropdowns on the registration form (State and Country), which have options in the normal registration form. On the 'Create Subuser' form, these dropdowns have no options.. Two other dropdowns (Title and a list of 11 Industries) are shown. Could it be related to the amount of options? Any ideas how to fix this?
Comment #14
anoui got this error with the patch :
warning: array_merge(): Argument #2 is not an array in /sites/all/modules/subuser/subuser.pages.inc on line 236.
but i use content profile and not profile...
Comment #15
mlalu commentedThanks for the patch. This might be asking for too much, but I use the profile role module which allows me to only require certain profile categories based on which role they are signing up for. Is it possible for me to change this line of code that the patch inserts, to only add a certain profile category?
$extra = _user_forms($null, NULL, NULL, 'register');Comment #16
smartsystems160 commented@anou. These patches seem to do the work for content profile module http://drupal.org/node/571660
Comment #17
adigunsherif commentedFor users who may be after Drupal 7, create a module and place this in your .module file
NB: CHANGE profile_name to the name of your profile
If you want to be sure that this profile only shows when the current user that is creating a subuser has a particular role, you can use this
NB: CHANGE the_role to the name of the role you want to check.