Cross reference csv userlist against new users

Is there a sql script that could be created that can check a username against an xls file or fully imported list in sql that can do one of two things:

When user signs up, discourse already can put an account on hold for admin verification. Is there a way to write a custom plugin that functions through that rule/option that will say:

  • check username against forum2 master list.
    • if user is in group 1 (matching name) place user into a group (verification_required_conflicting_username)
    • if username not in master list, place user into group (confirmed_non_conflicting_username)

Either way set a rule (plugin or sql code) that auto confirms the user’s forum account (our forum) for immediate use, but dump users into one of 2 separate groups upon signup dependent on username matching/not matching on spreadsheet or sql database.

Between the native discourse capibilities to interrupt user account verification so admin can confirm account, and sql code capibilities to auto award badges based on database criteria, there’s gotta be a way to write something to do this.

We need some serious guru powers here.
@sam @codinghorror