when masqueraded users make node revisions, the author of those revisions is the fake user and not the real one. It should be set to "real user" or "real user masqueraded by fake user", is that possibile?

Thanks, bye
Maurizio

Comments

mauriziopinotti’s picture

for anyone iterested in a working solution for that issue I added in my custom module this code:

/**
 * Implements hook_node_update().
 */
function casaconvenienza_node_update($node) {
  // When masqueraded users add new revisions the revision uid should be set to the real user's uid
  if ($node->revision && !empty($_SESSION['masquerading']) && $node->vid) {
    db_query("UPDATE {node_revision} SET uid=:uid WHERE vid=:vid",
      array(':uid' => intval($_SESSION['masquerading']), ':vid' => $node->vid));
  }
} // casaconvenienza_node_update

Altering database directly is not a good idea but AFAIK there's no hook to edit revision uid, here is the relevant node.module part in node_save() function:

      if (!empty($node->revision)) {
        _node_save_revision($node, $user->uid);
      }

The revision uid is set from current user object.

nvahalik’s picture

Issue summary: View changes
Status: Active » Closed (won't fix)

This is what Masquerade does. It allows you to assume the identity of another user on the site.