mirror of https://github.com/pixelfed/pixelfed
commit
ed5b1e26a7
@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Middleware;
|
||||
|
||||
use App, Auth, Closure;
|
||||
use Carbon\Carbon;
|
||||
|
||||
class DangerZone
|
||||
{
|
||||
/**
|
||||
* Handle an incoming request.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @param \Closure $next
|
||||
* @return mixed
|
||||
*/
|
||||
public function handle($request, Closure $next)
|
||||
{
|
||||
if(!Auth::check()) {
|
||||
return redirect(route('login'));
|
||||
}
|
||||
if(!$request->is('i/auth/sudo')) {
|
||||
if( !$request->session()->has('sudoMode') ) {
|
||||
$request->session()->put('redirectNext', $request->url());
|
||||
return redirect('/i/auth/sudo');
|
||||
}
|
||||
if( $request->session()->get('sudoMode') < Carbon::now()->subMinutes(30)->timestamp ) {
|
||||
$request->session()->put('redirectNext', $request->url());
|
||||
return redirect('/i/auth/sudo');
|
||||
}
|
||||
}
|
||||
return $next($request);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class UpdateImportDatasTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('import_datas', function (Blueprint $table) {
|
||||
$table->bigInteger('job_id')->unsigned()->nullable()->after('profile_id');
|
||||
$table->string('original_name')->nullable()->after('stage');
|
||||
$table->boolean('import_accepted')->default(false)->nullable()->after('original_name');
|
||||
$table->unique(['job_id', 'original_name']);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
//
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,49 @@
|
||||
@extends('layouts.blank')
|
||||
|
||||
@section('content')
|
||||
<div class="container mt-5">
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-lg-5">
|
||||
<div class="text-center">
|
||||
<img src="/img/pixelfed-icon-color.svg" height="60px">
|
||||
<p class="font-weight-light h3 py-4">Confirm password to continue</p>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<form method="POST">
|
||||
@csrf
|
||||
|
||||
<div class="form-group row">
|
||||
|
||||
<div class="col-md-12">
|
||||
<input id="password" type="password" class="form-control{{ $errors->has('password') ? ' is-invalid' : '' }}" name="password" placeholder="{{__('Password')}}" required>
|
||||
|
||||
@if ($errors->has('password'))
|
||||
<span class="invalid-feedback">
|
||||
<strong>{{ $errors->first('password') }}</strong>
|
||||
</span>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@if(config('pixelfed.recaptcha'))
|
||||
<div class="row my-3">
|
||||
{!! Recaptcha::render() !!}
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<div class="form-group row mb-0">
|
||||
<div class="col-md-12">
|
||||
<button type="submit" class="btn btn-success btn-block font-weight-bold">
|
||||
{{ __('Confirm Password') }}
|
||||
</button>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
@ -0,0 +1,15 @@
|
||||
@extends('layouts.app')
|
||||
|
||||
@section('content')
|
||||
<div class="container">
|
||||
<div class="error-page py-5 my-5">
|
||||
<div class="card mx-5">
|
||||
<div class="card-body p-5 text-center">
|
||||
<h1>Whoops! Something went wrong.</h1>
|
||||
<p class="mb-0 text-muted lead">Please try again, if this error keeps happening please contact an admin.</p>
|
||||
<img src="/img/fred1.gif" class="img-fluid">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
@ -0,0 +1,36 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="{{ app()->getLocale() }}">
|
||||
<head>
|
||||
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<meta name="csrf-token" content="{{ csrf_token() }}">
|
||||
|
||||
<meta name="mobile-web-app-capable" content="yes">
|
||||
|
||||
<title>{{ $title ?? config('app.name', 'Laravel') }}</title>
|
||||
|
||||
<meta property="og:site_name" content="{{ config('app.name', 'pixelfed') }}">
|
||||
<meta property="og:title" content="{{ $title or config('app.name', 'pixelfed') }}">
|
||||
<meta property="og:type" content="article">
|
||||
<meta property="og:url" content="{{request()->url()}}">
|
||||
@stack('meta')
|
||||
|
||||
<meta name="medium" content="image">
|
||||
<meta name="theme-color" content="#10c5f8">
|
||||
<meta name="apple-mobile-web-app-capable" content="yes">
|
||||
<link rel="shortcut icon" type="image/png" href="/img/favicon.png">
|
||||
<link rel="canonical" href="{{request()->url()}}">
|
||||
<link href="{{ mix('css/app.css') }}" rel="stylesheet">
|
||||
@stack('styles')
|
||||
</head>
|
||||
<body class="">
|
||||
<main id="content">
|
||||
@yield('content')
|
||||
</main>
|
||||
@include('layouts.partial.footer')
|
||||
<script type="text/javascript" src="{{ mix('js/app.js') }}"></script>
|
||||
@stack('scripts')
|
||||
</body>
|
||||
</html>
|
||||
Loading…
Reference in New Issue