X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/timetracker.git/blobdiff_plain/30f870da6d0f5d73cd6f33ab284ff45559d1ee13..35a538725eb9bc8a651a012a7bccc546aa22e6b2:/user_add.php diff --git a/user_add.php b/user_add.php index 8a507e9e..9fa61129 100644 --- a/user_add.php +++ b/user_add.php @@ -157,7 +157,13 @@ if ($request->isPost()) { 'client_id' => $cl_client_id, 'projects' => $assigned_projects, 'email' => $cl_email); - if (ttUserHelper::insert($fields)) { + $user_id = ttUserHelper::insert($fields); + if ($user_id) { + if (!$user->exists()) { + // We added a user to an empty subgroup. Set new user as on behalf user. + // Needed for user-based things to work (such as notifications config). + $user->setOnBehalfUser($user_id); + } header('Location: users.php'); exit(); } else