Moved group sync

This commit is contained in:
snipe 2016-06-15 11:51:10 -07:00
parent 1efa69e51f
commit 464ecc7cc6

View file

@ -114,15 +114,16 @@ class UsersController extends Controller
$data['password'] = $request->input('password');
}
if ($user->save()) {
if ($request->has('groups')) {
$user->groups()->sync($request->input('groups'));
} else {
$user->groups()->sync(array());
}
if ($user->save()) {
if (($request->input('email_user') == 1) && ($request->has('email'))) {
// Send the credentials through email
$data = array();