The title says it all, see attached patch.

Comments

killes@www.drop.org’s picture

StatusFileSize
new4.24 KB

patch contained a stray var-dump

marcp’s picture

Nice patch. I noticed a small problem when moving a user to a role that s/he already belongs to (not something that would normally be done, but the way it fails is to not move the user out of the role they were expecting to be moved from):

user warning: Duplicate entry '5-4' for key 1 query: UPDATE users_roles SET rid = 4 WHERE rid = 5 AND uid IN (5) in /home/drupal/htdocs/includes/database.mysql.inc on line 120.

It would be great if you fixed this -- then I'll commit the patch.

Ideally, I'd rather see a way so that we can use the "assign user roles" tab (admin/user/userplus/userperms) to make this new patch unnecessary. It can be done now, but it's a pain, if not impossible, with a lot of users to only see the ones that are currently in any role. If the "assign user roles" tab had a filter control at the top to allow the administrator to filter out users based on role, and if we added "check all" and "clear all" links or buttons to each column, then we'd pretty much be there in a more flexible way. What do you think?

- Marc

killes@www.drop.org’s picture

fixed patch attached. Also added some error checking.

This patch is different from what you propose. The main use is to quickly get several users _out_ of a role. It is used together with evaluation.module where it is desirable to remove the current students to another role at the end of the term.

killes@www.drop.org’s picture

StatusFileSize
new4.93 KB

and the patch...

marcp’s picture

Status: Needs review » Fixed

Thanks Gerhard -- I committed the patch with a little bit of change to the wording. Also the list of source roles is now in a table instead of a bullet separated list.

venkat-rk’s picture

Thanks, Killes, for this great feature.

Anonymous’s picture

Status: Fixed » Closed (fixed)