6 Commits
0.6.0 ... 0.6.1

Author SHA1 Message Date
1319ce6b86 Added more debug logging 2020-09-07 22:56:54 +01:00
bea83b650c Added more debug logging 2020-09-07 22:54:20 +01:00
675cc3c329 Import missing facade 2020-09-07 22:35:42 +01:00
e8119b763c Register Application observers 2020-09-07 21:43:48 +01:00
04838048ce Merge pull request #10 from spacejewel-hosting/translate
Force new users to verify email
2020-09-03 20:22:11 +01:00
87f8e63b24 Force new users to verify email 2020-09-03 20:06:29 +01:00
6 changed files with 31 additions and 6 deletions

View File

@@ -68,4 +68,8 @@ PUSHER_APP_CLUSTER=mt1
MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
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=
PAPERTRAIL_URL=
PAPERTRAIL_PORT

View File

@@ -7,6 +7,7 @@ use App\Options as Option;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Log;
class OptionsController extends Controller
{
@@ -29,17 +30,33 @@ class OptionsController extends Controller
{
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)
{
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);
}
}
catch(\Exception $ex)
{
Log::error('Unable to update options!', [
'msg' => $ex->getMessage(),
'trace' => $ex->getTraceAsString()
]);
report($ex);
$errorCond = true;
$request->session()->flash('error', 'An error occurred while trying to save settings: ' . $ex->getMessage());
}

View File

@@ -3,6 +3,7 @@
namespace App\Observers;
use App\Application;
use Illuminate\Support\Facades\Log;
class ApplicationObserver
{
@@ -55,7 +56,7 @@ class ApplicationObserver
}
}
// application can now be deleted
// application can now be deleted
}
/**

View File

@@ -2,6 +2,8 @@
namespace App\Providers;
use App\Application;
use App\Observers\ApplicationObserver;
use App\Observers\UserObserver;
use App\User;
use Illuminate\Support\Facades\Schema;
@@ -32,7 +34,9 @@ class AppServiceProvider extends ServiceProvider
]);
Schema::defaultStringLength(191);
User::observe(UserObserver::class);
Application::observe(ApplicationObserver::class);
$this->app['request']->server->set('HTTPS', $this->app->environment() != 'local');
}

View File

@@ -7,11 +7,10 @@ use Illuminate\Foundation\Auth\User as Authenticatable;
use Illuminate\Notifications\Notifiable;
use Spatie\Permission\Traits\HasRoles;
class User extends Authenticatable
class User extends Authenticatable implements MustVerifyEmail
{
use Notifiable;
use HasRoles;
//use MustVerifyEmail;
/**
* The attributes that are mass assignable.

View File

@@ -17,7 +17,7 @@ Route::group(['prefix' => LaravelLocalization::setLocale(), 'middleware' => [ 'l
Route::group(['prefix' => 'auth', 'middleware' => ['usernameUUID']], function (){
Auth::routes();
Auth::routes(['verify' => true]);
Route::post('/twofa/authenticate', 'Auth\TwofaController@verify2FA')
->name('verify2FA');
@@ -31,7 +31,7 @@ Route::group(['prefix' => LaravelLocalization::setLocale(), 'middleware' => [ 'l
->name('sendSubmission');
Route::group(['middleware' => ['auth', 'forcelogout', '2fa']], function(){
Route::group(['middleware' => ['auth', 'forcelogout', '2fa', 'verified']], function(){
Route::get('/dashboard', 'DashboardController@index')
->name('dashboard')