Wouldn't it be better to update the database with a unique index on e-mail and usertype?
I mean something like
Code:
ALTER TABLE xcart_customers ADD UNIQUE (usertype, email);
So it would be possible to have a provider, admin and customer account (for testing) on the same e-mail address.
What do you think?
Hope to hear from you soon.
Best wishes,
Marc