Compare commits
31 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| b32fba7f8a | |||
| 7573a03cc5 | |||
| b2e7572fe0 | |||
| d4f7b5f80c | |||
| 64b582c657 | |||
| 6c86a28d18 | |||
| 63f8b0cad1 | |||
| b05d85ab0a | |||
| 93e509bd79 | |||
| 4c06a451b8 | |||
| 1c32dcae9f | |||
| 33c3a5a8ca | |||
| f608e4586c | |||
| a050be873b | |||
| ed8e82a606 | |||
| 8eed01bfa4 | |||
| 418131df69 | |||
| 5030c7e5ff | |||
| 91fb27ee00 | |||
| 5f1f6baee9 | |||
| cc35a9ab6b | |||
| 3fe0e04d52 | |||
| d904fb1d80 | |||
| 4401dab8d6 | |||
| c4d75dca68 | |||
| 3a31104b5c | |||
| 3ff745937a | |||
| 333aa05809 | |||
| c5ec3efc70 | |||
| 747b58cb59 | |||
| 6fc222a648 |
@@ -5,7 +5,7 @@
|
||||
|
||||
This is a FOSS project for asset management in IT Operations. Knowing who has which laptop, when it was purchased in order to depreciate it correctly, handling software licenses, etc.
|
||||
|
||||
It is built on [Laravel 6](http://laravel.com).
|
||||
It is built on [Laravel 8](http://laravel.com).
|
||||
|
||||
Snipe-IT is actively developed and we [release quite frequently](https://github.com/snipe/snipe-it/releases). ([Check out the live demo here](https://snipeitapp.com/demo/).)
|
||||
|
||||
|
||||
@@ -213,12 +213,14 @@ class LdapSync extends Command
|
||||
$user->country = $item['country'];
|
||||
$user->department_id = $department->id;
|
||||
|
||||
if($item['manager']!= null) {
|
||||
if($item['manager'] != null) {
|
||||
//Captures only the Canonical Name
|
||||
$item['manager'] = ltrim($item['manager'], "CN=");
|
||||
$item['manager'] = substr($item['manager'],0, strpos($item['manager'], ','));
|
||||
$ldap_manager = User::where('username', $item['manager'])->first();
|
||||
$user->manager_id = $ldap_manager->id;
|
||||
if ( $ldap_manager && isset($ldap_manager->id) ) {
|
||||
$user->manager_id = $ldap_manager->id;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -48,6 +48,7 @@ class ResetDemoSettings extends Command
|
||||
$settings->auto_increment_assets = 1;
|
||||
$settings->logo = 'snipe-logo.png';
|
||||
$settings->alert_email = 'service@snipe-it.io';
|
||||
$settings->login_note = 'Use `admin` / `password` to login to the demo.';
|
||||
$settings->header_color = null;
|
||||
$settings->barcode_type = 'QRCODE';
|
||||
$settings->default_currency = 'USD';
|
||||
|
||||
@@ -1059,4 +1059,34 @@ class Helper
|
||||
|
||||
return $file_name;
|
||||
}
|
||||
|
||||
public static function formatFilesizeUnits($bytes)
|
||||
{
|
||||
if ($bytes >= 1073741824)
|
||||
{
|
||||
$bytes = number_format($bytes / 1073741824, 2) . ' GB';
|
||||
}
|
||||
elseif ($bytes >= 1048576)
|
||||
{
|
||||
$bytes = number_format($bytes / 1048576, 2) . ' MB';
|
||||
}
|
||||
elseif ($bytes >= 1024)
|
||||
{
|
||||
$bytes = number_format($bytes / 1024, 2) . ' KB';
|
||||
}
|
||||
elseif ($bytes > 1)
|
||||
{
|
||||
$bytes = $bytes . ' bytes';
|
||||
}
|
||||
elseif ($bytes == 1)
|
||||
{
|
||||
$bytes = $bytes . ' byte';
|
||||
}
|
||||
else
|
||||
{
|
||||
$bytes = '0 bytes';
|
||||
}
|
||||
|
||||
return $bytes;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,6 +18,7 @@ use Illuminate\Support\Facades\Notification;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
use Illuminate\Support\Facades\Validator;
|
||||
use App\Http\Requests\SlackSettingsRequest;
|
||||
use App\Http\Transformers\LoginAttemptsTransformer;
|
||||
|
||||
|
||||
class SettingsController extends Controller
|
||||
|
||||
@@ -168,9 +168,9 @@ class AssetsController extends Controller
|
||||
if ($field->field_encrypted == '1') {
|
||||
if (Gate::allows('admin')) {
|
||||
if (is_array($request->input($field->convertUnicodeDbSlug()))) {
|
||||
$asset->{$field->convertUnicodeDbSlug()} = \Crypt::encrypt(e(implode(', ', $request->input($field->convertUnicodeDbSlug()))));
|
||||
$asset->{$field->convertUnicodeDbSlug()} = \Crypt::encrypt(implode(', ', $request->input($field->convertUnicodeDbSlug())));
|
||||
} else {
|
||||
$asset->{$field->convertUnicodeDbSlug()} = \Crypt::encrypt(e($request->input($field->convertUnicodeDbSlug())));
|
||||
$asset->{$field->convertUnicodeDbSlug()} = \Crypt::encrypt($request->input($field->convertUnicodeDbSlug()));
|
||||
}
|
||||
}
|
||||
} else {
|
||||
@@ -344,9 +344,9 @@ class AssetsController extends Controller
|
||||
if ($field->field_encrypted == '1') {
|
||||
if (Gate::allows('admin')) {
|
||||
if (is_array($request->input($field->convertUnicodeDbSlug()))) {
|
||||
$asset->{$field->convertUnicodeDbSlug()} = \Crypt::encrypt(e(implode(', ', $request->input($field->convertUnicodeDbSlug()))));
|
||||
$asset->{$field->convertUnicodeDbSlug()} = \Crypt::encrypt(implode(', ', $request->input($field->convertUnicodeDbSlug())));
|
||||
} else {
|
||||
$asset->{$field->convertUnicodeDbSlug()} = \Crypt::encrypt(e($request->input($field->convertUnicodeDbSlug())));
|
||||
$asset->{$field->convertUnicodeDbSlug()} = \Crypt::encrypt($request->input($field->convertUnicodeDbSlug()));
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
||||
@@ -185,7 +185,7 @@ class LoginController extends Controller
|
||||
Log::debug("Local user ".$request->input('username')." does not exist");
|
||||
Log::debug("Creating local user ".$request->input('username'));
|
||||
|
||||
if ($user = Ldap::createUserFromLdap($ldap_user)) { //this handles passwords on its own
|
||||
if ($user = Ldap::createUserFromLdap($ldap_user, $request->input('password'))) {
|
||||
Log::debug("Local user created.");
|
||||
} else {
|
||||
Log::debug("Could not create local user.");
|
||||
@@ -449,10 +449,17 @@ class LoginController extends Controller
|
||||
*/
|
||||
public function logout(Request $request)
|
||||
{
|
||||
// Logout is only allowed with a http POST but we need to allow GET for SAML SLO
|
||||
$settings = Setting::getSettings();
|
||||
$saml = $this->saml;
|
||||
$samlLogout = $request->session()->get('saml_logout');
|
||||
$sloRedirectUrl = null;
|
||||
$sloRequestUrl = null;
|
||||
|
||||
// Only allow GET if we are doing SAML SLO otherwise abort with 405
|
||||
if ($request->isMethod('GET') && !$samlLogout) {
|
||||
abort(405);
|
||||
}
|
||||
|
||||
if ($saml->isEnabled()) {
|
||||
$auth = $saml->getAuth();
|
||||
|
||||
@@ -142,6 +142,6 @@ class SamlController extends Controller
|
||||
return view('errors.403');
|
||||
}
|
||||
|
||||
return redirect()->route('logout')->with('saml_slo_redirect_url', $sloUrl);
|
||||
return redirect()->route('logout')->with(['saml_logout' => true,'saml_slo_redirect_url' => $sloUrl]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -46,9 +46,9 @@ class BulkUsersController extends Controller
|
||||
foreach ($users as $user) {
|
||||
if (($user->activated == '1') && ($user->email != '')) {
|
||||
$credentials = ['email' => $user->email];
|
||||
Password::sendResetLink($credentials, function (Message $message) {
|
||||
$message->subject($this->getEmailSubject());
|
||||
});
|
||||
Password::sendResetLink($credentials/* , function (Message $message) {
|
||||
$message->subject($this->getEmailSubject()); // TODO - I'm not sure if we still need this, but this second parameter is no longer accepted in later Laravel versions.
|
||||
} */ ); // TODO - so hopefully this doesn't give us generic password reset messages? But it at least _works_
|
||||
}
|
||||
}
|
||||
return redirect()->back()->with('success', trans('admin/users/message.password_resets_sent'));
|
||||
|
||||
@@ -625,9 +625,8 @@ class UsersController extends Controller
|
||||
$credentials = ['email' => trim($user->email)];
|
||||
|
||||
try {
|
||||
\Password::sendResetLink($credentials, function (Message $message) use ($user) {
|
||||
$message->subject($this->getEmailSubject());
|
||||
});
|
||||
|
||||
Password::sendResetLink($credentials);
|
||||
|
||||
return redirect()->back()->with('success', trans('admin/users/message.password_reset_sent', ['email' => $user->email]));
|
||||
} catch (\Exception $e) {
|
||||
|
||||
+3
-2
@@ -233,7 +233,7 @@ class Ldap extends Model
|
||||
* @param $ldapatttibutes
|
||||
* @return array|bool
|
||||
*/
|
||||
public static function createUserFromLdap($ldapatttibutes)
|
||||
public static function createUserFromLdap($ldapatttibutes, $password)
|
||||
{
|
||||
$item = self::parseAndMapLdapAttributes($ldapatttibutes);
|
||||
|
||||
@@ -246,7 +246,8 @@ class Ldap extends Model
|
||||
$user->email = $item['email'];
|
||||
|
||||
if (Setting::getSettings()->ldap_pw_sync == '1') {
|
||||
$user->password = bcrypt(Input::get('password'));
|
||||
|
||||
$user->password = bcrypt($password);
|
||||
} else {
|
||||
$pass = substr(str_shuffle('0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'), 0, 25);
|
||||
$user->password = bcrypt($pass);
|
||||
|
||||
@@ -33,6 +33,7 @@
|
||||
"doctrine/dbal": "^3.1",
|
||||
"doctrine/inflector": "^1.3",
|
||||
"doctrine/instantiator": "^1.3",
|
||||
"dompdf/dompdf": "^1.2",
|
||||
"eduardokum/laravel-mail-auto-embed": "^1.0",
|
||||
"enshrined/svg-sanitize": "^0.15.0",
|
||||
"erusev/parsedown": "^1.7",
|
||||
|
||||
Generated
+10
-8
@@ -4,7 +4,7 @@
|
||||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
||||
"This file is @generated automatically"
|
||||
],
|
||||
"content-hash": "ad10a039e46761e93b4461865b0e20f0",
|
||||
"content-hash": "b7693679154b236b5aff817b32d77c93",
|
||||
"packages": [
|
||||
{
|
||||
"name": "alek13/slack",
|
||||
@@ -1813,16 +1813,16 @@
|
||||
},
|
||||
{
|
||||
"name": "dompdf/dompdf",
|
||||
"version": "v1.2.0",
|
||||
"version": "v1.2.2",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/dompdf/dompdf.git",
|
||||
"reference": "60b704331479a69e9bcdb3496da2315b5c4f94fd"
|
||||
"reference": "5031045d9640b38cfc14aac9667470df09c9e090"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/dompdf/dompdf/zipball/60b704331479a69e9bcdb3496da2315b5c4f94fd",
|
||||
"reference": "60b704331479a69e9bcdb3496da2315b5c4f94fd",
|
||||
"url": "https://api.github.com/repos/dompdf/dompdf/zipball/5031045d9640b38cfc14aac9667470df09c9e090",
|
||||
"reference": "5031045d9640b38cfc14aac9667470df09c9e090",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -1833,6 +1833,8 @@
|
||||
"php": "^7.1 || ^8.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"ext-json": "*",
|
||||
"ext-zip": "*",
|
||||
"mockery/mockery": "^1.3",
|
||||
"phpunit/phpunit": "^7.5 || ^8 || ^9",
|
||||
"squizlabs/php_codesniffer": "^3.5"
|
||||
@@ -1874,9 +1876,9 @@
|
||||
"homepage": "https://github.com/dompdf/dompdf",
|
||||
"support": {
|
||||
"issues": "https://github.com/dompdf/dompdf/issues",
|
||||
"source": "https://github.com/dompdf/dompdf/tree/v1.2.0"
|
||||
"source": "https://github.com/dompdf/dompdf/tree/v1.2.2"
|
||||
},
|
||||
"time": "2022-02-07T13:02:10+00:00"
|
||||
"time": "2022-04-27T13:50:54+00:00"
|
||||
},
|
||||
{
|
||||
"name": "dragonmantank/cron-expression",
|
||||
@@ -13666,5 +13668,5 @@
|
||||
"ext-pdo": "*"
|
||||
},
|
||||
"platform-dev": [],
|
||||
"plugin-api-version": "2.1.0"
|
||||
"plugin-api-version": "2.0.0"
|
||||
}
|
||||
|
||||
+5
-5
@@ -1,10 +1,10 @@
|
||||
<?php
|
||||
return array (
|
||||
'app_version' => 'v6.0.0',
|
||||
'full_app_version' => 'v6.0.0 - build 6860-g722e88a47',
|
||||
'build_version' => '6860',
|
||||
'app_version' => 'v6.0.1',
|
||||
'full_app_version' => 'v6.0.1 - build 7750-gb2e7572fe',
|
||||
'build_version' => '7750',
|
||||
'prerelease_version' => '',
|
||||
'hash_version' => 'g722e88a47',
|
||||
'full_hash' => 'v6.0.0-30-g722e88a47',
|
||||
'hash_version' => 'gb2e7572fe',
|
||||
'full_hash' => 'v6.0.1-29-gb2e7572fe',
|
||||
'branch' => 'master',
|
||||
);
|
||||
@@ -28,6 +28,7 @@ return [
|
||||
'auto_increment_prefix' => 'Prefix (optional)',
|
||||
'auto_incrementing_help' => 'Enable auto-incrementing asset tags first to set this',
|
||||
'backups' => 'Backups',
|
||||
'backups_help' => 'Create, download, and restore backups ',
|
||||
'backups_restoring' => 'Restoring from Backup',
|
||||
'backups_upload' => 'Upload Backup',
|
||||
'backups_path' => 'Backups on the server are stored in <code>:path</code>',
|
||||
|
||||
@@ -115,6 +115,7 @@ return [
|
||||
'files' => 'Files',
|
||||
'file_name' => 'File',
|
||||
'file_type' => 'File Type',
|
||||
'filesize' => 'File Size',
|
||||
'file_uploads' => 'File Uploads',
|
||||
'file_upload' => 'File Upload',
|
||||
'generate' => 'Generate',
|
||||
|
||||
@@ -132,6 +132,9 @@
|
||||
<th data-searchable="true">{{ trans('admin/custom_fields/general.unique') }}</th>
|
||||
<th data-visible="false">{{ trans('admin/custom_fields/general.db_field') }}</th>
|
||||
<th data-searchable="true">{{ trans('admin/custom_fields/general.field_format') }}</th>
|
||||
<th><i class="fa fa-lock" aria-hidden="true"></i>
|
||||
<span class="hidden-xs hidden-sm hidden-md hidden-lg">{{ trans('admin/custom_fields/general.encrypted') }}</span>
|
||||
</th>
|
||||
<th data-searchable="true">{{ trans('admin/custom_fields/general.field_element_short') }}</th>
|
||||
<th data-searchable="true">{{ trans('admin/custom_fields/general.fieldsets') }}</th>
|
||||
<th>{{ trans('button.actions') }}</th>
|
||||
@@ -151,6 +154,7 @@
|
||||
@endif
|
||||
</td>
|
||||
<td>{{ $field->format }}</td>
|
||||
<td>{!! ($field->field_encrypted=='1' ? '<i class="fa fa-check text-success"></i>' : '<i class="fa fa-times text-danger"></i>') !!}</td>
|
||||
<td>{{ $field->element }}</td>
|
||||
<td>
|
||||
@foreach($field->fieldset as $fieldset)
|
||||
|
||||
@@ -104,7 +104,7 @@
|
||||
<li class="active">
|
||||
<a href="#details" data-toggle="tab">
|
||||
<span class="hidden-lg hidden-md">
|
||||
<i class="fas fa-info-circle fa-2x"x></i>
|
||||
<i class="fas fa-info-circle fa-2x"></i>
|
||||
</span>
|
||||
<span class="hidden-xs hidden-sm">{{ trans('admin/users/general.info') }}</span>
|
||||
</a>
|
||||
@@ -1122,6 +1122,7 @@
|
||||
data-id-table="assetFileHistory"
|
||||
data-search="true"
|
||||
data-side-pagination="client"
|
||||
data-sortable="true"
|
||||
data-show-columns="true"
|
||||
data-show-refresh="true"
|
||||
data-sort-order="desc"
|
||||
@@ -1134,12 +1135,13 @@
|
||||
data-cookie-id-table="assetFileHistory">
|
||||
<thead>
|
||||
<tr>
|
||||
<th data-visible="true" data-field="icon">{{trans('general.file_type')}}</th>
|
||||
<th class="col-md-2" data-searchable="true" data-visible="true" data-field="notes">{{ trans('general.notes') }}</th>
|
||||
<th data-visible="true" data-field="icon" data-sortable="true">{{trans('general.file_type')}}</th>
|
||||
<th class="col-md-2" data-searchable="true" data-visible="true" data-field="image">{{ trans('general.image') }}</th>
|
||||
<th class="col-md-2" data-searchable="true" data-visible="true" data-field="filename">{{ trans('general.file_name') }}</th>
|
||||
<th class="col-md-2" data-searchable="true" data-visible="true" data-field="download">{{ trans('general.download') }}</th>
|
||||
<th class="col-md-2" data-searchable="true" data-visible="true" data-field="created_at">{{ trans('general.created_at') }}</th>
|
||||
<th class="col-md-2" data-searchable="true" data-visible="true" data-field="filename" data-sortable="true">{{ trans('general.file_name') }}</th>
|
||||
<th class="col-md-1" data-searchable="true" data-visible="true" data-field="filesize">{{ trans('general.filesize') }}</th>
|
||||
<th class="col-md-2" data-searchable="true" data-visible="true" data-field="notes" data-sortable="true">{{ trans('general.notes') }}</th>
|
||||
<th class="col-md-1" data-searchable="true" data-visible="true" data-field="download">{{ trans('general.download') }}</th>
|
||||
<th class="col-md-2" data-searchable="true" data-visible="true" data-field="created_at" data-sortable="true">{{ trans('general.created_at') }}</th>
|
||||
<th class="col-md-1" data-searchable="true" data-visible="true" data-field="actions">{{ trans('table.actions') }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
@@ -1148,11 +1150,6 @@
|
||||
@foreach ($asset->uploads as $file)
|
||||
<tr>
|
||||
<td><i class="{{ Helper::filetype_icon($file->filename) }} icon-med" aria-hidden="true"></i></td>
|
||||
<td>
|
||||
@if ($file->note)
|
||||
{{ $file->note }}
|
||||
@endif
|
||||
</td>
|
||||
<td>
|
||||
@if ( Helper::checkUploadIsImage($file->get_src('assets')))
|
||||
<a href="{{ route('show/assetfile', ['assetId' => $asset->id, 'fileId' =>$file->id]) }}" data-toggle="lightbox" data-type="image" data-title="{{ $file->filename }}" data-footer="{{ Helper::getFormattedDateObject($asset->last_checkout, 'datetime', false) }}">
|
||||
@@ -1163,6 +1160,14 @@
|
||||
<td>
|
||||
{{ $file->filename }}
|
||||
</td>
|
||||
<td data-value="{{ filesize(storage_path('private_uploads/assets/').$file->filename) }}">
|
||||
{{ Helper::formatFilesizeUnits(filesize(storage_path('private_uploads/assets/').$file->filename)) }}
|
||||
</td>
|
||||
<td>
|
||||
@if ($file->note)
|
||||
{{ $file->note }}
|
||||
@endif
|
||||
</td>
|
||||
<td>
|
||||
@if ($file->filename)
|
||||
<a href="{{ route('show/assetfile', [$asset->id, $file->id]) }}" class="btn btn-default">
|
||||
@@ -1170,14 +1175,11 @@
|
||||
</a>
|
||||
@endif
|
||||
</td>
|
||||
|
||||
<td>
|
||||
@if ($file->created_at)
|
||||
{{ Helper::getFormattedDateObject($file->created_at, 'datetime', false) }}
|
||||
@endif
|
||||
</td>
|
||||
|
||||
|
||||
<td>
|
||||
@can('update', \App\Models\Asset::class)
|
||||
<a class="btn delete-asset btn-sm btn-danger btn-sm" href="{{ route('delete/assetfile', [$asset->id, $file->id]) }}" data-tooltip="true" data-title="Delete" data-content="{{ trans('general.delete_confirm', ['item' => $file->filename]) }}"><i class="fas fa-trash icon-white" aria-hidden="true"></i></a>
|
||||
|
||||
@@ -454,13 +454,14 @@
|
||||
}'>
|
||||
<thead>
|
||||
<tr>
|
||||
<th data-visible="true" aria-hidden="true">{{ trans('admin/hardware/table.icon') }}</th>
|
||||
<th class="col-md-3" data-field="file_name" data-visible="true" data-sortable="true" data-switchable="true">{{ trans('general.file_name') }}</th>
|
||||
<th class="col-md-3" data-field="notes" data-visible="true" data-sortable="true" data-switchable="true">{{ trans('general.notes') }}</th>
|
||||
<th class="col-md-2" data-field="created_at" data-visible="true" data-sortable="true" data-switchable="true">{{ trans('general.created_at') }}</th>
|
||||
<th class="col-md-2" data-searchable="true" data-visible="true">{{ trans('general.image') }}</th>
|
||||
<th class="col-md-2" data-field="download" data-visible="true" data-sortable="false" data-switchable="true">{{ trans('general.download') }}</th>
|
||||
<th class="col-md-2" data-field="delete" data-visible="true" data-sortable="false" data-switchable="true">{{ trans('general.delete') }}</th>
|
||||
<th data-visible="true" data-field="icon" data-sortable="true">{{trans('general.file_type')}}</th>
|
||||
<th class="col-md-2" data-searchable="true" data-visible="true" data-field="image">{{ trans('general.image') }}</th>
|
||||
<th class="col-md-2" data-searchable="true" data-visible="true" data-field="filename" data-sortable="true">{{ trans('general.file_name') }}</th>
|
||||
<th class="col-md-1" data-searchable="true" data-visible="true" data-field="filesize">{{ trans('general.filesize') }}</th>
|
||||
<th class="col-md-2" data-searchable="true" data-visible="true" data-field="notes" data-sortable="true">{{ trans('general.notes') }}</th>
|
||||
<th class="col-md-1" data-searchable="true" data-visible="true" data-field="download">{{ trans('general.download') }}</th>
|
||||
<th class="col-md-2" data-searchable="true" data-visible="true" data-field="created_at" data-sortable="true">{{ trans('general.created_at') }}</th>
|
||||
<th class="col-md-1" data-searchable="true" data-visible="true" data-field="actions">{{ trans('table.actions') }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@@ -473,22 +474,24 @@
|
||||
|
||||
</td>
|
||||
<td>
|
||||
{{ $file->filename }}
|
||||
|
||||
@if ($file->filename)
|
||||
@if ( Helper::checkUploadIsImage($file->get_src('licenses')))
|
||||
<a href="{{ route('show.licensefile', ['licenseId' => $license->id, 'fileId' => $file->id, 'download' => 'false']) }}" data-toggle="lightbox" data-type="image"><img src="{{ route('show.licensefile', ['licenseId' => $license->id, 'fileId' => $file->id]) }}" class="img-thumbnail" style="max-width: 50px;"></a>
|
||||
@endif
|
||||
@endif
|
||||
</td>
|
||||
<td>
|
||||
{{ $file->filename }}
|
||||
</td>
|
||||
<td data-value="{{ filesize(storage_path('private_uploads/licenses/').$file->filename) }}">
|
||||
{{ Helper::formatFilesizeUnits(filesize(storage_path('private_uploads/licenses/').$file->filename)) }}
|
||||
</td>
|
||||
|
||||
<td>
|
||||
@if ($file->note)
|
||||
{{ $file->note }}
|
||||
@endif
|
||||
</td>
|
||||
<td>{{ $file->created_at }}</td>
|
||||
<td>
|
||||
@if ($file->filename)
|
||||
@if ( Helper::checkUploadIsImage($file->get_src('licenses')))
|
||||
<a href="{{ route('show.licensefile', ['licenseId' => $license->id, 'fileId' => $file->id, 'download' => 'false']) }}" data-toggle="lightbox" data-type="image"><img src="{{ route('show.licensefile', ['licenseId' => $license->id, 'fileId' => $file->id]) }}" class="img-thumbnail" style="max-width: 50px;"></a>
|
||||
@endif
|
||||
@endif
|
||||
</td>
|
||||
<td>
|
||||
@if ($file->filename)
|
||||
<a href="{{ route('show.licensefile', [$license->id, $file->id, 'download' => 'true']) }}" class="btn btn-default">
|
||||
@@ -497,6 +500,7 @@
|
||||
</a>
|
||||
@endif
|
||||
</td>
|
||||
<td>{{ $file->created_at }}</td>
|
||||
<td>
|
||||
<a class="btn delete-asset btn-danger btn-sm" href="{{ route('delete/licensefile', [$license->id, $file->id]) }}" data-content="{{ trans('general.delete_confirm', array('item' => $file)) }}" data-title="{{ trans('general.delete') }} {{ $file->filename }}?">
|
||||
<i class="fas fa-trash icon-white" aria-hidden="true"></i>
|
||||
@@ -507,7 +511,7 @@
|
||||
@endforeach
|
||||
@else
|
||||
<tr>
|
||||
<td colspan="6">{{ trans('general.no_results') }}</td>
|
||||
<td colspan="8">{{ trans('general.no_results') }}</td>
|
||||
</tr>
|
||||
@endif
|
||||
</tbody>
|
||||
|
||||
@@ -138,14 +138,7 @@
|
||||
<i class="fas fa-paperclip" aria-hidden="true"></i>
|
||||
{{ trans('button.select_file') }}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- screen reader only -->
|
||||
<input type="file" id="file" name="file" aria-label="file" class="sr-only">
|
||||
|
||||
<input type="file" name="file" class="js-uploadFile" id="uploadFile" data-maxsize="{{ Helper::file_upload_max_size() }}" accept="application/zip" style="display:none;" aria-label="file" aria-hidden="true">
|
||||
<input type="file" name="file" class="js-uploadFile" id="uploadFile" data-maxsize="{{ Helper::file_upload_max_size() }}" accept="application/zip" style="display:none;" aria-label="file" aria-hidden="true">
|
||||
|
||||
|
||||
</label>
|
||||
|
||||
@@ -757,38 +757,87 @@
|
||||
|
||||
<div class="col-md-12 col-sm-12">
|
||||
<div class="table-responsive">
|
||||
<table id="files-table" class="table display table-striped">
|
||||
<table
|
||||
data-cookie-id-table="userUploadsTable"
|
||||
data-id-table="userUploadsTable"
|
||||
id="userUploadsTable"
|
||||
data-search="true"
|
||||
data-pagination="true"
|
||||
data-side-pagination="client"
|
||||
data-show-columns="true"
|
||||
data-show-export="true"
|
||||
data-show-footer="true"
|
||||
data-toolbar="#upload-toolbar"
|
||||
data-show-refresh="true"
|
||||
data-sort-order="asc"
|
||||
data-sort-name="name"
|
||||
class="table table-striped snipe-table"
|
||||
data-export-options='{
|
||||
"fileName": "export-license-uploads-{{ str_slug($user->name) }}-{{ date('Y-m-d') }}",
|
||||
"ignoreColumn": ["actions","image","change","checkbox","checkincheckout","delete","download","icon"]
|
||||
}'>
|
||||
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="col-md-5">{{ trans('general.notes') }}</th>
|
||||
<th class="col-md-5"><span class="line"></span>{{ trans('general.file_name') }}</th>
|
||||
<th class="col-md-2">{{ trans('general.download') }}</th>
|
||||
<th class="col-md-2">{{ trans('general.delete') }}</th>
|
||||
<th data-visible="true" data-field="icon" data-sortable="true">{{trans('general.file_type')}}</th>
|
||||
<th class="col-md-2" data-searchable="true" data-visible="true" data-field="image">{{ trans('general.image') }}</th>
|
||||
<th class="col-md-2" data-searchable="true" data-visible="true" data-field="filename" data-sortable="true">{{ trans('general.file_name') }}</th>
|
||||
<th class="col-md-1" data-searchable="true" data-visible="true" data-field="filesize">{{ trans('general.filesize') }}</th>
|
||||
<th class="col-md-2" data-searchable="true" data-visible="true" data-field="notes" data-sortable="true">{{ trans('general.notes') }}</th>
|
||||
<th class="col-md-1" data-searchable="true" data-visible="true" data-field="download">{{ trans('general.download') }}</th>
|
||||
<th class="col-md-2" data-searchable="true" data-visible="true" data-field="created_at" data-sortable="true">{{ trans('general.created_at') }}</th>
|
||||
<th class="col-md-1" data-searchable="true" data-visible="true" data-field="actions">{{ trans('table.actions') }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach ($user->uploads as $file)
|
||||
<tr>
|
||||
<td>
|
||||
@if ($file->note)
|
||||
{{ $file->note }}
|
||||
@endif
|
||||
</td>
|
||||
<td>
|
||||
{{ $file->filename }}
|
||||
</td>
|
||||
<td>
|
||||
@if ($file->filename)
|
||||
<a href="{{ route('show/userfile', [$user->id, $file->id]) }}" class="btn btn-default">{{ trans('general.download') }}</a>
|
||||
@endif
|
||||
</td>
|
||||
<td>
|
||||
@can('update', $user)
|
||||
<a class="btn delete-asset btn-danger btn-sm hidden-print" href="{{ route('userfile.destroy', [$user->id, $file->id]) }}" data-content="Are you sure you wish to delete this file?" data-title="Delete {{ $file->filename }}?"><i class="fas fa-trash icon-white" aria-hidden="true"></i><span class="sr-only">Delete</span></a>
|
||||
@endcan
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<i class="{{ Helper::filetype_icon($file->filename) }} icon-med" aria-hidden="true"></i>
|
||||
<span class="sr-only">{{ Helper::filetype_icon($file->filename) }}</span>
|
||||
|
||||
</td>
|
||||
<td>
|
||||
@if ($file->filename)
|
||||
@if ( Helper::checkUploadIsImage($file->get_src('users')))
|
||||
<a href="{{ route('show/userfile', ['userId' => $user->id, 'fileId' => $file->id, 'download' => 'false']) }}" data-toggle="lightbox" data-type="image"><img src="{{ route('show/userfile', ['userId' => $user->id, 'fileId' => $file->id]) }}" class="img-thumbnail" style="max-width: 50px;"></a>
|
||||
@endif
|
||||
@endif
|
||||
</td>
|
||||
<td>
|
||||
{{ $file->filename }}
|
||||
</td>
|
||||
<td>
|
||||
{{ Helper::formatFilesizeUnits(filesize(storage_path('private_uploads/users/').$file->filename)) }}
|
||||
</td>
|
||||
|
||||
<td>
|
||||
@if ($file->note)
|
||||
{{ $file->note }}
|
||||
@endif
|
||||
</td>
|
||||
<td>
|
||||
@if ($file->filename)
|
||||
<a href="{{ route('show/userfile', [$user->id, $file->id]) }}" class="btn btn-default">
|
||||
<i class="fas fa-download" aria-hidden="true"></i>
|
||||
<span class="sr-only">{{ trans('general.download') }}</span>
|
||||
</a>
|
||||
@endif
|
||||
</td>
|
||||
<td>{{ $file->created_at }}</td>
|
||||
|
||||
<td>
|
||||
<a class="btn delete-asset btn-danger btn-sm hidden-print" href="{{ route('userfile.destroy', [$user->id, $file->id]) }}" data-content="Are you sure you wish to delete this file?" data-title="Delete {{ $file->filename }}?">
|
||||
<i class="fa fa-trash icon-white" aria-hidden="true"></i>
|
||||
<span class="sr-only">{{ trans('general.delete') }}</span>
|
||||
</a>
|
||||
</td>
|
||||
|
||||
|
||||
|
||||
</tr>
|
||||
@endforeach
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
@@ -434,6 +434,12 @@ Route::group(['middleware' => 'web'], function () {
|
||||
'uses' => 'DashboardController@getIndex' ]
|
||||
);
|
||||
|
||||
// need to keep GET /logout for SAML SLO
|
||||
Route::get(
|
||||
'logout',
|
||||
[LoginController::class, 'logout']
|
||||
)->name('logout');
|
||||
|
||||
Route::post(
|
||||
'logout',
|
||||
[LoginController::class, 'logout']
|
||||
|
||||
Reference in New Issue
Block a user