From 591cc8648dd156fe5634a032847e002564ccb818 Mon Sep 17 00:00:00 2001 From: Dane Everitt Date: Wed, 20 Jan 2016 22:07:33 -0500 Subject: [PATCH] Fix user creation --- app/Http/Controllers/Admin/AccountsController.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/Http/Controllers/Admin/AccountsController.php b/app/Http/Controllers/Admin/AccountsController.php index d091ddd83..ca6de204b 100644 --- a/app/Http/Controllers/Admin/AccountsController.php +++ b/app/Http/Controllers/Admin/AccountsController.php @@ -86,14 +86,14 @@ class AccountsController extends Controller { try { $user = new UserRepository; - $userid = $user->create($request->input('username'), $request->input('email'), $request->input('password')); + $userid = $user->create($request->input('email'), $request->input('password')); Alert::success('Account has been successfully created.')->flash(); return redirect()->route('admin.accounts.view', ['id' => $userid]); } catch (\Pterodactyl\Exceptions\DisplayValidationException $ex) { - return redirect()->route('admin.nodes.view', $id)->withErrors(json_decode($e->getMessage()))->withInput(); + return redirect()->route('admin.accounts.new')->withErrors(json_decode($ex->getMessage()))->withInput(); } catch (\Exception $ex) { Log::error($ex); - Alert::danger('An error occured while attempting to add a new user. ' . $e->getMessage())->flash(); + Alert::danger('An error occured while attempting to add a new user. ' . $ex->getMessage())->flash(); return redirect()->route('admin.accounts.new'); } }