> I understand -- that does work better from the perspective
> of the larger
> design goals. The question then becomes: at what point do
> you declare the
> user ID of the person performing the change as
> APP_SYSTEM_USER_ID? In
> download_emails.php, and thread it through all the calling
> methods until the
> correct value is handed off to Auth::getUserID()?
> I can work on that if that's how you'd rather see it implemented.
Yes, please. The user ID of the person performing the change is passed
to Issue::createFromEmail() as the second parameter ($usr_id). That
comes from Support::getEmailInfo() [which is a terrible choice for a
So anyway, all we need to do is pass that $usr_id parameter to
Issue::addUserAssociation() and replace the Auth::getUserID() calls