Update codebase to L5.4 (#367)
This commit is contained in:
parent
0a95d97d7f
commit
9c303456fb
25 changed files with 593 additions and 583 deletions
|
@ -154,6 +154,19 @@ class UpdateEnvironment extends Command
|
|||
$variables['SESSION_DRIVER'] = $this->option('session-driver');
|
||||
}
|
||||
|
||||
if (is_null($this->option('queue-driver'))) {
|
||||
$this->line('If you chose redis as your cache driver backend, you *must* have a redis server configured already.');
|
||||
$variables['QUEUE_DRIVER'] = $this->choice('Which cache driver backend would you like to use?', [
|
||||
'database' => 'Database (recommended)',
|
||||
'redis' => 'Redis',
|
||||
'sqs' => 'Amazon SQS',
|
||||
'sync' => 'Sync',
|
||||
'null' => 'None',
|
||||
], config('queue.driver', 'database'));
|
||||
} else {
|
||||
$variables['QUEUE_DRIVER'] = $this->option('queue-driver');
|
||||
}
|
||||
|
||||
$bar = $this->output->createProgressBar(count($variables));
|
||||
|
||||
foreach ($variables as $key => $value) {
|
||||
|
|
|
@ -70,6 +70,6 @@ class Handler extends ExceptionHandler
|
|||
return response()->json(['error' => 'Unauthenticated.'], 401);
|
||||
}
|
||||
|
||||
return redirect()->guest('/auth/login');
|
||||
return redirect()->guest(route('auth.login'));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -63,7 +63,7 @@ class LanguageController extends Controller
|
|||
$user->language = $language;
|
||||
$user->save();
|
||||
}
|
||||
Session::set('applocale', $language);
|
||||
Session::put('applocale', $language);
|
||||
}
|
||||
|
||||
return redirect()->back();
|
||||
|
|
|
@ -13,12 +13,9 @@ class Kernel extends HttpKernel
|
|||
*/
|
||||
protected $middleware = [
|
||||
\Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode::class,
|
||||
\Pterodactyl\Http\Middleware\EncryptCookies::class,
|
||||
\Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class,
|
||||
\Illuminate\Session\Middleware\StartSession::class,
|
||||
\Illuminate\View\Middleware\ShareErrorsFromSession::class,
|
||||
|
||||
\Pterodactyl\Http\Middleware\LanguageMiddleware::class,
|
||||
\Illuminate\Foundation\Http\Middleware\ValidatePostSize::class,
|
||||
\Pterodactyl\Http\Middleware\TrimStrings::class,
|
||||
\Illuminate\Foundation\Http\Middleware\ConvertEmptyStringsToNull::class,
|
||||
\Fideloper\Proxy\TrustProxies::class,
|
||||
];
|
||||
|
||||
|
@ -35,6 +32,7 @@ class Kernel extends HttpKernel
|
|||
\Illuminate\View\Middleware\ShareErrorsFromSession::class,
|
||||
\Pterodactyl\Http\Middleware\VerifyCsrfToken::class,
|
||||
\Illuminate\Routing\Middleware\SubstituteBindings::class,
|
||||
\Pterodactyl\Http\Middleware\LanguageMiddleware::class,
|
||||
],
|
||||
'api' => [
|
||||
'throttle:60,1',
|
||||
|
|
|
@ -44,7 +44,7 @@ class LanguageMiddleware
|
|||
if (Session::has('applocale')) {
|
||||
App::setLocale(Session::get('applocale'));
|
||||
} elseif (Auth::check() && isset(Auth::user()->language)) {
|
||||
Session::set('applocale', Auth::user()->language);
|
||||
Session::put('applocale', Auth::user()->language);
|
||||
App::setLocale(Auth::user()->language);
|
||||
} else {
|
||||
App::setLocale(Settings::get('default_language', 'en'));
|
||||
|
|
|
@ -18,7 +18,7 @@ class RedirectIfAuthenticated
|
|||
public function handle($request, Closure $next, $guard = null)
|
||||
{
|
||||
if (Auth::guard($guard)->check()) {
|
||||
return redirect('/');
|
||||
return redirect(route('index'));
|
||||
}
|
||||
|
||||
return $next($request);
|
||||
|
|
18
app/Http/Middleware/TrimStrings.php
Normal file
18
app/Http/Middleware/TrimStrings.php
Normal file
|
@ -0,0 +1,18 @@
|
|||
<?php
|
||||
|
||||
namespace Pterodactyl\Http\Middleware;
|
||||
|
||||
use Illuminate\Foundation\Http\Middleware\TrimStrings as BaseTrimmer;
|
||||
|
||||
class TrimStrings extends BaseTrimmer
|
||||
{
|
||||
/**
|
||||
* The names of the attributes that should not be trimmed.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $except = [
|
||||
'password',
|
||||
'password_confirmation',
|
||||
];
|
||||
}
|
|
@ -25,11 +25,8 @@
|
|||
namespace Pterodactyl\Observers;
|
||||
|
||||
use Cache;
|
||||
use Carbon;
|
||||
use Pterodactyl\Events;
|
||||
use Pterodactyl\Models\Server;
|
||||
use Pterodactyl\Jobs\DeleteServer;
|
||||
use Pterodactyl\Jobs\SuspendServer;
|
||||
use Pterodactyl\Notifications\ServerCreated;
|
||||
use Illuminate\Foundation\Bus\DispatchesJobs;
|
||||
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
|
||||
namespace Pterodactyl\Providers;
|
||||
|
||||
use Illuminate\Contracts\Auth\Access\Gate as GateContract;
|
||||
use Illuminate\Foundation\Support\Providers\AuthServiceProvider as ServiceProvider;
|
||||
|
||||
class AuthServiceProvider extends ServiceProvider
|
||||
|
@ -22,8 +21,8 @@ class AuthServiceProvider extends ServiceProvider
|
|||
* @param \Illuminate\Contracts\Auth\Access\Gate $gate
|
||||
* @return void
|
||||
*/
|
||||
public function boot(GateContract $gate)
|
||||
public function boot()
|
||||
{
|
||||
parent::registerPolicies($gate);
|
||||
$this->registerPolicies();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -33,7 +33,7 @@ class RouteServiceProvider extends ServiceProvider
|
|||
*/
|
||||
public function map()
|
||||
{
|
||||
Route::group(['namespace' => $this->namespace], function ($router) {
|
||||
Route::group(['namespace' => $this->namespace, 'middleware' => 'web'], function ($router) {
|
||||
foreach (glob(app_path('Http//Routes') . '/*.php') as $file) {
|
||||
$this->app->make('Pterodactyl\\Http\\Routes\\' . basename($file, '.php'))->map($router);
|
||||
}
|
||||
|
|
|
@ -25,7 +25,6 @@
|
|||
namespace Pterodactyl\Repositories;
|
||||
|
||||
use DB;
|
||||
use Log;
|
||||
use Crypt;
|
||||
use Validator;
|
||||
use Pterodactyl\Models;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue