The roles assigned to the site user disappear from the table shown in the Members list.
This happens at the moment when the user logs on to the site. The problem is reproduced if the user is included in the LDAP group. LDAP server must be run.

db_query("DELETE FROM {site_user_list_roles} WHERE uid = %d", $uid);
if (!empty($roles_final)) {
  db_query("INSERT INTO {site_user_list_roles} (uid, roles) VALUES (%d, '%s')", $uid, theme('item_list', $roles_final));
}

$roles_final may be empty. A list of user roles is removed, but not overwritten.

CommentFileSizeAuthor
#1 patch_site_user_list_roles.patch168 bytesmaxim.glibin

Comments

maxim.glibin’s picture

Assigned: maxim.glibin » Unassigned
Status: Active » Fixed
StatusFileSize
new168 bytes

In order to fix the problem it is necessary to write the following:

if (!empty($roles_final)) {
  db_query("DELETE FROM {site_user_list_roles} WHERE uid = %d", $uid);
  db_query("INSERT INTO {site_user_list_roles} (uid, roles) VALUES (%d, '%s')", $uid, theme('item_list', $roles_final));
}

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.