Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent same account on multiple sites in Multisite #256

Open
iandunn opened this issue Jan 20, 2016 · 2 comments
Open

Prevent same account on multiple sites in Multisite #256

iandunn opened this issue Jan 20, 2016 · 2 comments

Comments

@iandunn
Copy link
Contributor

iandunn commented Jan 20, 2016

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:

  1. 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.

  2. 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.

@iandunn
Copy link
Contributor Author

iandunn commented Jan 21, 2016

We should also notify all parties that the account has been removed from the previous site. The current site's user should get an admin notice, and the previous site's admin should get an email.

@iandunn
Copy link
Contributor Author

iandunn commented Jan 11, 2017

It might be simpler to just prevent adding the new account if we detect it's being used elsewhere. That way the admin is responsible for removing it and dealing with the consequences.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant