-
Notifications
You must be signed in to change notification settings - Fork 12
Description
If SupportFlow is running in a Multisite instance, we should prevent the same account from being used on multiple sites, because that could result in messages being delivered to both.
See https://wordpress.slack.com/archives/events/p1447084257000192
This is my first thought on how to approach it:
-
We'd have a site-wide option with an array that maps a hash of the
{imap hostname, smtp hostname, account username}to the site ID. e.g.,array( '234adsfa3h42af234' => 23, '23jadf2348adfs324' => 104, etc ). The hash should be the key instead of the value, because there can be multiple unique accounts on a single site, and the array entry would be overridden if the ID was the key. -
Whenever a new account is added, the option is checked to see if that hash exists in the array. If it does, then the account is removed from that site and added to the current site, and the hash is updated. If the hash doesn't already exist, then the account is added and the hash is added to the option.