diff --git a/app/Console/Commands/User/DeleteUserCommand.php b/app/Console/Commands/User/DeleteUserCommand.php index 2b13b4866..bac97ddaf 100644 --- a/app/Console/Commands/User/DeleteUserCommand.php +++ b/app/Console/Commands/User/DeleteUserCommand.php @@ -44,10 +44,10 @@ class DeleteUserCommand extends Command if ($this->input->isInteractive()) { $tableValues = []; foreach ($results as $user) { - $tableValues[] = [$user->id, $user->email, $user->name]; + $tableValues[] = [$user->id, $user->email, $user->username]; } - $this->table(['User ID', 'Email', 'Name'], $tableValues); + $this->table(['User ID', 'Email', 'Username'], $tableValues); if (!$deleteUser = $this->ask(trans('command/messages.user.select_search_user'))) { return $this->handle(); } diff --git a/app/Console/Commands/User/MakeUserCommand.php b/app/Console/Commands/User/MakeUserCommand.php index 635a95646..f37de218b 100644 --- a/app/Console/Commands/User/MakeUserCommand.php +++ b/app/Console/Commands/User/MakeUserCommand.php @@ -30,8 +30,6 @@ class MakeUserCommand extends Command $root_admin = $this->option('admin') ?? $this->confirm(trans('command/messages.user.ask_admin')); $email = $this->option('email') ?? $this->ask(trans('command/messages.user.ask_email')); $username = $this->option('username') ?? $this->ask(trans('command/messages.user.ask_username')); - $name_first = $this->option('name-first') ?? $this->ask(trans('command/messages.user.ask_name_first')); - $name_last = $this->option('name-last') ?? $this->ask(trans('command/messages.user.ask_name_last')); if (is_null($password = $this->option('password')) && !$this->option('no-password')) { $this->warn(trans('command/messages.user.ask_password_help')); @@ -39,12 +37,11 @@ class MakeUserCommand extends Command $password = $this->secret(trans('command/messages.user.ask_password')); } - $user = $this->creationService->handle(compact('email', 'username', 'name_first', 'name_last', 'password', 'root_admin')); + $user = $this->creationService->handle(compact('email', 'username', 'password', 'root_admin')); $this->table(['Field', 'Value'], [ ['UUID', $user->uuid], ['Email', $user->email], ['Username', $user->username], - ['Name', $user->name], ['Admin', $user->root_admin ? 'Yes' : 'No'], ]); } diff --git a/app/Models/User.php b/app/Models/User.php index 50361af8b..fa6ebffa1 100644 --- a/app/Models/User.php +++ b/app/Models/User.php @@ -43,7 +43,6 @@ use Pterodactyl\Notifications\SendPasswordReset as ResetPasswordNotification; * @property \Illuminate\Support\Carbon|null $updated_at * @property \Illuminate\Database\Eloquent\Collection|\Pterodactyl\Models\ApiKey[] $apiKeys * @property int|null $api_keys_count - * @property string $name * @property \Illuminate\Notifications\DatabaseNotificationCollection|\Illuminate\Notifications\DatabaseNotification[] $notifications * @property int|null $notifications_count * @property \Illuminate\Database\Eloquent\Collection|\Pterodactyl\Models\RecoveryToken[] $recoveryTokens @@ -223,14 +222,6 @@ class User extends Model implements $this->attributes['username'] = mb_strtolower($value); } - /** - * Return a concatenated result for the accounts full name. - */ - public function getNameAttribute(): string - { - return trim($this->name_first . ' ' . $this->name_last); - } - public function avatarURL(): string { return 'https://www.gravatar.com/avatar/' . md5($this->email) . '.jpg'; diff --git a/app/Notifications/AccountCreated.php b/app/Notifications/AccountCreated.php index fb1338012..50d7f1f42 100644 --- a/app/Notifications/AccountCreated.php +++ b/app/Notifications/AccountCreated.php @@ -33,7 +33,7 @@ class AccountCreated extends Notification implements ShouldQueue public function toMail(): MailMessage { $message = (new MailMessage()) - ->greeting('Hello ' . $this->user->name . '!') + ->greeting('Hello!') ->line('You are receiving this email because an account has been created for you on ' . config('app.name') . '.') ->line('Username: ' . $this->user->username) ->line('Email: ' . $this->user->email); diff --git a/app/Notifications/MailTested.php b/app/Notifications/MailTested.php index 892ff7b0a..3ef25a57b 100644 --- a/app/Notifications/MailTested.php +++ b/app/Notifications/MailTested.php @@ -21,7 +21,7 @@ class MailTested extends Notification { return (new MailMessage()) ->subject('Pterodactyl Test Message') - ->greeting('Hello ' . $this->user->name . '!') + ->greeting('Hello ' . $this->user->username . '!') ->line('This is a test of the Pterodactyl mail system. You\'re good to go!'); } } diff --git a/app/Observers/SubuserObserver.php b/app/Observers/SubuserObserver.php index f1e028b96..efb24d947 100644 --- a/app/Observers/SubuserObserver.php +++ b/app/Observers/SubuserObserver.php @@ -25,7 +25,7 @@ class SubuserObserver event(new Events\Subuser\Created($subuser)); $subuser->user->notify(new AddedToServer([ - 'user' => $subuser->user->name_first, + 'user' => $subuser->user->username, 'name' => $subuser->server->name, 'uuidShort' => $subuser->server->uuidShort, ])); @@ -47,7 +47,7 @@ class SubuserObserver event(new Events\Subuser\Deleted($subuser)); $subuser->user->notify(new RemovedFromServer([ - 'user' => $subuser->user->name_first, + 'user' => $subuser->user->username, 'name' => $subuser->server->name, ])); } diff --git a/app/Services/Subusers/SubuserCreationService.php b/app/Services/Subusers/SubuserCreationService.php index c207b0d07..e45f2813a 100644 --- a/app/Services/Subusers/SubuserCreationService.php +++ b/app/Services/Subusers/SubuserCreationService.php @@ -58,8 +58,6 @@ class SubuserCreationService $user = $this->userCreationService->handle([ 'email' => $email, 'username' => $username, - 'name_first' => 'Server', - 'name_last' => 'Subuser', 'root_admin' => false, ]); } diff --git a/app/Transformers/Api/Client/AccountTransformer.php b/app/Transformers/Api/Client/AccountTransformer.php index 68651d8f3..3a78792d6 100644 --- a/app/Transformers/Api/Client/AccountTransformer.php +++ b/app/Transformers/Api/Client/AccountTransformer.php @@ -25,8 +25,6 @@ class AccountTransformer extends Transformer 'admin' => $model->root_admin, 'username' => $model->username, 'email' => $model->email, - 'first_name' => $model->name_first, - 'last_name' => $model->name_last, 'language' => $model->language, ]; }