mirror of
https://github.com/devcode-it/openstamanager.git
synced 2025-06-05 22:09:38 +02:00
Correzioni minori sui template generali
This commit is contained in:
54
app/Http/Controllers/Auth/AuthenticatedSessionController.php
Normal file
54
app/Http/Controllers/Auth/AuthenticatedSessionController.php
Normal file
@@ -0,0 +1,54 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers\Auth;
|
||||||
|
|
||||||
|
use App\Http\Controllers\Controller;
|
||||||
|
use App\Http\Requests\Auth\LoginRequest;
|
||||||
|
use App\Providers\RouteServiceProvider;
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
use Illuminate\Support\Facades\Auth;
|
||||||
|
|
||||||
|
class AuthenticatedSessionController extends Controller
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Display the login view.
|
||||||
|
*
|
||||||
|
* @return \Illuminate\View\View
|
||||||
|
*/
|
||||||
|
public function create()
|
||||||
|
{
|
||||||
|
return view('auth.login');
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Handle an incoming authentication request.
|
||||||
|
*
|
||||||
|
* @param \App\Http\Requests\Auth\LoginRequest $request
|
||||||
|
* @return \Illuminate\Http\RedirectResponse
|
||||||
|
*/
|
||||||
|
public function store(LoginRequest $request)
|
||||||
|
{
|
||||||
|
$request->authenticate();
|
||||||
|
|
||||||
|
$request->session()->regenerate();
|
||||||
|
|
||||||
|
return redirect(RouteServiceProvider::HOME);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Destroy an authenticated session.
|
||||||
|
*
|
||||||
|
* @param \Illuminate\Http\Request $request
|
||||||
|
* @return \Illuminate\Http\RedirectResponse
|
||||||
|
*/
|
||||||
|
public function destroy(Request $request)
|
||||||
|
{
|
||||||
|
Auth::guard('web')->logout();
|
||||||
|
|
||||||
|
$request->session()->invalidate();
|
||||||
|
|
||||||
|
$request->session()->regenerateToken();
|
||||||
|
|
||||||
|
return redirect('/');
|
||||||
|
}
|
||||||
|
}
|
45
app/Http/Controllers/Auth/ConfirmablePasswordController.php
Normal file
45
app/Http/Controllers/Auth/ConfirmablePasswordController.php
Normal file
@@ -0,0 +1,45 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers\Auth;
|
||||||
|
|
||||||
|
use App\Http\Controllers\Controller;
|
||||||
|
use App\Providers\RouteServiceProvider;
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
use Illuminate\Support\Facades\Auth;
|
||||||
|
use Illuminate\Validation\ValidationException;
|
||||||
|
|
||||||
|
class ConfirmablePasswordController extends Controller
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Show the confirm password view.
|
||||||
|
*
|
||||||
|
* @param \Illuminate\Http\Request $request
|
||||||
|
* @return \Illuminate\View\View
|
||||||
|
*/
|
||||||
|
public function show(Request $request)
|
||||||
|
{
|
||||||
|
return view('auth.confirm-password');
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Confirm the user's password.
|
||||||
|
*
|
||||||
|
* @param \Illuminate\Http\Request $request
|
||||||
|
* @return mixed
|
||||||
|
*/
|
||||||
|
public function store(Request $request)
|
||||||
|
{
|
||||||
|
if (! Auth::guard('web')->validate([
|
||||||
|
'usernamen' => $request->user()->usernamen,
|
||||||
|
'password' => $request->password,
|
||||||
|
])) {
|
||||||
|
throw ValidationException::withMessages([
|
||||||
|
'password' => __('auth.password'),
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
$request->session()->put('auth.password_confirmed_at', time());
|
||||||
|
|
||||||
|
return redirect()->intended(RouteServiceProvider::HOME);
|
||||||
|
}
|
||||||
|
}
|
@@ -0,0 +1,27 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers\Auth;
|
||||||
|
|
||||||
|
use App\Http\Controllers\Controller;
|
||||||
|
use App\Providers\RouteServiceProvider;
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
|
||||||
|
class EmailVerificationNotificationController extends Controller
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Send a new email verification notification.
|
||||||
|
*
|
||||||
|
* @param \Illuminate\Http\Request $request
|
||||||
|
* @return \Illuminate\Http\Response
|
||||||
|
*/
|
||||||
|
public function store(Request $request)
|
||||||
|
{
|
||||||
|
if ($request->user()->hasVerifiedEmail()) {
|
||||||
|
return redirect()->intended(RouteServiceProvider::HOME);
|
||||||
|
}
|
||||||
|
|
||||||
|
$request->user()->sendEmailVerificationNotification();
|
||||||
|
|
||||||
|
return back()->with('status', 'verification-link-sent');
|
||||||
|
}
|
||||||
|
}
|
@@ -0,0 +1,23 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers\Auth;
|
||||||
|
|
||||||
|
use App\Http\Controllers\Controller;
|
||||||
|
use App\Providers\RouteServiceProvider;
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
|
||||||
|
class EmailVerificationPromptController extends Controller
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Display the email verification prompt.
|
||||||
|
*
|
||||||
|
* @param \Illuminate\Http\Request $request
|
||||||
|
* @return mixed
|
||||||
|
*/
|
||||||
|
public function __invoke(Request $request)
|
||||||
|
{
|
||||||
|
return $request->user()->hasVerifiedEmail()
|
||||||
|
? redirect()->intended(RouteServiceProvider::HOME)
|
||||||
|
: view('auth.verify-email');
|
||||||
|
}
|
||||||
|
}
|
63
app/Http/Controllers/Auth/NewPasswordController.php
Normal file
63
app/Http/Controllers/Auth/NewPasswordController.php
Normal file
@@ -0,0 +1,63 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers\Auth;
|
||||||
|
|
||||||
|
use App\Http\Controllers\Controller;
|
||||||
|
use Illuminate\Auth\Events\PasswordReset;
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
use Illuminate\Support\Facades\Hash;
|
||||||
|
use Illuminate\Support\Facades\Password;
|
||||||
|
use Illuminate\Support\Str;
|
||||||
|
|
||||||
|
class NewPasswordController extends Controller
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Display the password reset view.
|
||||||
|
*
|
||||||
|
* @return \Illuminate\View\View
|
||||||
|
*/
|
||||||
|
public function create(Request $request)
|
||||||
|
{
|
||||||
|
return view('auth.reset-password', ['request' => $request]);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Handle an incoming new password request.
|
||||||
|
*
|
||||||
|
* @param \Illuminate\Http\Request $request
|
||||||
|
* @return \Illuminate\Http\RedirectResponse
|
||||||
|
*
|
||||||
|
* @throws \Illuminate\Validation\ValidationException
|
||||||
|
*/
|
||||||
|
public function store(Request $request)
|
||||||
|
{
|
||||||
|
$request->validate([
|
||||||
|
'token' => 'required',
|
||||||
|
'username' => 'required|string',
|
||||||
|
'password' => 'required|string|confirmed|min:8',
|
||||||
|
]);
|
||||||
|
|
||||||
|
// Here we will attempt to reset the user's password. If it is successful we
|
||||||
|
// will update the password on an actual user model and persist it to the
|
||||||
|
// database. Otherwise we will parse the error and return the response.
|
||||||
|
$status = Password::reset(
|
||||||
|
$request->only('username', 'password', 'password_confirmation', 'token'),
|
||||||
|
function ($user) use ($request) {
|
||||||
|
$user->forceFill([
|
||||||
|
'password' => Hash::make($request->password),
|
||||||
|
'remember_token' => Str::random(60),
|
||||||
|
])->save();
|
||||||
|
|
||||||
|
event(new PasswordReset($user));
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
// If the password was successfully reset, we will redirect the user back to
|
||||||
|
// the application's home authenticated view. If there is an error we can
|
||||||
|
// redirect them back to where they came from with their error message.
|
||||||
|
return $status == Password::PASSWORD_RESET
|
||||||
|
? redirect()->route('login')->with('status', __($status))
|
||||||
|
: back()->withInput($request->only('username'))
|
||||||
|
->withErrors(['username' => __($status)]);
|
||||||
|
}
|
||||||
|
}
|
47
app/Http/Controllers/Auth/PasswordResetLinkController.php
Normal file
47
app/Http/Controllers/Auth/PasswordResetLinkController.php
Normal file
@@ -0,0 +1,47 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers\Auth;
|
||||||
|
|
||||||
|
use App\Http\Controllers\Controller;
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
use Illuminate\Support\Facades\Password;
|
||||||
|
|
||||||
|
class PasswordResetLinkController extends Controller
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Display the password reset link request view.
|
||||||
|
*
|
||||||
|
* @return \Illuminate\View\View
|
||||||
|
*/
|
||||||
|
public function create()
|
||||||
|
{
|
||||||
|
return view('auth.forgot-password');
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Handle an incoming password reset link request.
|
||||||
|
*
|
||||||
|
* @param \Illuminate\Http\Request $request
|
||||||
|
* @return \Illuminate\Http\RedirectResponse
|
||||||
|
*
|
||||||
|
* @throws \Illuminate\Validation\ValidationException
|
||||||
|
*/
|
||||||
|
public function store(Request $request)
|
||||||
|
{
|
||||||
|
$request->validate([
|
||||||
|
'email' => 'required|email',
|
||||||
|
]);
|
||||||
|
|
||||||
|
// We will send the password reset link to this user. Once we have attempted
|
||||||
|
// to send the link, we will examine the response then see the message we
|
||||||
|
// need to show to the user. Finally, we'll send out a proper response.
|
||||||
|
$status = Password::sendResetLink(
|
||||||
|
$request->only('email')
|
||||||
|
);
|
||||||
|
|
||||||
|
return $status == Password::RESET_LINK_SENT
|
||||||
|
? back()->with('status', __($status))
|
||||||
|
: back()->withInput($request->only('email'))
|
||||||
|
->withErrors(['email' => __($status)]);
|
||||||
|
}
|
||||||
|
}
|
51
app/Http/Controllers/Auth/RegisteredUserController.php
Normal file
51
app/Http/Controllers/Auth/RegisteredUserController.php
Normal file
@@ -0,0 +1,51 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers\Auth;
|
||||||
|
|
||||||
|
use App\Http\Controllers\Controller;
|
||||||
|
use App\Models\User;
|
||||||
|
use App\Providers\RouteServiceProvider;
|
||||||
|
use Illuminate\Auth\Events\Registered;
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
use Illuminate\Support\Facades\Auth;
|
||||||
|
use Illuminate\Support\Facades\Hash;
|
||||||
|
|
||||||
|
class RegisteredUserController extends Controller
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Display the registration view.
|
||||||
|
*
|
||||||
|
* @return \Illuminate\View\View
|
||||||
|
*/
|
||||||
|
public function create()
|
||||||
|
{
|
||||||
|
return view('auth.register');
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Handle an incoming registration request.
|
||||||
|
*
|
||||||
|
* @param \Illuminate\Http\Request $request
|
||||||
|
* @return \Illuminate\Http\RedirectResponse
|
||||||
|
*
|
||||||
|
* @throws \Illuminate\Validation\ValidationException
|
||||||
|
*/
|
||||||
|
public function store(Request $request)
|
||||||
|
{
|
||||||
|
$request->validate([
|
||||||
|
'name' => 'required|string|max:255',
|
||||||
|
'email' => 'required|string|email|max:255|unique:users',
|
||||||
|
'password' => 'required|string|confirmed|min:8',
|
||||||
|
]);
|
||||||
|
|
||||||
|
Auth::login($user = User::create([
|
||||||
|
'name' => $request->name,
|
||||||
|
'email' => $request->email,
|
||||||
|
'password' => Hash::make($request->password),
|
||||||
|
]));
|
||||||
|
|
||||||
|
event(new Registered($user));
|
||||||
|
|
||||||
|
return redirect(RouteServiceProvider::HOME);
|
||||||
|
}
|
||||||
|
}
|
30
app/Http/Controllers/Auth/VerifyEmailController.php
Normal file
30
app/Http/Controllers/Auth/VerifyEmailController.php
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers\Auth;
|
||||||
|
|
||||||
|
use App\Http\Controllers\Controller;
|
||||||
|
use App\Providers\RouteServiceProvider;
|
||||||
|
use Illuminate\Auth\Events\Verified;
|
||||||
|
use Illuminate\Foundation\Auth\EmailVerificationRequest;
|
||||||
|
|
||||||
|
class VerifyEmailController extends Controller
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Mark the authenticated user's email address as verified.
|
||||||
|
*
|
||||||
|
* @param \Illuminate\Foundation\Auth\EmailVerificationRequest $request
|
||||||
|
* @return \Illuminate\Http\RedirectResponse
|
||||||
|
*/
|
||||||
|
public function __invoke(EmailVerificationRequest $request)
|
||||||
|
{
|
||||||
|
if ($request->user()->hasVerifiedEmail()) {
|
||||||
|
return redirect()->intended(RouteServiceProvider::HOME.'?verified=1');
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($request->user()->markEmailAsVerified()) {
|
||||||
|
event(new Verified($request->user()));
|
||||||
|
}
|
||||||
|
|
||||||
|
return redirect()->intended(RouteServiceProvider::HOME.'?verified=1');
|
||||||
|
}
|
||||||
|
}
|
170
app/Http/Controllers/InfoController.php
Normal file
170
app/Http/Controllers/InfoController.php
Normal file
@@ -0,0 +1,170 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers;
|
||||||
|
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
|
||||||
|
class InfoController extends Controller
|
||||||
|
{
|
||||||
|
/** @var int Lunghezza minima della password */
|
||||||
|
public static $min_length_password = 8;
|
||||||
|
|
||||||
|
protected static $bugEmail = 'info@openstamanager.com';
|
||||||
|
|
||||||
|
public function info()
|
||||||
|
{
|
||||||
|
return view('info.info');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function logs()
|
||||||
|
{
|
||||||
|
$user = auth()->getUser();
|
||||||
|
|
||||||
|
$query = 'SELECT * FROM `zz_logs`';
|
||||||
|
if (!Auth::admin()) {
|
||||||
|
$query .= ' WHERE `id_utente`='.prepare($user['id']);
|
||||||
|
}
|
||||||
|
$query .= ' ORDER BY `created_at` DESC LIMIT 0, 100';
|
||||||
|
|
||||||
|
$results = $this->database->fetchArray($query);
|
||||||
|
|
||||||
|
$status = Auth::getStatus();
|
||||||
|
$data = [];
|
||||||
|
foreach ($status as $state) {
|
||||||
|
$color = 'warning';
|
||||||
|
|
||||||
|
$color = $state['code'] == $status['success']['code'] ? 'success' : $color;
|
||||||
|
$color = $state['code'] == $status['failed']['code'] ? 'danger' : $color;
|
||||||
|
|
||||||
|
$data[$state['code']] = [
|
||||||
|
'message' => $state['message'],
|
||||||
|
'color' => $color,
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
$args['status'] = $data;
|
||||||
|
$args['results'] = $results;
|
||||||
|
|
||||||
|
$response = $this->twig->render($response, '@resources/info/logs.twig', $args);
|
||||||
|
|
||||||
|
return $response;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function user()
|
||||||
|
{
|
||||||
|
$token = auth()->getToken();
|
||||||
|
|
||||||
|
$api = BASEURL.'/api/?token='.$token;
|
||||||
|
|
||||||
|
$args['api'] = $api;
|
||||||
|
$args['token'] = $token;
|
||||||
|
$args['sync_link'] = $api.'&resource=sync';
|
||||||
|
|
||||||
|
$response = $this->twig->render($response, '@resources/user/user.twig', $args);
|
||||||
|
|
||||||
|
return $response;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function password()
|
||||||
|
{
|
||||||
|
$args['min_length_password'] = self::$min_length_password;
|
||||||
|
|
||||||
|
$response = $this->twig->render($response, '@resources/user/password.twig', $args);
|
||||||
|
|
||||||
|
return $response;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function passwordPost()
|
||||||
|
{
|
||||||
|
$user = auth()->getUser();
|
||||||
|
$password = post('password');
|
||||||
|
|
||||||
|
$user->password = $password;
|
||||||
|
$user->save();
|
||||||
|
|
||||||
|
flash()->info(tr('Password aggiornata!'));
|
||||||
|
|
||||||
|
$response = $response->withRedirect($this->router->urlFor('user'));
|
||||||
|
|
||||||
|
return $response;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function bug()
|
||||||
|
{
|
||||||
|
$args['mail'] = Account::where('predefined', true)->first();
|
||||||
|
$args['bug_email'] = self::$bugEmail;
|
||||||
|
|
||||||
|
$response = $this->twig->render($response, '@resources/info/bug.twig', $args);
|
||||||
|
|
||||||
|
return $response;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function bugSend()
|
||||||
|
{
|
||||||
|
$user = auth()->getUser();
|
||||||
|
$bug_email = self::$bugEmail;
|
||||||
|
|
||||||
|
// Preparazione email
|
||||||
|
$mail = new EmailNotification();
|
||||||
|
|
||||||
|
// Destinatario
|
||||||
|
$mail->AddAddress($bug_email);
|
||||||
|
|
||||||
|
// Oggetto
|
||||||
|
$mail->Subject = 'Segnalazione bug OSM '.$args['version'];
|
||||||
|
|
||||||
|
// Aggiunta dei file di log (facoltativo)
|
||||||
|
if (!empty(post('log')) && file_exists(DOCROOT.'/logs/error.log')) {
|
||||||
|
$mail->AddAttachment(DOCROOT.'/logs/error.log');
|
||||||
|
}
|
||||||
|
|
||||||
|
// Aggiunta della copia del database (facoltativo)
|
||||||
|
if (!empty(post('sql'))) {
|
||||||
|
$backup_file = DOCROOT.'/Backup OSM '.date('Y-m-d').' '.date('H_i_s').'.sql';
|
||||||
|
Backup::database($backup_file);
|
||||||
|
|
||||||
|
$mail->AddAttachment($backup_file);
|
||||||
|
|
||||||
|
flash()->info(tr('Backup del database eseguito ed allegato correttamente!'));
|
||||||
|
}
|
||||||
|
|
||||||
|
// Aggiunta delle informazioni di base sull'installazione
|
||||||
|
$infos = [
|
||||||
|
'Utente' => $user['username'],
|
||||||
|
'IP' => get_client_ip(),
|
||||||
|
'Versione OSM' => $args['version'].' ('.($args['revision'] ? $args['revision'] : 'In sviluppo').')',
|
||||||
|
'PHP' => phpversion(),
|
||||||
|
];
|
||||||
|
|
||||||
|
// Aggiunta delle informazioni sul sistema (facoltativo)
|
||||||
|
if (!empty(post('info'))) {
|
||||||
|
$infos['Sistema'] = $_SERVER['HTTP_USER_AGENT'].' - '.getOS();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Completamento del body
|
||||||
|
$body = post('body').'<hr>';
|
||||||
|
foreach ($infos as $key => $value) {
|
||||||
|
$body .= '<p>'.$key.': '.$value.'</p>';
|
||||||
|
}
|
||||||
|
|
||||||
|
$mail->Body = $body;
|
||||||
|
|
||||||
|
$mail->AltBody = 'Questa email arriva dal modulo bug di segnalazione bug di OSM';
|
||||||
|
|
||||||
|
// Invio mail
|
||||||
|
if (!$mail->send()) {
|
||||||
|
flash()->error(tr("Errore durante l'invio della segnalazione").': '.$mail->ErrorInfo);
|
||||||
|
} else {
|
||||||
|
flash()->info(tr('Email inviata correttamente!'));
|
||||||
|
}
|
||||||
|
|
||||||
|
// Rimozione del dump del database
|
||||||
|
if (!empty(post('sql'))) {
|
||||||
|
delete($backup_file);
|
||||||
|
}
|
||||||
|
|
||||||
|
$response = $response->withRedirect($this->router->urlFor('bug'));
|
||||||
|
|
||||||
|
return $response;
|
||||||
|
}
|
||||||
|
}
|
@@ -28,8 +28,6 @@ class LegacyController extends Controller
|
|||||||
|
|
||||||
$output = ob_get_clean();
|
$output = ob_get_clean();
|
||||||
|
|
||||||
$output = translateTemplate($output);
|
|
||||||
|
|
||||||
return new Response($output);
|
return new Response($output);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
namespace App\Http;
|
namespace App\Http;
|
||||||
|
|
||||||
|
use App\Http\Middleware\HTMLBuilder;
|
||||||
use Illuminate\Foundation\Http\Kernel as HttpKernel;
|
use Illuminate\Foundation\Http\Kernel as HttpKernel;
|
||||||
|
|
||||||
class Kernel extends HttpKernel
|
class Kernel extends HttpKernel
|
||||||
@@ -21,6 +22,7 @@ class Kernel extends HttpKernel
|
|||||||
\Illuminate\Foundation\Http\Middleware\ValidatePostSize::class,
|
\Illuminate\Foundation\Http\Middleware\ValidatePostSize::class,
|
||||||
\App\Http\Middleware\TrimStrings::class,
|
\App\Http\Middleware\TrimStrings::class,
|
||||||
\Illuminate\Foundation\Http\Middleware\ConvertEmptyStringsToNull::class,
|
\Illuminate\Foundation\Http\Middleware\ConvertEmptyStringsToNull::class,
|
||||||
|
HTMLBuilder::class
|
||||||
];
|
];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
27
app/Http/Middleware/HTMLBuilder.php
Normal file
27
app/Http/Middleware/HTMLBuilder.php
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Middleware;
|
||||||
|
|
||||||
|
use Closure;
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
|
||||||
|
class HTMLBuilder
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Handle an incoming request.
|
||||||
|
*
|
||||||
|
* @param \Illuminate\Http\Request $request
|
||||||
|
* @param \Closure $next
|
||||||
|
* @return mixed
|
||||||
|
*/
|
||||||
|
public function handle(Request $request, Closure $next)
|
||||||
|
{
|
||||||
|
$response = $next($request);
|
||||||
|
|
||||||
|
$html_template = $response->content();
|
||||||
|
$content = translateTemplate($html_template);
|
||||||
|
$response->setContent($content);
|
||||||
|
|
||||||
|
return $response;
|
||||||
|
}
|
||||||
|
}
|
93
app/Http/Requests/Auth/LoginRequest.php
Normal file
93
app/Http/Requests/Auth/LoginRequest.php
Normal file
@@ -0,0 +1,93 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Requests\Auth;
|
||||||
|
|
||||||
|
use Illuminate\Auth\Events\Lockout;
|
||||||
|
use Illuminate\Foundation\Http\FormRequest;
|
||||||
|
use Illuminate\Support\Facades\Auth;
|
||||||
|
use Illuminate\Support\Facades\RateLimiter;
|
||||||
|
use Illuminate\Support\Str;
|
||||||
|
use Illuminate\Validation\ValidationException;
|
||||||
|
|
||||||
|
class LoginRequest extends FormRequest
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Determine if the user is authorized to make this request.
|
||||||
|
*
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
|
public function authorize()
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the validation rules that apply to the request.
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
public function rules()
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'username' => 'required|string',
|
||||||
|
'password' => 'required|string',
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Attempt to authenticate the request's credentials.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*
|
||||||
|
* @throws \Illuminate\Validation\ValidationException
|
||||||
|
*/
|
||||||
|
public function authenticate()
|
||||||
|
{
|
||||||
|
$this->ensureIsNotRateLimited();
|
||||||
|
|
||||||
|
if (! Auth::attempt($this->only('username', 'password'), $this->filled('remember'))) {
|
||||||
|
RateLimiter::hit($this->throttleKey());
|
||||||
|
|
||||||
|
throw ValidationException::withMessages([
|
||||||
|
'username' => __('auth.failed'),
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
RateLimiter::clear($this->throttleKey());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Ensure the login request is not rate limited.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*
|
||||||
|
* @throws \Illuminate\Validation\ValidationException
|
||||||
|
*/
|
||||||
|
public function ensureIsNotRateLimited()
|
||||||
|
{
|
||||||
|
if (! RateLimiter::tooManyAttempts($this->throttleKey(), 5)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
event(new Lockout($this));
|
||||||
|
|
||||||
|
$seconds = RateLimiter::availableIn($this->throttleKey());
|
||||||
|
|
||||||
|
throw ValidationException::withMessages([
|
||||||
|
'username' => trans('auth.throttle', [
|
||||||
|
'seconds' => $seconds,
|
||||||
|
'minutes' => ceil($seconds / 60),
|
||||||
|
]),
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the rate limiting throttle key for the request.
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public function throttleKey()
|
||||||
|
{
|
||||||
|
return Str::lower($this->input('username')).'|'.$this->ip();
|
||||||
|
}
|
||||||
|
}
|
36
resources/views/auth/confirm-password.blade.php
Normal file
36
resources/views/auth/confirm-password.blade.php
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
<x-guest-layout>
|
||||||
|
<x-auth-card>
|
||||||
|
<x-slot name="logo">
|
||||||
|
<a href="/">
|
||||||
|
<x-application-logo class="w-20 h-20 fill-current text-gray-500" />
|
||||||
|
</a>
|
||||||
|
</x-slot>
|
||||||
|
|
||||||
|
<div class="mb-4 text-sm text-gray-600">
|
||||||
|
{{ __('This is a secure area of the application. Please confirm your password before continuing.') }}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Validation Errors -->
|
||||||
|
<x-auth-validation-errors class="mb-4" :errors="$errors" />
|
||||||
|
|
||||||
|
<form method="POST" action="{{ route('password.confirm') }}">
|
||||||
|
@csrf
|
||||||
|
|
||||||
|
<!-- Password -->
|
||||||
|
<div>
|
||||||
|
<x-label for="password" :value="__('Password')" />
|
||||||
|
|
||||||
|
<x-input id="password" class="block mt-1 w-full"
|
||||||
|
type="password"
|
||||||
|
name="password"
|
||||||
|
required autocomplete="current-password" />
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="flex justify-end mt-4">
|
||||||
|
<x-button>
|
||||||
|
{{ __('Confirm') }}
|
||||||
|
</x-button>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</x-auth-card>
|
||||||
|
</x-guest-layout>
|
36
resources/views/auth/forgot-password.blade.php
Normal file
36
resources/views/auth/forgot-password.blade.php
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
<x-guest-layout>
|
||||||
|
<x-auth-card>
|
||||||
|
<x-slot name="logo">
|
||||||
|
<a href="/">
|
||||||
|
<x-application-logo class="w-20 h-20 fill-current text-gray-500" />
|
||||||
|
</a>
|
||||||
|
</x-slot>
|
||||||
|
|
||||||
|
<div class="mb-4 text-sm text-gray-600">
|
||||||
|
{{ __('Forgot your password? No problem. Just let us know your email address and we will email you a password reset link that will allow you to choose a new one.') }}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Session Status -->
|
||||||
|
<x-auth-session-status class="mb-4" :status="session('status')" />
|
||||||
|
|
||||||
|
<!-- Validation Errors -->
|
||||||
|
<x-auth-validation-errors class="mb-4" :errors="$errors" />
|
||||||
|
|
||||||
|
<form method="POST" action="{{ route('password.email') }}">
|
||||||
|
@csrf
|
||||||
|
|
||||||
|
<!-- Email Address -->
|
||||||
|
<div>
|
||||||
|
<x-label for="email" :value="__('Email')" />
|
||||||
|
|
||||||
|
<x-input id="email" class="block mt-1 w-full" type="email" name="email" :value="old('email')" required autofocus />
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="flex items-center justify-end mt-4">
|
||||||
|
<x-button>
|
||||||
|
{{ __('Email Password Reset Link') }}
|
||||||
|
</x-button>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</x-auth-card>
|
||||||
|
</x-guest-layout>
|
90
resources/views/auth/login.blade.php
Normal file
90
resources/views/auth/login.blade.php
Normal file
@@ -0,0 +1,90 @@
|
|||||||
|
@extends('layouts.base')
|
||||||
|
|
||||||
|
@section('body_class', 'hold-transition login-page')
|
||||||
|
@section('title', __("Login"))
|
||||||
|
|
||||||
|
@section('body')
|
||||||
|
<div class="login-box">
|
||||||
|
<div class="login-logo">
|
||||||
|
<a href="//openstamanager.com" target="_blank">
|
||||||
|
<img src="{{ base_url() }}/assets/img/full_logo.png" style="max-width: 360px">
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<form method="POST" action="{{ route('login') }}">
|
||||||
|
@csrf
|
||||||
|
|
||||||
|
<div class="box">
|
||||||
|
<div class="box-body login-box-body">
|
||||||
|
<h4 class="login-box-msg">{{ __('Accedi') }}</h4>
|
||||||
|
|
||||||
|
{[ "type": "text", "name": "username", "autocomplete": "username", "placeholder": "{{ __('Username') }}", "value": "{{ old('username') }}", "icon-before": "<i class=\"fa fa-user\"></i>", "required": 1 ]}
|
||||||
|
<div class="mb-3" style="margin-bottom: 1rem !important;"></div>
|
||||||
|
|
||||||
|
{[ "type": "password", "name": "password", "autocomplete": "current-password", "placeholder": "{{ __('Password') }}", "icon-before": "<i class=\"fa fa-lock\"></i>" ]}
|
||||||
|
<div class="mb-3" style="margin-bottom: 1rem !important;"></div>
|
||||||
|
|
||||||
|
@if (Route::has('password.request'))
|
||||||
|
<div class="text-right">
|
||||||
|
<a href="{{ route('password.request') }}">{{ __('Dimenticata la password?') }}</a>
|
||||||
|
</div>
|
||||||
|
@endif
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="box-footer">
|
||||||
|
<button type="submit" class="btn btn-warning btn-block">{{ __('Accedi') }}</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
@endsection
|
||||||
|
|
||||||
|
@section('before_content')
|
||||||
|
@if (Update::isBeta())
|
||||||
|
<div class="clearfix"> </div>
|
||||||
|
<div class="alert alert-warning alert-dismissable col-md-6 col-md-push-3 text-center fade in">
|
||||||
|
<i class="fa fa-warning"></i> <b>{{ __('Attenzione!') }}</b> {{ __('Stai utilizzando una versione <b>non stabile</b> di OSM.') }}
|
||||||
|
|
||||||
|
<button aria-hidden="true" data-dismiss="alert" class="close" type="button">×</button>
|
||||||
|
</div>
|
||||||
|
@endif
|
||||||
|
|
||||||
|
@if (false)
|
||||||
|
<div class="box box-outline box-danger box-center" id="brute">
|
||||||
|
<div class="box-header text-center">
|
||||||
|
<h3 class="box-title">{{ __('Attenzione') }}</h3>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="box-body text-center">
|
||||||
|
<p>{{ __('Sono stati effettuati troppi tentativi di accesso consecutivi!') }}</p>
|
||||||
|
<p>{{ __('Tempo rimanente (in secondi)') }}: <span id="brute-timeout">{{ brute.timeout + 1 }}</span></p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<script>
|
||||||
|
$(document).ready(function(){
|
||||||
|
$(".login-box").fadeOut();
|
||||||
|
brute();
|
||||||
|
});
|
||||||
|
|
||||||
|
function brute() {
|
||||||
|
var value = parseFloat($("#brute-timeout").html()) - 1;
|
||||||
|
$("#brute-timeout").html(value);
|
||||||
|
|
||||||
|
if(value > 0){
|
||||||
|
setTimeout("brute()", 1000);
|
||||||
|
} else{
|
||||||
|
$("#brute").fadeOut();
|
||||||
|
$(".login-box").fadeIn();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
@endif
|
||||||
|
|
||||||
|
@if (flash()->getMessage('error') !== null)
|
||||||
|
<script>
|
||||||
|
$(document).ready(function(){
|
||||||
|
$(".login-box").effect("shake");
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
@endif
|
||||||
|
@endsection
|
48
resources/views/auth/reset-password.blade.php
Normal file
48
resources/views/auth/reset-password.blade.php
Normal file
@@ -0,0 +1,48 @@
|
|||||||
|
<x-guest-layout>
|
||||||
|
<x-auth-card>
|
||||||
|
<x-slot name="logo">
|
||||||
|
<a href="/">
|
||||||
|
<x-application-logo class="w-20 h-20 fill-current text-gray-500" />
|
||||||
|
</a>
|
||||||
|
</x-slot>
|
||||||
|
|
||||||
|
<!-- Validation Errors -->
|
||||||
|
<x-auth-validation-errors class="mb-4" :errors="$errors" />
|
||||||
|
|
||||||
|
<form method="POST" action="{{ route('password.update') }}">
|
||||||
|
@csrf
|
||||||
|
|
||||||
|
<!-- Password Reset Token -->
|
||||||
|
<input type="hidden" name="token" value="{{ $request->route('token') }}">
|
||||||
|
|
||||||
|
<!-- Email Address -->
|
||||||
|
<div>
|
||||||
|
<x-label for="email" :value="__('Email')" />
|
||||||
|
|
||||||
|
<x-input id="email" class="block mt-1 w-full" type="email" name="email" :value="old('email', $request->email)" required autofocus />
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Password -->
|
||||||
|
<div class="mt-4">
|
||||||
|
<x-label for="password" :value="__('Password')" />
|
||||||
|
|
||||||
|
<x-input id="password" class="block mt-1 w-full" type="password" name="password" required />
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Confirm Password -->
|
||||||
|
<div class="mt-4">
|
||||||
|
<x-label for="password_confirmation" :value="__('Confirm Password')" />
|
||||||
|
|
||||||
|
<x-input id="password_confirmation" class="block mt-1 w-full"
|
||||||
|
type="password"
|
||||||
|
name="password_confirmation" required />
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="flex items-center justify-end mt-4">
|
||||||
|
<x-button>
|
||||||
|
{{ __('Reset Password') }}
|
||||||
|
</x-button>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</x-auth-card>
|
||||||
|
</x-guest-layout>
|
39
resources/views/auth/verify-email.blade.php
Normal file
39
resources/views/auth/verify-email.blade.php
Normal file
@@ -0,0 +1,39 @@
|
|||||||
|
<x-guest-layout>
|
||||||
|
<x-auth-card>
|
||||||
|
<x-slot name="logo">
|
||||||
|
<a href="/">
|
||||||
|
<x-application-logo class="w-20 h-20 fill-current text-gray-500" />
|
||||||
|
</a>
|
||||||
|
</x-slot>
|
||||||
|
|
||||||
|
<div class="mb-4 text-sm text-gray-600">
|
||||||
|
{{ __('Thanks for signing up! Before getting started, could you verify your email address by clicking on the link we just emailed to you? If you didn\'t receive the email, we will gladly send you another.') }}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
@if (session('status') == 'verification-link-sent')
|
||||||
|
<div class="mb-4 font-medium text-sm text-green-600">
|
||||||
|
{{ __('A new verification link has been sent to the email address you provided during registration.') }}
|
||||||
|
</div>
|
||||||
|
@endif
|
||||||
|
|
||||||
|
<div class="mt-4 flex items-center justify-between">
|
||||||
|
<form method="POST" action="{{ route('verification.send') }}">
|
||||||
|
@csrf
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<x-button>
|
||||||
|
{{ __('Resend Verification Email') }}
|
||||||
|
</x-button>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
|
||||||
|
<form method="POST" action="{{ route('logout') }}">
|
||||||
|
@csrf
|
||||||
|
|
||||||
|
<button type="submit" class="underline text-sm text-gray-600 hover:text-gray-900">
|
||||||
|
{{ __('Logout') }}
|
||||||
|
</button>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</x-auth-card>
|
||||||
|
</x-guest-layout>
|
@@ -1,10 +1,17 @@
|
|||||||
@extends('layouts.base')
|
@extends('layouts.base')
|
||||||
|
|
||||||
|
@php
|
||||||
|
// Fix per inizializzazione variabili comuni
|
||||||
|
$module = \Models\Module::getCurrent();
|
||||||
|
$id_module = $module ? $module->id : null;
|
||||||
|
$id_record = isset($id_record) ? $id_record : null;
|
||||||
|
@endphp
|
||||||
|
|
||||||
@section('js')
|
@section('js')
|
||||||
<script>
|
<script>
|
||||||
search = [];
|
search = [];
|
||||||
|
|
||||||
@foreach($search as $key => $value)
|
@foreach(getSessionSearch($id_module) as $key => $value)
|
||||||
search.push("search_{{ $key }}");
|
search.push("search_{{ $key }}");
|
||||||
search["search_{{ $key }}"] = "{{ $value }}";
|
search["search_{{ $key }}"] = "{{ $value }}";
|
||||||
@endforeach
|
@endforeach
|
||||||
@@ -12,8 +19,8 @@
|
|||||||
globals = {
|
globals = {
|
||||||
rootdir: '{{ base_url() }}',
|
rootdir: '{{ base_url() }}',
|
||||||
|
|
||||||
id_module: '{{ id_module }}',
|
id_module: '{{ $id_module }}',
|
||||||
id_record: '{{ id_record }}',
|
id_record: '{{ $id_record }}',
|
||||||
|
|
||||||
is_mobile: {{ intval(isMobile()) }},
|
is_mobile: {{ intval(isMobile()) }},
|
||||||
cifre_decimali: '{{ setting('Cifre decimali per importi') }}',
|
cifre_decimali: '{{ setting('Cifre decimali per importi') }}',
|
||||||
@@ -123,7 +130,7 @@
|
|||||||
["Undo","Redo","-","Cut","Copy","Paste","PasteText","PasteFromWord","-","Scayt", "-","Link","Unlink","-","Bold","Italic","Underline","Superscript","SpecialChar","HorizontalRule","-","JustifyLeft","JustifyCenter","JustifyRight","JustifyBlock","-","NumberedList","BulletedList","Outdent","Indent","Blockquote","-","Styles","Format","Image","Table", "TextColor", "BGColor" ],
|
["Undo","Redo","-","Cut","Copy","Paste","PasteText","PasteFromWord","-","Scayt", "-","Link","Unlink","-","Bold","Italic","Underline","Superscript","SpecialChar","HorizontalRule","-","JustifyLeft","JustifyCenter","JustifyRight","JustifyBlock","-","NumberedList","BulletedList","Outdent","Indent","Blockquote","-","Styles","Format","Image","Table", "TextColor", "BGColor" ],
|
||||||
],
|
],
|
||||||
|
|
||||||
order_manager_id: '{{ module('Stato dei serivizi')['id'] }}',
|
order_manager_id: '{{ module('Stato dei servizi')['id'] }}',
|
||||||
tempo_attesa_ricerche: {{ setting('Tempo di attesa ricerche in secondi') }},
|
tempo_attesa_ricerche: {{ setting('Tempo di attesa ricerche in secondi') }},
|
||||||
restrict_summables_to_selected: {{ setting('Totali delle tabelle ristretti alla selezione') }},
|
restrict_summables_to_selected: {{ setting('Totali delle tabelle ristretti alla selezione') }},
|
||||||
select_url: "{{ route('ajax-select') }}",
|
select_url: "{{ route('ajax-select') }}",
|
||||||
@@ -208,10 +215,6 @@
|
|||||||
<i class="fa fa-print"></i>
|
<i class="fa fa-print"></i>
|
||||||
</a></li>
|
</a></li>
|
||||||
|
|
||||||
<li><a href="{{ base_url() }}/{{ record_id ? __('editor.php?id_record=' ~ record_id ~ '&' : 'controller.php?' }}id_module={{ module_id }}" class="tip btn-warning" title="{{ 'Base') }}">
|
|
||||||
<i class="fa fa-fast-backward"></i>
|
|
||||||
</a></li>
|
|
||||||
|
|
||||||
<li><a href="{{ route('bug') }}" class="tip" title="{{ __('Segnalazione bug') }}">
|
<li><a href="{{ route('bug') }}" class="tip" title="{{ __('Segnalazione bug') }}">
|
||||||
<i class="fa fa-bug"></i>
|
<i class="fa fa-bug"></i>
|
||||||
</a></li>
|
</a></li>
|
||||||
@@ -263,7 +266,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<ul class="sidebar-menu"><!-- class="nav nav-pills nav-sidebar nav-sidebar nav-child-indent flex-column" data-widget="treeview" role="menu" data-accordion="true" -->
|
<ul class="sidebar-menu"><!-- class="nav nav-pills nav-sidebar nav-sidebar nav-child-indent flex-column" data-widget="treeview" role="menu" data-accordion="true" -->
|
||||||
{{ main_menu|raw }}
|
{{ isset($main_menu) ? $main_menu : null }}
|
||||||
</ul>
|
</ul>
|
||||||
</section>
|
</section>
|
||||||
<!-- /.sidebar -->
|
<!-- /.sidebar -->
|
||||||
@@ -274,7 +277,7 @@
|
|||||||
<!-- Main content -->
|
<!-- Main content -->
|
||||||
<section class="content">
|
<section class="content">
|
||||||
<div class="container-fluid">
|
<div class="container-fluid">
|
||||||
@section('content')
|
@yield('content')
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
</div>
|
</div>
|
||||||
|
@@ -22,7 +22,6 @@
|
|||||||
<script type="text/javascript" charset="utf-8" src="{{ base_url() }}{{ asset('/js/app.js') }}"></script>
|
<script type="text/javascript" charset="utf-8" src="{{ base_url() }}{{ asset('/js/app.js') }}"></script>
|
||||||
<script type="text/javascript" charset="utf-8" src="{{ base_url() }}{{ asset('/js/base.js') }}"></script--->
|
<script type="text/javascript" charset="utf-8" src="{{ base_url() }}{{ asset('/js/base.js') }}"></script--->
|
||||||
|
|
||||||
|
|
||||||
@foreach (AppLegacy::getAssets()['css'] as $css)
|
@foreach (AppLegacy::getAssets()['css'] as $css)
|
||||||
<link rel="stylesheet" type="text/css" media="all" href="{{ $css }}"/>
|
<link rel="stylesheet" type="text/css" media="all" href="{{ $css }}"/>
|
||||||
@endforeach
|
@endforeach
|
||||||
|
@@ -1,86 +0,0 @@
|
|||||||
@extends('layouts.base')
|
|
||||||
|
|
||||||
@section('body_class', 'hold-transition login-page')
|
|
||||||
@section('title', __("Login"))
|
|
||||||
|
|
||||||
@section('body')
|
|
||||||
<div class="login-box">
|
|
||||||
<div class="login-logo">
|
|
||||||
<a href="//openstamanager.com" target="_blank">
|
|
||||||
<img src="{{ base_url() }}/assets/img/full_logo.png" style="max-width: 360px">
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<form novalidate action="" method="post">
|
|
||||||
<div class="box">
|
|
||||||
<div class="box-body login-box-body">
|
|
||||||
<h4 class="login-box-msg">{{ __('Accedi') }}</h4>
|
|
||||||
|
|
||||||
{[ "type": "text", "name": "username", "autocomplete": "username", "placeholder": "{{ __('Username') }}", "value": "{{ old('username') }}", "icon-before": "<i class=\"fa fa-user\"></i>", "required": 1 ]}
|
|
||||||
<div class="mb-3" style="margin-bottom: 1rem !important;"></div>
|
|
||||||
|
|
||||||
{[ "type": "password", "name": "password", "autocomplete": "current-password", "placeholder": "{{ __('Password') }}", "icon-before": "<i class=\"fa fa-lock\"></i>" ]}
|
|
||||||
<div class="mb-3" style="margin-bottom: 1rem !important;"></div>
|
|
||||||
|
|
||||||
<div class="text-right">
|
|
||||||
<a href="{{ base_url() }}/reset.php">{{ __('Dimenticata la password?') }}</a>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="box-footer">
|
|
||||||
<button type="submit" class="btn btn-warning btn-block">{{ __('Accedi') }}</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</form>
|
|
||||||
</div>
|
|
||||||
@endsection
|
|
||||||
|
|
||||||
@section('before_content')
|
|
||||||
@if (Update::isBeta())
|
|
||||||
<div class="clearfix"> </div>
|
|
||||||
<div class="alert alert-warning alert-dismissable col-md-6 col-md-push-3 text-center fade in">
|
|
||||||
<i class="fa fa-warning"></i> <b>{{ __('Attenzione!') }}</b> {{ __('Stai utilizzando una versione <b>non stabile</b> di OSM.') }}
|
|
||||||
|
|
||||||
<button aria-hidden="true" data-dismiss="alert" class="close" type="button">×</button>
|
|
||||||
</div>
|
|
||||||
@endif
|
|
||||||
|
|
||||||
@if (false)
|
|
||||||
<div class="box box-outline box-danger box-center" id="brute">
|
|
||||||
<div class="box-header text-center">
|
|
||||||
<h3 class="box-title">{{ __('Attenzione') }}</h3>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="box-body text-center">
|
|
||||||
<p>{{ __('Sono stati effettuati troppi tentativi di accesso consecutivi!') }}</p>
|
|
||||||
<p>{{ __('Tempo rimanente (in secondi)') }}: <span id="brute-timeout">{{ brute.timeout + 1 }}</span></p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<script>
|
|
||||||
$(document).ready(function(){
|
|
||||||
$(".login-box").fadeOut();
|
|
||||||
brute();
|
|
||||||
});
|
|
||||||
|
|
||||||
function brute() {
|
|
||||||
var value = parseFloat($("#brute-timeout").html()) - 1;
|
|
||||||
$("#brute-timeout").html(value);
|
|
||||||
|
|
||||||
if(value > 0){
|
|
||||||
setTimeout("brute()", 1000);
|
|
||||||
} else{
|
|
||||||
$("#brute").fadeOut();
|
|
||||||
$(".login-box").fadeIn();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
@endif
|
|
||||||
|
|
||||||
@if (flash()->getMessage('error') !== null)
|
|
||||||
<script>
|
|
||||||
$(document).ready(function(){
|
|
||||||
$(".login-box").effect("shake");
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
@endif
|
|
||||||
@endsection
|
|
57
routes/auth.php
Normal file
57
routes/auth.php
Normal file
@@ -0,0 +1,57 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
use App\Http\Controllers\Auth\AuthenticatedSessionController;
|
||||||
|
use App\Http\Controllers\Auth\ConfirmablePasswordController;
|
||||||
|
use App\Http\Controllers\Auth\EmailVerificationNotificationController;
|
||||||
|
use App\Http\Controllers\Auth\EmailVerificationPromptController;
|
||||||
|
use App\Http\Controllers\Auth\NewPasswordController;
|
||||||
|
use App\Http\Controllers\Auth\PasswordResetLinkController;
|
||||||
|
use App\Http\Controllers\Auth\RegisteredUserController;
|
||||||
|
use App\Http\Controllers\Auth\VerifyEmailController;
|
||||||
|
use Illuminate\Support\Facades\Route;
|
||||||
|
|
||||||
|
Route::get('/login', [AuthenticatedSessionController::class, 'create'])
|
||||||
|
->middleware('guest')
|
||||||
|
->name('login');
|
||||||
|
|
||||||
|
Route::post('/login', [AuthenticatedSessionController::class, 'store'])
|
||||||
|
->middleware('guest');
|
||||||
|
|
||||||
|
Route::get('/forgot-password', [PasswordResetLinkController::class, 'create'])
|
||||||
|
->middleware('guest')
|
||||||
|
->name('password.request');
|
||||||
|
|
||||||
|
Route::post('/forgot-password', [PasswordResetLinkController::class, 'store'])
|
||||||
|
->middleware('guest')
|
||||||
|
->name('password.email');
|
||||||
|
|
||||||
|
Route::get('/reset-password/{token}', [NewPasswordController::class, 'create'])
|
||||||
|
->middleware('guest')
|
||||||
|
->name('password.reset');
|
||||||
|
|
||||||
|
Route::post('/reset-password', [NewPasswordController::class, 'store'])
|
||||||
|
->middleware('guest')
|
||||||
|
->name('password.update');
|
||||||
|
|
||||||
|
Route::get('/verify-email', [EmailVerificationPromptController::class, '__invoke'])
|
||||||
|
->middleware('auth')
|
||||||
|
->name('verification.notice');
|
||||||
|
|
||||||
|
Route::get('/verify-email/{id}/{hash}', [VerifyEmailController::class, '__invoke'])
|
||||||
|
->middleware(['auth', 'signed', 'throttle:6,1'])
|
||||||
|
->name('verification.verify');
|
||||||
|
|
||||||
|
Route::post('/email/verification-notification', [EmailVerificationNotificationController::class, 'store'])
|
||||||
|
->middleware(['auth', 'throttle:6,1'])
|
||||||
|
->name('verification.send');
|
||||||
|
|
||||||
|
Route::get('/confirm-password', [ConfirmablePasswordController::class, 'show'])
|
||||||
|
->middleware('auth')
|
||||||
|
->name('password.confirm');
|
||||||
|
|
||||||
|
Route::post('/confirm-password', [ConfirmablePasswordController::class, 'store'])
|
||||||
|
->middleware('auth');
|
||||||
|
|
||||||
|
Route::post('/logout', [AuthenticatedSessionController::class, 'destroy'])
|
||||||
|
->middleware('auth')
|
||||||
|
->name('logout');
|
@@ -1,5 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
use App\Http\Controllers\InfoController;
|
||||||
use App\Http\Controllers\LegacyController;
|
use App\Http\Controllers\LegacyController;
|
||||||
use App\Http\Controllers\Test;
|
use App\Http\Controllers\Test;
|
||||||
use Illuminate\Support\Facades\Route;
|
use Illuminate\Support\Facades\Route;
|
||||||
@@ -19,31 +20,52 @@ Route::get('/test', function () {
|
|||||||
return view('welcome');
|
return view('welcome');
|
||||||
});
|
});
|
||||||
|
|
||||||
Route::get('/login', function () {
|
|
||||||
return view('user.login');
|
|
||||||
});
|
|
||||||
|
|
||||||
// Messaggi flash
|
// Messaggi flash
|
||||||
Route::get('/messages', [Test::class, 'index'])
|
Route::get('/messages', [Test::class, 'index'])
|
||||||
->name('messages');
|
->name('messages');
|
||||||
|
|
||||||
|
// Operazioni Ajax
|
||||||
|
Route::prefix('ajax')->group(function () {
|
||||||
|
Route::get('/select', [Test::class, 'index'])
|
||||||
|
->name('ajax-select');
|
||||||
|
Route::get('/complete', [Test::class, 'index'])
|
||||||
|
->name('ajax-complete');
|
||||||
|
Route::get('/search', [Test::class, 'index'])
|
||||||
|
->name('ajax-search');
|
||||||
|
|
||||||
|
// Sessioni
|
||||||
|
Route::get('/session/', [Test::class, 'index'])
|
||||||
|
->name('ajax-session');
|
||||||
|
Route::get('/session-array/', [Test::class, 'index'])
|
||||||
|
->name('ajax-session-array');
|
||||||
|
|
||||||
|
// Dataload
|
||||||
|
Route::get('/dataload/{module_id}/{reference_id?}', [Test::class, 'index'])
|
||||||
|
->where('module_id', '[0-9]+')
|
||||||
|
->where('reference_id', '[0-9]+')
|
||||||
|
->name('ajax-dataload');
|
||||||
|
});
|
||||||
|
|
||||||
// Hooks
|
// Hooks
|
||||||
Route::prefix('hook')->group(function () {
|
Route::prefix('hook')->group(function () {
|
||||||
Route::get('/list', [Test::class, 'index'])
|
Route::get('/list', [Test::class, 'index'])
|
||||||
->name('hooks');
|
->name('hooks');
|
||||||
|
|
||||||
Route::get('/lock/{hook_id:[0-9]+}', [Test::class, 'index'])
|
Route::get('/lock/{hook_id}', [Test::class, 'index'])
|
||||||
|
->where('hook_id', '[0-9]+')
|
||||||
->name('hook-lock');
|
->name('hook-lock');
|
||||||
|
|
||||||
Route::get('/execute/{hook_id:[0-9]+}/{token}', [Test::class, 'index'])
|
Route::get('/execute/{hook_id}/{token}', [Test::class, 'index'])
|
||||||
|
->where('hook_id', '[0-9]+')
|
||||||
->name('hook-execute');
|
->name('hook-execute');
|
||||||
|
|
||||||
Route::get('/response/{hook_id:[0-9]+}', [Test::class, 'index'])
|
Route::get('/response/{hook_id}', [Test::class, 'index'])
|
||||||
|
->where('hook_id', '[0-9]+')
|
||||||
->name('hook-response');
|
->name('hook-response');
|
||||||
});
|
});
|
||||||
|
|
||||||
// Informazioni su OpenSTAManager
|
// Informazioni su OpenSTAManager
|
||||||
Route::get('/info', [Test::class, 'index'])
|
Route::get('/info', [InfoController::class, 'info'])
|
||||||
->name('info');
|
->name('info');
|
||||||
|
|
||||||
// Segnalazione bug
|
// Segnalazione bug
|
||||||
@@ -62,3 +84,9 @@ Route::get('/user', [Test::class, 'index'])
|
|||||||
Route::get('/password', [Test::class, 'index'])
|
Route::get('/password', [Test::class, 'index'])
|
||||||
->name('user-password');
|
->name('user-password');
|
||||||
Route::post('/password', [Test::class, 'index']);
|
Route::post('/password', [Test::class, 'index']);
|
||||||
|
|
||||||
|
Route::get('/dashboard', function () {
|
||||||
|
return view('dashboard');
|
||||||
|
})->middleware(['auth'])->name('dashboard');
|
||||||
|
|
||||||
|
require __DIR__ . '/auth.php';
|
||||||
|
Reference in New Issue
Block a user