commit
871bd680b8
|
@ -51,6 +51,9 @@ class System
|
||||||
'show-imprint' => 'string',
|
'show-imprint' => 'string',
|
||||||
'show-privacy' => 'string',
|
'show-privacy' => 'string',
|
||||||
'show-tos' => 'string',
|
'show-tos' => 'string',
|
||||||
|
'alert-enabled' => 'string',
|
||||||
|
'alter-type' => 'string',
|
||||||
|
'alert-message' => 'string',
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$validator->after(function ($validator) use ($request) {
|
$validator->after(function ($validator) use ($request) {
|
||||||
|
@ -96,6 +99,9 @@ class System
|
||||||
"SETTINGS::SYSTEM:SHOW_IMPRINT" => "show-imprint",
|
"SETTINGS::SYSTEM:SHOW_IMPRINT" => "show-imprint",
|
||||||
"SETTINGS::SYSTEM:SHOW_PRIVACY" => "show-privacy",
|
"SETTINGS::SYSTEM:SHOW_PRIVACY" => "show-privacy",
|
||||||
"SETTINGS::SYSTEM:SHOW_TOS" => "show-tos",
|
"SETTINGS::SYSTEM:SHOW_TOS" => "show-tos",
|
||||||
|
"SETTINGS::SYSTEM:ALERT_ENABLED" => "alert-enabled",
|
||||||
|
"SETTINGS::SYSTEM:ALERT_TYPE" => "alert-type",
|
||||||
|
"SETTINGS::SYSTEM:ALERT_MESSAGE" => "alert-message",
|
||||||
];
|
];
|
||||||
|
|
||||||
foreach ($values as $key => $value) {
|
foreach ($values as $key => $value) {
|
||||||
|
|
|
@ -41,6 +41,19 @@ class LoginController extends Controller
|
||||||
$this->middleware('guest')->except('logout');
|
$this->middleware('guest')->except('logout');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the login username to be used by the controller.
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public function username()
|
||||||
|
{
|
||||||
|
$login = request()->input('email');
|
||||||
|
$field = filter_var($login, FILTER_VALIDATE_EMAIL) ? 'email' : 'name';
|
||||||
|
request()->merge([$field => $login]);
|
||||||
|
return $field;
|
||||||
|
}
|
||||||
|
|
||||||
public function login(Request $request)
|
public function login(Request $request)
|
||||||
{
|
{
|
||||||
$validationRules = [
|
$validationRules = [
|
||||||
|
|
|
@ -298,7 +298,7 @@ class User extends Authenticatable implements MustVerifyEmail
|
||||||
public function getActivitylogOptions(): LogOptions
|
public function getActivitylogOptions(): LogOptions
|
||||||
{
|
{
|
||||||
return LogOptions::defaults()
|
return LogOptions::defaults()
|
||||||
-> logOnly(['*'])
|
-> logOnly(['role', 'name', 'server_limit', 'pterodactyl_id', 'email'])
|
||||||
-> logOnlyDirty()
|
-> logOnlyDirty()
|
||||||
-> dontSubmitEmptyLogs();
|
-> dontSubmitEmptyLogs();
|
||||||
}
|
}
|
||||||
|
|
|
@ -97,7 +97,7 @@ return [
|
||||||
|
|
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
'available_locales' => array_map('basename', preg_replace('/\\.[^.\\s]{3,4}$/', '', glob(resource_path().'/lang/*.json', GLOB_BRACE))),
|
'available_locales' => array_map('basename', preg_replace('/\\.[^.\\s]{3,4}$/', '', glob(base_path("lang").'/*.json', GLOB_BRACE))),
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
@ -574,5 +574,28 @@ class SettingsSeeder extends Seeder
|
||||||
'type' => 'boolean',
|
'type' => 'boolean',
|
||||||
'description' => 'Enable/disable Terms of Service in footer',
|
'description' => 'Enable/disable Terms of Service in footer',
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
Settings::firstOrCreate([
|
||||||
|
'key' => 'SETTINGS::SYSTEM:ALERT_ENABLED',
|
||||||
|
], [
|
||||||
|
'value' => 'false',
|
||||||
|
'type' => 'boolean',
|
||||||
|
'description' => 'Enable/disable Alerts on Homepage',
|
||||||
|
]);
|
||||||
|
Settings::firstOrCreate([
|
||||||
|
'key' => 'SETTINGS::SYSTEM:ALERT_TYPE',
|
||||||
|
], [
|
||||||
|
'value' => 'dark',
|
||||||
|
'type' => 'text',
|
||||||
|
'description' => 'Changes the Color of the Alert',
|
||||||
|
]);
|
||||||
|
|
||||||
|
Settings::firstOrCreate([
|
||||||
|
'key' => 'SETTINGS::SYSTEM:ALERT_MESSAGE',
|
||||||
|
], [
|
||||||
|
'value' => '',
|
||||||
|
'type' => 'text',
|
||||||
|
'description' => 'Changes the Content the Alert',
|
||||||
|
]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -299,7 +299,48 @@
|
||||||
class="form-control @error('minimum-credits') is-invalid @enderror" required>
|
class="form-control @error('minimum-credits') is-invalid @enderror" required>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
{{-- ALERT --}}
|
||||||
|
<div class="row mb-2">
|
||||||
|
<div class="col text-center">
|
||||||
|
<h1>Alert</h1>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="custom-control mb-3 p-0">
|
||||||
|
<input value="true" id="alert-enabled" name="alert-enabled"
|
||||||
|
{{ config('SETTINGS::SYSTEM:ALERT_ENABLED') == 'true' ? 'checked' : '' }} type="checkbox">
|
||||||
|
<label for="enable-login-logo">{{ __('Enable the Alert Message on Homepage') }} </label>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="custom-control mb-3 p-0">
|
||||||
|
<label for="alert-type">{{ __('Alert Color') }}</label>
|
||||||
|
<select id="alert-type" style="width:100%" class="custom-select" name="alert-type" required
|
||||||
|
autocomplete="off" @error('alert-type') is-invalid @enderror>
|
||||||
|
<option value="primary" @if (config('SETTINGS::SYSTEM:ALERT_TYPE') == "primary") selected
|
||||||
|
@endif>{{ __("Blue") }}</option>
|
||||||
|
<option value="secondary" @if (config('SETTINGS::SYSTEM:ALERT_TYPE') == "secondary") selected
|
||||||
|
@endif>{{ __("Grey") }}</option>
|
||||||
|
<option value="success" @if (config('SETTINGS::SYSTEM:ALERT_TYPE') == "success") selected
|
||||||
|
@endif>{{ __("Green") }}</option>
|
||||||
|
<option value="danger" @if (config('SETTINGS::SYSTEM:ALERT_TYPE') == "danger") selected
|
||||||
|
@endif>{{ __("Red") }}</option>
|
||||||
|
<option value="warning" @if (config('SETTINGS::SYSTEM:ALERT_TYPE') == "warning") selected
|
||||||
|
@endif>{{ __("Orange") }}</option>
|
||||||
|
<option value="info" @if (config('SETTINGS::SYSTEM:ALERT_TYPE') == "info") selected
|
||||||
|
@endif>{{ __("Cyan") }}</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="custom-control mb-3 p-0">
|
||||||
|
<label for="alert-message">{{ __('Alert Message (HTML might be used)') }}</label>
|
||||||
|
<textarea x-model="alert-message" id="alert-message" name="alert-message"
|
||||||
|
class="form-control @error('alert-message') is-invalid @enderror">
|
||||||
|
{{ config('SETTINGS::SYSTEM:ALERT_MESSAGE', '') }}
|
||||||
|
</textarea>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
{{-- Design --}}
|
{{-- Design --}}
|
||||||
<div class="col-md-3 px-3">
|
<div class="col-md-3 px-3">
|
||||||
|
|
|
@ -31,9 +31,9 @@
|
||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<div class="input-group mb-3">
|
<div class="input-group mb-3">
|
||||||
<input type="email" name="email"
|
<input type="text" name="email"
|
||||||
class="form-control @error('email') is-invalid @enderror"
|
class="form-control @error('email') is-invalid @enderror"
|
||||||
placeholder="{{ __('Email') }}">
|
placeholder="{{ __('Email or Username') }}">
|
||||||
<div class="input-group-append">
|
<div class="input-group-append">
|
||||||
<div class="input-group-text">
|
<div class="input-group-text">
|
||||||
<span class="fas fa-envelope"></span>
|
<span class="fas fa-envelope"></span>
|
||||||
|
|
|
@ -26,6 +26,12 @@
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
@endif
|
@endif
|
||||||
|
|
||||||
|
@if(config("SETTINGS::SYSTEM:ALERT_ENABLED") && !empty(config("SETTINGS::SYSTEM:ALERT_MESSAGE")))
|
||||||
|
<div class="alert mt-4 alert-{{config("SETTINGS::SYSTEM:ALERT_TYPE")}}" role="alert">
|
||||||
|
{!! config("SETTINGS::SYSTEM:ALERT_MESSAGE") !!}
|
||||||
|
</div>
|
||||||
|
@endif
|
||||||
<!-- MAIN CONTENT -->
|
<!-- MAIN CONTENT -->
|
||||||
<section class="content">
|
<section class="content">
|
||||||
<div class="container-fluid">
|
<div class="container-fluid">
|
||||||
|
|
Loading…
Reference in a new issue