2022-06-28 16:25:56 +01:00
@ extends ( 'adminlte::page' )
@ section ( 'title' , config ( 'app.name' ) . ' | ' . __ ( 'Account Management' ))
@ section ( 'content_header' )
< h4 > {{ __ ( 'Users / Accounts / :username / Manage' , [ 'username' => $user -> name ]) }} </ h4 >
@ stop
@ section ( 'js' )
< script src = " /js/app.js " ></ script >
< x - global - errors ></ x - global - errors >
@ stop
@ section ( 'content' )
2022-09-04 20:30:49 +01:00
< x - modal id = " resetAccountPasswordModal " modal - label = " resetAccountPassword " modal - title = " { { __('Confirm your password') }} " include - close - button = " true " >
< p > {{ __ ( 'Please confirm that you want to invalidate this account\'s password. Since this is a sensitive operation, you\'ll need to confirm your own password and provide a 2FA code, if enabled.' ) }} </ p >
< form id = " resetAccountPasswordForm " method = " POST " action = " { { route('force-reset-user', ['user' => $user ]) }} " >
@ csrf
@ method ( 'patch' )
< x - confirm - password >
{{ __ ( 'Re-entering your password is required to confirm sensitive administration actions.' ) }}
</ x - confirm - password >
< x - confirm - second - factor >
{{ __ ( 'Two-factor authentication is required to confirm sensitive administration actions.' ) }}
</ x - confirm - second - factor >
</ form >
< x - slot name = " modalFooter " >
< button onclick = " $ ('#resetAccountPasswordForm').submit() " type = " button " class = " btn btn-warning " >< i class = " fas fa-check " ></ i > {{ __ ( 'Re-authenticate and confirm' ) }} </ button >
</ x - slot >
</ x - modal >
2022-06-28 16:25:56 +01:00
< x - modal id = " banAccountModal " modal - label = " banAccount " modal - title = " { { __('Please confirm')}} " include - close - button = " true " >
< p > {{ __ ( " Please confirm that you want to suspend this account. You'll need to add a reason and expiration date to confirm this. " )}} </ p >
< form id = " banAccountForm " name = " banAccount " method = " POST " action = " { { route('banUser', ['user' => $user->id ])}} " >
@ csrf
@ if ( $demoActive )
< div class = " alert alert-danger " >
< p class = " font-weight-bold " >< i class = " fas fa-exclamation-triangle " ></ i > {{ __ ( 'This feature is disabled' ) }} </ p >
</ div >
@ endif
< div class = " row " >
< div class = " col " >
2022-08-19 00:54:32 +01:00
< label for = " reason " > {{ __ ( 'Reason' )}} </ label >
2022-06-28 16:25:56 +01:00
< input type = " text " name = " reason " id = " reason " class = " form-control " placeholder = " { { __('e.g. Spamming')}} " >
</ div >
< div class = " col " >
< label for = " duration " > {{ __ ( 'Duration' ) }} </ label >
< input type = " text " name = " duration " id = " duration " class = " form-control " placeholder = " { { __('in days') }} " >
</ div >
</ div >
< div class = " mt-2 " >
< input type = " hidden " name = " suspensionType " value = " off " >
< label for = " suspensionType " > {{ __ ( 'Suspension type' ) }} </ label >< br >
< input type = " checkbox " id = " suspensionType " name = " suspensionType " checked data - toggle = " toggle " data - on = " Temporary " data - off = " Permanent " data - onstyle = " success " data - offstyle = " danger " data - width = " 130 " data - height = " 40 " >
< p class = " text-muted text-sm " >< i class = " fas fa-info-circle " ></ i > {{ __ ( 'Temporary suspensions will be automatically lifted. The suspension note is visible to all users. Suspended users will not be able to login or register.' ) }} </ p >
</ div >
</ form >
< x - slot name = " modalFooter " >
2022-08-19 00:54:32 +01:00
< button onclick = " $ ('#banAccountForm').submit() " id = " banAccountButton " type = " button " class = " btn btn-danger " {{ ( $demoActive ) ? 'disabled' : '' }} >< i class = " fa fa-gavel " ></ i > {{ __ ( 'Confirm' )}} </ button >
2022-06-28 16:25:56 +01:00
</ x - slot >
</ x - modal >
@ if ( ! Auth :: user () -> is ( $user ) && $user -> isStaffMember ())
< x - modal id = " terminateUser " modal - label = " terminateUser " modal - title = " { { __('Please Confirm')}} " include - close - button = " true " >
@ if ( $demoActive )
< div class = " alert alert-danger " >
< p class = " font-weight-bold " >< i class = " fas fa-exclamation-triangle " ></ i > {{ __ ( 'This feature is disabled' ) }} </ p >
</ div >
@ endif
< p >< i class = " fa fa-exclamation-triangle " ></ i > < b > {{ __ ( 'You are about to terminate a recruited staff member' )}} </ b ></ p >
< p >
{{ __ ( 'Terminating a staff member will remove their privileges on the application management site and connected integrations configured for the vacancy they applied for.' )}}
</ p >
< p >
< b > {{ __ ( 'THIS PROCESS IS IRREVERSIBLE AND IMMEDIATE' )}} </ b >
</ p >
< x - slot name = " modalFooter " >
< form method = " POST " action = " { { route('terminateStaffMember', ['user' => $user->id ])}} " id = " terminateUserForm " >
@ csrf
@ method ( 'PATCH' )
< button type = " submit " class = " btn btn-warning " {{ ( $demoActive ) ? 'disabled' : '' }} >< i class = " fas fa-exclamation-circle " ></ i > {{ __ ( 'Confirm' )}} </ button >
</ form >
</ x - slot >
</ x - modal >
@ endif
< x - modal id = " deleteAccount " modal - label = " deleteAccount " modal - title = " { { __('Confirm')}} " include - close - button = " true " >
@ if ( $demoActive )
< div class = " alert alert-danger " >
< p class = " font-weight-bold " >< i class = " fas fa-exclamation-triangle " ></ i > {{ __ ( 'This feature is disabled' ) }} </ p >
</ div >
@ endif
< p >< i class = " fa fa-exclamation-triangle " ></ i >< b > {{ __ ( 'WARNING: This is a potentially destructive action!' )}} </ b ></ p >
< p > {{ __ ( " Deleting a user's account is an irreversible process. Historic and current applications, votes, and profile content, as well as any personally identifiable information will be immediately erased. " )}} </ p >
< form id = " deleteAccountForm " method = " POST " action = {{ route ( 'deleteUser' , [ 'user' => $user -> id ])}} >
@ csrf
@ method ( 'DELETE' )
< label for = " promptConfirm " > {{ __ ( 'Type to confirm: ' )}} " DELETE ACCOUNT " </ label >
< input type = " text " name = " confirmPrompt " class = " form-control " placeholder = " { { __('Please type the above text')}} " >
</ form >
< x - slot name = " modalFooter " >
< button type = " button " class = " btn btn-danger " {{ ( $demoActive ) ? 'disabled' : '' }} onclick = " document.getElementById('deleteAccountForm').submit() " >< i class = " fa fa-trash " ></ i > {{ strtoupper ( __ ( 'Confirm' ))}} </ button >
</ x - slot >
</ x - modal >
< x - modal id = " editUser " modal - label = " editUser " modal - title = " { { __('Edit account')}} " include - close - button = " true " >
@ if ( $demoActive )
< div class = " alert alert-danger " >
< p class = " font-weight-bold " >< i class = " fas fa-exclamation-triangle " ></ i > {{ __ ( 'This feature is disabled' ) }} </ p >
</ div >
@ endif
< form id = " updateUserForm " method = " post " action = " { { route('updateUser', ['user' => $user->id ]) }} " >
@ csrf
@ method ( 'PATCH' )
< label for = " email " > {{ __ ( 'Email' )}} </ label >
< input {{ ( $demoActive ) ? 'disabled' : '' }} id = " email " type = " text " name = " email " class = " form-control " required value = " { { $user->email }} " />
< label for = " name " > {{ __ ( 'Name' )}} </ label >
< input {{ ( $demoActive ) ? 'disabled' : '' }} id = " name " type = " text " name = " name " class = " form-control " required value = " { { $user->name }} " />
< label for = " uuid " > {{ __ ( 'Mojang UUID (deprecated)' ) }} </ label >
< input {{ ( $demoActive ) ? 'disabled' : '' }} id = " uuid " type = " text " name = " uuid " class = " form-control " required value = " { { $user->uuid ?? " disabled " }} " />
< p class = " text-muted text-sm " >
< i class = " fas fa-exclamation-triangle " ></ i > {{ __ ( 'If the setting "Require Valid Game License" is activated, editing this field may have unintended consequences. Proceed with caution.' )}}
</ p >
< div class = " form-group mt-3 " >
< label > {{ __ ( 'Roles' )}} </ label >
< table class = " table table-borderless " >
< tbody >
@ foreach ( $roles as $roleName => $status )
< tr >
< th >< input {{ ( $demoActive ) ? 'disabled' : '' }} type = " checkbox " name = " roles[] " value = " { { $roleName }} " {{ ( $status ) ? 'checked' : '' }} ></ th >
< td class = " col-md-2 " > {{ ucfirst ( $roleName ) }} </ td >
</ tr >
@ endforeach
</ tbody >
</ table >
</ div >
</ form >
< x - slot name = " modalFooter " >
< button type = " button " {{ ( $demoActive ) ? 'disabled' : '' }} class = " btn btn-warning " onclick = " $ ('#updateUserForm').submit() " >< i class = " fa fa-exclamation-cicle " ></ i > {{ __ ( 'Save changes' )}} </ button >
</ x - slot >
</ x - modal >
< div class = " row " >
< div class = " col " >
< div class = " card " >
< div class = " card-header " >
2022-08-19 00:54:32 +01:00
< h3 >< i class = " fas fa-user-alt " ></ i > {{ __ ( 'Personal details' ) }} </ h3 >
2022-06-28 16:25:56 +01:00
</ div >
2022-08-03 13:14:33 +01:00
< div class = " card-body " >
< div class = " row " >
2022-06-28 16:25:56 +01:00
2022-08-03 13:14:33 +01:00
< div class = " col " >
< label for = " uname " > {{ __ ( 'Account name' ) }} </ label >
< input id = " uname " type = " text " class = " form-control " value = " { { $user->name }} " disabled >
</ div >
2022-06-28 16:25:56 +01:00
2022-08-03 13:14:33 +01:00
< div class = " col " >
< label for = " uemail " > {{ __ ( 'Account email' ) }} </ label >
< input id = " uemail " type = " email " class = " form-control " value = " { { $user->email }} " disabled >
</ div >
2022-06-28 16:25:56 +01:00
2022-08-03 13:14:33 +01:00
</ div >
2022-06-28 16:25:56 +01:00
2022-08-03 13:14:33 +01:00
< div class = " row " >
< div class = " col " >
2022-08-19 00:54:32 +01:00
< label for = " uip " > {{ __ ( 'Current IP' ) }} </ label >
< input type = " text " class = " form-control " id = " uip " value = " { { $user->currentIp }} " disabled >
</ div >
< div class = " col " >
< label for = " uip " > {{ __ ( 'Registration IP' ) }} </ label >
< input type = " text " class = " form-control " id = " uip " value = " { { (empty( $user->registrationIp )) ? __('Unavailable') : $user->registrationIp }} " disabled >
2022-08-03 13:14:33 +01:00
</ div >
2022-06-28 16:25:56 +01:00
</ div >
2022-08-03 13:14:33 +01:00
< div class = " row " >
< div class = " col " >
2022-08-19 00:54:32 +01:00
< label for = " uregdate " > {{ __ ( ' Registered at' ) }} </ label >
< input id = " uregdate " class = " form-control " type = " text " value = " { { $user->created_at }} ( { { $user->created_at ->diffForHumans() }}) " disabled >
2022-08-03 13:14:33 +01:00
</ div >
</ div >
2022-08-19 00:54:32 +01:00
< div class = " mt-2 " >
< label > {{ __ ( 'Account indicators' ) }} </ label >
< x - account - status is - verified = " { { $isVerified }} " is - locked = " { { $isLocked }} " is - suspended = " { { $isSuspended }} " has2 - f - a = " { { $has2FA }} " />
</ div >
</ div >
< div class = " card-footer " >
< button onclick = " $ ('#editUser').modal('show') " type = " button " class = " btn btn-warning " >< i class = " fas fa-pencil-alt " ></ i > {{ __ ( 'Edit account details' ) }} </ button >
2022-06-28 16:25:56 +01:00
</ div >
</ div >
</ div >
</ div >
2022-08-19 00:54:32 +01:00
< div class = " row mt-5 " >
< div class = " col " >
< div class = " card " >
< div class = " card-header " >
< h3 >< i class = " fas fa-clipboard " ></ i > {{ __ ( 'Application history' ) }} </ h3 >
</ div >
< div class = " card-body " >
@ if ( ! $applications -> isEmpty ())
< table class = " table table-borderless " style = " whitespace: nowrap " >
< thead >
< tr >
< th > #</th>
< th > {{ __ ( 'Status' )}} </ th >
< th > {{ __ ( 'Vacancy' ) }} </ th >
< th > {{ __ ( 'Date' )}} </ th >
< th > {{ __ ( 'Actions' )}} </ th >
</ tr >
</ thead >
< tbody >
@ foreach ( $applications as $application )
< tr >
< td > {{ $application -> id }} </ td >
< td >
@ switch ( $application -> applicationStatus )
@ case ( 'STAGE_SUBMITTED' )
< span class = " badge badge-primary " >< i class = " far fa-clock " ></ i > {{ __ ( 'Outstanding (Submitted)' )}} </ span >
@ break
@ case ( 'STAGE_PEERAPPROVAL' )
< span class = " badge badge-warning " >< i class = " fas fa-vote-yea " ></ i > {{ __ ( 'Peer Review' )}} </ span >
@ break
@ case ( 'STAGE_INTERVIEW' )
< span class = " badge badge-warning " >< i class = " fas fa-microphone-alt " ></ i > {{ __ ( 'Interview' )}} </ span >
@ break
@ case ( 'STAGE_INTERVIEW_SCHEDULED' )
< span class = " badge badge-warning " >< i class = " far fa-clock " ></ i > {{ __ ( 'Interview Scheduled' )}} </ span >
@ break
@ case ( 'APPROVED' )
< span class = " badge badge-success " >< i class = " fas fa-check " ></ i > {{ __ ( 'Approved' )}} </ span >
@ break
@ case ( 'DENIED' )
< span class = " badge badge-danger " >< i class = " fas fa-times " ></ i > {{ __ ( 'Denied' )}} </ span >
@ break ;
@ default
< span class = " badge badge-secondary " >< i class = " fas fa-question-circle " ></ i > {{ __ ( 'Denied' )}} </ span >
@ endswitch
</ td >
< td > {{ $application -> response -> vacancy -> vacancyName }} </ td >
< td > {{ $application -> created_at }} ({{ $application -> created_at -> diffForHumans () }}) </ td >
< td >
< x - button id = " view " link = " { { route('showUserApp', ['application' => $application->id ]) }} " icon = " fas fa-eye " target = " _blank " color = " success " size = " sm " >
{{ __ ( 'View' ) }}
</ x - button >
</ td >
</ tr >
@ endforeach
</ tbody >
</ table >
@ else
< x - alert alert - type = " warning " icon = " fas fa-exclamation-triangle " title = " { { __('No applications') }} " >
{{ __ ( 'This user has not submitted any applications yet.' ) }}
</ x - alert >
@ endif
</ div >
</ div >
</ div >
</ div >
< div class = " row mt-5 mb-5 " >
< div class = " col " >
< div class = " card " >
< div class = " card-header " >
2022-08-19 02:50:56 +01:00
< h3 >< i class = " fas fa-shield-alt " ></ i > {{ __ ( 'Admin actions' ) }} </ h3 >
2022-08-19 00:54:32 +01:00
</ div >
< div class = " card-body " >
2022-08-19 02:08:39 +01:00
@ if ( $isSuspended )
< x - alert extra - styling = " mb-4 " alert - type = " danger " icon = " fa fa-exclamation-triangle " title = " { { __('Account suspended') }} " >
< p >< i class = " fas fa-arrow-circle-right " ></ i >& nbsp ;{{ __ ( 'This account has been :suspensionType suspended.' , [ 'suspensionType' => ( is_null ( $suspensionDuration )) ? __ ( 'permanently' ) : __ ( 'temporarily' ) ]) }} </ p >
< p >< i class = " fas fa-arrow-circle-right " ></ i >& nbsp ;{ !! __ ( '<b>Reason: </b>:reason' , [ 'reason' => $suspensionReason ]) !! } </ p >
2022-08-19 03:06:15 +01:00
@ if ( ! is_null ( $suspensionDuration ))
< p >< i class = " fas fa-arrow-circle-right " ></ i >& nbsp ;{ !! __ ( '<b>Suspension expires: </b>:duration' , [ 'duration' => $suspensionDuration ]) !! } </ p >
@ endif
2022-08-19 02:08:39 +01:00
</ x - alert >
@ endif
@ if ( ! $isSuspended )
< button onclick = " $ ('#banAccountModal').modal('show') " type = " button " class = " btn btn-warning mr-3 " >< i class = " fas fa-user-slash " ></ i > {{ __ ( 'Suspend account' ) }} </ button >
@ else
< form class = " d-inline " method = " post " action = " { { route('unbanUser', ['user' => $user ]) }} " >
@ csrf
@ method ( 'DELETE' )
< button type = " submit " class = " btn btn-success mr-2 " >< i class = " fas fa-user " ></ i > {{ __ ( 'Unsuspend account' ) }} </ button >
</ form >
@ endif
2022-09-04 20:30:49 +01:00
< button onclick = " $ ('#resetAccountPasswordModal').modal('show') " class = " btn-danger btn mr-3 " type = " button " >< i class = " fas fa-key " ></ i > {{ __ ( 'Force password reset' ) }} </ button >
2022-08-19 02:50:56 +01:00
< button class = " btn-danger btn mr-3 " type = " button " >< i class = " fas fa-unlock " ></ i > {{ __ ( 'Reset MFA' ) }} </ button >
< button onclick = " $ ('#deleteAccount').modal('show') " type = " button " class = " btn btn-danger " >< i class = " fas fa-trash " ></ i > {{ __ ( 'Delete account' ) }} </ button >
2022-08-19 00:54:32 +01:00
</ div >
</ div >
</ div >
</ div >
2022-06-28 16:25:56 +01:00
@ stop
@ section ( 'footer' )
@ include ( 'breadcrumbs.dashboard.footer' )
@ stop