Skip to content

Commit 8e9069c

Browse files
committed
Subuser updates
1 parent 95f574e commit 8e9069c

File tree

4 files changed

+433
-5
lines changed

4 files changed

+433
-5
lines changed

app/Repositories/SubuserRepository.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,10 +133,15 @@ public function create($sid, array $data)
133133
// Determine if this user exists or if we need to make them an account.
134134
$user = Models\User::where('email', $data['email'])->first();
135135
if (! $user) {
136-
$password = str_random(16);
137136
try {
138137
$repo = new UserRepository;
139-
$uid = $repo->create($data['email'], $password);
138+
$uid = $repo->create([
139+
'email' => $data['email'],
140+
'username' => substr(str_replace('@', '', $data['email']), 0, 8),
141+
'name_first' => 'John',
142+
'name_last' => 'Doe',
143+
'root_admin' => false,
144+
]);
140145
$user = Models\User::findOrFail($uid);
141146
} catch (\Exception $ex) {
142147
throw $ex;

resources/lang/en/server.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@
1212
'configure' => 'Configure Permissions',
1313
'list' => 'Accounts with Access',
1414
'add' => 'Add New Subuser',
15+
'update' => 'Update Subuser',
16+
'edit' => [
17+
'header' => 'Edit Subuser',
18+
'header_sub' => 'Modify user\'s access to server.'
19+
],
1520
'new' => [
1621
'header' => 'Add New User',
1722
'header_sub' => 'Add a new user with permissions to this server.',
@@ -33,11 +38,11 @@
3338
'description' => 'Allows user to stop the server.',
3439
],
3540
'restart' => [
36-
'title' => 'Stop Server',
41+
'title' => 'Restart Server',
3742
'description' => 'Allows user to restart the server.',
3843
],
3944
'kill' => [
40-
'title' => 'Stop Server',
45+
'title' => 'Kill Server',
4146
'description' => 'Allows user to kill the server process.',
4247
],
4348
'command' => [

resources/themes/pterodactyl/server/users/new.blade.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@
4343
<div class="form-group">
4444
<label class="control-label">@lang('server.users.new.email')</label>
4545
<div>
46-
<input type="email" class="form-control" name="new_password_confirmation" />
46+
{!! csrf_field() !!}
47+
<input type="email" class="form-control" name="email" />
4748
<p class="text-muted small">@lang('server.users.new.email_help')</p>
4849
</div>
4950
</div>

0 commit comments

Comments
 (0)