Compare commits
6 Commits
Author | SHA1 | Date | |
---|---|---|---|
1319ce6b86 | |||
bea83b650c | |||
675cc3c329 | |||
e8119b763c | |||
04838048ce | |||
87f8e63b24 |
@@ -68,4 +68,8 @@ PUSHER_APP_CLUSTER=mt1
|
|||||||
MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
|
MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
|
||||||
MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"
|
MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"
|
||||||
|
|
||||||
|
# Mostly for developers, but with Papertrail, you can easily see what the app's users are doing without relying on
|
||||||
|
# the internal log viewer.
|
||||||
SENTRY_LARAVEL_DSN=
|
SENTRY_LARAVEL_DSN=
|
||||||
|
PAPERTRAIL_URL=
|
||||||
|
PAPERTRAIL_PORT
|
||||||
|
@@ -7,6 +7,7 @@ use App\Options as Option;
|
|||||||
|
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
use Illuminate\Support\Facades\Auth;
|
use Illuminate\Support\Facades\Auth;
|
||||||
|
use Illuminate\Support\Facades\Log;
|
||||||
|
|
||||||
class OptionsController extends Controller
|
class OptionsController extends Controller
|
||||||
{
|
{
|
||||||
@@ -29,17 +30,33 @@ class OptionsController extends Controller
|
|||||||
{
|
{
|
||||||
if (Auth::user()->can('admin.settings.edit'))
|
if (Auth::user()->can('admin.settings.edit'))
|
||||||
{
|
{
|
||||||
|
Log::debug('Updating application options', [
|
||||||
|
'ip' => $request->ip(),
|
||||||
|
'ua' => $request->userAgent(),
|
||||||
|
'username' => Auth::user()->username
|
||||||
|
]);
|
||||||
foreach($request->all() as $optionName => $option)
|
foreach($request->all() as $optionName => $option)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
if (Options::optionExists($option))
|
Log::debug('Going through option ' . $optionName);
|
||||||
|
if (Options::optionExists($optionName))
|
||||||
{
|
{
|
||||||
|
Log::debug('Option exists, updating to new values', [
|
||||||
|
'opt' => $optionName,
|
||||||
|
'new_value' => $option
|
||||||
|
]);
|
||||||
Options::changeOption($optionName, $option);
|
Options::changeOption($optionName, $option);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch(\Exception $ex)
|
catch(\Exception $ex)
|
||||||
{
|
{
|
||||||
|
Log::error('Unable to update options!', [
|
||||||
|
'msg' => $ex->getMessage(),
|
||||||
|
'trace' => $ex->getTraceAsString()
|
||||||
|
]);
|
||||||
|
report($ex);
|
||||||
|
|
||||||
$errorCond = true;
|
$errorCond = true;
|
||||||
$request->session()->flash('error', 'An error occurred while trying to save settings: ' . $ex->getMessage());
|
$request->session()->flash('error', 'An error occurred while trying to save settings: ' . $ex->getMessage());
|
||||||
}
|
}
|
||||||
|
@@ -3,6 +3,7 @@
|
|||||||
namespace App\Observers;
|
namespace App\Observers;
|
||||||
|
|
||||||
use App\Application;
|
use App\Application;
|
||||||
|
use Illuminate\Support\Facades\Log;
|
||||||
|
|
||||||
class ApplicationObserver
|
class ApplicationObserver
|
||||||
{
|
{
|
||||||
|
@@ -2,6 +2,8 @@
|
|||||||
|
|
||||||
namespace App\Providers;
|
namespace App\Providers;
|
||||||
|
|
||||||
|
use App\Application;
|
||||||
|
use App\Observers\ApplicationObserver;
|
||||||
use App\Observers\UserObserver;
|
use App\Observers\UserObserver;
|
||||||
use App\User;
|
use App\User;
|
||||||
use Illuminate\Support\Facades\Schema;
|
use Illuminate\Support\Facades\Schema;
|
||||||
@@ -32,7 +34,9 @@ class AppServiceProvider extends ServiceProvider
|
|||||||
]);
|
]);
|
||||||
|
|
||||||
Schema::defaultStringLength(191);
|
Schema::defaultStringLength(191);
|
||||||
|
|
||||||
User::observe(UserObserver::class);
|
User::observe(UserObserver::class);
|
||||||
|
Application::observe(ApplicationObserver::class);
|
||||||
|
|
||||||
$this->app['request']->server->set('HTTPS', $this->app->environment() != 'local');
|
$this->app['request']->server->set('HTTPS', $this->app->environment() != 'local');
|
||||||
}
|
}
|
||||||
|
@@ -7,11 +7,10 @@ use Illuminate\Foundation\Auth\User as Authenticatable;
|
|||||||
use Illuminate\Notifications\Notifiable;
|
use Illuminate\Notifications\Notifiable;
|
||||||
use Spatie\Permission\Traits\HasRoles;
|
use Spatie\Permission\Traits\HasRoles;
|
||||||
|
|
||||||
class User extends Authenticatable
|
class User extends Authenticatable implements MustVerifyEmail
|
||||||
{
|
{
|
||||||
use Notifiable;
|
use Notifiable;
|
||||||
use HasRoles;
|
use HasRoles;
|
||||||
//use MustVerifyEmail;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The attributes that are mass assignable.
|
* The attributes that are mass assignable.
|
||||||
|
@@ -17,7 +17,7 @@ Route::group(['prefix' => LaravelLocalization::setLocale(), 'middleware' => [ 'l
|
|||||||
|
|
||||||
Route::group(['prefix' => 'auth', 'middleware' => ['usernameUUID']], function (){
|
Route::group(['prefix' => 'auth', 'middleware' => ['usernameUUID']], function (){
|
||||||
|
|
||||||
Auth::routes();
|
Auth::routes(['verify' => true]);
|
||||||
|
|
||||||
Route::post('/twofa/authenticate', 'Auth\TwofaController@verify2FA')
|
Route::post('/twofa/authenticate', 'Auth\TwofaController@verify2FA')
|
||||||
->name('verify2FA');
|
->name('verify2FA');
|
||||||
@@ -31,7 +31,7 @@ Route::group(['prefix' => LaravelLocalization::setLocale(), 'middleware' => [ 'l
|
|||||||
->name('sendSubmission');
|
->name('sendSubmission');
|
||||||
|
|
||||||
|
|
||||||
Route::group(['middleware' => ['auth', 'forcelogout', '2fa']], function(){
|
Route::group(['middleware' => ['auth', 'forcelogout', '2fa', 'verified']], function(){
|
||||||
|
|
||||||
Route::get('/dashboard', 'DashboardController@index')
|
Route::get('/dashboard', 'DashboardController@index')
|
||||||
->name('dashboard')
|
->name('dashboard')
|
||||||
|
Reference in New Issue
Block a user