Compare commits
38 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 1361340928 | |||
| 1bda30e957 | |||
| a87423d879 | |||
| 24cda34681 | |||
| 2c514a8ab6 | |||
| b1ea728c15 | |||
| 9d5c20113f | |||
| 47762a8557 | |||
| 939a4fe03e | |||
| 493de65892 | |||
| 23ae8e1b1d | |||
| 7ad20993d9 | |||
| 8978980901 | |||
| 6d66c5cf97 | |||
| b3f19be47d | |||
| 13e73abc5d | |||
| 14d91b6d6e | |||
| c004636b6c | |||
| 4c4c6e3153 | |||
| 7d0824d01f | |||
| 32c0966801 | |||
| 57ab20ed1f | |||
| c533973420 | |||
| b092abf8c7 | |||
| 78089cadc1 | |||
| 3816bf5a20 | |||
| e8b15d8096 | |||
| d925726ecd | |||
| aaad0a6bda | |||
| 9c8f40a90b | |||
| 7c111b0dba | |||
| 7d0224ac19 | |||
| d033024363 | |||
| 6bec7bca15 | |||
| 489226f13a | |||
| 247f154cc8 | |||
| e683a81f46 | |||
| cf7068d7c6 |
@@ -37,4 +37,9 @@ PUSHER_APP_SECRET=
|
|||||||
PUSHER_APP_CLUSTER=mt1
|
PUSHER_APP_CLUSTER=mt1
|
||||||
|
|
||||||
MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
|
MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
|
||||||
MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"
|
MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"
|
||||||
|
|
||||||
|
# Credenziali API VisualLims
|
||||||
|
API_BASE_URL=https://93.43.5.102/limsapi
|
||||||
|
API_USERNAME=WebApiUser
|
||||||
|
API_PASSWORD=webapiuser01
|
||||||
@@ -3,7 +3,7 @@
|
|||||||
/public/hot
|
/public/hot
|
||||||
/public/storage
|
/public/storage
|
||||||
/storage/*.key
|
/storage/*.key
|
||||||
|
/vendor
|
||||||
/.idea
|
/.idea
|
||||||
/.fleet
|
/.fleet
|
||||||
/.vscode
|
/.vscode
|
||||||
@@ -12,7 +12,7 @@ Homestead.json
|
|||||||
Homestead.yaml
|
Homestead.yaml
|
||||||
npm-debug.log
|
npm-debug.log
|
||||||
yarn-error.log
|
yarn-error.log
|
||||||
|
.env
|
||||||
.phpunit.result.cache
|
.phpunit.result.cache
|
||||||
.php_cs.cache
|
.php_cs.cache
|
||||||
/documentation
|
/documentation
|
||||||
@@ -21,3 +21,14 @@ yarn-error.log
|
|||||||
.env.backup
|
.env.backup
|
||||||
.env.production
|
.env.production
|
||||||
auth.json
|
auth.json
|
||||||
|
# File di debug e temporanei JSON e log
|
||||||
|
/public/userarea/*.json
|
||||||
|
/public/userarea/*.log
|
||||||
|
/public/userarea/*.txt
|
||||||
|
|
||||||
|
# File di log nella sottocartella class
|
||||||
|
/public/userarea/class/*.log
|
||||||
|
|
||||||
|
# File XLSX temporanei importati
|
||||||
|
/public/userarea/imported_trf/*.xlsx
|
||||||
|
/public/userarea/xlstemplates/*.xlsx
|
||||||
|
|||||||
@@ -0,0 +1,74 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers\Userarea;
|
||||||
|
|
||||||
|
use App\Http\Controllers\Controller;
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
use Illuminate\Support\Facades\DB;
|
||||||
|
use Illuminate\Support\Facades\Storage;
|
||||||
|
|
||||||
|
class UploadPhotosMobileController extends Controller
|
||||||
|
{
|
||||||
|
public function index(Request $request)
|
||||||
|
{
|
||||||
|
$iddatadb = $request->query('iddatadb');
|
||||||
|
|
||||||
|
if (empty($iddatadb)) {
|
||||||
|
return response('ID riga non fornito', 400);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Show the upload form
|
||||||
|
return view('userarea.upload_photos_mobile', [
|
||||||
|
'iddatadb' => $iddatadb
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function upload(Request $request)
|
||||||
|
{
|
||||||
|
// Validation
|
||||||
|
$request->validate([
|
||||||
|
'photo' => 'required|file|mimes:jpeg,png,gif,heic,heif|max:5120', // 5MB
|
||||||
|
'iddatadb' => 'required|integer'
|
||||||
|
]);
|
||||||
|
|
||||||
|
$iddatadb = $request->input('iddatadb');
|
||||||
|
$photo = $request->file('photo');
|
||||||
|
$iduserlogin = auth()->id(); // assuming Laravel authentication
|
||||||
|
|
||||||
|
// Check if user exists
|
||||||
|
$userExists = DB::table('auth_users')->where('id', $iduserlogin)->exists();
|
||||||
|
if (!$userExists) {
|
||||||
|
return response()->json(['success' => false, 'message' => 'Utente non valido']);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Upload folder
|
||||||
|
$uploadDir = public_path('photostrf');
|
||||||
|
if (!is_dir($uploadDir)) {
|
||||||
|
mkdir($uploadDir, 0755, true);
|
||||||
|
}
|
||||||
|
if (!is_writable($uploadDir)) {
|
||||||
|
return response()->json(['success' => false, 'message' => 'La cartella photostrf non è scrivibile']);
|
||||||
|
}
|
||||||
|
|
||||||
|
// New filename
|
||||||
|
$timestamp = now()->format('YmdHis');
|
||||||
|
$originalName = pathinfo($photo->getClientOriginalName(), PATHINFO_FILENAME);
|
||||||
|
$extension = strtolower($photo->getClientOriginalExtension());
|
||||||
|
|
||||||
|
$newFileName = "{$iddatadb}-{$timestamp}-{$originalName}.{$extension}";
|
||||||
|
$destination = $uploadDir . '/' . $newFileName;
|
||||||
|
|
||||||
|
// Move uploaded file
|
||||||
|
$photo->move($uploadDir, $newFileName);
|
||||||
|
|
||||||
|
// Save DB record
|
||||||
|
DB::table('datadb_photos')->insert([
|
||||||
|
'iddatadb' => $iddatadb,
|
||||||
|
'file_path' => $newFileName,
|
||||||
|
'file_name' => $newFileName,
|
||||||
|
'uploaded_by' => $iduserlogin
|
||||||
|
]);
|
||||||
|
|
||||||
|
return response()->json(['success' => true, 'message' => 'Foto caricata con successo']);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -44,7 +44,7 @@ class LoginController extends Controller
|
|||||||
$throttles = (bool) setting('throttle_enabled');
|
$throttles = (bool) setting('throttle_enabled');
|
||||||
|
|
||||||
//Redirect URL that can be passed as hidden field.
|
//Redirect URL that can be passed as hidden field.
|
||||||
$to = $request->has('to') ? '?to='.$request->get('to') : '';
|
$to = $request->has('to') ? '?to=' . $request->get('to') : '';
|
||||||
|
|
||||||
if ($throttles && $this->hasTooManyLoginAttempts($request)) {
|
if ($throttles && $this->hasTooManyLoginAttempts($request)) {
|
||||||
return $this->sendLockoutResponse($request);
|
return $this->sendLockoutResponse($request);
|
||||||
@@ -60,20 +60,20 @@ class LoginController extends Controller
|
|||||||
$this->incrementLoginAttempts($request);
|
$this->incrementLoginAttempts($request);
|
||||||
}
|
}
|
||||||
|
|
||||||
return redirect()->to('login'.$to)
|
return redirect()->to('login' . $to)
|
||||||
->withErrors(trans('auth.failed'));
|
->withErrors(trans('auth.failed'));
|
||||||
}
|
}
|
||||||
|
|
||||||
$user = Auth::getProvider()->retrieveByCredentials($credentials);
|
$user = Auth::getProvider()->retrieveByCredentials($credentials);
|
||||||
|
|
||||||
if ($user->isBanned()) {
|
if ($user->isBanned()) {
|
||||||
return redirect()->to('login'.$to)
|
return redirect()->to('login' . $to)
|
||||||
->withErrors(trans('auth.banned'));
|
->withErrors(trans('auth.banned'));
|
||||||
}
|
}
|
||||||
|
|
||||||
$maxSessions = setting('max_active_sessions');
|
$maxSessions = setting('max_active_sessions');
|
||||||
if ($maxSessions && $sessions->getActiveSessionsCount($user->id) >= $maxSessions) {
|
if ($maxSessions && $sessions->getActiveSessionsCount($user->id) >= $maxSessions) {
|
||||||
return redirect()->to('login'.$to)
|
return redirect()->to('login' . $to)
|
||||||
->withErrors(trans('auth.max_sessions_reached'));
|
->withErrors(trans('auth.max_sessions_reached'));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -107,15 +107,14 @@ class LoginController extends Controller
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Reindirizza in base al ruolo
|
// Reindirizza in base al ruolo
|
||||||
if ($user->hasRole('Admin')) {
|
if ($user->hasRole('Admin')) {
|
||||||
return redirect()->to('userarea/admin.php');
|
return redirect()->to('userarea/import_dashboard.php');
|
||||||
} elseif ($user->hasRole('User')) {
|
} elseif ($user->hasRole('User')) {
|
||||||
return redirect()->to('userarea/index.php');
|
return redirect()->to('userarea/import_dashboard.php');
|
||||||
}
|
}
|
||||||
|
|
||||||
// Se il ruolo non è specificato, reindirizza alla home predefinita
|
|
||||||
return redirect()->intended('/');
|
|
||||||
|
|
||||||
|
// Se il ruolo non è specificato, reindirizza alla home predefinita
|
||||||
|
return redirect()->intended('/');
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function logoutAndRedirectToTokenPage(Request $request, $user, ?string $redirectPage): RedirectResponse
|
protected function logoutAndRedirectToTokenPage(Request $request, $user, ?string $redirectPage): RedirectResponse
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 4.5 KiB After Width: | Height: | Size: 10 KiB |
|
After Width: | Height: | Size: 9.3 KiB |
|
After Width: | Height: | Size: 5.9 KiB |
|
After Width: | Height: | Size: 5.9 KiB |
|
After Width: | Height: | Size: 5.9 KiB |
|
After Width: | Height: | Size: 5.9 KiB |
|
After Width: | Height: | Size: 5.9 KiB |
|
After Width: | Height: | Size: 5.9 KiB |
|
After Width: | Height: | Size: 5.9 KiB |
|
After Width: | Height: | Size: 5.9 KiB |
|
After Width: | Height: | Size: 5.9 KiB |
|
After Width: | Height: | Size: 5.9 KiB |
|
After Width: | Height: | Size: 571 KiB |
|
After Width: | Height: | Size: 571 KiB |
|
After Width: | Height: | Size: 571 KiB |
|
After Width: | Height: | Size: 571 KiB |
|
After Width: | Height: | Size: 571 KiB |
|
After Width: | Height: | Size: 571 KiB |
|
After Width: | Height: | Size: 571 KiB |
|
After Width: | Height: | Size: 5.1 KiB |
|
After Width: | Height: | Size: 5.9 KiB |
|
After Width: | Height: | Size: 5.1 KiB |
|
After Width: | Height: | Size: 5.9 KiB |
|
After Width: | Height: | Size: 5.9 KiB |
|
After Width: | Height: | Size: 5.1 KiB |
|
After Width: | Height: | Size: 5.1 KiB |
|
After Width: | Height: | Size: 5.1 KiB |
|
After Width: | Height: | Size: 39 KiB |
|
After Width: | Height: | Size: 49 KiB |
|
After Width: | Height: | Size: 38 KiB |
|
After Width: | Height: | Size: 5.1 KiB |
|
After Width: | Height: | Size: 5.1 KiB |
|
After Width: | Height: | Size: 5.1 KiB |
|
After Width: | Height: | Size: 5.9 KiB |
|
After Width: | Height: | Size: 5.1 KiB |
|
After Width: | Height: | Size: 5.9 KiB |
|
After Width: | Height: | Size: 5.1 KiB |
|
After Width: | Height: | Size: 5.1 KiB |
|
After Width: | Height: | Size: 5.1 KiB |
|
After Width: | Height: | Size: 5.1 KiB |
|
After Width: | Height: | Size: 5.1 KiB |
|
After Width: | Height: | Size: 5.1 KiB |
|
After Width: | Height: | Size: 5.1 KiB |
|
After Width: | Height: | Size: 5.1 KiB |
|
After Width: | Height: | Size: 5.9 KiB |
|
After Width: | Height: | Size: 5.1 KiB |
|
After Width: | Height: | Size: 5.9 KiB |
|
After Width: | Height: | Size: 38 KiB |
|
After Width: | Height: | Size: 38 KiB |
|
After Width: | Height: | Size: 52 KiB |
|
After Width: | Height: | Size: 54 KiB |
|
After Width: | Height: | Size: 5.9 KiB |
|
After Width: | Height: | Size: 5.1 KiB |
|
After Width: | Height: | Size: 5.9 KiB |
|
After Width: | Height: | Size: 5.1 KiB |
|
After Width: | Height: | Size: 5.9 KiB |
|
After Width: | Height: | Size: 5.1 KiB |
|
After Width: | Height: | Size: 5.9 KiB |
|
After Width: | Height: | Size: 5.1 KiB |
|
After Width: | Height: | Size: 5.9 KiB |
|
After Width: | Height: | Size: 5.1 KiB |
|
After Width: | Height: | Size: 5.9 KiB |
|
After Width: | Height: | Size: 5.1 KiB |
|
After Width: | Height: | Size: 5.9 KiB |
|
After Width: | Height: | Size: 5.1 KiB |
|
After Width: | Height: | Size: 5.9 KiB |
|
After Width: | Height: | Size: 5.1 KiB |
|
After Width: | Height: | Size: 5.9 KiB |
|
After Width: | Height: | Size: 3.6 KiB |
|
After Width: | Height: | Size: 52 KiB |
|
After Width: | Height: | Size: 92 KiB |
|
After Width: | Height: | Size: 44 KiB |
|
After Width: | Height: | Size: 44 KiB |
|
After Width: | Height: | Size: 52 KiB |
|
After Width: | Height: | Size: 52 KiB |
|
After Width: | Height: | Size: 54 KiB |
|
After Width: | Height: | Size: 54 KiB |
|
After Width: | Height: | Size: 511 B |
|
After Width: | Height: | Size: 518 B |
|
After Width: | Height: | Size: 511 B |
|
After Width: | Height: | Size: 515 B |
|
After Width: | Height: | Size: 509 B |
|
After Width: | Height: | Size: 508 B |
|
After Width: | Height: | Size: 518 B |
|
After Width: | Height: | Size: 510 B |
|
After Width: | Height: | Size: 516 B |
|
After Width: | Height: | Size: 512 B |
|
After Width: | Height: | Size: 518 B |
|
After Width: | Height: | Size: 511 B |
|
After Width: | Height: | Size: 517 B |
|
After Width: | Height: | Size: 513 B |
|
After Width: | Height: | Size: 510 B |
|
After Width: | Height: | Size: 514 B |
|
After Width: | Height: | Size: 511 B |
|
After Width: | Height: | Size: 508 B |
|
After Width: | Height: | Size: 514 B |