AuthManager: Break AuthPlugin::addUser more explicitly
commit677c66b31ecfadc48733396ed7c729847875fe21
authorBrad Jorsch <bjorsch@wikimedia.org>
Sun, 10 Jul 2016 13:09:43 +0000 (10 09:09 -0400)
committerBrad Jorsch <bjorsch@wikimedia.org>
Sun, 10 Jul 2016 13:17:42 +0000 (10 09:17 -0400)
tree8c02a3fba53d71679bc7ec8654ad83a47dfa05f1
parent86c82492ecf34bf2fbc140a61b148be7f203d772
AuthManager: Break AuthPlugin::addUser more explicitly

AuthPlugin::addUser() is intended to only touch the external database
without creating a local user, which isn't possible under AuthManager
without reproducing too much of AuthManager's account creation methods
(and risking breaking things in even more obscure ways) to be
worthwhile.

As it is, either this will fail because the caller already called
User::addToDatabase() or the caller's subsequent User::addToDatabase()
call will fail because we're creating the local user.

So instead, let's just throw an exception unconditionally instead of
pretending it could work.

Bug: T137843
Change-Id: I8a439ea190c752a7fc49de5617e2c64c314c38f0
includes/auth/AuthManagerAuthPlugin.php