+ $markedDeleted = ttGroupHelper::markGroupDeleted($group_id);
+ if ($markedDeleted) {
+ if ($group_id == $user->group_id) {
+ // We marked deleted our own group. Logout and redirect to login page.
+ $auth->doLogout();
+ session_unset();
+ header('Location: login.php');
+ exit();
+ } else {
+ // We marked deleted a subgroup.
+ if ($user->behalfGroup && $user->behalfGroup->id == $group_id)
+ $user->setOnBehalfGroup($user->group_id); // Remove on behalf group from session.
+ header('Location: success.php');
+ exit();
+ }