mirror of
https://github.com/snipe/snipe-it.git
synced 2024-12-25 05:34:06 -08:00
Merge remote-tracking branch 'upstream/develop' into upstream/dev
Some checks are pending
Crowdin Action / upload-sources-to-crowdin (push) Waiting to run
Docker images (Alpine) / docker (push) Waiting to run
Docker images / docker (push) Waiting to run
Tests in MySQL / PHP ${{ matrix.php-version }} (8.1) (push) Waiting to run
Tests in MySQL / PHP ${{ matrix.php-version }} (8.2) (push) Waiting to run
Tests in MySQL / PHP ${{ matrix.php-version }} (8.3) (push) Waiting to run
Tests in SQLite / PHP ${{ matrix.php-version }} (8.1.1) (push) Waiting to run
Some checks are pending
Crowdin Action / upload-sources-to-crowdin (push) Waiting to run
Docker images (Alpine) / docker (push) Waiting to run
Docker images / docker (push) Waiting to run
Tests in MySQL / PHP ${{ matrix.php-version }} (8.1) (push) Waiting to run
Tests in MySQL / PHP ${{ matrix.php-version }} (8.2) (push) Waiting to run
Tests in MySQL / PHP ${{ matrix.php-version }} (8.3) (push) Waiting to run
Tests in SQLite / PHP ${{ matrix.php-version }} (8.1.1) (push) Waiting to run
This commit is contained in:
commit
fffcbdc44d
|
@ -3,6 +3,7 @@
|
||||||
namespace App\Console\Commands;
|
namespace App\Console\Commands;
|
||||||
|
|
||||||
use App\Models\Accessory;
|
use App\Models\Accessory;
|
||||||
|
use App\Models\Actionlog;
|
||||||
use App\Models\Asset;
|
use App\Models\Asset;
|
||||||
use App\Models\AssetModel;
|
use App\Models\AssetModel;
|
||||||
use App\Models\Category;
|
use App\Models\Category;
|
||||||
|
@ -15,6 +16,8 @@ use App\Models\Statuslabel;
|
||||||
use App\Models\Supplier;
|
use App\Models\Supplier;
|
||||||
use App\Models\User;
|
use App\Models\User;
|
||||||
use Illuminate\Console\Command;
|
use Illuminate\Console\Command;
|
||||||
|
use Illuminate\Support\Facades\Log;
|
||||||
|
use Illuminate\Support\Facades\Storage;
|
||||||
|
|
||||||
class Purge extends Command
|
class Purge extends Command
|
||||||
{
|
{
|
||||||
|
@ -141,6 +144,20 @@ class Purge extends Command
|
||||||
$this->info($users->count().' users purged.');
|
$this->info($users->count().' users purged.');
|
||||||
$user_assoc = 0;
|
$user_assoc = 0;
|
||||||
foreach ($users as $user) {
|
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.');
|
$this->info('- User "'.$user->username.'" deleted.');
|
||||||
$user_assoc += $user->userlog()->count();
|
$user_assoc += $user->userlog()->count();
|
||||||
$user->userlog()->forceDelete();
|
$user->userlog()->forceDelete();
|
||||||
|
|
|
@ -87,7 +87,7 @@ class ResetPasswordController extends Controller
|
||||||
'password.not_in' => trans('validation.disallow_same_pwd_as_user_fields'),
|
'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');
|
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
|
// Check to see if the user even exists - we'll treat the response the same to prevent user sniffing
|
||||||
|
|
|
@ -714,6 +714,11 @@ th.css-location > .th-inner::before {
|
||||||
margin-top:50px
|
margin-top:50px
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@media screen and (max-width: 1318px) and (min-width: 1200px){
|
||||||
|
.box{
|
||||||
|
height:170px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.ellipsis {
|
.ellipsis {
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
|
|
Loading…
Reference in a new issue