test per configurazione ruoli

This commit is contained in:
Amministratore 2023-05-30 16:14:57 +02:00
parent b4bf945c6f
commit f300136cf2
12 changed files with 161 additions and 8 deletions

View File

@ -18,4 +18,9 @@ class CondominioController extends Controller
$pdf->loadHTML('<h1>Test</h1>');*/ $pdf->loadHTML('<h1>Test</h1>');*/
return $pdf->stream(); return $pdf->stream();
} }
public function err403()
{
abort(403);
}
} }

View File

@ -63,5 +63,6 @@ class Kernel extends HttpKernel
'signed' => \Illuminate\Routing\Middleware\ValidateSignature::class, 'signed' => \Illuminate\Routing\Middleware\ValidateSignature::class,
'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class, 'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class,
'verified' => \Illuminate\Auth\Middleware\EnsureEmailIsVerified::class, 'verified' => \Illuminate\Auth\Middleware\EnsureEmailIsVerified::class,
]; ];
} }

View File

@ -4,7 +4,8 @@ namespace App\Models;
use Illuminate\Contracts\Auth\MustVerifyEmail; use Illuminate\Contracts\Auth\MustVerifyEmail;
use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Foundation\Auth\User as Authenticatable; use Illuminate\Database\Eloquent\SoftDeletes;
use Illuminate\Foundation\Auth\User as Authenticatable;
use Illuminate\Notifications\Notifiable; use Illuminate\Notifications\Notifiable;
use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\DB;
use Laravel\Sanctum\HasApiTokens; use Laravel\Sanctum\HasApiTokens;
@ -15,7 +16,7 @@ use Junges\ACL\Concerns\HasGroups;
class User extends Authenticatable class User extends Authenticatable
{ {
use HasApiTokens, HasFactory, Notifiable, AuthenticateswithLdap, HasGroups; use HasApiTokens, HasFactory, Notifiable, AuthenticateswithLdap, HasGroups, SoftDeletes;
/** /**
* The attributes that are mass assignable. * The attributes that are mass assignable.
@ -71,4 +72,7 @@ class User extends Authenticatable
{ {
return DB::table('users')->orderBy('name')->get(); return DB::table('users')->orderBy('name')->get();
} }
} }

View File

@ -8,4 +8,7 @@ use Illuminate\Database\Eloquent\Model;
class condominio extends Model class condominio extends Model
{ {
use HasFactory; use HasFactory;
} }

View File

@ -0,0 +1,36 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class ColumnUsersRoles extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('users', function (Blueprint $table) {
//
$table->softDeletes();
$table->string('user_role',25)->default('user')->nullable(false);
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('users', function (Blueprint $table) {
//
$table->dropColumn('user_role');
$table->dropSoftDeletes();
});
}
}

79
public/css/style.css vendored Normal file
View File

@ -0,0 +1,79 @@
html { box-sizing: border-box; }
*,
*::before,
*::after { box-sizing: inherit; }
body * {
margin: 0;
padding: 0;
}
body {
font: normal 100%/1.15 "Merriweather", serif;
background: #fff url("/images/texture.jpg") repeat 0 0;
color: #fff;
}
/* https://www.vecteezy.com/vector-art/87721-wood-fence-vectors */
.wrapper {
position: relative;
max-width: 1298px;
height: auto;
margin: 2em auto 0 auto;
background: transparent url("/images/fence.png") no-repeat center top 24em;
}
/* https://www.vecteezy.com/vector-art/237238-dog-family-colored-doodle-drawing */
.box {
max-width: 70%;
min-height: 600px;
margin: 0 auto;
padding: 1em 1em;
text-align: center;
background: transparent url("/images/dogs.jpg") no-repeat top 10em center;
}
h1 {
margin: 0 0 1rem 0;
font-size: 8em;
text-shadow: 0 0 6px #8b4d1a;
}
p {
margin-bottom: 0.5em;
font-size: 1.75em;
color: #ea8a1a;
}
p:first-of-type {
margin-top: 16em;
text-shadow: none;
}
p > a {
border-bottom: 1px dashed #837256;
font-style: italic;
text-decoration: none;
color: #837256;
}
p > a:hover { text-shadow: 0 0 3px #8b4d1a; }
p img { vertical-align: bottom; }
@media screen and (max-width: 600px) {
.wrapper {
background-size: 300px 114px;
background-position: center top 22em;
}
.box {
max-width: 100%;
margin: 0 auto;
padding: 0;
background-size: 320px 185px;
}
p:first-of-type { margin-top: 12em; }
}

BIN
public/images/dogs.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 90 KiB

BIN
public/images/fence.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

BIN
public/images/texture.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

View File

@ -0,0 +1,24 @@
<!DOCTYPE html>
<html lang="en" >
<head>
<meta charset="UTF-8">
<title>Vietato - 403 - Forbidden</title>
<meta name=viewport content="width=device-width, initial-scale=1" />
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Merriweather:400,400i" />
<link rel="stylesheet" href="/css/style.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/prefixfree/1.0.7/prefixfree.min.js"></script>
</head>
<body>
<!-- partial:index.partial.html -->
<div class="wrapper">
<div class="box">
<h1>403</h1>
<p>Spiacente, non è possibile andare oltre questo punto!</p>
<p><a href="/">Prego torna indietro da qui.</a></p>
</div>
</div>
<!-- partial -->
</body>
</html>

View File

@ -131,5 +131,6 @@ Route::get('/', [MovimentiController::class,'dashboard']);
Route::get('test/fullcalendar', [FullCalenderController::class, 'index']); Route::get('test/fullcalendar', [FullCalenderController::class, 'index']);
Route::post('test/fullcalendar', [FullCalenderController::class, 'ajax']); Route::post('test/fullcalendar', [FullCalenderController::class, 'ajax']);
Route::get('test/condominio',[CondominioController::class,'testPdf']); Route::get('test/condominio',[CondominioController::class,'testPdf']);
Route::get('test/err403',[CondominioController::class,'err403']);