diff --git a/app/Http/Controllers/CondominioController.php b/app/Http/Controllers/CondominioController.php index 66b7450..2cda2fa 100644 --- a/app/Http/Controllers/CondominioController.php +++ b/app/Http/Controllers/CondominioController.php @@ -13,9 +13,14 @@ class CondominioController extends Controller public function testPdf(){ $data=DB::table('categories')->get(); $pdf = PDF::setOptions(['dpi' => 150, 'defaultFont' => 'Helvetica'])->loadView('conti.categorie.list', ['categorie' => $data->toArray()]); - //return $pdf->download('invoice.pdf'); + //return $pdf->download('invoice.pdf'); /*$pdf = App::make('dompdf.wrapper'); $pdf->loadHTML('

Test

');*/ return $pdf->stream(); } + + public function err403() + { + abort(403); + } } diff --git a/app/Http/Kernel.php b/app/Http/Kernel.php index d3722c2..4c7391a 100644 --- a/app/Http/Kernel.php +++ b/app/Http/Kernel.php @@ -63,5 +63,6 @@ class Kernel extends HttpKernel 'signed' => \Illuminate\Routing\Middleware\ValidateSignature::class, 'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class, 'verified' => \Illuminate\Auth\Middleware\EnsureEmailIsVerified::class, + ]; } diff --git a/app/Models/User.php b/app/Models/User.php index 03f90ea..416ade0 100644 --- a/app/Models/User.php +++ b/app/Models/User.php @@ -4,7 +4,8 @@ namespace App\Models; use Illuminate\Contracts\Auth\MustVerifyEmail; 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\Support\Facades\DB; use Laravel\Sanctum\HasApiTokens; @@ -15,7 +16,7 @@ use Junges\ACL\Concerns\HasGroups; class User extends Authenticatable { - use HasApiTokens, HasFactory, Notifiable, AuthenticateswithLdap, HasGroups; + use HasApiTokens, HasFactory, Notifiable, AuthenticateswithLdap, HasGroups, SoftDeletes; /** * The attributes that are mass assignable. @@ -46,23 +47,23 @@ class User extends Authenticatable protected $casts = [ 'email_verified_at' => 'datetime', ]; - + public function getLdapDomainColumn() { return 'domain'; } - + public function getLdapGuidColumn() { return 'guid'; } - + public static function addGroup($gruppo) { $user= new User(); $user->assignGroup($gruppo); } - + public static function getUserById($id) { return DB::table('users')->where('id','=',$id)->get(); @@ -71,4 +72,7 @@ class User extends Authenticatable { return DB::table('users')->orderBy('name')->get(); } + + + } diff --git a/app/Models/condominio.php b/app/Models/condominio.php index 60cb336..8c53d0a 100644 --- a/app/Models/condominio.php +++ b/app/Models/condominio.php @@ -8,4 +8,7 @@ use Illuminate\Database\Eloquent\Model; class condominio extends Model { use HasFactory; + + } + diff --git a/app/Providers/RouteServiceProvider.php b/app/Providers/RouteServiceProvider.php index 924382e..272c7ce 100644 --- a/app/Providers/RouteServiceProvider.php +++ b/app/Providers/RouteServiceProvider.php @@ -47,7 +47,7 @@ class RouteServiceProvider extends ServiceProvider Route::middleware('web') ->namespace($this->namespace) ->group(base_path('routes/web.php')); - + Route::prefix('admin') ->middleware(['web','auth']) ->namespace($this->namespace) diff --git a/database/migrations/2023_05_30_111044_column_users_roles.php b/database/migrations/2023_05_30_111044_column_users_roles.php new file mode 100644 index 0000000..ae66786 --- /dev/null +++ b/database/migrations/2023_05_30_111044_column_users_roles.php @@ -0,0 +1,36 @@ +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(); + }); + } +} diff --git a/public/css/style.css b/public/css/style.css new file mode 100644 index 0000000..daa0af2 --- /dev/null +++ b/public/css/style.css @@ -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; } +} diff --git a/public/images/dogs.jpg b/public/images/dogs.jpg new file mode 100644 index 0000000..78537dc Binary files /dev/null and b/public/images/dogs.jpg differ diff --git a/public/images/fence.png b/public/images/fence.png new file mode 100644 index 0000000..305204c Binary files /dev/null and b/public/images/fence.png differ diff --git a/public/images/texture.jpg b/public/images/texture.jpg new file mode 100644 index 0000000..7a4ade1 Binary files /dev/null and b/public/images/texture.jpg differ diff --git a/resources/views/errors/403.blade.php b/resources/views/errors/403.blade.php new file mode 100644 index 0000000..2eb9b0f --- /dev/null +++ b/resources/views/errors/403.blade.php @@ -0,0 +1,24 @@ + + + + + Vietato - 403 - Forbidden + + + + + + + + +
+
+

403

+

Spiacente, non รจ possibile andare oltre questo punto!

+

Prego torna indietro da qui.

+
+
+ + + + diff --git a/routes/admin.php b/routes/admin.php index dba710e..b0bd1bf 100644 --- a/routes/admin.php +++ b/routes/admin.php @@ -131,5 +131,6 @@ Route::get('/', [MovimentiController::class,'dashboard']); Route::get('test/fullcalendar', [FullCalenderController::class, 'index']); Route::post('test/fullcalendar', [FullCalenderController::class, 'ajax']); Route::get('test/condominio',[CondominioController::class,'testPdf']); + Route::get('test/err403',[CondominioController::class,'err403']);