First of all....the subuser module is great! I'm excited to have it.
There are two scenarios i'm facing that I'm not sure if subuser can support....i'm hoping for a few page.tpl.php tweaks or template.php overrides can help.....anyone know?

1) Lets say i'm logged in as a subuser....I perform actions that generate system emails (webform submission, a Rule where when a user's role is changed that user is notified). Is there any way to associate the parent to this subaccount so they receive the same email communications? Basically, cc'ing the parent when email is invoked by the system for a subuser.....

2) On the /user page you see a list of all subusers with an edit or switch action. Greta idea! Is there a way once you switch to a subuser, to have a link/button persistent maybe in the login block to have a 'switch back' functionality which in essence returns to the original session?

CommentFileSizeAuthor
#4 subuser_cc_parent-765944-4.patch1.33 KBshawn dearmond

Comments

Dublin Drupaller’s picture

I agree, it's a superb module.

quick answer to (2)...your 1st question sounds a little involved.

you could use the $_SESSION['subuser_uid'] to setup your own block with a large "logout (return)" button and control the visibility settings for that block..using something like this:

<?php
  if (isset($_SESSION['subuser_uid'])) {
    return TRUE;  // block will be shown
  }
  return FALSE;
?>

hope that helps

dub

shawn dearmond’s picture

Version: 6.x-1.2 » 6.x-1.x-dev

I am particularly interested in your request #1, so I'm going to take a stab at it.

My feeling is that hook_mail_alter() could be used to simply CC the parent(s) whenever the subuser is sent mail. However, it should probably be configurable to some extent.

shawn dearmond’s picture

Title: Drupal being aware of the "parent" user » CC parent when subuser is sent email.
Category: task » feature

Let's call it a "feature request".

Also, forgive me for hijacking this issue, but it's like two years old. It looks like the second part of the request was solved, so let's rename this issue to focus on the first part.

shawn dearmond’s picture

Status: Active » Needs review
StatusFileSize
new1.33 KB

Here's a patch that does this. It is configurable on the subuser settings page.

lauriii’s picture

Issue summary: View changes
Status: Needs review » Closed (fixed)

Committed and pushed! Thanks!

DrCord’s picture

I was able to apply this with some changes and another patch to the 7.x branch of the module and it works great.