eve-seat / seat

SeAT 0x. [UNSUPPORTED]
https://github.com/eveseat/seat
MIT License
69 stars 38 forks source link

fix addition of new user with admin checked, issue #320 #321

Closed gattebury closed 9 years ago

gattebury commented 9 years ago

User creation would fail when 'Superuser' was checked with the following: http://pastebin.com/hMfDrjuG

This would occur in postNewUser() as there is no addGroup method. Changed things to use Auth::addUserToGroup() as is done elsewhere in the code.

The $user->save() had to be moved above this logic in order to avoid a constraint violation (need the user_id to exist before addUserToGroup can do its stuff).