Add demo mode restrictions to user operations.
Added functionalities to restrict certain user operations like update, password change, and deletion in demo mode. This is done to prevent demo users from modifying crucial data. Helper methods are created for standard re-usable checks. Also, Blade directive is added for frontend UI demo checks.
This commit is contained in:
@@ -56,7 +56,7 @@
|
||||
</nav>
|
||||
|
||||
<main class="content min-vh-100 position-relative pb-7 pb-lg-5">
|
||||
|
||||
@demo <p style="border: 1px solid #ff1810; color: #ff1810; font-weight: bold; font-size: 18px; padding: 7px; text-align: center;">{{ __('Demo Mode') }}</p> @endif
|
||||
<nav class="navbar navbar-top navbar-expand navbar-dashboard navbar-dark ps-0 pe-2 pb-2 pb-lg-3">
|
||||
<div class="container-fluid px-0">
|
||||
<div class="d-flex justify-content-between w-100" id="navbarSupportedContent">
|
||||
|
@@ -3,6 +3,7 @@
|
||||
<div class="row justify-content-center form-bg-image" data-background-lg="{{ Vite::asset('resources/volt/images/illustrations/signin.svg') }}">
|
||||
<div class="col-12 d-flex align-items-center justify-content-center">
|
||||
<div class="bg-white shadow border-0 rounded border-light p-4 p-lg-5 w-100 fmxw-500">
|
||||
@demo <p style="border: 1px solid #ff1810; color: #ff1810; font-weight: bold; font-size: 18px; padding: 7px; text-align: center;">{{ __('Demo Mode') }}</p> @endif
|
||||
<div class="text-center text-md-center mb-4 mt-md-0">
|
||||
<h1 class="mb-0 h3">{{ __('Sign in to our platform') }}</h1>
|
||||
</div>
|
||||
@@ -24,7 +25,7 @@
|
||||
<span class="input-group-text" id="basic-addon1">
|
||||
<svg class="icon icon-xs text-gray-600" fill="currentColor" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M2.003 5.884L10 9.882l7.997-3.998A2 2 0 0016 4H4a2 2 0 00-1.997 1.884z"></path><path d="M18 8.118l-8 4-8-4V14a2 2 0 002 2h12a2 2 0 002-2V8.118z"></path></svg>
|
||||
</span>
|
||||
<input type="email" name="email" class="form-control" placeholder="example@company.com" id="email" autofocus required>
|
||||
<input type="email" name="email" class="form-control" placeholder="example@company.com" @demo value="{{ config('app.demo_email', null) }}" @endif id="email" autofocus required>
|
||||
</div>
|
||||
</div>
|
||||
<!-- End of Form -->
|
||||
@@ -36,7 +37,7 @@
|
||||
<span class="input-group-text" id="basic-addon2">
|
||||
<svg class="icon icon-xs text-gray-600" fill="currentColor" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" d="M5 9V7a5 5 0 0110 0v2a2 2 0 012 2v5a2 2 0 01-2 2H5a2 2 0 01-2-2v-5a2 2 0 012-2zm8-2v2H7V7a3 3 0 016 0z" clip-rule="evenodd"></path></svg>
|
||||
</span>
|
||||
<input type="password" name="password" placeholder="Password" class="form-control" id="password" required>
|
||||
<input type="password" name="password" placeholder="Password" @demo value="{{ config('app.demo_password', null) }}" @endif class="form-control" id="password" required>
|
||||
</div>
|
||||
</div>
|
||||
<!-- End of Form -->
|
||||
|
Reference in New Issue
Block a user