2021-06-26 17:23:15 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace BookStack\Http\Controllers;
|
2015-08-08 21:05:30 +02:00
|
|
|
|
2018-09-25 13:30:50 +02:00
|
|
|
use BookStack\Auth\Access\SocialAuthService;
|
2022-02-13 13:56:26 +01:00
|
|
|
use BookStack\Auth\Queries\AllUsersPaginatedAndSorted;
|
|
|
|
use BookStack\Auth\Role;
|
2018-09-25 13:30:50 +02:00
|
|
|
use BookStack\Auth\User;
|
2018-09-25 17:58:03 +02:00
|
|
|
use BookStack\Auth\UserRepo;
|
2021-03-10 00:06:12 +01:00
|
|
|
use BookStack\Exceptions\ImageUploadException;
|
2018-12-30 17:11:58 +01:00
|
|
|
use BookStack\Exceptions\UserUpdateException;
|
2019-05-04 16:48:15 +02:00
|
|
|
use BookStack\Uploads\ImageRepo;
|
2021-03-10 00:06:12 +01:00
|
|
|
use Exception;
|
2018-09-25 17:58:03 +02:00
|
|
|
use Illuminate\Http\Request;
|
2022-01-19 20:46:38 +01:00
|
|
|
use Illuminate\Support\Facades\DB;
|
2021-12-18 17:31:48 +01:00
|
|
|
use Illuminate\Validation\Rules\Password;
|
2021-03-10 00:06:12 +01:00
|
|
|
use Illuminate\Validation\ValidationException;
|
2015-08-08 21:05:30 +02:00
|
|
|
|
|
|
|
class UserController extends Controller
|
|
|
|
{
|
2022-08-09 13:40:59 +02:00
|
|
|
protected UserRepo $userRepo;
|
|
|
|
protected ImageRepo $imageRepo;
|
2015-08-08 21:05:30 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* UserController constructor.
|
|
|
|
*/
|
2022-02-04 01:26:19 +01:00
|
|
|
public function __construct(UserRepo $userRepo, ImageRepo $imageRepo)
|
2015-08-08 21:05:30 +02:00
|
|
|
{
|
2015-09-06 13:14:32 +02:00
|
|
|
$this->userRepo = $userRepo;
|
2019-05-04 16:48:15 +02:00
|
|
|
$this->imageRepo = $imageRepo;
|
2015-08-08 21:05:30 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Display a listing of the users.
|
|
|
|
*/
|
2016-05-22 11:44:31 +02:00
|
|
|
public function index(Request $request)
|
2015-08-08 21:05:30 +02:00
|
|
|
{
|
2016-03-05 13:09:09 +01:00
|
|
|
$this->checkPermission('users-manage');
|
2016-05-22 11:44:31 +02:00
|
|
|
$listDetails = [
|
2017-11-19 16:56:06 +01:00
|
|
|
'search' => $request->get('search', ''),
|
2022-10-29 16:23:21 +02:00
|
|
|
'sort' => setting()->getForCurrentUser('users_sort', 'name'),
|
|
|
|
'order' => setting()->getForCurrentUser('users_sort_order', 'asc'),
|
2016-05-22 11:44:31 +02:00
|
|
|
];
|
2022-02-13 13:56:26 +01:00
|
|
|
|
|
|
|
$users = (new AllUsersPaginatedAndSorted())->run(20, $listDetails);
|
2021-01-10 23:43:22 +01:00
|
|
|
|
2016-12-04 17:51:39 +01:00
|
|
|
$this->setPageTitle(trans('settings.users'));
|
2022-10-29 16:23:21 +02:00
|
|
|
$users->appends(['search' => $listDetails['search']]);
|
2021-06-26 17:23:15 +02:00
|
|
|
|
2022-02-13 13:56:26 +01:00
|
|
|
return view('users.index', [
|
2022-02-13 14:16:43 +01:00
|
|
|
'users' => $users,
|
|
|
|
'listDetails' => $listDetails,
|
2022-02-13 13:56:26 +01:00
|
|
|
]);
|
2015-08-08 21:05:30 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Show the form for creating a new user.
|
|
|
|
*/
|
|
|
|
public function create()
|
|
|
|
{
|
2016-02-27 20:24:42 +01:00
|
|
|
$this->checkPermission('users-manage');
|
2016-01-13 23:22:30 +01:00
|
|
|
$authMethod = config('auth.method');
|
2022-02-13 13:56:26 +01:00
|
|
|
$roles = Role::query()->orderBy('display_name', 'asc')->get();
|
2022-01-31 23:15:21 +01:00
|
|
|
$this->setPageTitle(trans('settings.users_add_new'));
|
2021-06-26 17:23:15 +02:00
|
|
|
|
2019-04-06 17:21:20 +02:00
|
|
|
return view('users.create', ['authMethod' => $authMethod, 'roles' => $roles]);
|
2015-08-08 21:05:30 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2022-02-04 01:26:19 +01:00
|
|
|
* Store a new user in storage.
|
2021-06-26 17:23:15 +02:00
|
|
|
*
|
2021-03-10 00:06:12 +01:00
|
|
|
* @throws ValidationException
|
2015-08-08 21:05:30 +02:00
|
|
|
*/
|
|
|
|
public function store(Request $request)
|
|
|
|
{
|
2016-02-27 20:24:42 +01:00
|
|
|
$this->checkPermission('users-manage');
|
2016-01-17 16:20:07 +01:00
|
|
|
|
|
|
|
$authMethod = config('auth.method');
|
2019-08-18 14:11:30 +02:00
|
|
|
$sendInvite = ($request->get('send_invite', 'false') === 'true');
|
2022-02-04 01:26:19 +01:00
|
|
|
$externalAuth = $authMethod === 'ldap' || $authMethod === 'saml2' || $authMethod === 'oidc';
|
|
|
|
$passwordRequired = ($authMethod === 'standard' && !$sendInvite);
|
2019-08-18 14:11:30 +02:00
|
|
|
|
2022-02-04 01:26:19 +01:00
|
|
|
$validationRules = [
|
2022-08-09 13:40:59 +02:00
|
|
|
'name' => ['required', 'max:100'],
|
2022-02-08 16:29:58 +01:00
|
|
|
'email' => ['required', 'email', 'unique:users,email'],
|
2022-08-04 18:24:04 +02:00
|
|
|
'language' => ['string', 'max:15', 'alpha_dash'],
|
2022-02-04 01:26:19 +01:00
|
|
|
'roles' => ['array'],
|
|
|
|
'roles.*' => ['integer'],
|
2022-02-08 16:29:58 +01:00
|
|
|
'password' => $passwordRequired ? ['required', Password::default()] : null,
|
2022-02-04 01:26:19 +01:00
|
|
|
'password-confirm' => $passwordRequired ? ['required', 'same:password'] : null,
|
|
|
|
'external_auth_id' => $externalAuth ? ['required'] : null,
|
|
|
|
];
|
2022-01-24 21:55:03 +01:00
|
|
|
|
2022-02-04 01:26:19 +01:00
|
|
|
$validated = $this->validate($request, array_filter($validationRules));
|
2022-01-24 21:55:03 +01:00
|
|
|
|
2022-02-04 01:26:19 +01:00
|
|
|
DB::transaction(function () use ($validated, $sendInvite) {
|
|
|
|
$this->userRepo->create($validated, $sendInvite);
|
2022-01-19 20:46:38 +01:00
|
|
|
});
|
2021-06-26 17:23:15 +02:00
|
|
|
|
2016-02-16 22:25:11 +01:00
|
|
|
return redirect('/settings/users');
|
2015-08-08 21:05:30 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Show the form for editing the specified user.
|
|
|
|
*/
|
2019-12-29 14:02:26 +01:00
|
|
|
public function edit(int $id, SocialAuthService $socialAuthService)
|
2015-08-08 21:05:30 +02:00
|
|
|
{
|
2019-04-27 15:18:00 +02:00
|
|
|
$this->checkPermissionOrCurrentUser('users-manage', $id);
|
2015-09-04 21:40:36 +02:00
|
|
|
|
2021-07-14 21:18:48 +02:00
|
|
|
/** @var User $user */
|
2022-02-04 01:26:19 +01:00
|
|
|
$user = User::query()->with(['apiTokens', 'mfaValues'])->findOrFail($id);
|
2016-09-29 13:43:46 +02:00
|
|
|
|
|
|
|
$authMethod = ($user->system_name) ? 'system' : config('auth.method');
|
|
|
|
|
2015-09-04 21:40:36 +02:00
|
|
|
$activeSocialDrivers = $socialAuthService->getActiveDrivers();
|
2021-07-14 21:18:48 +02:00
|
|
|
$mfaMethods = $user->mfaValues->groupBy('method');
|
2016-12-04 17:51:39 +01:00
|
|
|
$this->setPageTitle(trans('settings.user_profile'));
|
2022-02-13 13:56:26 +01:00
|
|
|
$roles = Role::query()->orderBy('display_name', 'asc')->get();
|
2021-06-26 17:23:15 +02:00
|
|
|
|
2019-12-29 14:02:26 +01:00
|
|
|
return view('users.edit', [
|
2021-06-26 17:23:15 +02:00
|
|
|
'user' => $user,
|
2019-12-29 14:02:26 +01:00
|
|
|
'activeSocialDrivers' => $activeSocialDrivers,
|
2021-07-14 21:06:41 +02:00
|
|
|
'mfaMethods' => $mfaMethods,
|
2021-06-26 17:23:15 +02:00
|
|
|
'authMethod' => $authMethod,
|
|
|
|
'roles' => $roles,
|
2019-12-29 14:02:26 +01:00
|
|
|
]);
|
2015-08-08 21:05:30 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Update the specified user in storage.
|
2021-06-26 17:23:15 +02:00
|
|
|
*
|
2018-12-30 17:11:58 +01:00
|
|
|
* @throws UserUpdateException
|
2021-03-10 00:06:12 +01:00
|
|
|
* @throws ImageUploadException
|
|
|
|
* @throws ValidationException
|
2015-08-08 21:05:30 +02:00
|
|
|
*/
|
2020-04-10 13:49:16 +02:00
|
|
|
public function update(Request $request, int $id)
|
2015-08-08 21:05:30 +02:00
|
|
|
{
|
2019-09-19 16:12:10 +02:00
|
|
|
$this->preventAccessInDemoMode();
|
2019-04-27 15:18:00 +02:00
|
|
|
$this->checkPermissionOrCurrentUser('users-manage', $id);
|
2015-12-31 18:57:34 +01:00
|
|
|
|
2022-02-03 17:52:28 +01:00
|
|
|
$validated = $this->validate($request, [
|
2022-08-09 13:40:59 +02:00
|
|
|
'name' => ['min:2', 'max:100'],
|
2021-11-05 01:26:55 +01:00
|
|
|
'email' => ['min:2', 'email', 'unique:users,email,' . $id],
|
2021-12-18 17:31:48 +01:00
|
|
|
'password' => ['required_with:password_confirm', Password::default()],
|
2021-11-05 01:26:55 +01:00
|
|
|
'password-confirm' => ['same:password', 'required_with:password'],
|
2022-08-04 18:24:04 +02:00
|
|
|
'language' => ['string', 'max:15', 'alpha_dash'],
|
2022-02-03 17:52:28 +01:00
|
|
|
'roles' => ['array'],
|
|
|
|
'roles.*' => ['integer'],
|
2022-02-04 02:02:13 +01:00
|
|
|
'external_auth_id' => ['string'],
|
2021-11-05 01:26:55 +01:00
|
|
|
'profile_image' => array_merge(['nullable'], $this->getImageValidationRules()),
|
2015-08-08 21:05:30 +02:00
|
|
|
]);
|
|
|
|
|
2018-12-30 17:11:58 +01:00
|
|
|
$user = $this->userRepo->getById($id);
|
2022-02-03 17:52:28 +01:00
|
|
|
$this->userRepo->update($user, $validated, userCan('users-manage'));
|
2017-01-15 17:27:24 +01:00
|
|
|
|
2019-05-04 16:48:15 +02:00
|
|
|
// Save profile image if in request
|
2020-03-04 00:08:01 +01:00
|
|
|
if ($request->hasFile('profile_image')) {
|
2019-05-04 16:48:15 +02:00
|
|
|
$imageUpload = $request->file('profile_image');
|
|
|
|
$this->imageRepo->destroyImage($user->avatar);
|
|
|
|
$image = $this->imageRepo->saveNew($imageUpload, 'user', $user->id);
|
|
|
|
$user->image_id = $image->id;
|
2022-02-03 17:52:28 +01:00
|
|
|
$user->save();
|
2019-05-04 16:48:15 +02:00
|
|
|
}
|
|
|
|
|
2020-12-09 00:46:38 +01:00
|
|
|
// Delete the profile image if reset option is in request
|
2019-05-04 16:48:15 +02:00
|
|
|
if ($request->has('profile_image_reset')) {
|
|
|
|
$this->imageRepo->destroyImage($user->avatar);
|
|
|
|
}
|
|
|
|
|
2022-02-03 17:52:28 +01:00
|
|
|
$redirectUrl = userCan('users-manage') ? '/settings/users' : "/settings/users/{$user->id}";
|
2021-06-26 17:23:15 +02:00
|
|
|
|
2016-03-13 16:37:46 +01:00
|
|
|
return redirect($redirectUrl);
|
2015-08-08 21:05:30 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Show the user delete page.
|
|
|
|
*/
|
2020-04-10 13:49:16 +02:00
|
|
|
public function delete(int $id)
|
2015-08-08 21:05:30 +02:00
|
|
|
{
|
2019-04-27 15:18:00 +02:00
|
|
|
$this->checkPermissionOrCurrentUser('users-manage', $id);
|
2015-12-31 18:57:34 +01:00
|
|
|
|
2018-12-30 17:11:58 +01:00
|
|
|
$user = $this->userRepo->getById($id);
|
2016-12-04 17:51:39 +01:00
|
|
|
$this->setPageTitle(trans('settings.users_delete_named', ['userName' => $user->name]));
|
2021-06-26 17:23:15 +02:00
|
|
|
|
2019-04-06 17:21:20 +02:00
|
|
|
return view('users.delete', ['user' => $user]);
|
2015-08-08 21:05:30 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Remove the specified user from storage.
|
2021-06-26 17:23:15 +02:00
|
|
|
*
|
2021-03-10 00:06:12 +01:00
|
|
|
* @throws Exception
|
2015-08-08 21:05:30 +02:00
|
|
|
*/
|
2021-01-01 19:31:01 +01:00
|
|
|
public function destroy(Request $request, int $id)
|
2015-08-08 21:05:30 +02:00
|
|
|
{
|
2019-09-19 16:12:10 +02:00
|
|
|
$this->preventAccessInDemoMode();
|
2019-04-27 15:18:00 +02:00
|
|
|
$this->checkPermissionOrCurrentUser('users-manage', $id);
|
2015-12-14 21:13:32 +01:00
|
|
|
|
2015-12-15 20:27:36 +01:00
|
|
|
$user = $this->userRepo->getById($id);
|
2021-01-01 19:31:01 +01:00
|
|
|
$newOwnerId = $request->get('new_owner_id', null);
|
2016-05-22 10:23:41 +02:00
|
|
|
|
2021-01-01 19:31:01 +01:00
|
|
|
$this->userRepo->destroy($user, $newOwnerId);
|
2015-12-14 21:13:32 +01:00
|
|
|
|
2016-02-16 22:25:11 +01:00
|
|
|
return redirect('/settings/users');
|
|
|
|
}
|
|
|
|
|
2017-12-29 17:49:03 +01:00
|
|
|
/**
|
|
|
|
* Update the user's preferred book-list display setting.
|
|
|
|
*/
|
2020-04-10 13:49:16 +02:00
|
|
|
public function switchBooksView(Request $request, int $id)
|
2018-01-28 17:58:52 +01:00
|
|
|
{
|
2018-12-07 19:33:32 +01:00
|
|
|
return $this->switchViewType($id, $request, 'books');
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Update the user's preferred shelf-list display setting.
|
|
|
|
*/
|
2020-04-10 13:49:16 +02:00
|
|
|
public function switchShelvesView(Request $request, int $id)
|
2018-12-07 19:33:32 +01:00
|
|
|
{
|
|
|
|
return $this->switchViewType($id, $request, 'bookshelves');
|
|
|
|
}
|
|
|
|
|
2020-04-10 13:49:16 +02:00
|
|
|
/**
|
|
|
|
* Update the user's preferred shelf-view book list display setting.
|
|
|
|
*/
|
|
|
|
public function switchShelfView(Request $request, int $id)
|
|
|
|
{
|
|
|
|
return $this->switchViewType($id, $request, 'bookshelf');
|
|
|
|
}
|
|
|
|
|
2018-12-07 19:33:32 +01:00
|
|
|
/**
|
|
|
|
* For a type of list, switch with stored view type for a user.
|
|
|
|
*/
|
2020-04-10 13:49:16 +02:00
|
|
|
protected function switchViewType(int $userId, Request $request, string $listName)
|
2018-12-07 19:33:32 +01:00
|
|
|
{
|
|
|
|
$this->checkPermissionOrCurrentUser('users-manage', $userId);
|
2017-12-26 08:08:16 +01:00
|
|
|
|
2018-08-27 15:18:09 +02:00
|
|
|
$viewType = $request->get('view_type');
|
2017-12-26 08:08:16 +01:00
|
|
|
if (!in_array($viewType, ['grid', 'list'])) {
|
|
|
|
$viewType = 'list';
|
|
|
|
}
|
|
|
|
|
2019-01-13 16:54:55 +01:00
|
|
|
$user = $this->userRepo->getById($userId);
|
2018-12-07 19:33:32 +01:00
|
|
|
$key = $listName . '_view_type';
|
|
|
|
setting()->putUser($user, $key, $viewType);
|
2017-12-26 08:08:16 +01:00
|
|
|
|
2018-12-07 19:33:32 +01:00
|
|
|
return redirect()->back(302, [], "/settings/users/$userId");
|
2017-12-26 08:08:16 +01:00
|
|
|
}
|
2018-08-27 15:18:09 +02:00
|
|
|
|
|
|
|
/**
|
2019-02-03 14:45:45 +01:00
|
|
|
* Change the stored sort type for a particular view.
|
2018-08-27 15:18:09 +02:00
|
|
|
*/
|
2019-09-15 19:53:30 +02:00
|
|
|
public function changeSort(Request $request, string $id, string $type)
|
2018-08-27 15:18:09 +02:00
|
|
|
{
|
2022-10-29 21:52:17 +02:00
|
|
|
$validSortTypes = ['books', 'bookshelves', 'shelf_books', 'users', 'roles'];
|
2019-02-03 14:45:45 +01:00
|
|
|
if (!in_array($type, $validSortTypes)) {
|
|
|
|
return redirect()->back(500);
|
|
|
|
}
|
2021-06-26 17:23:15 +02:00
|
|
|
|
2019-02-03 14:45:45 +01:00
|
|
|
return $this->changeListSort($id, $request, $type);
|
2018-12-07 19:33:32 +01:00
|
|
|
}
|
2018-08-27 15:18:09 +02:00
|
|
|
|
2020-04-11 21:37:51 +02:00
|
|
|
/**
|
|
|
|
* Toggle dark mode for the current user.
|
|
|
|
*/
|
|
|
|
public function toggleDarkMode()
|
|
|
|
{
|
|
|
|
$enabled = setting()->getForCurrentUser('dark-mode-enabled', false);
|
|
|
|
setting()->putUser(user(), 'dark-mode-enabled', $enabled ? 'false' : 'true');
|
2021-06-26 17:23:15 +02:00
|
|
|
|
2020-04-11 21:37:51 +02:00
|
|
|
return redirect()->back();
|
|
|
|
}
|
|
|
|
|
2019-04-14 14:01:51 +02:00
|
|
|
/**
|
|
|
|
* Update the stored section expansion preference for the given user.
|
|
|
|
*/
|
2019-09-15 19:53:30 +02:00
|
|
|
public function updateExpansionPreference(Request $request, string $id, string $key)
|
2019-04-14 14:01:51 +02:00
|
|
|
{
|
|
|
|
$this->checkPermissionOrCurrentUser('users-manage', $id);
|
|
|
|
$keyWhitelist = ['home-details'];
|
|
|
|
if (!in_array($key, $keyWhitelist)) {
|
2021-06-26 17:23:15 +02:00
|
|
|
return response('Invalid key', 500);
|
2019-04-14 14:01:51 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
$newState = $request->get('expand', 'false');
|
|
|
|
|
2022-02-04 01:26:19 +01:00
|
|
|
$user = $this->userRepo->getById($id);
|
2019-04-14 14:01:51 +02:00
|
|
|
setting()->putUser($user, 'section_expansion#' . $key, $newState);
|
2021-06-26 17:23:15 +02:00
|
|
|
|
|
|
|
return response('', 204);
|
2019-04-14 14:01:51 +02:00
|
|
|
}
|
|
|
|
|
2022-07-25 14:10:27 +02:00
|
|
|
public function updateCodeLanguageFavourite(Request $request)
|
|
|
|
{
|
|
|
|
$validated = $this->validate($request, [
|
|
|
|
'language' => ['required', 'string', 'max:20'],
|
2022-07-27 12:07:41 +02:00
|
|
|
'active' => ['required', 'bool'],
|
2022-07-25 14:10:27 +02:00
|
|
|
]);
|
|
|
|
|
|
|
|
$currentFavoritesStr = setting()->getForCurrentUser('code-language-favourites', '');
|
|
|
|
$currentFavorites = array_filter(explode(',', $currentFavoritesStr));
|
|
|
|
|
|
|
|
$isFav = in_array($validated['language'], $currentFavorites);
|
|
|
|
if (!$isFav && $validated['active']) {
|
|
|
|
$currentFavorites[] = $validated['language'];
|
2022-07-27 12:07:41 +02:00
|
|
|
} elseif ($isFav && !$validated['active']) {
|
2022-07-25 14:10:27 +02:00
|
|
|
$index = array_search($validated['language'], $currentFavorites);
|
|
|
|
array_splice($currentFavorites, $index, 1);
|
|
|
|
}
|
|
|
|
|
|
|
|
setting()->putUser(user(), 'code-language-favourites', implode(',', $currentFavorites));
|
|
|
|
}
|
|
|
|
|
2018-12-07 19:33:32 +01:00
|
|
|
/**
|
|
|
|
* Changed the stored preference for a list sort order.
|
|
|
|
*/
|
|
|
|
protected function changeListSort(int $userId, Request $request, string $listName)
|
|
|
|
{
|
|
|
|
$this->checkPermissionOrCurrentUser('users-manage', $userId);
|
|
|
|
|
|
|
|
$sort = $request->get('sort');
|
2022-10-29 21:52:17 +02:00
|
|
|
// TODO - Need to find a better way to validate sort options
|
|
|
|
// Probably better to do a simple validation here then validate at usage.
|
|
|
|
$validSorts = [
|
|
|
|
'name', 'created_at', 'updated_at', 'default', 'email', 'last_activity_at', 'display_name',
|
|
|
|
'users_count', 'permissions_count',
|
|
|
|
];
|
|
|
|
if (!in_array($sort, $validSorts)) {
|
2018-12-07 19:33:32 +01:00
|
|
|
$sort = 'name';
|
2018-08-27 15:18:09 +02:00
|
|
|
}
|
|
|
|
|
2018-12-07 19:33:32 +01:00
|
|
|
$order = $request->get('order');
|
|
|
|
if (!in_array($order, ['asc', 'desc'])) {
|
|
|
|
$order = 'asc';
|
|
|
|
}
|
2018-08-27 15:18:09 +02:00
|
|
|
|
2022-02-04 01:26:19 +01:00
|
|
|
$user = $this->userRepo->getById($userId);
|
2018-12-07 19:33:32 +01:00
|
|
|
$sortKey = $listName . '_sort';
|
|
|
|
$orderKey = $listName . '_sort_order';
|
|
|
|
setting()->putUser($user, $sortKey, $sort);
|
|
|
|
setting()->putUser($user, $orderKey, $order);
|
|
|
|
|
|
|
|
return redirect()->back(302, [], "/settings/users/$userId");
|
2018-08-27 15:18:09 +02:00
|
|
|
}
|
2015-08-08 21:05:30 +02:00
|
|
|
}
|