diff --git a/app/Console/Commands/Purge.php b/app/Console/Commands/Purge.php index 7abd83c85..1dd2aaa51 100644 --- a/app/Console/Commands/Purge.php +++ b/app/Console/Commands/Purge.php @@ -3,6 +3,7 @@ namespace App\Console\Commands; use App\Models\Accessory; +use App\Models\Actionlog; use App\Models\Asset; use App\Models\AssetModel; use App\Models\Category; @@ -15,6 +16,8 @@ use App\Models\Statuslabel; use App\Models\Supplier; use App\Models\User; use Illuminate\Console\Command; +use Illuminate\Support\Facades\Log; +use Illuminate\Support\Facades\Storage; class Purge extends Command { @@ -141,6 +144,20 @@ class Purge extends Command $this->info($users->count().' users purged.'); $user_assoc = 0; foreach ($users as $user) { + + $rel_path = 'private_uploads/users'; + $filenames = Actionlog::where('action_type', 'uploaded') + ->where('item_id', $user->id) + ->pluck('filename'); + foreach($filenames as $filename) { + try { + if (Storage::exists($rel_path . '/' . $filename)) { + Storage::delete($rel_path . '/' . $filename); + } + } catch (\Exception $e) { + Log::info('An error occurred while deleting files: ' . $e->getMessage()); + } + } $this->info('- User "'.$user->username.'" deleted.'); $user_assoc += $user->userlog()->count(); $user->userlog()->forceDelete(); diff --git a/app/Http/Controllers/Auth/ResetPasswordController.php b/app/Http/Controllers/Auth/ResetPasswordController.php index fe1b33128..f1cfbc853 100644 --- a/app/Http/Controllers/Auth/ResetPasswordController.php +++ b/app/Http/Controllers/Auth/ResetPasswordController.php @@ -87,7 +87,7 @@ class ResetPasswordController extends Controller 'password.not_in' => trans('validation.disallow_same_pwd_as_user_fields'), ]; - $request->validate($this->rules(), $request->all(), $this->validationErrorMessages()); + $request->validate($this->rules()); Log::debug('Checking if '.$request->input('username').' exists'); // Check to see if the user even exists - we'll treat the response the same to prevent user sniffing diff --git a/resources/assets/less/overrides.less b/resources/assets/less/overrides.less index 12bce00bb..8ef34bb3e 100644 --- a/resources/assets/less/overrides.less +++ b/resources/assets/less/overrides.less @@ -714,6 +714,11 @@ th.css-location > .th-inner::before { margin-top:50px } } +@media screen and (max-width: 1318px) and (min-width: 1200px){ + .box{ + height:170px; + } +} .ellipsis { overflow: hidden;