Closed (fixed)
Project:
Drupal core
Version:
x.y.z
Component:
user system
Priority:
Normal
Category:
Feature request
Assigned:
Reporter:
Created:
26 Jul 2006 at 04:27 UTC
Updated:
19 Aug 2006 at 19:00 UTC
Jump to comment: Most recent file
Comments
Comment #1
hunmonk commentedoh, and of course a nice demo site here:
http://useradmin.xcarnated.com/
Comment #2
michelleAwesome! I run a site that lets anyone join but club members get a special role. This would make it much easier to see at a glance if I have everyone on the right role and correct any ones that aren't.
Michelle
Comment #3
hunmonk commentedsome touchups to the patch. i changed the markings for roles that a user already has to a leading asterisk--seems easier to read to me. also added a 'Select/View' option to the dropdowns, as it seems to make the interface come together a little better, and allowed me to get rid of the conditional display code for the roles column.
Comment #4
eaton commentedA major +1 for this functionality. Dealing with users in batches is a real pain, and role-adding is just as bad.
Haven't had a chance to apply the patch yet but I've used it on the test site. Will comment further when I am able to apply it.
Comment #5
hunmonk commentedok, i've revamped the approach for roles, and i'm much happier with the result. roles column for users is now a collapsible fieldset which lists their current roles--this allows for a quick look at that detail w/o clogging the table with a constant display, plus all those dropdowns in the table were a bit ugly and confusing.
i moved the mass adding/deleting of roles straight to the update dropdown inside of optgroups, which seems more intuitive to me--just select the role to mass add/delete, check the users it applies to, and click update.
while this version loses the ability to mass add/delete different roles for different users at the same time, i don't think it's a big loss compared to how much cleaner and more intuitive the interface is now.
you can check out the upgrade here: http://useradmin.xcarnated.com/
Comment #6
hunmonk commentedstupid me--not using theme_item_list where i should... :)
attached patch corrects this.
demo site: http://useradmin.xcarnated.com/
Comment #7
hunmonk commentedlooks like a cache_clear_all was added to the admin/node submit function. since this function basically mirrors that, i figured i should throw that in here as well...
demo site: http://useradmin.xcarnated.com/
Comment #8
jivyb commentedI might have missed it on the demo, but I'd love to see an option to check all or uncheck all. I think the content admin page really needs this too...(sorry I know that is irrelevant here:)
Comment #9
hunmonk commented@jivyb: would be nice, but out of scope for this patch, i think.
Comment #10
hunmonk commentedsomewhere along the way i broke the updates for blocking and unblocking users--i'll attend to that shortly. also, after some discussion on irc, i'm persuaded to make some changes in the roles column display. the consensus seemed to be that if collapsible form groups are going to be used:
i'll play with those ideas tonight and get something posted which addresses those points.
Comment #11
hunmonk commentedok, latest fixes to address the issues in the post above. all role rows are wrapped in collapsible fieldsets now, which gives a lot more visual consistency. for convenience, any users w/ 2 or less roles have the fieldset open so the roles can be viewed.
demo site: http://useradmin.xcarnated.com/
Comment #12
dries commentedCool feature but the fieldset looks really,really weird (please take it out, if the user filtering patch in is available, it shouldn't really matter). I'm traveling so I don't have time to review the code.
Comment #13
hunmonk commentedattached patch removes the collapsible fieldsets from around the role column. i also removed the auth user from the roles listing--seems wasteful as every user has the role.
Comment #14
dries commentedCode looks good, functionality is great. Your test site is down though.
The only thing that looks a little bit weird is:
Is this proper use of the forms API?
Instead of writing:
write:
Comment #15
hunmonk commentedThanks :) sorry about the test site--i'm out of town, the server is down, and won't be able to get it back up until later tonight.
this is the exact same implementation that admin/node uses, and i'm not really sure there's a better way to do it. the problem is that since it's a delete op, there's a confirmation screen, which kind of makes this page a two-stage form for deletions only. it doesn't really work very well to put the delete stuff in the _submit function, as you can't call another drupal_get_form while you're in the middle of executing another one... :) i'm open for suggestions for a better implementation...
attached patch corrects this.
Comment #16
hunmonk commented...and the patch... :)
Comment #17
hunmonk commentedbroken by the admin patch. updated patch attached. apologies for the test site not being up. i'll get that remedied shortly...
Comment #18
dries commentedPlease spit the user_operation callbacks in separate functions and document them properly (cfr. node operations). Thanks.
Comment #19
hunmonk commentedok, broke out the mass ops into seperate functions, and properly doc'd. got rid of the call back arg stuff in the submit function. also fixed some bad paths in the delete confirm form b/c of the admin patch. i think she's ready to go!
test site is working again as well: http://useradmin.xcarnated.com/
Comment #20
chx commentedFor some reason, sorting on test site is by uid and not name though from teh code it looks OK.
array_diff($edit['accounts'], array(0));isn't this a baroque way of saying
array_filter($edit['accounts'])?form_set_error('', t('Please select some users to perform the delete operation.')); we sure that there is no better way to this? looks a very little bit hackish.
db_query('INSERT INTO {users_roles} VALUES(there missing a space.these are just small things. nice job.
Comment #21
hunmonk commented@chx: thanks for these. i'm busy today and tomorrow, but will attend to the patch the next day.
Comment #22
hunmonk commented@chx: ok, all of your concerns have been addressed.
the sorting problem had to do w/ the fact that i wasn't including the data key in the $header array during the form building function, since i thought it wasn't really needed until the theming function. however, the tablesorting code does in fact need that key in order to process the sorting request. given the fact that sometimes the form building code and theming code are in different functions now, we might want to examine the tablesort code and streamline it for these cases--it seems wasteful to me to have to include the entire $header array in both the form building and form theming functions. for now, though, it does seem like the correct approach.
i decided to get rid of that whole optional message thing in the validation code--it seems like overkill to me. now if no users are selected, you simply get a "No users selected" warning message. btw, that dual message approach was copied from the node admin code, so we might want to clean that up as well. :)
updated patch attached.
test site: http://useradmin.xcarnated.com/
Comment #23
hunmonk commentedComment #24
chx commentedThe test site seems working. I found no glaring code errors.
Comment #25
drummCommitted to HEAD.
Comment #26
(not verified) commented