Added Demo mode
Demo mode allows to safely run a demo version of the app, with destructive features limited. Some bugs were also fixed in this commit.
This commit is contained in:
@@ -43,6 +43,12 @@
|
||||
<form id="banAccountForm" name="banAccount" method="POST" action="{{route('banUser', ['user' => $profile->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">
|
||||
@@ -69,7 +75,7 @@
|
||||
</form>
|
||||
|
||||
<x-slot name="modalFooter">
|
||||
<button id="banAccountButton" type="button" class="btn btn-danger"><i class="fa fa-gavel"></i> {{__('Confirm')}}</button>
|
||||
<button id="banAccountButton" type="button" class="btn btn-danger" {{ ($demoActive) ? 'disabled' : '' }} ><i class="fa fa-gavel"></i> {{__('Confirm')}}</button>
|
||||
</x-slot>
|
||||
|
||||
</x-modal>
|
||||
@@ -77,6 +83,12 @@
|
||||
@if (!Auth::user()->is($profile->user) && $profile->user->isStaffMember())
|
||||
<x-modal id="terminateUser" modal-label="terminateUser" modal-title="{{__('messages.reusable.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>{{__('messages.profile.terminate_notice')}}</b></p>
|
||||
<p>
|
||||
{{__('messages.profile.terminate_notice_warning')}}
|
||||
@@ -91,7 +103,7 @@
|
||||
<form method="POST" action="{{route('terminateStaffMember', ['user' => $profile->user->id])}}" id="terminateUserForm">
|
||||
@csrf
|
||||
@method('PATCH')
|
||||
<button type="submit" class="btn btn-warning"><i class="fas fa-exclamation-circle"></i> {{__('messages.reusable.confirm')}}</button>
|
||||
<button type="submit" class="btn btn-warning" {{ ($demoActive) ? 'disabled' : '' }}><i class="fas fa-exclamation-circle"></i> {{__('messages.reusable.confirm')}}</button>
|
||||
|
||||
</form>
|
||||
|
||||
@@ -102,6 +114,12 @@
|
||||
|
||||
<x-modal id="deleteAccount" modal-label="deleteAccount" modal-title="{{__('messages.reusable.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> {{__('messages.profile.delete_acc_warn')}}</b></p>
|
||||
|
||||
<p>{{__('messages.profile.delete_acc_consequence')}}</p>
|
||||
@@ -118,12 +136,12 @@
|
||||
|
||||
<x-slot name="modalFooter">
|
||||
|
||||
<button type="button" class="btn btn-danger" onclick="document.getElementById('deleteAccountForm').submit()"><i class="fa fa-trash"></i> {{strtoupper(__('messages.reusable.confirm'))}}</button>
|
||||
<button type="button" class="btn btn-danger" {{ ($demoActive) ? 'disabled' : '' }} onclick="document.getElementById('deleteAccountForm').submit()"><i class="fa fa-trash"></i> {{strtoupper(__('messages.reusable.confirm'))}}</button>
|
||||
|
||||
</x-slot>
|
||||
</x-modal>
|
||||
|
||||
<x-modal id="ipInfo" modal-label="ipInfo" modal-title="{{__('messages.reusable.ip_info')}} {{$ipInfo->ip ?? 'Unknown'}}" include-close-button="true">
|
||||
<x-modal id="ipInfo" modal-label="ipInfo" modal-title="{{__('IP Address Information')}}" include-close-button="true">
|
||||
|
||||
<h4 class="text-center">{{__('messages.profile.search_result')}}</h3>
|
||||
|
||||
@@ -209,18 +227,24 @@
|
||||
|
||||
<x-modal id="editUser" modal-label="editUser" modal-title="{{__('messages.profile.edituser')}}" 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' => $profile->user->id]) }}">
|
||||
@csrf
|
||||
@method('PATCH')
|
||||
|
||||
<label for="email">{{__('messages.contactlabel_email')}}</label>
|
||||
<input id="email" type="text" name="email" class="form-control" required value="{{ $profile->user->email }}" />
|
||||
<input {{ ($demoActive) ? 'disabled' : '' }} id="email" type="text" name="email" class="form-control" required value="{{ $profile->user->email }}" />
|
||||
|
||||
<label for="name">{{__('messages.contactlabel_name')}}</label>
|
||||
<input id="name" type="text" name="name" class="form-control" required value="{{ $profile->user->name }}" />
|
||||
<input {{ ($demoActive) ? 'disabled' : '' }} id="name" type="text" name="name" class="form-control" required value="{{ $profile->user->name }}" />
|
||||
|
||||
<label for="uuid">Mojang UUID</label>
|
||||
<input id="uuid" type="text" name="uuid" class="form-control" required value="{{ $profile->user->uuid }}" />
|
||||
<input {{ ($demoActive) ? 'disabled' : '' }} id="uuid" type="text" name="uuid" class="form-control" required value="{{ $profile->user->uuid }}" />
|
||||
<p class="text-muted text-sm">
|
||||
<i class="fas fa-exclamation-triangle"></i> {{__('messages.profile.edituser_consequence')}}
|
||||
</p>
|
||||
@@ -233,7 +257,7 @@
|
||||
|
||||
@foreach($roles as $roleName => $status)
|
||||
<tr>
|
||||
<th><input type="checkbox" name="roles[]" value="{{ $roleName }}" {{ ($status) ? 'checked' : '' }}></th>
|
||||
<th><input {{ ($demoActive) ? 'disabled' : '' }} type="checkbox" name="roles[]" value="{{ $roleName }}" {{ ($status) ? 'checked' : '' }}></th>
|
||||
<td class="col-md-2">{{ ucfirst($roleName) }}</td>
|
||||
</tr>
|
||||
|
||||
@@ -250,7 +274,7 @@
|
||||
|
||||
<x-slot name="modalFooter">
|
||||
|
||||
<button type="button" class="btn btn-warning" onclick="$('#updateUserForm').submit()"><i class="fa fa-exclamation-cicle"></i> {{__('messages.vacancy.save')}}</button>
|
||||
<button type="button" {{ ($demoActive) ? 'disabled' : '' }} class="btn btn-warning" onclick="$('#updateUserForm').submit()"><i class="fa fa-exclamation-cicle"></i> {{__('messages.vacancy.save')}}</button>
|
||||
|
||||
</x-slot>
|
||||
|
||||
@@ -293,7 +317,7 @@
|
||||
<p class="text-muted">{{$profile->profileShortBio}}</p>
|
||||
<p class="text-muted">{{__('messages.reusable.member_since', ['date' => $since])}}</p>
|
||||
@if (Auth::user()->hasRole('admin'))
|
||||
<button type="button" class="btn btn-sm btn-info" onclick="$('#ipInfo').modal('show')">{{__('messages.reusable.lookup', ['ipAddress' => $profile->user->originalIP])}}</button>
|
||||
<button type="button" class="btn btn-sm btn-info" onclick="$('#ipInfo').modal('show')">{{__('messages.reusable.lookup', ['ipAddress' => (!$demoActive) ? $profile->user->originalIP : '0.0.0.0'])}}</button>
|
||||
@endif
|
||||
|
||||
@if ($profile->user->is(Auth::user()))
|
||||
|
@@ -22,6 +22,14 @@
|
||||
|
||||
<x-modal id="deleteAccountModal" modal-label="deleteAccountModalLabel" modal-title="Close 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
|
||||
|
||||
<p>Deleting your account is an irreversible process. The following data will be deleted (including personally identifiable data):</p>
|
||||
<ul>
|
||||
<li>Last IP address</li>
|
||||
@@ -66,7 +74,7 @@
|
||||
|
||||
<x-slot name="modalFooter">
|
||||
|
||||
<button onclick="$('#deleteAccountForm').submit()" type="button" class="btn btn-warning"><i class="fas fa-exclamation-triangle"></i> Continue</button>
|
||||
<button {{ ($demoActive) ? 'disabled' : '' }} onclick="$('#deleteAccountForm').submit()" type="button" class="btn btn-warning"><i class="fas fa-exclamation-triangle"></i> Continue</button>
|
||||
|
||||
</x-slot>
|
||||
|
||||
@@ -74,10 +82,16 @@
|
||||
|
||||
@if (!Auth::user()->has2FA())
|
||||
|
||||
|
||||
|
||||
|
||||
<x-modal id="twoFactorAuthModal" modal-label="2faLabel" modal-title="{{__('messages.2fa_txt')}}" include-close-button="true">
|
||||
|
||||
@if($demoActive)
|
||||
<div class="alert alert-danger">
|
||||
<p class="font-weight-bold"><i class="fa fa-exclamation-triangle"></i> This feature is disabled</p>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<h3><i class="fas fa-user-shield"></i> {{__('messages.profile.2fa_welcome')}}</h3>
|
||||
|
||||
<p><b>{{__('messages.profile.supported_apps')}}</b></p>
|
||||
@@ -118,7 +132,7 @@
|
||||
|
||||
<x-slot name="modalFooter">
|
||||
|
||||
<button type="button" class="btn btn-success" onclick="$('#enable2Fa').submit()"><i class="fas fa-key"></i> {{__('messages.profile.2fa_enable')}}</button>
|
||||
<button {{ ($demoActive) ? 'disabled' : '' }} type="button" class="btn btn-success" onclick="$('#enable2Fa').submit()"><i class="fas fa-key"></i> {{__('messages.profile.2fa_enable')}}</button>
|
||||
|
||||
</x-slot>
|
||||
|
||||
@@ -248,6 +262,12 @@
|
||||
|
||||
<div class="tab-content" id="myTabContent">
|
||||
<div class="tab-pane fade show active p-3" id="accountSecurity" role="tabpanel" aria-labelledby="accountSecurityTab">
|
||||
@if($demoActive)
|
||||
<div class="alert alert-danger">
|
||||
<p class="font-weight-bold"><i class="fa fa-exclamation-triangle"></i> This feature is disabled</p>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<h5 class="card-title">{{__('messages.profile.change_password')}}</h5>
|
||||
<p class="card-text">{{__('messages.profile.change_password_exp')}}</p>
|
||||
|
||||
@@ -271,7 +291,7 @@
|
||||
|
||||
</form>
|
||||
|
||||
<button class="btn btn-success" type="button" onclick="document.getElementById('changePassword').submit()">{{__('messages.profile.change_password')}}</button>
|
||||
<button {{ ($demoActive) ? 'disabled' : '' }} class="btn btn-success" type="button" onclick="document.getElementById('changePassword').submit()">{{__('messages.profile.change_password')}}</button>
|
||||
</div>
|
||||
<div class="tab-pane fade p-3" id="twofa" role="tabpanel" aria-labelledby="twofaTab">
|
||||
<h5 class="card-title">{{__('messages.profile.2fa')}}</h5>
|
||||
@@ -289,10 +309,15 @@
|
||||
<div class="tab-pane fade p-3" id="sessions" role="tabpanel" aria-labelledby="sessionsTab">
|
||||
<h5 class="card-title">{{__('messages.profile.session_manager')}}</h5>
|
||||
<p class="card-text">{{__('messages.profile.terminate_others')}}</p>
|
||||
<p>{{__('messages.profile.current_session', ['ipAddress' => $ip])}}</p>
|
||||
<p>{{__('messages.profile.current_session', ['ipAddress' => ($demoActive) ? '0.0.0.0 (censored)' : $ip])}}</p>
|
||||
<button type="button" class="btn btn-warning" onclick="$('#authenticationForm').modal('show')">{{__('messages.profile.flush_session')}}</button>
|
||||
</div>
|
||||
<div class="tab-pane fade p-3" id="contactSettings" role="tabpanel" aria-labelledby="contactSettingsTab">
|
||||
@if($demoActive)
|
||||
<div class="alert alert-danger">
|
||||
<p class="font-weight-bold"><i class="fa fa-exclamation-triangle"></i> This feature is disabled</p>
|
||||
</div>
|
||||
@endif
|
||||
<h5 class="card-title">{{__('messages.profile.contact_settings')}}</h5>
|
||||
<p class="card-text">{{__('messages.profile.personal_data_change')}}</p>
|
||||
|
||||
@@ -320,7 +345,7 @@
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<button class="btn btn-success" type="button" onclick="document.getElementById('changeEmail').submit()">{{__('messages.profile.change_email')}}</button>
|
||||
<button {{ ($demoActive) ? 'disabled' : '' }} class="btn btn-success" type="button" onclick="document.getElementById('changeEmail').submit()">{{__('messages.profile.change_email')}}</button>
|
||||
</div>
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user