Compare commits

..

2015 Commits

Author SHA1 Message Date
snipe
8cd78b2790 Merge remote-tracking branch 'origin/develop'
Signed-off-by: snipe <snipe@snipe.net>

# Conflicts:
#	config/version.php
2021-06-10 17:44:17 -07:00
snipe
aae6a8fc6c Bumped version
Signed-off-by: snipe <snipe@snipe.net>
2021-06-10 17:42:29 -07:00
snipe
ace7abc1ad Merge remote-tracking branch 'origin/develop' 2021-06-10 15:18:24 -07:00
snipe
c567ad0617 Add @travismiller as a contributor 2021-06-10 15:18:02 -07:00
snipe
4c007ae085 Merge remote-tracking branch 'origin/develop' 2021-06-10 15:17:19 -07:00
snipe
54cb6c050a Merge pull request #9679 from tulsaschoolsdata/serial-number-indexes
Fixed #8486: Add index for asset serial number
2021-06-09 17:36:06 -07:00
snipe
851e5ca96e Merge pull request #9683 from tulsaschoolsdata/9682-company-id-indexes
Thanks!
2021-06-09 17:35:37 -07:00
Travis Miller
103c4325ce Fixed #9682: Add indexes for company_id 2021-06-09 14:29:00 -05:00
Travis Miller
ebe7c2da87 Fixed #8486: Add index for asset serial number 2021-06-09 14:12:35 -05:00
snipe
6c1dd81e0a Merge pull request #9640 from inietov/fixes/errorexception_invalid_argument_supplied
Fixes an issue when tried to upload a file to an user without actually selecting a file. [ch16471]
2021-05-27 14:03:25 -07:00
Ivan Nieto Vivanco
9f944ad497 Added the 'required' attribute to the input file n the upload file form modal. Added a validation for the UserFilesController if the user doesn't select any file to upload [ch16471]. 2021-05-27 15:48:13 -05:00
snipe
01e3296ff3 Updated hash
Signed-off-by: snipe <snipe@snipe.net>
2021-05-26 15:58:24 -07:00
snipe
7d5a9180e6 Updated hash
Signed-off-by: snipe <snipe@snipe.net>
2021-05-26 15:57:56 -07:00
snipe
9f2b4c721d Allow password reset from user profile
Signed-off-by: snipe <snipe@snipe.net>
2021-05-26 15:32:23 -07:00
snipe
3d008079c9 Merge branch 'develop' of https://github.com/snipe/snipe-it into develop 2021-05-26 14:32:33 -07:00
snipe
b8d413a6b8 Merge pull request #9632 from inietov/fixes/api_allow_duplicate_asset_tags
Fixes an issue that allows duplicate asset tags when the Asset is created via API.
2021-05-26 13:34:59 -07:00
snipe
30a193502f Merge branch 'develop' of https://github.com/snipe/snipe-it into develop 2021-05-26 13:27:20 -07:00
snipe
11f1b29db9 Add @kcoyo as a contributor 2021-05-26 13:04:51 -07:00
snipe
200d0804ec Merge pull request #9630 from kcoyo/develop
Fixed #9607: Sessions expire for SAML/RemoteUser/LDAP
2021-05-26 13:04:13 -07:00
Ivan Nieto Vivanco
d9f5f1182a Delete a couple lines that rewrites validation rules for asset tags in the model Asset.php:save() method. 2021-05-25 23:09:27 -05:00
snipe
3f09d17389 Fixed typo “synchronization”
Signed-off-by: snipe <snipe@snipe.net>
2021-05-25 18:45:06 -07:00
kcoyo
55555ee233 Merge pull request #1 from kcoyo/Fixed-#9607---Sessions-expire-for-SAML/RemoteUser/LDAP
Fixed #9607 - Sessions expire for SAML/RemoteUser/LDAP
2021-05-25 16:44:08 -07:00
kcoyo
cee6f0d579 Update LoginController.php
Fixed #9607 - Sessions expire for SAML/RemoteUser/LDAP
2021-05-25 16:37:34 -07:00
snipe
5b4550a6a8 Merge branch 'develop' of https://github.com/snipe/snipe-it into develop 2021-05-21 16:56:15 -07:00
snipe
1a7edb3411 Accept webp in uploads (not just image files)
Signed-off-by: snipe <snipe@snipe.net>
2021-05-21 16:56:11 -07:00
snipe
796c7c8431 Merge pull request #9619 from uberbrady/migrator_misses_logos
Several improvements to the snipeit:restore Artisan command
2021-05-21 16:02:55 -07:00
Brady Wetherington
94c1d36e08 The legacy 'logo.png' might not be a PNG, so switched to wildcard. 2021-05-21 15:55:37 -07:00
Brady Wetherington
e71bba441e Several improvements to the snipeit:restore Artisan command
The output now focuses on files that were skipped. Wildcard support
was added for individual files. A progress bar fills as the files
are transferred from the ZIPball to the filesystem. A new command-line
switch can be used to disable the progress bar. Barcode restores are
now skipped (we'd probably prefer to regenerate them). A few missed
directories have been added in. Some logic to skip macOS resource-fork
files has been put in. Some bugs with array operations were fixed.
There's now a concept of 'valid' and 'invalid' files for wildcard
operations.
2021-05-21 15:23:23 -07:00
Sabir Manandhar
c3d75d3be3 feat[docker]: create session table migration if session driver is set to database (#9587) 2021-05-20 14:31:22 -07:00
snipe
9eea46adef Fixed parse error in user print view
Signed-off-by: snipe <snipe@snipe.net>
2021-05-20 13:53:43 -07:00
sabir-dzangolab
19766a0a72 Fix/startup-sh (#9586)
* fix: update docker/startup.sh broken after merging hotfixs/2fa_qr

* fix: Typo in Dockerfile.alpine
2021-05-17 15:39:05 -07:00
Marc Leuser
4030789786 fix LicenseSeatsController method documentation (#9584)
in an attempt to get the automatic API reference generation to work
2021-05-14 16:14:32 -07:00
Jonathon Reinhart
fd082addff Fix incorrect case of ldap sync status string (#9563)
Fixes #9562
2021-05-12 19:15:39 -07:00
snipe
d636566012 Merge remote-tracking branch 'origin/master' into develop 2021-05-12 17:45:06 -07:00
Brady Wetherington
6066005aeb [WIP] Initial rough stabs at the Backup Migrator. It kinda-sorta works? (#9457)
* Initial rough stabs at the Backup Migrator. It kinda-sorta works?

* Fix hardcoded mysql path var
2021-05-12 17:44:39 -07:00
snipe
76897f3a3a Make label printing from asset page more consistent with normal UI
Signed-off-by: snipe <snipe@snipe.net>
2021-05-12 17:08:53 -07:00
snipe
c1babdc9b0 Merge remote-tracking branch 'origin/develop' 2021-05-12 16:51:57 -07:00
snipe
1a95337db1 Merge branch 'develop' of https://github.com/snipe/snipe-it into develop 2021-05-12 16:51:39 -07:00
Ivan Nieto Vivanco
6ed5dff1a5 Fix the target path to copy the demo logos in the database\seeds\SettingsSeeder.php. Also added the code that copies the demo logos to app\Console\Commands\ResetDemoSettings.php (#9571) 2021-05-12 16:41:49 -07:00
snipe
3f559c4a50 Add @tbrconnect as a contributor 2021-05-12 13:38:56 -07:00
tbrconnect
a29ef73346 Feature #3088 Print labels from asset detail page (#9559)
This PR adds a "Generate Label" button to the detail asset page as
described in #3088.

Fixes #3088

Co-authored-by: tilmann.bitterberg <tilmann@tbrglobal.com>
2021-05-12 13:38:26 -07:00
snipe
015ca1fcdc Merge remote-tracking branch 'origin/develop' 2021-05-07 18:13:22 -07:00
snipe
ded61614d1 Attempt to fix transient LDAP bug
Signed-off-by: snipe <snipe@snipe.net>
2021-05-07 18:13:04 -07:00
Brady Wetherington
62199f6255 Manually re-add support for Label Logos in Labels (#9552) 2021-05-07 17:01:32 -07:00
snipe
75b89b5a97 Merge remote-tracking branch 'origin/develop' 2021-05-07 16:42:41 -07:00
snipe
a704614397 Bumped max for country on model
Signed-off-by: snipe <snipe@snipe.net>
2021-05-07 16:42:26 -07:00
snipe
2dcb50d28e Merge branch 'develop' of https://github.com/snipe/snipe-it into develop 2021-05-07 16:36:12 -07:00
snipe
9aac3ae628 Fixed HTML causing two backup headers to appear
Signed-off-by: snipe <snipe@snipe.net>
2021-05-07 16:36:07 -07:00
Tom Misilo
397e2df3ea Upgrade the Alpine docker img to v3.13 for PHP 7.4 (#9550)
v3.13 of the alpine image has php7.4 instead of php7.3
2021-05-07 13:50:36 -07:00
Tom Misilo
4e408cbc42 Fix CSP Always being Enabled unless in debug mode. (#9543) 2021-05-05 10:51:47 -07:00
snipe
570a31a1c4 Merge remote-tracking branch 'origin/develop' 2021-05-05 10:29:10 -07:00
snipe
ece627b3a3 Small fixes for location printing when relationships are missing/invalid, per #9521
Signed-off-by: snipe <snipe@snipe.net>
2021-05-05 10:23:46 -07:00
snipe
d8d3fa2293 Only show department if it’s valid
Signed-off-by: snipe <snipe@snipe.net>
2021-05-05 10:13:19 -07:00
snipe
ab694347b0 Added favicon to demo dir
Signed-off-by: snipe <snipe@snipe.net>
2021-05-05 01:18:49 -07:00
snipe
aa98e4ea7a Bumped hash
Signed-off-by: snipe <snipe@snipe.net>

# Conflicts:
#	config/version.php
2021-05-05 00:04:17 -07:00
snipe
6935d94184 Bumped hash
Signed-off-by: snipe <snipe@snipe.net>
2021-05-05 00:03:33 -07:00
snipe
d9d5b4d730 Merge remote-tracking branch 'origin/develop'
Signed-off-by: snipe <snipe@snipe.net>

# Conflicts:
#	.all-contributorsrc
#	README.md
2021-05-05 00:01:09 -07:00
Ivan Nieto Vivanco
36a43642d8 Changed the orderBy clause inside the custom reports function that forms the CSV to be 'id' so making it a unique value and don't causes repeated items. [ch14587] (#9535) 2021-05-04 23:50:02 -07:00
snipe
ed98683496 Add @mikecmpbll as a contributor 2021-05-04 22:40:04 -07:00
snipe
c2dc7ac182 Merge branch 'develop' of https://github.com/snipe/snipe-it into develop 2021-05-04 22:39:24 -07:00
Dampfklon
37f7768e7a Fix Dockerfile.alpine build error and snipeit runtime permission error (#9520) 2021-05-04 22:29:24 -07:00
snipe
c1a8b609ea Add @markbrule as a contributor 2021-05-04 22:27:35 -07:00
markbrule
6c1553167d issue #9422 - pivot ID was being used as a user_id (#9512) 2021-05-04 22:27:01 -07:00
snipe
c572c98361 Merge branch 'develop' of https://github.com/snipe/snipe-it into develop 2021-05-04 22:21:35 -07:00
snipe
6c0af3c6e1 Add @JohnnyPicnic as a contributor 2021-05-04 22:21:18 -07:00
snipe
715b1a0fb2 Fixed #9157 Update .env to API_TOKEN_EXPIRATION_YEARS=15 (reapplies #9524)
Signed-off-by: snipe <snipe@snipe.net>
2021-05-04 22:20:54 -07:00
Tom Misilo
a6bbe1fec3 Delete file from assets folder, not just the ref. (#9525) 2021-05-04 22:18:22 -07:00
snipe
67ac3631df Production assets
Signed-off-by: snipe <snipe@snipe.net>
2021-05-04 22:05:26 -07:00
snipe
5760b76c4e Merge remote-tracking branch 'origin/develop'
Signed-off-by: snipe <snipe@snipe.net>

# Conflicts:
#	public/css/dist/skins/skin-black-dark.css
#	public/css/dist/skins/skin-black-dark.min.css
#	public/css/dist/skins/skin-black.css
#	public/css/dist/skins/skin-black.min.css
#	public/css/dist/skins/skin-blue-dark.css
#	public/css/dist/skins/skin-blue-dark.min.css
#	public/css/dist/skins/skin-blue.css
#	public/css/dist/skins/skin-blue.min.css
#	public/css/dist/skins/skin-contrast.css
#	public/css/dist/skins/skin-contrast.min.css
#	public/css/dist/skins/skin-green-dark.css
#	public/css/dist/skins/skin-green-dark.min.css
#	public/css/dist/skins/skin-green.css
#	public/css/dist/skins/skin-green.min.css
#	public/css/dist/skins/skin-orange-dark.css
#	public/css/dist/skins/skin-orange-dark.min.css
#	public/css/dist/skins/skin-orange.css
#	public/css/dist/skins/skin-orange.min.css
#	public/css/dist/skins/skin-purple-dark.css
#	public/css/dist/skins/skin-purple-dark.min.css
#	public/css/dist/skins/skin-purple.css
#	public/css/dist/skins/skin-purple.min.css
#	public/css/dist/skins/skin-red-dark.css
#	public/css/dist/skins/skin-red-dark.min.css
#	public/css/dist/skins/skin-red.css
#	public/css/dist/skins/skin-red.min.css
#	public/css/dist/skins/skin-yellow-dark.css
#	public/css/dist/skins/skin-yellow-dark.min.css
#	public/css/dist/skins/skin-yellow.css
#	public/css/dist/skins/skin-yellow.min.css
#	public/mix-manifest.json
2021-05-04 22:03:56 -07:00
snipe
57b9b571dc Fixed #9531 - highlight search box when filled, add clear button (#9534) 2021-05-04 22:00:34 -07:00
snipe
62f091e769 Merge remote-tracking branch 'origin/develop' 2021-04-30 15:38:02 -07:00
snipe
cee5eea121 Use 24-hour date format for audit
Signed-off-by: snipe <snipe@snipe.net>
2021-04-30 15:37:39 -07:00
snipe
c6726015f7 Added missing use statement
Signed-off-by: snipe <snipe@snipe.net>
2021-04-30 14:52:08 -07:00
snipe
961268172b Merge remote-tracking branch 'origin/develop' 2021-04-26 18:12:10 -07:00
snipe
b01baec7a8 Updated languages
Signed-off-by: snipe <snipe@snipe.net>
2021-04-26 18:11:48 -07:00
snipe
a1bc984d17 Generate production assets, bumped version
Signed-off-by: snipe <snipe@snipe.net>
2021-04-26 17:34:02 -07:00
snipe
31944cd4d4 Bumped version
Signed-off-by: snipe <snipe@snipe.net>
2021-04-26 17:28:38 -07:00
snipe
d5894a4d64 Generated dev assets
Signed-off-by: snipe <snipe@snipe.net>
2021-04-26 17:27:28 -07:00
snipe
32f043c5df Set the body skin style if one was overridden by the user profile
Signed-off-by: snipe <snipe@snipe.net>
2021-04-26 17:25:39 -07:00
snipe
23376c317e Use correct URL for css for subdirs
Signed-off-by: snipe <snipe@snipe.net>
2021-04-26 17:22:02 -07:00
snipe
b3b02933a5 Removed duplicate code
Signed-off-by: snipe <snipe@snipe.net>
2021-04-26 17:21:48 -07:00
snipe
882732b2de WTF kind of gendered language was this mess?
Signed-off-by: snipe <snipe@snipe.net>
2021-04-26 17:18:17 -07:00
snipe
b8c3564434 Removed min from personal CSS
Signed-off-by: snipe <snipe@snipe.net>
2021-04-26 14:05:18 -07:00
snipe
138ddfec1c Merge remote-tracking branch 'origin/develop' 2021-04-23 14:27:12 -07:00
snipe
315bcb6b38 Added use statement
Signed-off-by: snipe <snipe@snipe.net>
2021-04-23 14:26:57 -07:00
snipe
8016807268 Add @Nevets82 as a contributor 2021-04-23 12:09:34 -07:00
Steven
82f73eb9e2 Added user locale to REST API GET /api/users response; (#9486)
* Clearer reporting on import

Signed-off-by: snipe <snipe@snipe.net>

* Try adding  text/x-Algol68 to import

Signed-off-by: snipe <snipe@snipe.net>

* Added user locale to REST API GET /api/users response;

Co-authored-by: snipe <snipe@snipe.net>
2021-04-23 12:09:00 -07:00
snipe
b865a8aeea Merge remote-tracking branch 'origin/develop' 2021-04-21 20:19:17 -07:00
snipe
1d43eda21f Features: improved UI for importer (#9467)
* Small UI improvements for importer

Signed-off-by: snipe <snipe@snipe.net>

* And UI backup improvements

Signed-off-by: snipe <snipe@snipe.net>
2021-04-21 20:16:17 -07:00
snipe
ea0d0df1af Try adding text/x-Algol68 to import
Signed-off-by: snipe <snipe@snipe.net>
2021-04-21 13:48:51 -07:00
snipe
54ef469d98 Clearer reporting on import
Signed-off-by: snipe <snipe@snipe.net>
2021-04-21 13:27:23 -07:00
snipe
cef689a679 Merge branch 'develop' of https://github.com/snipe/snipe-it into develop 2021-04-21 12:29:06 -07:00
snipe
36c2edb278 Add @nepella as a contributor 2021-04-21 11:40:38 -07:00
Renee Margaret McConahy
e6c3d7fe57 Restore LOG_CHANNEL environment variable. (#9464)
This allows selecting the Monolog channel with the LOG_CHANNEL variable.
2021-04-21 11:40:23 -07:00
snipe
3855b74161 Merge remote-tracking branch 'origin/develop' 2021-04-21 10:24:04 -07:00
snipe
90f79eaf83 Merge branch 'develop' of https://github.com/snipe/snipe-it into develop 2021-04-21 10:23:46 -07:00
Brady Wetherington
72a813f23d This fixes the controller signature error people are getting with LDAP logins (#9466) 2021-04-21 10:23:32 -07:00
snipe
d90abdf86f Snipe codeacy workflow (#9460)
* Removed printerClass="NunoMaduro\Collision\Adapters\Phpunit\Printer"

Signed-off-by: snipe <snipe@snipe.net>

* fix ldap ad authentication filter query mechanism (#7441)

* Create SECURITY.md

* Create codacy-analysis.yml

Co-authored-by: Istvan Basa <basipottom@gmail.com>
2021-04-20 22:17:37 -07:00
snipe
1886841ec5 Create SECURITY.md 2021-04-20 22:15:41 -07:00
Istvan Basa
b037d0efdd fix ldap ad authentication filter query mechanism (#7441) 2021-04-20 21:25:45 -07:00
aranar-pro
5127727730 Fixed #9424: import history adds asset model to assigned user and respects checkin date (#9350)
* Fixed #9294: Assets import history. Behaviour based on Checkin Date added, including assigning checked out items to users.

* Fixed #9294: Fixed asset import history to respect checkin and update user with checked out items.

* Fixed #9294: whitespace and comment cleanup for merge

* Fixed #9294: Fixed asset import history to respect checkin and update user with checked out items.
2021-04-20 21:25:17 -07:00
Ross Crawford-d'Heureuse
2a058c3ce1 Added a docker-compose with helper services (#9105)
* Updates

* BAse

* pdated instructions round app_key

Co-authored-by: Ross Crawford-d'Heureuse <ross.crawford@mindcurv.com>
2021-04-20 21:17:34 -07:00
Mateus Villar
fdcb63f251 Added #9313: Add new fpm-alpine docker image and docker secrets support (#9331)
* Add docker secret support

* Add docker secret support to selected environment variables below:

- APP_KEY_FILE        -> APP_KEY;

- DB_HOST_FILE        -> DB_HOST;
- DB_PORT_FILE        -> DB_PORT;
- DB_DATABASE_FILE    -> DB_DATABASE;
- DB_USERNAME_FILE    -> DB_USERNAME;
- DB_PASSWORD_FILE    -> DB_PASSWORD;

- REDIS_HOST_FILE     -> REDIS_HOST;
- REDIS_PASSWORD_FILE -> REDIS_PASSWORD;
- REDIS_PORT_FILE     -> REDIS_PORT;

- MAIL_HOST_FILE      -> MAIL_HOST;
- MAIL_PORT_FILE      -> MAIL_PORT;
- MAIL_USERNAME_FILE  -> MAIL_USERNAME;
- MAIL_PASSWORD_FILE  -> MAIL_PASSWORD;

* Add env file for docker secrets

* Added #9313: add new fpm-image using docker secrets

* Fix broken symlinks

* Add docker secrets support using shell script

* Remove old docker config php files
2021-04-20 21:14:47 -07:00
dependabot[bot]
da79a16284 Bump ssri from 6.0.1 to 6.0.2 (#9459)
* Removed printerClass="NunoMaduro\Collision\Adapters\Phpunit\Printer"

Signed-off-by: snipe <snipe@snipe.net>

* Bump ssri from 6.0.1 to 6.0.2

Bumps [ssri](https://github.com/npm/ssri) from 6.0.1 to 6.0.2.
- [Release notes](https://github.com/npm/ssri/releases)
- [Changelog](https://github.com/npm/ssri/blob/v6.0.2/CHANGELOG.md)
- [Commits](https://github.com/npm/ssri/compare/v6.0.1...v6.0.2)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: snipe <snipe@snipe.net>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-04-20 21:13:34 -07:00
snipe
d10d090d33 Moved status label help text to headline
Signed-off-by: snipe <snipe@snipe.net>
2021-04-20 15:31:07 -07:00
snipe
aa6b1456b2 Added help text to custom fields headline
Signed-off-by: snipe <snipe@snipe.net>
2021-04-20 15:29:43 -07:00
snipe
b2de0d4ade Changed “Asset Categories” to “Categories” since there are more than asset categories now
Signed-off-by: snipe <snipe@snipe.net>
2021-04-20 15:29:22 -07:00
snipe
c17eaaad69 Check that the field is valid before checking to see count()
This mostly affects the demo, since the seeder updates info often

Signed-off-by: snipe <snipe@snipe.net>
2021-04-20 15:10:28 -07:00
snipe
e286ff0be3 Added show() redirect for CustomFields::show()
Signed-off-by: snipe <snipe@snipe.net>
2021-04-20 15:09:23 -07:00
snipe
83200d3cbd Merge remote-tracking branch 'origin/develop' 2021-04-20 14:55:48 -07:00
snipe
d40fe1b683 Merge branch 'develop' of https://github.com/snipe/snipe-it into develop 2021-04-20 14:54:29 -07:00
Brady Wetherington
2a28f5e66c (Maybe?) Fixes the problem where we always need LDAP enabled (#9321)
* I *think* this fixes the problem where we need LDAP even if we aren't using it?

* Pull the LdapAd dependency out of the AuthController constructor
2021-04-20 14:53:47 -07:00
snipe
dd1a5681da Add @psarossy as a contributor 2021-04-20 14:53:10 -07:00
Peter Sarossy
cacb707a7f Added #9355: include Accessories and Consumables on the location reports (#9356) 2021-04-20 14:53:04 -07:00
snipe
e92f69dcda Add @zybersup as a contributor 2021-04-20 14:52:29 -07:00
Supapong Areeprasertkul
b28b245acc Update labels.blade.php (#8441)
- Make the qr_size bigger when no barcode printed.
- BUG: Missing unit of font size for .qr-text class.
- Reduce padding-right to remove the additional space above text when print from Google Chrome. (I do not know the cause. I tried "box-sizing: border-box" without success.)
2021-04-20 14:52:17 -07:00
Michael Pietsch
15e729f4b8 fix css when not runnin in webroot directory (#9445)
Co-authored-by: Michael Pietsch <skywalker-11@mi-pietsch.de>
2021-04-20 14:49:57 -07:00
snipe
3138f45e8c Merge branch 'develop' of https://github.com/snipe/snipe-it into develop 2021-04-20 14:49:38 -07:00
snipe
3e471a6587 Add @sh1hab as a contributor 2021-04-20 14:49:31 -07:00
Masudul Haque Shihab
f3831fe010 Fixed #9447 change route parameter name in locations view (#9456) 2021-04-20 14:49:05 -07:00
Ivan Nieto Vivanco
36bc47c61c Handle regex format when assigned from API (#9443) 2021-04-20 14:44:47 -07:00
snipe
e4acf8d795 Merge remote-tracking branch 'origin/master' into develop 2021-04-20 14:44:01 -07:00
snipe
b562f38729 Removed printerClass="NunoMaduro\Collision\Adapters\Phpunit\Printer"
Signed-off-by: snipe <snipe@snipe.net>
2021-04-19 10:51:29 -07:00
snipe
e8adf8d44c One more category fix
Signed-off-by: snipe <snipe@snipe.net>
2021-04-14 16:57:55 -07:00
snipe
b693e5202b Check for category name
Signed-off-by: snipe <snipe@snipe.net>
2021-04-14 16:54:36 -07:00
snipe
415ae5854f Add @Skywalker-11 as a contributor 2021-04-14 15:15:57 -07:00
snipe
e1c6d4ced7 Merge branch 'develop' of https://github.com/Skywalker-11/snipe-it into Skywalker-11-develop
Signed-off-by: snipe <snipe@snipe.net>

# Conflicts:
#	app/Http/Requests/SettingsSamlRequest.php
2021-04-14 15:15:07 -07:00
snipe
252b2ee1b4 Add @Jelle-S as a contributor 2021-04-14 15:07:40 -07:00
snipe
39b0f464d2 Adds ID columns to tables that don’t have them - reproduces #9363
This reproduces #9363 without the PK in custom fields

Signed-off-by: snipe <snipe@snipe.net>
2021-04-14 15:07:11 -07:00
snipe
2c0438bdcb Add @andreaci as a contributor 2021-04-14 11:18:13 -07:00
snipe
2986765a68 Implements #9373
Signed-off-by: snipe <snipe@snipe.net>
2021-04-14 11:17:59 -07:00
snipe
f19595f525 Add @deivishome as a contributor 2021-04-14 10:27:08 -07:00
snipe
465ec054d3 Add @limeless as a contributor 2021-04-14 10:22:58 -07:00
theburger
785b1ad5a6 Update snipeit.sh php version from 7.1 to 7.4 (#9407)
Snipe-it 5.2.x is required PHP 7.4 or above,
update script to install PHP 7.4 instead of 7.1

## Changed
- PHP to install in script is changed to 7.4 from 7.1
- Add `''`at DB_PASSWORD when configuring `.env` file
2021-04-14 10:22:31 -07:00
snipe
ab8f7e7b84 Add @Joly0 as a contributor 2021-04-14 10:21:18 -07:00
Joly0
31b2287a57 Update print.blade.php (#9426)
Fixes #9418
2021-04-14 10:20:36 -07:00
Godfrey Martinez
5fab1d6f0d FIxes Sum of purchase cost of components not taking quantity into account in Asset View > Components tab (#9424)
* git commit -m

* added text
2021-04-14 10:19:40 -07:00
Godfrey Martinez
246cc0eaa8 Feature/ch16172/adding other fields to ldap sync settings (#9416)
* new branch, added manager as an additional field. Currently having DB issues

* WIP DB Issue with eloquent

* added department to LDAP sync

* removed unused variables
2021-04-14 10:17:57 -07:00
snipe
ce1d3284b0 Buld assets
Signed-off-by: snipe <snipe@snipe.net>
2021-04-14 10:12:14 -07:00
Brady Wetherington
bf344fd707 Merge branch 'develop'
mix-manifest I just picked one.
version.php will get bumped by hand
bootstrap table seems to just be another copy? Added it back.
2021-04-14 09:58:21 -07:00
Ivan Nieto Vivanco
9cf5fbd675 Logic added to handle when a cloned user is imported via LDAP. (#9429) 2021-04-14 09:19:25 -07:00
Ivan Nieto Vivanco
3824a50e8b Fixes an issue with CSS when the 'skin' value in settings table is empty. (#9423) 2021-04-12 20:37:02 -07:00
snipe
b6006769c3 Bumped version
Signed-off-by: snipe <snipe@snipe.net>
2021-04-06 21:02:05 -07:00
snipe
bf2479c5d9 Fixed url to user-ridden style
Signed-off-by: snipe <snipe@snipe.net>
2021-04-06 20:36:13 -07:00
snipe
7ddcc97e79 Generated dev assets
Signed-off-by: snipe <snipe@snipe.net>
2021-04-06 20:35:58 -07:00
snipe
ba92d751a3 Removed depreciated Input:: facade
Signed-off-by: snipe <snipe@snipe.net>
2021-04-06 20:28:05 -07:00
Brady Wetherington
6b86e2a58f Rebuilt all assets after all commits had landed 2021-04-06 20:16:59 -07:00
Brady Wetherington
792a31cc7f Merge branch 'develop' 2021-04-06 20:10:22 -07:00
snipe
e47e2e3754 Fixed #9404 - include note in accessory API
Signed-off-by: snipe <snipe@snipe.net>
2021-04-06 10:57:30 -07:00
snipe
105f57e059 Possible fix for Docker failing on master
Signed-off-by: snipe <snipe@snipe.net>
2021-04-06 06:09:04 -07:00
snipe
390403ddb7 Fixed #9370 - listbox custom fields not decryoted on edit
Signed-off-by: snipe <snipe@snipe.net>
2021-04-06 05:59:31 -07:00
snipe
7da32443ff Move develop fixes to master
Signed-off-by: snipe <snipe@snipe.net>
2021-04-06 05:05:16 -07:00
Brady Wetherington
72806cf8db Fix up docker build on develop branch (#9401) 2021-04-05 22:13:31 -07:00
Serkan
0e34e43abb The return early pattern applied to improve readability. (#8894) 2021-04-05 22:03:15 -07:00
snipe
981b503653 Merge branch 'develop' of https://github.com/snipe/snipe-it into develop 2021-04-05 22:01:35 -07:00
Joel Pittet
af8509c4d0 Allow NPM packages to build for production (#9171)
* add back changes before compiling assets

* new css location and mix manifest

* update papaparse, most vunerabilities attached to it

* update axios and papaparse for security releases

* removing security fixes that still allow npm run production to work

* Update lodash
2021-04-05 22:01:11 -07:00
snipe
abddda2ab8 Add @kajes as a contributor 2021-04-05 21:56:45 -07:00
Lars Kajes
49532e1cd6 Add option to force TLS connection (#9327)
Co-authored-by: Lars Kajes <lars.kajes@iusinnovation.se>
2021-04-05 21:56:25 -07:00
snipe
09887bdabd Removed stray opening tag
Signed-off-by: snipe <snipe@snipe.net>
2021-04-05 21:54:31 -07:00
snipe
ff0e526021 Merge branch 'develop' of https://github.com/snipe/snipe-it into develop 2021-04-05 21:53:47 -07:00
Godfrey Martinez
f9f8ce6df6 Auditing feature improvement Better mobile [ch14328] (#9181) 2021-04-05 21:53:19 -07:00
snipe
55692bfe98 Add @Tetrachloromethane250 as a contributor 2021-04-05 21:52:14 -07:00
snipe
5c5fe2bd87 Merge branch 'develop' of https://github.com/snipe/snipe-it into develop 2021-04-05 21:52:01 -07:00
Tetrachloromethane250
157d9e4ebb Added #5977: Add permission to view files attached to licenses (#9264)
* Add permission to view and modify files for licenses

* Actually use the permission
2021-04-05 21:51:47 -07:00
snipe
20a3028386 Merge branch 'develop' of https://github.com/snipe/snipe-it into develop 2021-04-05 21:48:01 -07:00
snipe
3ffa3534a0 Use environmental variables in memory limits
Signed-off-by: snipe <snipe@snipe.net>
2021-04-05 21:47:57 -07:00
Jan Kiesewetter
d61d189328 Change owner while copy (#7552)
* Change owner while copy

Copy all files and chown them in a 2nd layer leads to a larger image.
See layer 22 and 26 of https://hub.docker.com/layers/snipe/snipe-it/v4.7.8/images/sha256-67c865d91df1b90cef1112f12bbc9c64402dfeafde0bdb160c4f07e785ee0bcc

* Copy docker.env as user docker
2021-04-05 21:15:54 -07:00
Earl Ramirez
6a8d5282ef Add support for Debian 10 (#7414) 2021-04-05 21:06:53 -07:00
snipe
f147c43dd4 Add @t3easy as a contributor 2021-04-05 21:04:39 -07:00
snipe
c9ec15101c Add @ajsy as a contributor 2021-04-05 20:56:39 -07:00
snipe
b9bab05ac3 Merge branch 'master' of https://github.com/ajsy/snipe-it into ajsy-master
Signed-off-by: snipe <snipe@snipe.net>

# Conflicts:
#	resources/views/users/print.blade.php
2021-04-05 20:55:49 -07:00
snipe
298bfa73c8 Add @ocelotsloth as a contributor 2021-04-05 20:35:28 -07:00
Mark Stenglein
dd1b9ab926 VAGRANT: Fix Ubuntu Development VMs (#6909)
* GITIGNORE: Add vagrant log and ansible retry files

This patch adds the following to the project's .gitignore file:
  - Vagrant's log file
  - Ansible's retry files

Signed-off-by: Mark Stenglein <mark@stengle.in>

* ANSIBLE: Add Ubuntu Ansible playbook for dev env

This patch adds an Ansible playbook to provision an Ubuntu based
development environment. This playbook is fully idempotent and
can be run multiple times without negative consequences.

Signed-off-by: Mark Stenglein <mark@stengle.in>

* VAGRANTFILE: Clean Vagrantfile

There was a lot of extra VMs being provisioned by the existing
Vagrantfile. Some of this may need to come back but I am removing
it with this commit to demonstrate that this is all that is
needed.

Signed-off-by: Mark Stenglein <mark@stengle.in>

* ANSIBLE: UBUNTU: PLAYBOOK: Add .env configuration

I missed the configuration of the .env file in the initial commit.
This patch adds these configuration steps as well as the needed
Cron job for the Artisan scheduler.

Signed-off-by: Mark Stenglein <mark@stengle.in>

* Revert "VAGRANTFILE: Clean Vagrantfile"

This reverts commit a608a30d6b.

* VAGRANTFILE: Fix Ubuntu Vagrant Development Boxes

This patch addresses problems with the existing Vagrant deployment
configurations for the Ubuntu VMs.
  - The vagrant file is configuring the VMs for an incorrect bridge
    interface. Fixed by changing the config to use the default
    networking as well as a port-forward.
  - Moves provisioning over to the Ansible-Local playbook I wrote.

Signed-off-by: Mark Stenglein <mark@stengle.in>
2021-04-05 20:35:04 -07:00
Sxderp
f01c93e162 Extend #6229 to include superuser permission check (#6772) 2021-04-05 20:26:06 -07:00
snipe
26b97d2b0b Add @JuustoMestari as a contributor 2021-04-05 20:16:35 -07:00
snipe
df72f92bc0 Brings PR #6744 up to parity with previous changes - Set custom field's default value when creating a new asset using the API
Signed-off-by: snipe <snipe@snipe.net>
2021-04-05 20:16:06 -07:00
AlexanderWPapyrus
a1f9642a18 Increases DPI of barcode for small lables (#9344)
solves issue #9293
2021-04-05 19:33:10 -07:00
Ivan Nieto Vivanco
90a24539b0 Fixes/cli importer issue (#9199)
* Added logic to handle the CLI importer.

* Fix bug introduced with the commit previous to the regression.

* Adds a validation for  variable when is null, add comments to clarify where the  class variable came from.

* Add support for when  variable is an instance of User class.
2021-04-05 19:28:31 -07:00
Godfrey Martinez
5ea759f615 Fixed #7211, #9197, #7864, [ch15504] - Added additional LDAP fields to sync (#9318)
* LDAP and Active Directory has plenty of other [ch15504]

* removed department id from ldap sync

* removed department id from ldap sync

* Update 2021_03_18_184102_adds_several_ldap_fields.php
2021-04-05 19:26:04 -07:00
Ivan Nieto Vivanco
eb0ae74ef8 Fixes typo that doesn't accepts 'textarea' as custom field type element. (#9387) 2021-04-01 18:23:05 -07:00
snipe
6f4215cfac Fixed label name for field_values
Signed-off-by: snipe <snipe@snipe.net>
2021-03-31 14:07:30 -07:00
snipe
a199c75f5c Added textarea and checkbox to validation rules
Signed-off-by: snipe <snipe@snipe.net>
2021-03-31 14:04:01 -07:00
snipe
b5f7cb534e Fixed element name
Signed-off-by: snipe <snipe@snipe.net>
2021-03-31 14:02:25 -07:00
snipe
618e4439e2 Fixed validation to include textarea
Signed-off-by: snipe <snipe@snipe.net>
2021-03-31 14:02:10 -07:00
snipe
6a8e761c5e Added created_at and updated_at to presenter
Signed-off-by: snipe <snipe@snipe.net>
2021-03-30 08:57:20 -07:00
snipe
70a7a8f20b WTF. This shit is haunted.
Signed-off-by: snipe <snipe@snipe.net>
2021-03-30 08:00:27 -07:00
snipe
a5b67965f2 Fixed CSS path
(Fixes RB #14746)

Signed-off-by: snipe <snipe@snipe.net>
2021-03-30 07:49:30 -07:00
snipe
2354e37504 Merge branch 'develop' of https://github.com/snipe/snipe-it into develop 2021-03-30 07:40:14 -07:00
Nikolay Didenko
06e641b782 Do not override per table data-id-cookie-table attribute by current route name globally (#7835) 2021-03-29 20:05:24 -07:00
Shaun McPeck
c88813bbb8 set docker user as owner of key symbolic links (#7924)
Co-authored-by: Shaun McPeck <shaun@shaunmcpeck.com>
2021-03-29 19:44:42 -07:00
Marc Leuser
90b7d34c69 Added #6695: add API endpoint for license seats (#8058)
* remove miselading comment line

* added dedicated API endpoint for license seats

* don't display a seat name via API
it makes no sense and we don't have any particular sorting order
so the numbering would be inconsistent anyway

* reduce amount of IFs

* add sanity checks to show()

* fix goofed logging logic

* add tests for action log entries
2021-03-29 19:41:26 -07:00
R. Christian McDonald
cb1a95a530 Apache site configurations shouldn't be written to sites-enabled (#6982)
It is better (best) practice to write configurations to sites-available and then let Apache copy the configuration to sites-enabled via 'a2ensite' command
2021-03-29 19:21:30 -07:00
NMC
3e934a1b96 Add a way for a user to override the site skin setting + fix mislabeled comment. (#6891)
* Add a way for a user to override the skin setting.

* Add site setting to allow user to change the skin.

* Fix skin list.

Co-authored-by: NMC <info@nmc-lab.com>
2021-03-29 19:09:23 -07:00
Nuno Maduro
8b6b95a05b Makes nunomaduro/collision versioning consistent with other dependencies (#9316) 2021-03-29 18:15:20 -07:00
snipe
53651ba3df Add @misilot as a contributor 2021-03-24 14:09:02 -07:00
snipe
d527f23ec8 Add @raelldottin as a contributor 2021-03-24 14:08:56 -07:00
Raell Dottin
78cc47a859 Added sanity check to determine if a bind user account is set. (#9340) 2021-03-24 14:08:37 -07:00
snipe
b00413e8aa Added missing .env vars to example from #8389
Signed-off-by: snipe <snipe@snipe.net>
2021-03-24 11:46:07 -07:00
Tom Misilo
7557879d4a Add support for overriding the Time and Memory Limits (#8389)
This is similar to what exists for the LDAP Import, and adds support for
setting th  Import and Report max execution time and memory limits

Co-authored-by: snipe <snipe@snipe.net>
2021-03-24 11:40:43 -07:00
snipe
0b41f9182a Merge remote-tracking branch 'origin/develop' 2021-03-24 11:35:39 -07:00
Jo Drexl
0114373468 Fixing #9224 (#9328) 2021-03-22 12:57:26 -07:00
snipe
86fef3f40a Set SAML errors to warning instead of error
Signed-off-by: snipe <snipe@snipe.net>
2021-03-17 22:30:26 -07:00
snipe
c90604b5ae Merge remote-tracking branch 'origin/develop' 2021-03-17 22:19:24 -07:00
snipe
069e9e52fe Try/catch barcodes so they don’t shit up the logs
Signed-off-by: snipe <snipe@snipe.net>
2021-03-17 22:19:10 -07:00
Peter Dave Hello
ca8b152549 Remove unnecessary apt-get clean in Dockerfile (#9201)
This image is built from the official Debian image as upstream, so there
is no need to do apt-get clean manually.

Ref:
- docs.docker.com/develop/develop-images/dockerfile_best-practices/#apt-get

> Official Debian and Ubuntu images automatically run apt-get clean, so
> explicit invocation is not required.
2021-03-17 20:33:54 -07:00
snipe
b2a3a80f96 Bumped hash
Signed-off-by: snipe <snipe@snipe.net>

# Conflicts:
#	composer.lock
#	config/version.php
2021-03-17 20:04:43 -07:00
snipe
c8e172ec6b Downgrade packages
Signed-off-by: snipe <snipe@snipe.net>
2021-03-17 20:03:09 -07:00
snipe
afb7fcfa3e Bumped hash
Signed-off-by: snipe <snipe@snipe.net>
2021-03-17 20:02:54 -07:00
snipe
9f3a8a43cc Merge remote-tracking branch 'origin/develop'
Signed-off-by: snipe <snipe@snipe.net>

# Conflicts:
#	composer.lock
2021-03-17 19:41:02 -07:00
snipe
8fd8e716ac Changed debug level on bad LDAP connection (#9314)
* Changed debug level on bad LDAP connection

TODO:

Unfuck all of this. It’s a mess and it really doesn’t work the way we think it does. AdLdap library strikes again. :(

Signed-off-by: snipe <snipe@snipe.net>

* Improved phrasing

Signed-off-by: snipe <snipe@snipe.net>
2021-03-17 19:24:28 -07:00
snipe
72f7baf5ee Removed unused class references 2021-03-17 16:56:32 -07:00
snipe
1b890ffcc5 Added collision 2021-03-17 15:45:00 -07:00
snipe
ca882e2b3d Add @elyscape as a contributor 2021-03-15 16:42:52 -07:00
Eli Young
97fa9663b1 Fixed #9299: Use correct SVG MIME type for uploads (#9300)
The correct MIME type of SVG is image/svg+xml. Out of an abundance of
caution, I am leaving in image/svg to avoid potentially causing issues
on very old browsers, but this can likely be removed without issue.
2021-03-15 16:42:11 -07:00
snipe
ab092fd209 Merge remote-tracking branch 'origin/develop'
# Conflicts:
#	app/Providers/AppServiceProvider.php
#	config/logging.php
#	config/services.php
2021-03-15 12:29:29 -07:00
Brady Wetherington
c7626f8387 Add new StorageHelper and use it where it makes sense (#9276) 2021-03-15 12:26:39 -07:00
snipe
3fc24b4e61 Set spatie encryption to null 2021-03-09 21:07:41 -08:00
snipe
f164f0ea60 Fixed #9266 - set a colors_array variable even if other conditions are not met 2021-03-09 21:04:32 -08:00
snipe
0dd38c4a9b One more try for logo copying
Again, this might not work, but I cannot find snipe-logo-lg.png anywhere in the repo
2021-03-09 20:41:47 -08:00
snipe
6e8aaddb40 One more changes for settings seeder (this may not work) 2021-03-09 17:40:22 -08:00
snipe
104912cdf3 Added default logos to setting seeder 2021-03-09 17:39:10 -08:00
snipe
b103f724b5 Added discard changes in composer (for those weird cases where it says something changed in a vendor directory) 2021-03-09 17:38:06 -08:00
snipe
0fa07a4bca Bumped point version 2021-03-09 16:19:21 -08:00
snipe
c3871c98df Updated rollbar package 2021-03-09 16:16:57 -08:00
snipe
cf4e97f103 Log namespacing 2021-03-09 13:39:53 -08:00
snipe
f05a8d782c Added spatie encryption line 2021-03-09 13:38:53 -08:00
snipe
89ab4bb86f Revert "Added PHP8 compatibility [experimental]"
This reverts commit 3873f14971.

# Conflicts:
#	composer.lock
2021-03-09 13:38:38 -08:00
snipe
707a68fc54 Rollback :( 2021-03-09 13:15:00 -08:00
snipe
4bd9706693 Merge branch 'develop' of https://github.com/snipe/snipe-it into develop 2021-03-09 12:56:17 -08:00
snipe
0d91ebfed8 One more try at Spatie 2021-03-09 12:56:13 -08:00
snipe
2d6dcb6b3b Applying fix for Undefined class constant 'EM_AES_256' in spatie
https://github.com/spatie/laravel-backup/discussions/1247
2021-03-09 12:52:26 -08:00
snipe
e9ee9ea2e9 Fixed rollbar integration 2021-03-09 12:40:00 -08:00
snipe
3873f14971 Added PHP8 compatibility [experimental] 2021-03-09 12:39:49 -08:00
snipe
7e56fc5e0d Updated mix manifest 2021-03-02 12:33:39 -08:00
snipe
3f01b02fd9 Updated BS tables 2021-03-02 12:33:29 -08:00
snipe
77ec64aded Merge remote-tracking branch 'origin/develop'
# Conflicts:
#	public/css/dist/skins/skin-black-dark.css
#	public/css/dist/skins/skin-black-dark.min.css
#	public/css/dist/skins/skin-blue-dark.css
#	public/css/dist/skins/skin-blue-dark.min.css
#	public/css/dist/skins/skin-green-dark.css
#	public/css/dist/skins/skin-green-dark.min.css
#	public/css/dist/skins/skin-orange-dark.css
#	public/css/dist/skins/skin-orange-dark.min.css
#	public/css/dist/skins/skin-purple-dark.css
#	public/css/dist/skins/skin-purple-dark.min.css
#	public/css/dist/skins/skin-red-dark.css
#	public/css/dist/skins/skin-red-dark.min.css
#	public/css/dist/skins/skin-yellow-dark.css
#	public/css/dist/skins/skin-yellow-dark.min.css
#	public/mix-manifest.json
2021-03-02 12:33:18 -08:00
Ivan Nieto Vivanco
9ed226a0af Fixes links in Models Actions, and to view the fieldset assigned to that Model. (#9232) 2021-03-01 13:08:29 -08:00
Ivan Nieto Vivanco
d64b35c348 Added a condition to ensure that only assets checked out to an user that is being deleted are updating their status (#9233) 2021-03-01 13:07:23 -08:00
snipe
5aa960603a Merge branch 'develop' of https://github.com/snipe/snipe-it into develop 2021-02-26 15:59:53 -08:00
Joel Pittet
c979779249 Fixes a couple blade templates for relative URLs (#9170)
* Switched branch name to master

* Production assets for better contrast in dark mode skins

* Fixed #9115: Duplicate column name 'provider' (#9137)

* Sigh. Real assets

* fix blade templates with missing url() function wrapper for relative URLs

* Develop to master (#9195)

* Added saml custom setting retrieveParametersFromServer to enable fixing SLO issues with Azure AD (#9187)

* [FIX] Lite test email won't use the mail component (#9092)

* [FIX] Lite test email won't use the mail component

* Revert "[FIX] Lite test email won't use the mail component"

This reverts commit 6dab9aa1a8.

* Fix check for snipeSettings

* Remove random text from message template

* Revert "Fix check for snipeSettings"

This reverts commit 887dcc7bbc.

* Fix test notification with setupCompleted

Co-authored-by: johnson-yi <63399474+johnson-yi@users.noreply.github.com>
Co-authored-by: Oliver Walerys <owalerys@users.noreply.github.com>

* Changed branch from develop to master

* fix blade templates with missing url() function wrapper for relative URLs

* Re-apply patch against develop

* Rebase against develop

Co-authored-by: snipe <snipe@snipe.net>
Co-authored-by: Kevin Köllmann <mail@kevinkoellmann.de>
Co-authored-by: johnson-yi <63399474+johnson-yi@users.noreply.github.com>
Co-authored-by: Oliver Walerys <owalerys@users.noreply.github.com>
2021-02-26 15:59:36 -08:00
snipe
52bf050c4f Add @joelpittet as a contributor 2021-02-26 15:59:17 -08:00
Ivan Nieto Vivanco
ab7dd90602 Fixes ternary that sets the offset in 0 when the offset passed to the API for the user is greater than total locations. (#9210) 2021-02-26 12:56:04 -08:00
snipe
2e298893b6 Updated mix manifest 2021-02-25 19:43:58 -08:00
Godfrey Martinez
b0078ff64d Audit dark mode theme skins and check for [ch15847] (#9102)
Co-authored-by: snipe <snipe@snipe.net>
2021-02-25 19:41:31 -08:00
snipe
fcd805638e Changed branch from develop to master 2021-02-25 16:54:23 -08:00
snipe
63629abb93 Merge remote-tracking branch 'origin/develop' 2021-02-25 16:53:50 -08:00
snipe
6373ef3283 Bumped version 2021-02-25 16:53:37 -08:00
snipe
00a7c1e9e2 Merge remote-tracking branch 'origin/develop' 2021-02-25 16:44:55 -08:00
snipe
f37d5d3d03 Fixed #9085 - asset models not showing proper pagination
Huge thanks to @inietov for catching this one
2021-02-25 16:43:38 -08:00
snipe
57e52f0ba4 Fixed extraneous closing </i> 2021-02-25 13:35:05 -08:00
snipe
dc8e06fc65 Merge remote-tracking branch 'origin/develop' 2021-02-24 09:12:27 -08:00
snipe
db3f80bb9b Fixed #9198 - added stdout as a log driver 2021-02-24 09:10:03 -08:00
snipe
f5dda06c55 Develop to master (#9195)
* Added saml custom setting retrieveParametersFromServer to enable fixing SLO issues with Azure AD (#9187)

* [FIX] Lite test email won't use the mail component (#9092)

* [FIX] Lite test email won't use the mail component

* Revert "[FIX] Lite test email won't use the mail component"

This reverts commit 6dab9aa1a8.

* Fix check for snipeSettings

* Remove random text from message template

* Revert "Fix check for snipeSettings"

This reverts commit 887dcc7bbc.

* Fix test notification with setupCompleted

Co-authored-by: johnson-yi <63399474+johnson-yi@users.noreply.github.com>
Co-authored-by: Oliver Walerys <owalerys@users.noreply.github.com>
2021-02-23 14:53:55 -08:00
Oliver Walerys
c3166d491a [FIX] Lite test email won't use the mail component (#9092)
* [FIX] Lite test email won't use the mail component

* Revert "[FIX] Lite test email won't use the mail component"

This reverts commit 6dab9aa1a8.

* Fix check for snipeSettings

* Remove random text from message template

* Revert "Fix check for snipeSettings"

This reverts commit 887dcc7bbc.

* Fix test notification with setupCompleted
2021-02-23 14:49:40 -08:00
johnson-yi
763e17f491 Added saml custom setting retrieveParametersFromServer to enable fixing SLO issues with Azure AD (#9187) 2021-02-23 11:05:22 -08:00
snipe
47b2fe571e Merge remote-tracking branch 'origin/develop' 2021-02-19 10:52:33 -08:00
snipe
c8f6318aba Fixed funky layout in asset model modal window (broken HTML) 2021-02-19 10:51:56 -08:00
snipe
adbb3a8f31 Merge remote-tracking branch 'origin/develop' 2021-02-19 10:20:07 -08:00
snipe
1f142fde8a Merge branch 'develop' of https://github.com/snipe/snipe-it into develop 2021-02-19 10:19:37 -08:00
Brady Wetherington
44eee019d9 Add variable declaration for $result (#9168) 2021-02-19 10:19:24 -08:00
snipe
f636aac2dd Add @sw-mreyes as a contributor 2021-02-19 10:11:52 -08:00
snipe
54fd1b993b Merge remote-tracking branch 'origin/develop'
# Conflicts:
#	config/version.php
2021-02-19 10:11:23 -08:00
snipe
a5731a3088 Updated hash 2021-02-19 10:09:22 -08:00
snipe
6449d0aaf9 Sigh. Real assets 2021-02-19 10:06:06 -08:00
snipe
931e2df3bd Updated production assets
# Conflicts:
#	public/js/build/app.js
#	public/js/dist/all.js
2021-02-19 10:05:29 -08:00
snipe
7f8eddede6 Updated compiled assets 2021-02-19 10:02:30 -08:00
snipe
4ddab03792 Merge branch 'develop' of https://github.com/sw-mreyes/snipe-it into sw-mreyes-develop
# Conflicts:
#	public/mix-manifest.json
2021-02-19 10:00:35 -08:00
snipe
ff341caf34 Merge remote-tracking branch 'origin/develop' 2021-02-18 14:21:34 -08:00
snipe
5754f0aa3f Revert "Added logic to handle the CLI importer. (#9088)"
This reverts commit 2e2d087639.
2021-02-18 14:21:19 -08:00
snipe
785bc40d9d Merge remote-tracking branch 'origin/develop'
# Conflicts:
#	public/css/dist/skins/skin-black.css
#	public/css/dist/skins/skin-blue.css
#	public/css/dist/skins/skin-green.css
#	public/css/dist/skins/skin-orange.css
#	public/css/dist/skins/skin-purple.css
#	public/css/dist/skins/skin-red.css
#	public/css/dist/skins/skin-yellow.css
#	public/mix-manifest.json
2021-02-17 13:50:14 -08:00
snipe
9d50e0e8d0 Fixed weird table formatting in expected checkin report 2021-02-17 13:44:35 -08:00
snipe
9deb4204c8 Fixed #9116 - incorrect parameter name sent to hardware.show in expected assets report 2021-02-17 13:41:08 -08:00
snipe
1ab349a63d Merge branch 'develop' of https://github.com/snipe/snipe-it into develop 2021-02-17 13:34:59 -08:00
Ivan Nieto
2e2d087639 Added logic to handle the CLI importer. (#9088) 2021-02-17 13:13:17 -08:00
snipe
bfadb2cea6 Add @koelle25 as a contributor 2021-02-17 12:58:57 -08:00
Kevin Köllmann
44eb67440a Fixed #9115: Duplicate column name 'provider' (#9137) 2021-02-17 12:57:08 -08:00
Godfrey Martinez
8fb97da314 Color of asset selection in bulk checkout [ch15525] (#9145) 2021-02-17 12:56:26 -08:00
Ivan Nieto
12ff465cdb Added feature: Checkbox Custom Fields as list of values. (#9112)
* Added functionality for checkboxes in custom fields. Similar to how radio buttons work.

* Added the same functionality when the custom fieldset is encrypted.

* Added missing bits, so the edit custom assets view shows what values have been already stored in database
2021-02-16 17:20:29 -08:00
Ivan Nieto
f89d789832 Fixes #8918 The validation rules on Manufacturer Model 'name' attribute are malformed. (#9133)
* Fixes the validation rules on Manufacturer Model

* Fixes a little issue; if the manufacturer is active soft-deletes it, if is already deleted permanently deletes it
2021-02-16 12:52:55 -08:00
Marcelo Reyes
4c3b46ea88 Fixed #9129: add missing function formatDatalistSafe to snipeit_modals.js 2021-02-16 13:50:00 +01:00
snipe
834e0a9dd5 Merge remote-tracking branch 'origin/develop'
# Conflicts:
#	config/version.php
2021-02-05 14:29:13 -08:00
snipe
681c41bd18 Bumped version 2021-02-05 14:28:31 -08:00
snipe
74488ddceb Added provider column to oauth_clients table for passport upgrade 2021-02-05 14:27:56 -08:00
snipe
19820f1b42 Merge remote-tracking branch 'origin/develop' 2021-02-03 16:08:36 -08:00
snipe
2a88781cd5 Add @Kurokat as a contributor 2021-02-03 16:07:25 -08:00
snipe
f96c867bd3 Update @ghost as a contributor 2021-02-03 16:07:06 -08:00
snipe
06f8e8620a Add @EDVLeer as a contributor 2021-02-03 16:06:28 -08:00
snipe
95d907c9e9 Add @sean-borg as a contributor 2021-02-03 16:06:14 -08:00
snipe
d990152856 Add @andres-baller as a contributor 2021-02-03 16:05:45 -08:00
snipe
05609230b2 Add @ncareau as a contributor 2021-02-03 16:05:21 -08:00
snipe
220c254093 Add @benwa as a contributor 2021-02-03 16:05:06 -08:00
snipe
02313ce361 Add @fashberg as a contributor 2021-02-03 16:04:47 -08:00
snipe
e70f7c610a Add @winstan as a contributor 2021-02-03 16:03:20 -08:00
snipe
32f77c3285 Add @alek13 as a contributor 2021-02-03 16:02:49 -08:00
snipe
0a639f4fcc Add @ThoBur as a contributor 2021-02-03 16:02:38 -08:00
snipe
f2b55fb641 Add @PauloLuna as a contributor 2021-02-03 16:02:27 -08:00
snipe
0e443356f0 Add @iansltx as a contributor 2021-02-03 16:02:00 -08:00
snipe
76f7f01398 Add @derlucas as a contributor 2021-02-03 16:01:42 -08:00
snipe
992de0156b Add @phenixdotnet as a contributor 2021-02-03 16:01:27 -08:00
snipe
c96b5f5a85 Add @sigmoidal as a contributor 2021-02-03 16:01:12 -08:00
snipe
8d2685f0f0 Add @PeterDaveHello as a contributor 2021-02-03 16:01:00 -08:00
snipe
eb14cc7f43 Add @giannello as a contributor 2021-02-03 15:59:48 -08:00
snipe
3dc67cdba6 Updated dark skins with compiled assets for prod 2021-02-03 15:20:26 -08:00
snipe
0bbe0c85d7 Small improvement to topnav dropdown text colors in dark skins 2021-02-03 15:17:31 -08:00
snipe
49415806e1 Nicer formatting of the page if custom logout [ch15660] 2021-02-03 14:56:26 -08:00
Giuseppe Iannello
5edbb4b229 Support Google Cloud IAP (#8768)
Following up on 7c2da81700,
this extends the logic, adding support for Google Cloud IAP.
2021-02-03 11:59:55 -08:00
ThoBur
c40b8334fc Update edit.blade.php (#8876)
Fix issue #8518
2021-02-03 11:59:05 -08:00
snipe
0a37c9564a Merge remote-tracking branch 'origin/develop' 2021-02-03 01:30:11 -08:00
snipe
985193ffff Fixed #9082 - allow deployable status type on checkout 2021-02-03 01:29:54 -08:00
snipe
721add5bc1 Merge remote-tracking branch 'origin/develop'
# Conflicts:
#	public/css/dist/skins/skin-blue-dark.css
#	public/css/dist/skins/skin-blue-dark.min.css
#	public/css/dist/skins/skin-green-dark.css
#	public/css/dist/skins/skin-green-dark.min.css
#	public/css/dist/skins/skin-orange-dark.css
#	public/css/dist/skins/skin-orange-dark.min.css
#	public/css/dist/skins/skin-purple-dark.css
#	public/css/dist/skins/skin-purple-dark.min.css
#	public/css/dist/skins/skin-red-dark.css
#	public/css/dist/skins/skin-red-dark.min.css
#	public/css/dist/skins/skin-yellow-dark.css
#	public/css/dist/skins/skin-yellow-dark.min.css
#	public/mix-manifest.json
2021-02-03 00:57:58 -08:00
snipe
ff8fa6ec77 Production assets for better contrast in dark mode skins 2021-02-03 00:52:23 -08:00
snipe
e0a6f22489 Small fixes to dark mode skins 2021-02-03 00:49:09 -08:00
snipe
030fdd60ff Switched branch name to master 2021-02-02 21:49:21 -08:00
snipe
fdde844ce5 Bumped version to 5.1.0 2021-02-02 21:48:42 -08:00
snipe
d263990401 Updated min requirements in composer.json 2021-02-02 21:29:09 -08:00
snipe
bf7a856fa6 Update minimum PHP requirements to 7.2.5 2021-02-02 21:05:37 -08:00
snipe
1e062d4fc8 Re-applying laravel update with PHP min 7.2.5 2021-02-02 20:58:15 -08:00
snipe
ca37de5e45 Ugh. Rolling back composer.lock
Everything sucks
2021-02-02 20:44:07 -08:00
snipe
9ba2fd93c1 Reverted Laravel upgrade :( 2021-02-02 20:34:23 -08:00
snipe
a2e177e754 Merge branch 'develop' of https://github.com/snipe/snipe-it into develop 2021-02-02 20:30:36 -08:00
snipe
5e6db0b219 Removed platform req 2021-02-02 20:30:33 -08:00
Brady Wetherington
b09ded2a3b Upgrade laravel (#9081)
* Hotfix to develop to yank extraneous e()

* Upgrade Laravel release only to a later 6.18.x version

* Upgrade Laravel to 6.x and Passport 9.x, the recommended versions
2021-02-02 20:22:36 -08:00
snipe
124343911f Merge remote-tracking branch 'origin/develop' 2021-02-02 16:57:18 -08:00
Brady Wetherington
462f8c791f Hotfix to develop to yank extraneous e() (#9080) 2021-02-02 16:44:54 -08:00
Brady Wetherington
9a224a07ba Modified how we do Select2 dynamic drop-down menus to be more secure (#9079)
* Modified how we do Select2 dynamic drop-down menus to be more secure

As noted by the author of select2, the more-secure way of creating
rich Select-dropdowns is to use jquery to create HTML snippets and
carefully modify text attributes within there. This prevents any
XSS from being brought to the page. As a side-effect, the extra
escaping that we had to do in all of the internal selectlist calls
is now no longer necessary, and has been removed. Rebased and
squashed from the original.

* Rebuilt all assets, but this still feels like it's too much stuff in here.

* Whoops, need to run that in dev, not prod
2021-02-02 15:55:21 -08:00
Ivan Nieto
df4686bc96 Added a clause that lets the function that updates the department to fail gracefully if no dept. name is provided in the CSV passed to the Importer. (#9078) 2021-02-02 12:23:36 -08:00
snipe
b6c432a596 One more line of logging for purges 2021-02-02 02:20:30 -08:00
snipe
de9f487664 Merge remote-tracking branch 'origin/develop' 2021-02-02 01:59:13 -08:00
snipe
ef668317a9 Log user initiating a purge 2021-02-02 01:58:50 -08:00
Godfrey Martinez
cf368a4577 fixed an issue with links colors (#9073)
* fixed an issue with links colors

* corrected btn-default's color
2021-02-01 13:50:37 -08:00
snipe
2e71968c04 Merge remote-tracking branch 'origin/develop' 2021-01-27 17:44:36 -08:00
snipe
fdb5b3baf1 Depreciation detail view fixes [ch15776] (#9059)
* Allow sorting by months for depreciation list view

* Added dataTableLayout to standardize the list display table

* Implement the dataTableLayout() on the list view blade

* Split the view into tabs so we can combine asset depreciations and license depreciations

* Updated depreciation view to use tabbed interface for assets and licenses

* Added asset models to depreciation details page

* Make asset model category sortable

* Added cateory as allowed to be sorted on

* Added category sort scope

* Removed offset variable

* Small fixes to asset modes display in depreciation to bulk edit models
2021-01-27 17:44:05 -08:00
snipe
c745fa095b Merge remote-tracking branch 'origin/develop' 2021-01-27 15:38:15 -08:00
Brady Wetherington
70e6a6ced6 Fix issue where users with edit permission cannot invoke LDAP sync (#9058)
* Fix issue where users with edit permission cannot invoke LDAP sync

* Make User::class consistent with usage elsewhere in the same directory
2021-01-27 15:36:43 -08:00
Ivan Nieto
6772835efc Added support for radio buttons in Custom Fields. (#9053) 2021-01-27 14:41:58 -08:00
snipe
fb482b0dd6 Fixed translation string in Depreciation view [ch15776] 2021-01-27 14:09:01 -08:00
snipe
9f43d3345f Merge remote-tracking branch 'origin/develop' 2021-01-27 12:49:33 -08:00
Ivan Nieto
6e83679528 Instead of return a JSON response, redirect back to the previous screen (#9055) 2021-01-27 12:01:42 -08:00
snipe
a050aba72f Merge remote-tracking branch 'origin/develop' 2021-01-27 01:34:57 -08:00
snipe
0031fab0fe Added termination date, depreciation in license column selection [ch14505] (#9052) 2021-01-27 01:34:32 -08:00
snipe
585bdff364 Added other logo for demo 2021-01-27 00:35:32 -08:00
snipe
1d9741a49e Merge remote-tracking branch 'origin/develop' 2021-01-26 22:12:39 -08:00
snipe
9f7f1460e9 Simplified availableForCheckout() on asset 2021-01-26 22:12:24 -08:00
snipe
f871759753 Bumped version to 5.0.13-pre 2021-01-26 20:08:44 -08:00
snipe
8e17818f1e Bumped version to 5.0.13-pre 2021-01-26 20:08:08 -08:00
snipe
d19c6ab8e7 Use fadeIn/fadeOut for password reset page for nicer look 2021-01-26 20:05:01 -08:00
snipe
d14b1e3825 Added better visual cues for login (#9051)
* Added better visual cues for login

* Changed box header class to box-header with-border to match other screens

* Since we have all.js now, added class=“minimal” to use icheck
2021-01-26 19:57:39 -08:00
snipe
ba12ee9954 Specifically call out username in forgotten password 2021-01-26 18:00:50 -08:00
Evgeny
d8bb69533c To eliminate 12/24hours ambiguity fix. This fix prevents loss of time accuracy. (#8887)
Its a tiny fix to eliminate 12/24hours ambiguity. Fix prevents time accuracy loss in field "last_audit_date" for assets.
2021-01-26 12:22:59 -08:00
snipe
01d3606c42 Merge remote-tracking branch 'origin/develop' 2021-01-26 12:20:57 -08:00
sigmoidal
208f1db3b2 Update .htaccess (#9001)
.htaccess will work on both apache v2.2 and v2.4 (without this change, on upgrade, an internal error on the server occurs)
2021-01-26 12:20:03 -08:00
Peter Dave Hello
e5b02da54b Fix apk add usage in Dockerfile.alpine (#9032)
There is no need to use `--update` when `--no-cache` is already
specified. Use `--no-cache` only will make `apk` leave no local cache
and make the image smaller.
2021-01-26 12:12:00 -08:00
Vincent Lainé
d6ead5ae17 Added #8931: add health controller without session (#8978)
* Added health controller

* Trying to move session middleware to web and api group to have health controller without session

* Fix health route store the session

Co-authored-by: Vincent Lainé <v.laine@dental-monitoring.com>
2021-01-26 12:10:54 -08:00
Ian Littman
1d7d31b9ae Optimize target type + ID index for more realistic use cases (#8923)
Per https://youtu.be/EOXgHH4-WX4?t=1378 or thereabouts
2021-01-26 12:08:25 -08:00
Brady Wetherington
2a817c2123 Add migration for ldap_server URL's to ensure they at least start with ldap:// or ldaps:// (#8936) 2021-01-26 12:07:32 -08:00
Lucas Pleß
f3a7467235 Added today as default Date for checkout Form. (#8938) 2021-01-26 12:06:58 -08:00
Ivan Nieto
2da6f9136f Add 'Last Audit Date/Next Audit Date' filter to custom report (#8989)
* Add 'Last Audit Date/Next Audit Date' filter to custom report

* Added a constraint: cannot require a report with a Last Audit Date in the future.
2021-01-26 12:05:31 -08:00
Ivan Nieto
79549dbfb9 Use the correct env variables in config/auth.php file. (#9048) 2021-01-26 12:04:41 -08:00
snipe
a48d09f37e Fixed non-superadmin gate permissions for kits (#9029) 2021-01-26 11:56:42 -08:00
Godfrey Martinez
0dc78fdea6 fixed color schema on dark mode skins for links (#9034) 2021-01-21 14:41:42 -08:00
snipe
75a8639a20 Fixed weird checkbox display
TODO: fix the 500 on the save
2021-01-12 18:16:42 -08:00
snipe
380c6171b7 Check if the asset is deployed before prompting for an expected checkin date 2021-01-12 18:02:10 -08:00
snipe
d36d6b8e07 Added expected_checkout as editable field in asset edit 2021-01-12 16:48:49 -08:00
snipe
c00a1fa21b Added new generic datepicker partial 2021-01-12 16:48:32 -08:00
snipe
bbcd215ea4 Suppress OAuth token errors 2021-01-12 08:58:40 -08:00
Godfrey Martinez
444f9a81da Bug/ch15603/read only text field in saml screen dark (#8993)
* fixed dark mode skins read only color schema

* fixed dark mode skins read only color schema
2021-01-11 14:07:55 -08:00
snipe
b4eee5a9b7 Merge remote-tracking branch 'origin/develop' 2021-01-05 19:40:25 -08:00
Ivan Nieto
72f9fe444d Fix for default parameters in JS functions IE (#8973)
* Small fix for IE which doesn't support default parameters in the function definition

* Stylistic changes for better comprehension
2021-01-05 19:25:30 -08:00
snipe
eb423c252a Merge remote-tracking branch 'origin/develop'
# Conflicts:
#	config/version.php
2021-01-04 09:09:39 -08:00
snipe
382fb31670 Updated translations (Finnish, Polish, Japanese, Turkish, Spanish) 2020-12-30 12:51:09 -08:00
snipe
e6ba4a423d Fixed #8721 - duplicate asset tags in select list when asset has name 2020-12-21 13:43:54 -08:00
snipe
13ed6cde67 Migration to confirm password min complies with newer Laravel min 2020-12-21 12:39:19 -08:00
snipe
cac78cdbf3 Use snipe-logo.png as default in settings seeder 2020-12-21 11:36:43 -08:00
snipe
8b67326e95 Merge branch 'develop' of https://github.com/snipe/snipe-it into develop 2020-12-21 11:35:21 -08:00
snipe
f65bc5caee Updated logos 2020-12-21 11:35:17 -08:00
Brady Wetherington
0329028e2c Fixed #8926, #8252 - introduce circular reference check for location parent_id - rebased from #8253 (#8927)
* Fixed #8252 - circular references in location parents

* Remove non-translated translation changes

* Fix typo

* Add loop limit to avoid unforseen infinite loops

* Remove check against parent_id in location controllers

* Remove the Location->id=null piece (no longer needed)

* Fix some formatting and whitespace

* Re-introduce accidentally merged-out language file

Co-authored-by: Travis Miller <milletr@tulsaschools.org>
2020-12-18 17:18:04 -08:00
snipe
d3d96c8285 Reverted composer until we can figure out wtf happened 2020-12-15 17:25:17 -08:00
snipe
5909860c5a Updated exception handler 2020-12-15 17:25:05 -08:00
snipe
1023fa3edd Re-added updated slack library 2020-12-15 14:10:57 -08:00
snipe
65e6d56f1f Display the extension error at the bottom of the extension list to make it more noticable 2020-12-15 14:09:42 -08:00
snipe
bf34385c3e Temp revert to old slack library
Getting a weird error, need to troubleshoot remotely
2020-12-15 13:43:18 -08:00
Godfrey Martinez
55a526a6b3 corrected background color for bulk checkout listable items in all da… (#8916)
* corrected background color for bulk checkout listable items in all dark schemas

* resubmitting
2020-12-15 12:37:22 -08:00
Evgeny
bbf7fbcff4 Localization digit separator feature. (#8915)
Provides an ability to localize the purchase_cost field in front-end hardware index table.
Has two digit separator formats in admin settings with comma and dot.
2020-12-15 11:49:13 -08:00
snipe
4a5cb94d94 Switch version file back to develop 2020-12-14 17:47:02 -08:00
snipe
cb184a9687 Updated composer.lock with newer packages 2020-12-14 17:46:39 -08:00
Alexander Chibrikin
fb37dbed92 use supported package for slack (#8867)
* Updated version.php to master

* use supported package for slack

Co-authored-by: snipe <snipe@snipe.net>
2020-12-14 17:45:00 -08:00
João Paulo
e410696a36 Fixed #8884: Fixed alpine image build (#8885)
* Fixed #8884: update alpine image dependencies, fix permission error in vendor folder and laravel.log file

* Fixed #8884: Removes unnecessary changes to fix alpine image build

* Fixed #8884: Removes unnecessary changes to fix alpine image build

* Fixed #8884: Fix typo
2020-12-14 17:42:43 -08:00
snipe
45bfec5cd3 Match setup admin on Quickstart password with min reqs for Settings model 2020-12-11 13:52:48 -08:00
snipe
055522510b Fixed logo in seeder 2020-12-09 08:48:47 -08:00
snipe
f1d0d1bfe7 Merge remote-tracking branch 'origin/develop' 2020-12-09 08:19:18 -08:00
snipe
c0aa6c153e Better callout for warning on api token page 2020-12-09 08:19:04 -08:00
snipe
da3451bf0d Merge remote-tracking branch 'origin/develop' 2020-12-09 08:15:04 -08:00
snipe
5f76e03616 Clarified API url info in account > api 2020-12-09 08:14:44 -08:00
snipe
84710eac98 Merge remote-tracking branch 'origin/develop' 2020-12-08 21:10:05 -08:00
snipe
81bf41a091 Added an explanation for folks trying to access the API base endpoint with no real endpoint 2020-12-08 21:05:01 -08:00
snipe
134acf3b87 Merge remote-tracking branch 'origin/develop' 2020-12-08 20:04:19 -08:00
snipe
82d8b2ab82 Fixed weird parsing in newer markdown 2020-12-08 20:04:01 -08:00
snipe
adc0d3a6ac Merge remote-tracking branch 'origin/develop'
# Conflicts:
#	config/version.php
2020-12-08 16:53:43 -08:00
snipe
8b15841c4b Bumped version 2020-12-07 19:16:42 -08:00
snipe
fd4ee60276 Merge remote-tracking branch 'origin/develop' 2020-12-07 19:14:00 -08:00
Brady Wetherington
93358b5872 Merge pull request #8863 from johnson-yi/fixes/saml_debug
Fixes #8853 - allow saml to be more easily debugged
2020-12-07 14:50:23 -08:00
Johnson Yi
1c4e20c712 Allow saml to be more easily debugged 2020-12-04 21:54:04 +11:00
snipe
0e1f6a3fd1 Merge remote-tracking branch 'origin/develop' 2020-12-02 12:38:16 -08:00
snipe
71d0e6369e Merge branch 'develop' of https://github.com/snipe/snipe-it into develop 2020-12-02 11:01:10 -08:00
snipe
b27aeb1952 Added LDAP flag in users API for #8741 2020-12-02 11:01:05 -08:00
snipe
bec2b170ec Only overwrite notes if the LDAP user is new 2020-12-02 11:00:18 -08:00
snipe
269d3fe509 Make assigned_to_id nullable 2020-12-02 10:48:34 -08:00
Brady Wetherington
34d5473553 Fixes 8472 (again) - LDAP sync was assigning a bad default location (#8846) 2020-12-01 21:26:52 -08:00
snipe
4ac15daee7 Fixed #8147 - allow webp image format for public file uploads 2020-12-01 19:06:53 -08:00
snipe
5f3a1f6287 Merge remote-tracking branch 'origin/develop' 2020-11-30 20:47:03 -08:00
snipe
bfc60864dd Fixed typo on route for licenses 2020-11-30 20:46:45 -08:00
snipe
ffa2701f89 Fixed typo in demo logo 2020-11-30 18:59:44 -08:00
snipe
60d269afb5 Merge remote-tracking branch 'origin/develop'
# Conflicts:
#	config/version.php
2020-11-30 17:28:46 -08:00
snipe
e2cb7a0242 Bumped version 2020-11-30 17:28:03 -08:00
snipe
f9b1fdc36b Merge remote-tracking branch 'origin/develop' 2020-11-30 17:26:31 -08:00
Brady Wetherington
93cf8d4e0a Forward-port of the old LDAP sync system (#8801)
* Forward-port of the old LDAP sync system

* Need to rename the class to avoid classname conflicts

* Make 'classic' LDAP sync not add surrounding parens to filters that already have them

* Re-work Test LDAP button to return 10 sample users

* Remove useless debugging code
2020-11-30 17:11:44 -08:00
snipe
e83bc03d97 Switch backup files array order to show latest first [ch15486]' 2020-11-30 14:46:10 -08:00
snipe
b0d493ee51 Merge remote-tracking branch 'origin/develop' 2020-11-30 12:54:30 -08:00
snipe
4882b01787 Added purchase order and order number to user > licenses view 2020-11-30 12:54:15 -08:00
snipe
f9dcf0783a Added phantomjs to package.json 2020-11-28 16:58:02 -08:00
snipe
985f3658be Added wider logo 2020-11-27 18:17:09 -08:00
snipe
705dd34f3e Removed older SAML fields 2020-11-27 18:14:32 -08:00
snipe
6cf5426540 Removed unused validation rule 2020-11-25 11:00:28 -08:00
snipe
2105a1ec1d Merge remote-tracking branch 'origin/develop' 2020-11-25 08:55:14 -08:00
snipe
f475bdbb2d Fixed #8797 - use html_entity_decode in fullName presenter for User 2020-11-25 08:54:23 -08:00
snipe
96eb623229 Merge remote-tracking branch 'origin/develop' 2020-11-25 01:53:21 -08:00
snipe
820a39cc90 Fixed #8814 - added App\Models\Recipients\AlertRecipient 2020-11-25 01:52:56 -08:00
snipe
615051cf66 Skip posix_getpwuid in upgrader if posix isn’t installed
We don’t need it for anything else, so no need to require it. Posix not being installed usually means it’s a windows machine.
2020-11-25 01:19:32 -08:00
snipe
bef42eb43c Merge remote-tracking branch 'origin/develop' 2020-11-25 00:47:15 -08:00
snipe
6f99ce2b07 Branding page UI improvements (image previews inline) 2020-11-25 00:45:46 -08:00
snipe
76ee5a679b Fixed #8810 - email logo was not being used in emails 2020-11-25 00:05:02 -08:00
snipe
26e4354433 Merge remote-tracking branch 'origin/develop' 2020-11-24 19:49:59 -08:00
snipe
72fc03aa50 Adds location to searchableRelations for asset model 2020-11-24 19:49:46 -08:00
snipe
bf1f8659cb Merge remote-tracking branch 'origin/develop' 2020-11-24 16:06:01 -08:00
snipe
c0d7564658 Fixed #8794 - Switched to firstOrCreate to create parents on import 2020-11-24 16:05:24 -08:00
snipe
74b26a349c Merge remote-tracking branch 'origin/develop'
# Conflicts:
#	config/version.php
2020-11-24 13:54:02 -08:00
snipe
e9bfb157bb Bumped version. Again. 2020-11-24 13:53:28 -08:00
snipe
ef957399aa Merge remote-tracking branch 'origin/develop' 2020-11-24 13:51:19 -08:00
snipe
973eacf6c3 Small fixes for SAML
The SAML routes are in a service provide (sigh), so they did not have the `web` middleware group assigned to it.

I also added some additional checks so that the setup blade won’t fail (the migrations wouldn’t have been run yet, so outside of a try/catch, it would return an error since those tables don’t exist.)
2020-11-24 13:51:02 -08:00
snipe
02fef7049f Merge remote-tracking branch 'origin/develop'
# Conflicts:
#	config/version.php
2020-11-24 12:17:38 -08:00
snipe
b2660002b9 Fixed #8781 - added asset count by status type (#8806) 2020-11-24 12:15:07 -08:00
snipe
2c0b9f959b Comment with possible alternatve to the custom undeleted validator 2020-11-24 12:01:09 -08:00
snipe
51286d2244 Merge branch 'develop' of https://github.com/snipe/snipe-it into develop 2020-11-24 11:40:35 -08:00
snipe
712363f861 Bumped version 2020-11-23 12:33:07 -08:00
johnson-yi
0cdd83aabf Fixes #8584, #8654, #8727 - fixes and improvements for saml (#8795)
* Let onelogin/php-saml know to use 'X-Forwarded-*' headers if it is from a trusted proxy

* Gracefully handle the case where openssl_csr_new fails when openssl.cnf is invalid/missing

* Improve ui of saml sp metadata by displaying it's url and a download button
2020-11-20 18:54:25 -08:00
snipe
98dfb9d1b5 Merge remote-tracking branch 'origin/develop' 2020-11-20 14:35:12 -08:00
snipe
ae5635ff97 Merge remote-tracking branch 'origin/develop' 2020-11-20 14:34:43 -08:00
snipe
8a38b9d018 Merge branch 'develop' of https://github.com/snipe/snipe-it into develop 2020-11-20 14:34:35 -08:00
Brady Wetherington
734cb941dd Fix for #8772 - initial LDAP import of users are deactivated (#8776) 2020-11-20 11:11:14 -08:00
snipe
c66f8c04c8 For for deleted user API 2020-11-18 14:57:44 -08:00
Brady Wetherington
fa24799d2b Change license serial type to TEXT for longer license files (#8782) 2020-11-18 14:22:51 -08:00
snipe
57d6a7d35e Fixed #8753 - create-asset-from-model did not preselect the model 2020-11-18 13:59:02 -08:00
snipe
9e2d402c3a Merge remote-tracking branch 'origin/develop' 2020-11-18 07:06:33 -08:00
snipe
551e28eec9 Fixed #8749 - added more default colors to prevent missing index in pie chart math 2020-11-18 07:06:14 -08:00
snipe
9e30be8a04 Merge remote-tracking branch 'origin/develop' 2020-11-17 22:31:46 -08:00
Brady Wetherington
8457207c8f Fix for 500-page on deactivated LDAP user trying to log in (#8774) 2020-11-17 22:31:22 -08:00
snipe
cc4f1a1485 Merge remote-tracking branch 'origin/develop' 2020-11-17 22:20:38 -08:00
snipe
2ea805b7ed Added search/sort by Location OU, added to listing 2020-11-17 22:17:07 -08:00
snipe
20ef74db42 Merge remote-tracking branch 'origin/develop' 2020-11-17 19:26:15 -08:00
Brady Wetherington
3dda4c9116 Add a new UAC setting to valid User Accounts for Active Directory (#8775) 2020-11-17 19:25:49 -08:00
snipe
e805feff9e Merge remote-tracking branch 'origin/develop' 2020-11-17 19:22:56 -08:00
snipe
0286cf6d46 Prevent license categories from being deleted if there are licenses in that category 2020-11-17 19:22:10 -08:00
snipe
6ebdfdbabb Merge remote-tracking branch 'origin/develop' 2020-11-17 16:16:11 -08:00
snipe
68487e1200 Added img-responsive class to preview images 2020-11-17 16:15:25 -08:00
snipe
f19b9a44fc Fixed #8773 - wrong path for suppliers image on suppliers edit 2020-11-17 16:10:54 -08:00
snipe
124af6ac6b Merge remote-tracking branch 'origin/develop' 2020-11-17 14:33:35 -08:00
snipe
7f126969d0 Fixed #8601 - Switched to “attachment” from “base64” 2020-11-17 14:33:16 -08:00
snipe
e4b0e9673d Merge remote-tracking branch 'origin/develop' 2020-11-17 13:43:46 -08:00
snipe
7ab44ca963 Ignore php-lint cache 2020-11-17 13:43:24 -08:00
snipe
4898b58bdb Fixed #8765 - UI not indicating model is required 2020-11-17 13:40:15 -08:00
snipe
9b1e7ba8a6 Updated translations with new strings 2020-11-17 13:22:53 -08:00
snipe
e3d2369151 Fixed #8769 - incorrect translation for “DELETE” in purge 2020-11-17 12:01:02 -08:00
snipe
e5f0a12c25 Updated version.php to master 2020-11-17 00:14:28 -08:00
Brady Wetherington
de6f3f866f Attempt to solve LDAP sync overriding administrator choices (#8742) 2020-11-17 00:11:00 -08:00
snipe
8444a60bc9 Merge branch 'develop' of https://github.com/snipe/snipe-it into develop 2020-11-16 23:57:23 -08:00
snipe
3237411b5d Bumped version 2020-11-16 23:57:17 -08:00
snipe
5ba1659563 Removed dupe date 2020-11-16 23:56:48 -08:00
snipe
6e068ec339 Add @chamilton-ccn as a contributor 2020-11-16 22:15:59 -08:00
Charles Hamilton
4fd666716f Fixed #8482 - Ubuntu version (#8598)
* Bash cannot compare floating point numbers natively. This modification addresses issue #8482 and retains the intended function of the previous code.

* Bash cannot compare floating point numbers natively. This modification addresses issue #8482 and retains the intended function of the previous code.

Co-authored-by: Charles Hamilton <chamilton@dyercpa.com>
2020-11-16 22:15:40 -08:00
snipe
6eb860ca24 Swapped travis build badge for chipper build badge 2020-11-16 21:49:57 -08:00
snipe
903698a7b0 Merge remote-tracking branch 'origin/develop' 2020-11-16 21:35:26 -08:00
snipe
513faf2db5 Merge branch 'develop' of https://github.com/snipe/snipe-it into develop 2020-11-16 21:34:59 -08:00
snipe
9e46bc6c28 Fix for spanish translation 2020-11-16 21:34:47 -08:00
NMC
402fecd408 Fixed #7850: allow xlsx file. (#8386)
Thanks!
2020-11-16 21:32:15 -08:00
Brady Wetherington
a97b15ec96 Re-add LDAP "test login" feature to LDAP settings (helps with #8751) (#8757)
* Start work on re-adding back the "Test LDAP logins" feature to develop

* Add back-end method to allow LDAP test users to try to log in.
2020-11-16 21:23:08 -08:00
snipe
8504c9e8b9 Added phplint to dev in composer 2020-11-16 19:08:04 -08:00
snipe
4ebfd6624c Merge remote-tracking branch 'origin/develop' 2020-11-16 17:24:57 -08:00
snipe
fbaf6e2494 Fixed #8747 - upload path for uploaded images 2020-11-16 16:39:02 -08:00
snipe
612d3f9b2a Merge remote-tracking branch 'origin/develop' 2020-11-16 13:32:53 -08:00
Brady Wetherington
6e4ab5cd96 Fix for #8746 - missing comma in a translation file (#8756) 2020-11-16 13:29:57 -08:00
snipe
849966d2c5 Merge remote-tracking branch 'origin/develop' 2020-11-13 16:48:58 -08:00
snipe
1f5bcf2475 Added option to download activity report 2020-11-13 16:25:05 -08:00
snipe
58c476195b Bumped hash 2020-11-13 14:14:27 -08:00
snipe
dcd98a7bf1 Bumped hash 2020-11-13 14:13:44 -08:00
snipe
686ab681e5 Removed duplicate badge 2020-11-13 13:54:27 -08:00
snipe
052f8e2c42 Addresses - not fixes - #8740
More investigation here is needed
2020-11-13 12:34:42 -08:00
snipe
e9578ba8a1 Fixed #8737 - incorrect validation string for components update 2020-11-13 12:09:48 -08:00
snipe
0c0de5e351 Added clarity in language as to what the activated flag does on LDAP screens 2020-11-13 11:52:34 -08:00
snipe
10cadecd14 Moved a few of the user edit fields to make more sense (optional stuff further down) 2020-11-13 11:52:09 -08:00
snipe
644084658a Merge remote-tracking branch 'origin/develop' 2020-11-13 04:30:03 -08:00
snipe
07936ea901 Changed asset name to asset tag in maintenances 2020-11-13 03:38:31 -08:00
snipe
08784f9cc5 Make expected_checkin fillable 2020-11-13 03:22:26 -08:00
snipe
a87e615e7f Fixed #8544 - escaping on maintenance notes 2020-11-12 23:55:16 -08:00
snipe
df5cc7525e Merge remote-tracking branch 'origin/develop' 2020-11-12 23:39:09 -08:00
snipe
75b8c3455c Fixed #8609 - custom fieldsets not draggable anymore (regression) 2020-11-12 23:38:12 -08:00
snipe
81d38a0ded Fixed #8733 - typo in unaccepted assets report 2020-11-12 23:26:05 -08:00
snipe
b2a8af2fa9 Fixed #8647 - Added additional help info on importer page 2020-11-12 22:46:51 -08:00
snipe
9d2363741e Improved 2FA reset layout 2020-11-12 22:25:07 -08:00
snipe
fc6a33ad38 Added some LDAP debugging - related to #8670 2020-11-12 22:19:16 -08:00
snipe
896ce3456e Possible fix for #8670 - LDAP users deactivated on login 2020-11-12 22:18:49 -08:00
snipe
9db191f0b2 Fixes for #8732 - Flysystem paths, migrator script 2020-11-12 21:46:06 -08:00
snipe
c7d752fb65 Added S3 url into CSP 2020-11-12 19:50:01 -08:00
snipe
5026177161 Added link to bricelabelle/snipe-it-bulkedit 2020-11-12 18:55:02 -08:00
snipe
d2805442ad Updated Laravel version 2020-11-12 18:54:49 -08:00
snipe
7765c87387 Fixed #8669 - Allow application/xml in SAML upload in Safari 2020-11-12 18:47:19 -08:00
snipe
6dccf399a5 Fixed offset issue for #8732 2020-11-12 15:51:31 -08:00
snipe
7432e3fb2d Add @dampfklon as a contributor 2020-11-12 15:28:29 -08:00
snipe
caeea9f530 Merge remote-tracking branch 'origin/develop' 2020-11-12 15:27:49 -08:00
snipe
0fdfd013e7 Fixed #8715 - wrong API url for unaccepted assets 2020-11-12 15:26:50 -08:00
snipe
d537fc5c32 Added linebreak to console confirmation 2020-11-12 15:21:00 -08:00
snipe
9164dda64f Added artisan command to purge logins 2020-11-12 15:20:15 -08:00
snipe
5ea9c31eab Removed debugging 2020-11-12 15:14:56 -08:00
snipe
c8572deb5c Merge branch 'develop' of https://github.com/snipe/snipe-it into develop 2020-11-12 15:13:50 -08:00
snipe
57d25ebb20 Fixed #8719 - use same convention for file names on licenses as we do on assets 2020-11-12 15:13:45 -08:00
Dampfklon
be114176a2 Refactor Expected Checkin Notification into markdown and enable translation (#8236)
Co-authored-by: snipe <snipe@snipe.net>
2020-11-12 15:09:40 -08:00
Dampfklon
1f9b04405c Enable translation of accept-asset page (#8237) 2020-11-12 15:07:45 -08:00
Dampfklon
4ef11c463c Enable translations of checkin notifications (#8235) 2020-11-12 15:05:57 -08:00
Dampfklon
5fb31a5a3f Use translated salutation from other notifications (#8234) 2020-11-12 15:05:22 -08:00
snipe
f0e04ab9e4 Fixed #8726 - disallow archived assets to be checked out 2020-11-12 15:01:13 -08:00
snipe
8a65081768 Possible fix for #8732 2020-11-12 14:47:38 -08:00
snipe
c451fde466 Fixed exception namespace 2020-11-12 14:27:59 -08:00
snipe
5098d69c05 Fixed stupid auto-indent 2020-11-12 14:20:54 -08:00
snipe
b12de13041 Fixed markdown in expiring licenses alert 2020-11-12 14:10:45 -08:00
snipe
72126f7d44 Removed duplicate extension checks 2020-11-12 13:24:53 -08:00
snipe
df000ce32f Merge branch 'develop' of https://github.com/snipe/snipe-it into develop 2020-11-12 13:22:54 -08:00
snipe
6a2e21f502 More in depth error reporting on mail test failure 2020-11-12 13:22:49 -08:00
Brady Wetherington
5ad6234584 Merge pull request #8730 from winstan/patch-1
Fixed #8699: exclude blank LDAP attributes from searches
2020-11-12 11:26:19 -08:00
Anthony Winstanley
cc79bb1449 Exclude blank LDAP attributes
Asking for '' attributes is an error for some LDAP servers.
2020-11-12 09:34:28 -08:00
snipe
c8d588871c Merge remote-tracking branch 'origin/develop' 2020-11-11 14:47:30 -08:00
snipe
8890372a69 Production assets with dark skin fixes 2020-11-11 14:47:13 -08:00
Godfrey Martinez
80f2d749a2 Corrected css to the bootstrap popovers for all dark mode skins (#8714)
* added css to the bootstrap popovers in dark blue

* corrects the tool tips css for all dark mode skins other than dark blue
2020-11-11 14:11:39 -08:00
snipe
7f7064c835 Make last_checkout fillable 2020-11-11 13:30:11 -08:00
snipe
31d0b4a46c Merge remote-tracking branch 'origin/develop' 2020-11-10 12:39:55 -08:00
snipe
5759d4819e Improved upgrade.php script to check for PHP extensions (#8712)
* Troubleshooting gd detection :(

* Welp, that didn’t work.

* Improvements to the update script that will make it easier to maintain

* Improved spacing

* Nicer intro

* Sorry for all the commits - I have to push in order to test :(

* More display improvements

* Phrasing!

* More formatting

* Removed extra line break

* Few more formatting changes

* Remove the config caching - it’s too confusing for users

* Added comments

* Temp required extension in the array so I can show output :)

* Added ascii x

* removed extra line break

* Made error message clearer

* Remove extra line

* Removed farts

* Changed phrasing for PHP upgrade warning

* Small tweaks per PR review

* Some spacing fixes

* Added confirmation of the either/ors

* Minor formatting tweaks

* Fixed weird indenting?

* Fixed missing $unused_file variable
2020-11-10 12:39:10 -08:00
snipe
c49788dd9f Fixed weird linebreaks in upgrade.php 2020-11-10 09:08:13 -08:00
snipe
3641a6d451 Additional extension checking 2020-11-10 09:06:44 -08:00
snipe
8c79070cd9 Added some extension checking for upgrade.php 2020-11-10 08:47:35 -08:00
snipe
f8563bec94 Added some extension checking for upgrade.php 2020-11-10 08:46:19 -08:00
snipe
fd7c0bc5fb Use newer blade facade for requests 2020-11-10 08:36:18 -08:00
snipe
7d708572fc Slightly nicer formatting for query 2020-11-10 07:43:54 -08:00
snipe
ea68ff1284 Sigh. Typo 2020-11-10 06:51:40 -08:00
snipe
66ccf4da03 Merge remote-tracking branch 'origin/develop' 2020-11-10 06:44:10 -08:00
snipe
0b4a13156f Added more detail and dryrun to assigned_to vs log checker script 2020-11-10 06:43:36 -08:00
snipe
a8a3962008 Merge remote-tracking branch 'origin/develop' 2020-11-10 06:17:04 -08:00
snipe
e110a7b15e Experimental script to find mismatched IDs based on logs 2020-11-10 06:16:15 -08:00
snipe
30d68309a9 Add ability to checkout an asset if the user it’s assigned_to isn’t valid
This would only happen if a merge-users went wonky
2020-11-10 05:06:47 -08:00
snipe
547d1a5a93 Merge remote-tracking branch 'origin/develop' 2020-11-10 04:43:20 -08:00
snipe
adf64361e8 Updated most recent translations 2020-11-10 04:43:02 -08:00
snipe
a43fb060f4 Throw an error if the asset cannot be updated in the merge 2020-11-10 04:41:40 -08:00
snipe
c607d89817 Merge remote-tracking branch 'origin/develop' 2020-11-10 01:59:18 -08:00
snipe
8c19b11e73 Fixed #8448 - “undefined” when testing email from quickstart 2020-11-10 01:48:18 -08:00
snipe
178ed82dc4 Fixed [ch9336] - Removed time stamp in Depreciation report 2020-11-10 01:13:13 -08:00
snipe
6757df5a2d Added Checkout Date Time to Asset Details Page [ch1418] 2020-11-10 01:02:08 -08:00
snipe
044dfe2620 Fixed [ch945] - Status colors are not displaying correctly in the chart on the dashboard 2020-11-10 00:54:39 -08:00
snipe
9e319e91d6 Merge remote-tracking branch 'origin/develop' 2020-11-09 23:56:33 -08:00
snipe
895a544d4c Fixed [ch15347] - added status in Depreciation Report 2020-11-09 23:56:16 -08:00
snipe
2aa9412565 Bumped version
# Conflicts:
#	config/version.php
2020-11-09 23:09:46 -08:00
snipe
35ab5c7df0 Bumped version 2020-11-09 23:09:10 -08:00
snipe
8a7cd87644 Merge remote-tracking branch 'origin/develop' 2020-11-09 23:05:40 -08:00
snipe
1cdf6f8263 Fixed #8673 - added category to accessories listing on Account > Assigned Assets 2020-11-09 23:05:19 -08:00
snipe
b8ad930690 Merge remote-tracking branch 'origin/develop' 2020-11-09 22:55:42 -08:00
snipe
ec14a117b7 Display on the API token page the expiration in years
TODO: Translate these strings
2020-11-09 22:55:27 -08:00
snipe
b7cc12a466 Merge remote-tracking branch 'origin/develop' 2020-11-09 22:53:23 -08:00
snipe
f4080a7aa9 Fixed created_at and expired_at order in API token screen 2020-11-09 22:53:07 -08:00
snipe
5abfbdd1d2 Allow API token expiration in years to be configured via env 2020-11-09 22:52:55 -08:00
snipe
31bbb2d035 Merge remote-tracking branch 'origin/develop' 2020-11-09 22:43:41 -08:00
snipe
33dca84ec7 Show expiry and created at date on API token page 2020-11-09 22:43:27 -08:00
snipe
460485d843 Make API tokens expire in 20 years
TODO: Make this configurable and report the expiration in the UI
2020-11-09 22:33:43 -08:00
snipe
b59269d5e2 Bumped version 2020-11-09 21:46:42 -08:00
snipe
118931b6fb Merge remote-tracking branch 'origin/develop' 2020-11-09 21:46:26 -08:00
snipe
8bbf8409b1 Bumped hash 2020-11-09 21:46:08 -08:00
snipe
b2101a5188 Merge remote-tracking branch 'origin/develop' 2020-11-09 21:09:05 -08:00
snipe
ede20523f2 Fixed #8680 - location image path 2020-11-09 21:08:19 -08:00
snipe
89d9b830a0 Updated PHP requirement 2020-11-09 21:05:41 -08:00
snipe
d76eea53c4 Bumped hash 2020-11-09 19:45:27 -08:00
snipe
63a8535de1 Merge remote-tracking branch 'origin/develop' 2020-11-09 19:11:37 -08:00
snipe
ef7434b7ac Updated template 2020-11-09 19:11:18 -08:00
snipe
148b375ec2 Make 600 a string for ini_set 2020-11-09 19:11:00 -08:00
snipe
d49bc33b54 Merge branch 'develop' of https://github.com/snipe/snipe-it into develop 2020-11-09 18:21:15 -08:00
snipe
5bff5cb8c0 Updated Crowdin file 2020-11-09 18:21:10 -08:00
snipe
c8634d85f5 Merge pull request #8706 from uberbrady/fix_bootstrap_tables_empty_fields
Potential fix for empty-page problem in Assets view
2020-11-09 18:19:42 -08:00
Brady Wetherington
a5423649f4 This is the smallest set of changes we can use to work around a change in functionality
in Bootstrap Tables. This should remedy some of the issues we've been having with large
GET strings being sent to the back-end by the Assets system.
2020-11-09 17:36:07 -08:00
snipe
b026953190 Merge pull request #8688 from sanjay900/patch-1
Fix AD Accounts with delegation disabled
2020-11-09 16:13:13 -08:00
snipe
3c209b29b1 Merge remote-tracking branch 'origin/develop' 2020-11-09 15:09:05 -08:00
snipe
c0fb87c7f9 Merge pull request #8702 from uberbrady/ldap_time_limit_sync
Restore the LDAP_TIME_LIM .env var
2020-11-09 15:08:17 -08:00
snipe
48c3d0fd19 Merge remote-tracking branch 'origin/develop'
# Conflicts:
#	resources/lang/es-VE/general.php
2020-11-09 14:55:11 -08:00
snipe
67f60127be Updated translations with latest from CrowdIn 2020-11-09 14:52:11 -08:00
snipe
4a8a98a7d3 Fixed user test 2020-11-09 14:17:45 -08:00
snipe
4b8e9a962b Fixed Venezuelan translation file 2020-11-09 14:05:31 -08:00
Brady Wetherington
966179290b Restore the LDAP_TIME_LIM env var for ldap sync of very large directories 2020-11-09 11:11:42 -08:00
snipe
6618e88a9a Fixed spanish translation parse error 2020-11-06 10:19:32 -08:00
Sanjay Govind
ab6d2987a4 Include documentation from @uberbrady
Previously on v4 this was all documented, so i have copied that documentation across to v5
2020-11-06 12:31:33 +13:00
Sanjay Govind
45c140814f Fix AD Accounts with delegation disabled 2020-11-06 12:02:19 +13:00
snipe
467ff045aa Moved the BACKUP_ENV to new BACKUP block 2020-11-03 14:58:19 -08:00
snipe
e0103a7fbd Fixed #8595 - Updated spatie settings 2020-11-03 14:50:02 -08:00
snipe
432263f09f Merge pull request #8671 from mzack5020/patch-1
Fixed #8624 #8312: Re-Added Accessories API
2020-11-03 13:50:38 -08:00
Matthew Zackschewski
911841d188 Re-Added Accessories API
#8312 #8624 Removed unnecessary duplicate licenses endpoint and re-added the user accessories endpoint which was left off.
2020-11-03 16:40:43 -05:00
snipe
e8fd2a7fe8 Merge remote-tracking branch 'origin/develop' 2020-11-03 13:07:31 -08:00
snipe
df5972c4fa Fixed send creds checkbox in create user form 2020-11-03 13:07:15 -08:00
snipe
4d003ac97a Merge remote-tracking branch 'origin/develop'
# Conflicts:
#	app/Http/Controllers/Auth/ResetPasswordController.php
#	config/version.php
2020-11-03 11:49:34 -08:00
snipe
9f4a212b44 Bumped hash 2020-11-03 11:47:58 -08:00
snipe
12667f41b9 bumped hash 2020-11-03 11:47:13 -08:00
snipe
a8390ce4bd Removed debugging 2020-11-03 11:45:19 -08:00
snipe
cfc1e1366c Added new password complexity rules to forgot password 2020-11-03 11:42:42 -08:00
snipe
44e5fec707 Fixed #8603 - Use correct CSS path for signature-pad.min.css 2020-11-03 10:01:55 -08:00
snipe
f138d3b781 Fixed typo 2020-11-03 01:00:37 -08:00
snipe
bbd7a752a0 Minor cleanup 2020-11-02 23:58:49 -08:00
snipe
a66a22ffb2 Updated passwordComplexityRulesSaving() signature so it isn’t nullable 2020-11-02 23:58:37 -08:00
snipe
b29f794b35 password.expire updated for forgotten password token expiration 2020-11-02 23:58:09 -08:00
snipe
410c99da17 Added signature-pad.min.css to the css directory - should possibly fix #8603 2020-11-02 23:57:39 -08:00
snipe
c800662f0c Use username for forgotten password
Since emails are not required to be unique
2020-11-02 23:57:00 -08:00
snipe
b828985151 Fixed strpos to !== FALSE in ProfileController for complexity eval 2020-11-02 22:28:56 -08:00
snipe
e6f53a53bc Updated min requirement for passwords in lang files 2020-11-02 22:15:01 -08:00
snipe
0c2800c7dd Removed debugging line 2020-11-02 21:26:13 -08:00
snipe
a8f9f5239c Merge pull request #8662 from snipe/features/disallow_password_equal_to_username_etc
Fixed #8661 - Added feature to disallow password equal to username, email, etc
2020-11-02 21:09:31 -08:00
snipe
63bb2de4d4 Derp. Check and make sure that setting is actually on 2020-11-02 20:13:54 -08:00
snipe
c4b2ef5660 Removed debugging code 2020-11-02 20:10:18 -08:00
snipe
296655542d Added comments 2020-11-02 20:07:39 -08:00
snipe
a55694da2f Added validation to disallow password to be the same as username, email, etc 2020-11-02 20:03:26 -08:00
snipe
33bda9b6d1 Added blade option for same_pwd_as_user_fields
Disallows password form value to be the same as username, email, first name or last name
2020-11-02 17:47:25 -08:00
snipe
42347d0f0c Added validation language for same_pwd_as_user_fields 2020-11-02 17:46:30 -08:00
snipe
6554903aeb Removed “use slack” debugging code 2020-11-02 17:46:09 -08:00
snipe
502322be4b Fixed v5 500 server error when requesting multiple [ch15345] 2020-11-02 16:08:38 -08:00
snipe
72facffcbe Fixed demo settings value for support_footer 2020-10-26 15:09:02 -07:00
snipe
001bb3cbe2 Bumped version to “pre” 2020-10-26 15:04:22 -07:00
snipe
f42bd3a144 Fixed #8613 - Added deleted_at to user API response, added all=true to include deleted and not-deleted in one call 2020-10-26 14:58:45 -07:00
snipe
b9330cf6b1 Fixed #8613 - 500 error on deleted users API call 2020-10-26 14:55:18 -07:00
snipe
2844800caf Merge remote-tracking branch 'origin/develop'
# Conflicts:
#	config/version.php
2020-10-26 14:26:05 -07:00
snipe
b7e8b9bad7 Merge branch 'develop' of https://github.com/snipe/snipe-it into develop 2020-10-26 14:24:43 -07:00
snipe
a7ecaa6ebc Merge pull request #8619 from uberbrady/fix_ldap_paging
Fixed #8563 - Clean up AdLdap2 integration to better handle paged result-sets
2020-10-26 14:24:34 -07:00
snipe
7937258f6e Bumped version 2020-10-26 14:24:19 -07:00
Brady Wetherington
cce0739bb7 Clean up AdLdap2 integration to better handle paged result-sets 2020-10-26 12:53:45 -07:00
snipe
c93f4ef0d5 Merge remote-tracking branch 'origin/develop' 2020-10-23 19:50:56 -07:00
snipe
89e36dbc42 Merge pull request #8606 from uberbrady/fix_cant_manage_self
Add a new custom validator for Users
2020-10-23 19:16:11 -07:00
snipe
d317052ede Updated CSS assets with green skin edits 2020-10-23 18:55:00 -07:00
snipe
8ee9e5e059 Fixed #8537 - wrong sorting on dashboard 2020-10-23 18:33:10 -07:00
snipe
2602e4d602 Exclude the config directory from backups
Everything there is handled via .env anyway
2020-10-23 18:21:32 -07:00
snipe
f357d9fc90 Include audit settings text in settings overview so they get picked up by the filter box 2020-10-23 18:13:28 -07:00
Brady Wetherington
0eda53c484 Add a new custom validator for Users to prevent someone from managing themselves 2020-10-23 16:55:10 -07:00
snipe
79a4acae1a Merge remote-tracking branch 'origin/develop'
# Conflicts:
#	config/version.php
2020-10-23 14:29:40 -07:00
snipe
91e0b26bbb Bumped version 2020-10-23 14:28:55 -07:00
snipe
5f82214703 Merge remote-tracking branch 'origin/develop' 2020-10-23 14:24:24 -07:00
Brady Wetherington
d517e2fd61 Merge pull request #8594 from uberbrady/try_to_fix_ldap_oom
Possible fix to #8563 - unset $ldapUsers to avoid OOM'ing
2020-10-23 14:23:53 -07:00
snipe
28612d8b61 Merge remote-tracking branch 'origin/develop' 2020-10-23 14:23:46 -07:00
snipe
6ee3d0eb97 Merge pull request #8605 from snipe/fixes/legacy_location_id_equals_zero
Fix for legacy location_id=0 issue that can cause failure to checkout/checkin
2020-10-23 14:22:53 -07:00
snipe
7987a4eca4 Used consistent phrasing in query 2020-10-23 14:22:15 -07:00
snipe
2aa8e1e76b Merge pull request #8596 from snipe/fixes/8462_move_accessory_notes
Fixes #8462 - move accessory notes into pivot table
2020-10-23 14:19:51 -07:00
snipe
be0e327221 Simplified the migration 2020-10-23 14:14:34 -07:00
snipe
9a1acced58 Fix for legacy location_id=0 issue 2020-10-23 14:00:04 -07:00
snipe
d74df93c48 Merge remote-tracking branch 'origin/develop' 2020-10-23 12:10:13 -07:00
snipe
b9a9949570 Use the form partial for avatars 2020-10-23 12:09:20 -07:00
snipe
4ccba5337a Added https://gravatar address to CSP 2020-10-23 12:09:03 -07:00
snipe
8aae2b46cd Merge remote-tracking branch 'origin/develop' 2020-10-23 11:56:10 -07:00
snipe
d03d4deef9 Temp fix for #8561 - manager_id validation error 2020-10-23 11:55:53 -07:00
snipe
21ceea0aed Removed extra debugging 2020-10-23 08:19:04 -07:00
snipe
2219c9ccb5 Merge remote-tracking branch 'origin/develop' 2020-10-23 06:55:39 -07:00
snipe
bf9e53fbe7 Updated markdown templates 2020-10-23 06:55:23 -07:00
snipe
f68580b482 Make the email table wider 2020-10-23 06:55:04 -07:00
snipe
aec2f2a249 Fixed #8576 - switch to HTML from markdown
This is really stupid. A markdown table with over 3 columns doesn’t render correctly. :(
2020-10-23 06:54:45 -07:00
snipe
831da2d6d1 New mail vendor files 2020-10-23 06:17:07 -07:00
snipe
f2aebe5f9a Fixed #8558 - error on asset acceptance when no sig is required 2020-10-23 05:09:03 -07:00
snipe
40c0ba9a95 Merge remote-tracking branch 'origin/develop' 2020-10-23 04:46:44 -07:00
snipe
f5a0726f98 Fixed #8597 - Added leading slash to notifications console commands 2020-10-23 04:46:26 -07:00
snipe
2263dae8f4 Fixed HTML 2020-10-23 04:07:55 -07:00
snipe
f182ce1c89 Merge remote-tracking branch 'origin/develop'
# Conflicts:
#	config/version.php
2020-10-23 01:12:54 -07:00
snipe
c6dde67e86 Bumped version 2020-10-23 01:12:19 -07:00
snipe
88f03e6b55 Added last_checkout and notes from pivot for accessories 2020-10-23 00:44:26 -07:00
snipe
8827d33a43 Fixed query to copy notes 2020-10-23 00:25:20 -07:00
snipe
c3e8f64064 Merge remote-tracking branch 'origin/develop' 2020-10-22 23:24:56 -07:00
snipe
68cfbaab2e Fixed signature issue on accepted assets - related to #8577
I have no idea how this ever worked? We didn’t rename that fieldname recently.
2020-10-22 23:20:55 -07:00
snipe
66ac5d05ad Started migration to normalize note 2020-10-22 23:18:14 -07:00
Brady Wetherington
18012279f9 Possible fix to #8563 - unset $ldapUsers to avoid OOM'ing 2020-10-22 21:51:23 -07:00
Brady Wetherington
2abfd8da74 Merge pull request #8568 from uberbrady/fix_wordy_json_ldap_output
Add a dirtiness check to slim down JSON LDAP sync summaries
2020-10-22 21:18:21 -07:00
snipe
ec7d70cea0 Merge pull request #8551 from Godmartinz/bug/ch10148/error-when-using-dark-green-skin
fixed the Green skin (dark mode) color scheme on the importer page and asset table
2020-10-22 21:16:52 -07:00
snipe
6c285b0273 Merge pull request #8586 from Godmartinz/Confusing_wording_in_LDAP
reworded the ad_append_domain_help string
2020-10-22 21:15:35 -07:00
snipe
e65269e9c7 Merge remote-tracking branch 'origin/develop' 2020-10-22 20:09:16 -07:00
snipe
5d112be49a Fixed #8585 - requested assets page blank 2020-10-22 20:08:33 -07:00
snipe
d3f5fde84a Merge remote-tracking branch 'origin/develop' 2020-10-22 19:46:55 -07:00
snipe
496b176d4e Fixed #8589 - unable to accept asset 2020-10-22 19:46:40 -07:00
snipe
fd66f7aeb4 Merge remote-tracking branch 'origin/develop' 2020-10-22 19:37:21 -07:00
snipe
c71086d2f3 Fixed #8590 - unable to checkin and delete from user view 2020-10-22 19:32:51 -07:00
snipe
153f849ef7 Merge pull request #8581 from fashberg/iss8580
Fixed #8580: ReportsController called method on NULL Object
2020-10-22 13:00:08 -07:00
Godfrey M
fcdb945f5f reworded the ad_append_domain_help string 2020-10-22 09:21:18 -07:00
Folke Ashberg
377c92a290 update 2020-10-22 14:33:24 +02:00
Folke Ashberg
5824ac3b28 Fix for #8580
Checking $asset->depreciation before calling $asset->depreciated_date()
2020-10-22 14:22:42 +02:00
Brady Wetherington
fad0ed6d5b Add a dirtiness check to slim down JSON LDAP sync summaries 2020-10-21 15:13:36 -07:00
snipe
ec9c69323a Merge remote-tracking branch 'origin/develop' 2020-10-21 13:58:58 -07:00
snipe
338106734a Fixed #8562 - manufacturer logo upload failing 2020-10-21 13:57:56 -07:00
snipe
81fcb4c7b3 Merge remote-tracking branch 'origin/develop' 2020-10-21 13:33:04 -07:00
snipe
5ae65d5329 Fixed #8566 - PDF files displaying as ascii instead of downloading 2020-10-21 13:32:46 -07:00
snipe
d04b0e4d4b Merge remote-tracking branch 'origin/develop' 2020-10-21 12:23:44 -07:00
snipe
a6d0209e93 Fixed #8567 - don’t require model for custom report 2020-10-21 12:23:27 -07:00
snipe
810f6a3970 Merge remote-tracking branch 'origin/develop'
# Conflicts:
#	config/version.php
2020-10-21 12:03:23 -07:00
snipe
1379821876 Removed accompanying method, since we don’t use it 2020-10-21 12:02:25 -07:00
snipe
33236f16ac Bumped minor version 2020-10-21 12:01:36 -07:00
snipe
90dddee923 Remove the storage moving commands - we don’t use this 2020-10-21 12:00:40 -07:00
snipe
7869ffcc79 Merge pull request #8557 from fashberg/develop
Fixed #8543: Change trustedproxy.php to read env('APP_TRUSTED_PROXIES') again
2020-10-21 11:19:23 -07:00
Folke Ashberg
1687e4b850 Fix for Issue #8543
* trustedproxy.php sets 'proxies' again according to
  env('APP_TRUSTED_PROXIES') again
2020-10-21 10:36:27 +02:00
Godfrey M
4a3d8f2cc0 fixed the Green skin (dark mode) color scheme on the importer page and assets table 2020-10-20 15:22:38 -07:00
snipe
c19f1b77b0 Merge pull request #8542 from benwa/patch-2
Fix typo
2020-10-20 10:51:45 -07:00
Bennett Blodinger
132f296f03 Fix typo 2020-10-20 08:13:52 -05:00
snipe
870b097f03 Derp. Should be master 2020-10-19 17:49:56 -07:00
snipe
3e2996a46a Merge remote-tracking branch 'origin/develop' 2020-10-19 16:57:24 -07:00
snipe
1090b291c3 Updated node packages, reregnerated assets 2020-10-19 16:56:59 -07:00
snipe
12ae408830 Merge remote-tracking branch 'origin/develop'
# Conflicts:
#	app/Http/Controllers/Auth/ResetPasswordController.php
#	resources/views/auth/passwords/reset.blade.php
2020-10-19 16:40:07 -07:00
snipe
a62e8413ba Updated version 2020-10-19 16:36:25 -07:00
snipe
c1443aa6eb Pull licenses, accessories, etc - the qty is not accurately reflected 2020-10-19 16:22:55 -07:00
snipe
e80b63b5c1 Fixed #8526 - skip cache for setup check 2020-10-19 12:33:38 -07:00
Brady Wetherington
6b1f1a29ef Merge pull request #8525 from uberbrady/fix_nonexistent_ldap_active_flag
Ensure misdefined active flags will not prevent user syncing
2020-10-19 10:56:40 -07:00
snipe
36436f7929 Nope - was right the first time. Sigh. 2020-10-15 19:17:08 -07:00
snipe
569905ad06 Fixed “down” migration 2020-10-15 19:15:33 -07:00
Brady Wetherington
b626b7895a Ensure misdefined active flags will not prevent user syncing 2020-10-15 19:10:47 -07:00
snipe
eebb463601 Merge pull request #8524 from snipe/fixes/8513_weird_oauth_table_migration_fsckery
Fixed #8513 - Manually created oauth tables
2020-10-15 18:27:36 -07:00
snipe
8f0b3ace92 Manuall created oauth tables
We shouldn’t have to do this, but…
2020-10-15 18:20:41 -07:00
snipe
2dc027e479 Bumped GM version 2020-10-09 17:29:31 -07:00
snipe
51d804c971 Merge branch 'develop' of https://github.com/snipe/snipe-it into develop 2020-10-09 17:24:55 -07:00
snipe
fa41b74856 Fixed parse error in Columbian spanish translation 2020-10-09 17:24:48 -07:00
snipe
701f35e063 Merge pull request #8508 from uberbrady/fix_ad_logins_v5
[Discuss] Fix some logic bugs in the AD-specific code for logging in via AD/LDAP
2020-10-09 17:15:55 -07:00
snipe
a39069bc45 Small UI improvements to API keys page 2020-10-09 16:02:30 -07:00
Brady Wetherington
be4aa07d8c Some logic bugs in the AD-specific code for logging in via AD/LDAP 2020-10-09 15:33:17 -07:00
snipe
714ad071ca Add API endpoint to API keys page
// TODO - localize it
2020-10-09 14:46:11 -07:00
snipe
0954ff0659 Fixed lost ldap password on save when nothing entered 2020-10-09 13:08:51 -07:00
snipe
33cf4896d8 Use password complexity rules on password reset 2020-10-08 19:28:21 -07:00
snipe
c0f9a35dea Fixed password reset blade with correct username 2020-10-08 18:47:42 -07:00
snipe
8a1136d80a Use password security settings on password reset 2020-10-08 18:43:39 -07:00
snipe
292370b02f Cleaned up validation 2020-10-08 18:43:23 -07:00
snipe
d7e58a35bf Revert "Updated translations"
This reverts commit aad14b4d7a.
2020-10-08 18:43:06 -07:00
snipe
aad14b4d7a Updated translations 2020-10-06 19:30:04 -07:00
snipe
01a98c38dc Added welsh as an localization option 2020-10-06 19:16:29 -07:00
snipe
4dbf1f58e3 Bumped RC to GM 2020-10-06 19:11:34 -07:00
snipe
f5116d4cb5 Merge pull request #8499 from uberbrady/fix_v5_AD_OU_handling
Modify Snipe-IT v5 AD handling to use the same ldap_host as for LDAP
2020-10-06 18:56:54 -07:00
Brady Wetherington
b015cff8bd Modify Snipe-IT v5 AD handling to use the same ldap_host, and improve OU handling 2020-10-06 18:31:06 -07:00
snipe
0e632cc7fb Merge pull request #8494 from snipe/features/nuke_barcodes
Added utility to delete barcode cache from labels/barcodes setting
2020-10-06 17:42:57 -07:00
snipe
b49c5dbf06 Clarified language 2020-10-05 20:43:28 -07:00
snipe
6234c6e5fc Fixed typo 2020-10-05 20:35:27 -07:00
snipe
0cd19c87bf Added utility to delete barcode cache from labels/barcodes setting 2020-10-05 20:34:17 -07:00
snipe
14a10f60d9 Undo previous change (it was an intentional choice) 2020-09-29 15:24:50 -07:00
snipe
186e229190 Make date example reflect actual date 2020-09-28 19:01:58 -07:00
snipe
dafac4ceb3 Disable ldap_enabled on demo, fixed some incorrect error messages 2020-09-25 19:04:38 -07:00
snipe
98b9ee9b25 Only save LDAP settings if not in demo mode 2020-09-25 18:38:26 -07:00
snipe
01548ba39d Add ad_append_domain to settings controller 2020-09-25 18:27:22 -07:00
snipe
695774a3fb Corrected throttle string 2020-09-24 23:39:32 -07:00
snipe
98246de4c7 Disable SAML on the demo 2020-09-24 19:25:28 -07:00
snipe
da9896b59a Remove SAML settings on demo reset 2020-09-24 19:13:31 -07:00
snipe
b0e9875a50 Counting is hard. :( 2020-09-24 14:20:29 -07:00
snipe
7314bc4c4e Bumped hash for newest RC 2020-09-24 14:19:34 -07:00
snipe
ba70e07637 Merge pull request #8466 from benwa/gmaps-8465
Changes Google Map to be a bit more detailed
2020-09-22 17:59:45 -07:00
Bennett Blodinger
83dfa2a28c Merge branch 'develop' into gmaps-8465 2020-09-22 17:41:38 -05:00
Blodinger
471e0fd2fc Changes the Google Maps window to be a bit more detailed 2020-09-22 14:30:38 -05:00
snipe
4bd140c324 Merge pull request #8451 from snipe/fixes/fix_ldap_js
No longer toggle the 'disabled' attribute for ldap_server based on is_ad
2020-09-17 14:14:23 -07:00
Brady Wetherington
0e823a962b Fix for #8424 - where the ldap_server setting was grayed out 2020-09-17 13:32:14 -07:00
snipe
002ca52c83 Standardize feature disabled messages in UI 2020-09-16 15:09:58 -07:00
snipe
9793d75947 Merge pull request #8445 from snipe/improve_slack_test_flow_js
Improve slack test flow js
2020-09-16 13:28:10 -07:00
Brady Wetherington
8331be05aa Some fancy JS to enable/disable Slack-test based on field values 2020-09-16 13:15:39 -07:00
snipe
e8dfb71682 Merge branch 'develop' of https://github.com/snipe/snipe-it into develop
# Conflicts:
#	resources/views/settings/slack.blade.php
2020-09-16 12:40:23 -07:00
snipe
7de685a1c1 Added demo disabled text on slack screen 2020-09-16 12:36:33 -07:00
snipe
b508482441 Merge pull request #8438 from snipe/features/nicer_slack_ui
Nicer slack settings UI
2020-09-16 12:29:58 -07:00
snipe
30f8431bfb Added required field indicator 2020-09-16 12:29:20 -07:00
snipe
81548e581d Fixed #8443 - wrong value for array_key_exists on location import 2020-09-16 11:45:47 -07:00
snipe
a3e738b283 Fixed #8442 - wrong CSS url path on /setup 2020-09-16 11:20:59 -07:00
snipe
ed3afd1e2e Removed debugging 2020-09-15 23:19:52 -07:00
snipe
74b96a7413 UI tweaks and updated JS to disable the save button if the settings are not correct 2020-09-15 23:14:10 -07:00
snipe
3ceff29e04 Added some translations for Slack integration 2020-09-15 23:05:42 -07:00
snipe
7736f12eb4 Switch to Guzzle for the Slack test 2020-09-15 23:05:27 -07:00
snipe
b1dda88c9d Removed SlackTest notification 2020-09-15 23:05:05 -07:00
snipe
440ca686e4 More verbose warning for data purge 2020-09-15 20:53:07 -07:00
snipe
4fd5358aa8 Changed login attempts icon so it’s not the same as SAML 2020-09-15 20:27:01 -07:00
snipe
2855a9b2e8 Added debugging to file upload for easier diagnostics 2020-09-15 20:07:46 -07:00
snipe
e8befe9afd Increased favicon filesize max 2020-09-15 20:07:29 -07:00
snipe
d5f8e93d7c Moved delete logo option higher for nicer layout 2020-09-15 19:52:34 -07:00
snipe
303388e1f5 Added a space between favicon help text blocks 2020-09-15 19:50:15 -07:00
snipe
b9e19468e5 Bumped version for v4.9.5 2020-09-15 18:43:19 -07:00
snipe
9601bf6edd Make “remove image” text clearer 2020-09-15 11:57:40 -07:00
snipe
3b6fb68ff1 Added space between padlock icon and demo warning text 2020-09-15 11:40:36 -07:00
snipe
bfd024fdfd Merge pull request #8434 from inietov/bug/ch15182/make-all-of-the-this-feature-has-been-disabled
Thanks!
2020-09-15 11:21:35 -07:00
snipe
4d6a8d48ee Merge branch 'develop' of https://github.com/snipe/snipe-it into develop 2020-09-15 10:15:17 -07:00
snipe
e464f0edf3 Small UI tweaks for kits 2020-09-15 10:15:14 -07:00
snipe
426897c902 Bumped hash 2020-09-15 10:13:55 -07:00
snipe
cfd78fa870 Merge pull request #8435 from inietov/bug/ch15188/v5-500-server-error-in-update-general-settings
Looks great, thank you!
2020-09-15 02:34:59 -07:00
Ivan Nieto
501d5680ea Fix [ch15188] 500 error 2020-09-15 03:51:10 -05:00
Ivan Nieto
291997c915 Change the class of a reusable element so the icon changes from a warning to a padlock 2020-09-15 01:32:46 -05:00
snipe
912401a0a0 Change warning icon to padlock icon 2020-09-12 12:07:56 -07:00
snipe
ec5daa387b Better explanation for demo mode 2020-09-12 10:04:57 -07:00
snipe
24a52eaeae Bumped hash 2020-09-12 10:04:36 -07:00
snipe
e448b626e2 Removed pagaination from dashboard 2020-09-12 08:37:37 -07:00
snipe
ac2403e8fc Fixed markdown issue in markdown notifications 2020-09-11 17:12:33 -07:00
snipe
cf545f0ed1 Fixed form layout on accessory checkin page 2020-09-11 16:20:56 -07:00
snipe
52848ca8d8 Fixed checkin/checkout notification crashing 2020-09-11 16:10:18 -07:00
snipe
a91e81fc42 Added checkin_email to category listing 2020-09-11 16:06:38 -07:00
snipe
e750b2b2da Added envelope css to overrides for table header 2020-09-11 16:06:19 -07:00
snipe
d3d64bd85c Removed asset tag from accessory checkin markdown notification 2020-09-11 16:06:02 -07:00
snipe
514e7ca072 Added boolean has_eula to categories 2020-09-11 16:05:42 -07:00
snipe
0f22cf6807 Fixed #8428 - Added purchase cost column to user tabs 2020-09-11 11:48:51 -07:00
snipe
2f435a57c1 Fixed #8426 - show model number in custom fields model listing 2020-09-11 11:27:30 -07:00
snipe
f949a95cfb Merge pull request #8423 from snipe/fix_ldap_test_php74
Fix ldap test php74
2020-09-09 14:38:26 -07:00
Brady Wetherington
f3f7d714a6 Fix ldap test button for php 7.4 (suppressing errors) 2020-09-09 14:18:05 -07:00
snipe
b258f34bce Merge branch 'integrations/rc5-4-2020-08-31-dev-into-master' into develop 2020-09-09 12:27:01 -07:00
snipe
3d4e1d4641 Merge pull request #8419 from snipe/fixes/ldap_init_fix_for_migrations
Hopefully fixes #8418 - migrations on new install go wonky because of…
2020-09-09 12:26:01 -07:00
snipe
cb5104c27d Hopefully fixes #8418 - migrations on new install go wonky because of LDAP service provider 2020-09-08 21:13:24 -07:00
snipe
5e3ccd1004 Merge branch 'develop' of https://github.com/snipe/snipe-it into develop 2020-09-08 18:29:38 -07:00
snipe
82e0b1ffd8 Fixed [ch15130] - update the seeder to clear requested assets table 2020-09-08 18:29:02 -07:00
snipe
5b68a321a6 Added comapny formatter to asset maintenance report - fixes [ch15119] 2020-09-08 18:15:45 -07:00
snipe
251ef82741 Added company formatter to asset maintenance report 2020-09-08 18:14:21 -07:00
snipe
327583f055 Merge branch 'integrations/rc5-4-2020-08-31-dev-into-master' into develop 2020-09-04 16:24:17 -07:00
snipe
acd15bc3e4 Fixed DB seeder to truncate the asset_maintenances table
This wouldn’t have affected anything in production, but could cause some weird behavior if re-seeding often, since the suppliers table gets stomped on but the old maintenances remained, leaving ghost entries and associating the wrong (old, now defunct) supplier with the maintenance as new supplier IDs get generated.
2020-09-04 16:23:58 -07:00
snipe
aabf9b6f9c Merge branch 'integrations/rc5-4-2020-08-31-dev-into-master' into develop 2020-09-04 16:02:38 -07:00
snipe
10648de9af Bulk Checkin and Delete also edit users [ch15107] 2020-09-04 16:02:25 -07:00
snipe
97743160ef Merge branch 'integrations/rc5-4-2020-08-31-dev-into-master' into develop 2020-09-04 15:45:03 -07:00
snipe
1bea83ee5a Fixed missing setting call
This is still broken further down the line in the event handler for license checkin, but this gets us closer
2020-09-04 15:44:37 -07:00
snipe
d9e7a457d4 Fixed regression on select menus [ch15093]
Custom report doesn’t pass an $item, so we have to check for that in that required check
2020-09-04 15:43:49 -07:00
snipe
5f5b80acae Added maintained and reassignable to license listing 2020-09-04 10:02:04 -07:00
snipe
ba06507e10 Merge branch 'integrations/rc5-4-2020-08-31-dev-into-master' into develop 2020-09-03 19:47:50 -07:00
snipe
69d7000922 Fixed [ch15085] - duplicate use statements in Consumables controller 2020-09-03 19:47:15 -07:00
snipe
96abe54aad Merge branch 'integrations/rc5-4-2020-08-31-dev-into-master' into develop 2020-09-03 19:41:09 -07:00
snipe
249b9b7509 Fixed [ch15086] - [object object] in companies date displays 2020-09-03 19:40:17 -07:00
snipe
25cb489b76 Merge branch 'integrations/rc5-4-2020-08-31-dev-into-master' into develop 2020-09-03 17:00:26 -07:00
snipe
0eeeb24cae Added data-validation=“required" to appropriate field partials 2020-09-03 16:59:42 -07:00
snipe
0503a51cae Corrected validation to match model 2020-09-03 16:58:45 -07:00
snipe
2e0f7921a8 Removed commented out javascript 2020-09-03 16:58:16 -07:00
snipe
c29ec6a100 Removed duplicate state field 2020-09-03 16:00:26 -07:00
snipe
a57ab29af6 Accessibility features for custom fields icons 2020-09-03 15:55:52 -07:00
snipe
b8ddbadd2b Use icons for 2FA, LDAP, etc info on user view 2020-09-03 15:55:41 -07:00
snipe
3e120812e3 Removed 2FA reset button if the user is not enrolled in 2FA 2020-09-03 15:55:20 -07:00
snipe
d0124b900a Merge branch 'integrations/rc5-4-2020-08-31-dev-into-master' into develop 2020-09-03 15:14:06 -07:00
snipe
3ea3e8b856 Updated user asset listing to use bootstrap-tables and asset endpoint [ch1389] 2020-09-03 15:12:51 -07:00
snipe
0ace7d16fb Merge branch 'integrations/rc5-4-2020-08-31-dev-into-master' into develop 2020-09-03 14:08:01 -07:00
snipe
fb59405a87 User view can t be loaded [ch15079] 2020-09-03 14:07:30 -07:00
Ivan Nieto
3fcd83c499 Fixes some errors in forms using the deprecated Input:: facade 2020-09-03 13:42:33 -05:00
snipe
9820bc6a58 Merge branch 'integrations/intermediate-2020-08-31-v5-rc' into develop
# Conflicts:
#	config/version.php
#	public/css/build/all.css
#	public/css/skins/skin-contrast.css
#	public/css/skins/skin-contrast.css.map
#	public/js/build/vue.js
#	public/js/dist/all.js
#	resources/views/custom_fields/fieldsets/view.blade.php
#	resources/views/layouts/default.blade.php
#	resources/views/users/index.blade.php
2020-09-03 09:40:38 -07:00
snipe
ed79eacb9d Updated help text 2020-08-31 19:55:30 -07:00
snipe
408435057e Small vue fixes 2020-08-31 19:41:05 -07:00
snipe
7cab9f48e5 Use darker red for errors 2020-08-31 19:40:49 -07:00
snipe
addb2bde23 Merge pull request #8392 from snipe/integrations/rc5-4-2020-08-31-dev-into-master
Integrations/rc5 4 2020 08 31 dev into master
2020-08-31 17:24:44 -07:00
snipe
a64e1be278 Fixed Input:: () vs request() 2020-08-31 17:18:09 -07:00
snipe
13216b8860 Fixed pGenerator (again) 2020-08-31 17:17:51 -07:00
snipe
2a5cd58ad9 Added gitignore to cache dir 2020-08-31 17:15:21 -07:00
snipe
6a90ce523b Bumped version 2020-08-31 15:38:40 -07:00
snipe
453fc718d9 Merge branch 'develop' into integrations/2020-08-31-dev-into-master
# Conflicts:
#	.all-contributorsrc
#	.nvmrc
#	README.md
#	app/Console/Commands/LdapSync.php
#	app/Http/Controllers/Api/AssetsController.php
#	app/Http/Controllers/Api/ConsumablesController.php
#	app/Http/Controllers/Api/ImportController.php
#	app/Http/Controllers/Assets/AssetsController.php
#	app/Http/Controllers/Auth/LoginController.php
#	app/Http/Controllers/CustomFieldsetsController.php
#	app/Http/Controllers/LicensesController.php
#	app/Http/Controllers/UsersController.php
#	app/Models/Ldap.php
#	composer.json
#	composer.lock
#	config/version.php
#	public/css/build/all.css
#	public/css/dist/all.css
#	public/css/skins/skin-contrast.css
#	public/css/skins/skin-contrast.css.map
#	public/js/build/all.js
#	public/js/build/vue.js
#	public/js/build/vue.js.map
#	public/js/dist/all.js
#	public/mix-manifest.json
#	resources/assets/less/overrides.less
#	resources/views/custom_fields/fieldsets/view.blade.php
#	resources/views/hardware/view.blade.php
#	resources/views/layouts/default.blade.php
#	resources/views/modals/model.blade.php
#	resources/views/modals/user.blade.php
#	resources/views/users/index.blade.php
#	routes/api.php
#	tests/unit/UserTest.php
2020-08-31 12:44:03 -07:00
snipe
9c8ca6af21 Squashed commit of the following:
commit e321aeabae
Merge: 8ec99ff43 37568ae9e
Author: snipe <snipe@snipe.net>
Date:   Mon Aug 31 12:14:44 2020 -0700

    Merge branch 'master' into integrations/2020-08-31-v5-rc

    # Conflicts:
    #	.all-contributorsrc
    #	.nvmrc
    #	README.md
    #	app/Console/Commands/LdapSync.php
    #	app/Http/Controllers/Api/ConsumablesController.php
    #	app/Http/Controllers/Api/ImportController.php
    #	app/Http/Controllers/Assets/AssetsController.php
    #	app/Http/Controllers/Auth/LoginController.php
    #	app/Http/Controllers/CustomFieldsetsController.php
    #	app/Http/Controllers/LicensesController.php
    #	app/Http/Controllers/UsersController.php
    #	app/Importer/import_mappings.md
    #	app/Models/Ldap.php
    #	app/Models/Loggable.php
    #	composer.json
    #	composer.lock
    #	config/version.php
    #	public/css/build/all.css
    #	public/css/dist/all.css
    #	public/css/skins/skin-contrast.css
    #	public/css/skins/skin-contrast.css.map
    #	public/js/build/all.js
    #	public/js/build/vue.js
    #	public/js/build/vue.js.map
    #	public/js/dist/all.js
    #	public/mix-manifest.json
    #	resources/assets/js/components/importer/importer-file.vue
    #	resources/assets/less/overrides.less
    #	resources/macros/macros.php
    #	resources/views/custom_fields/fieldsets/view.blade.php
    #	resources/views/hardware/edit.blade.php
    #	resources/views/hardware/labels.blade.php
    #	resources/views/hardware/view.blade.php
    #	resources/views/layouts/default.blade.php
    #	resources/views/modals/model.blade.php
    #	resources/views/modals/user.blade.php
    #	resources/views/users/index.blade.php
    #	routes/api.php
    #	routes/web/fields.php
    #	tests/unit/UserTest.php

commit 37568ae9ec
Merge: 01a832169 32ad9050c
Author: snipe <snipe@snipe.net>
Date:   Tue Aug 25 20:49:37 2020 -0700

    Merge pull request #8365 from snipe/fixes/8338_google_maps_CSP

    Fixed #8338 - Added google maps to CSP

commit 32ad9050cf
Author: snipe <snipe@snipe.net>
Date:   Tue Aug 25 20:48:53 2020 -0700

    Added google maps to CSP

commit 01a832169c
Merge: bcad49ce7 3c6883489
Author: snipe <snipe@snipe.net>
Date:   Tue Aug 25 20:38:31 2020 -0700

    Merge pull request #8364 from snipe/fixes/8335_assigned_to_null_on_status_assetlist

    Fixed #8335 - added assignedTo scope on status labels API call for assetlist

commit 3c6883489c
Author: snipe <snipe@snipe.net>
Date:   Tue Aug 25 20:37:30 2020 -0700

    Added assignedTo scope

commit bcad49ce79
Author: snipe <snipe@snipe.net>
Date:   Fri Aug 14 16:10:22 2020 -0700

    Try to better handle slack “too many requests” issue

commit b5acca89d7
Author: snipe <snipe@snipe.net>
Date:   Fri Aug 14 16:02:15 2020 -0700

    Check for admin for slack notifications

commit e52919cf1b
Merge: 714576be4 29f3a5c48
Author: snipe <snipe@snipe.net>
Date:   Fri Aug 14 15:35:15 2020 -0700

    Merge pull request #8327 from snipe/features/checkin_license_from_all_users

    Checkin license from all users cli tool

commit 29f3a5c48f
Author: snipe <snipe@snipe.net>
Date:   Fri Aug 14 15:27:40 2020 -0700

    Use more verbose annotation for Auth::user if/else

commit 134e8e6fb9
Author: snipe <snipe@snipe.net>
Date:   Fri Aug 14 15:25:07 2020 -0700

    Moved user email nulling until after the save

commit 714576be45
Merge: b999c50a2 512899294
Author: Brady Wetherington <bwetherington@grokability.com>
Date:   Fri Aug 14 15:24:03 2020 -0700

    Merge pull request #8328 from snipe/fix_deprecation_report

    Fix deprecation report for customers with many active assets

commit 5128992940
Author: Brady Wetherington <uberbrady@gmail.com>
Date:   Fri Aug 14 15:03:03 2020 -0700

    Fix deprecation report for customers with many active assets

commit 0291323502
Author: snipe <snipe@snipe.net>
Date:   Fri Aug 14 14:57:58 2020 -0700

    Use the user as the target

commit e0f6f9b839
Author: snipe <snipe@snipe.net>
Date:   Fri Aug 14 14:43:37 2020 -0700

    Artisan command to check in licenses from all users

commit f1a6308002
Author: snipe <snipe@snipe.net>
Date:   Fri Aug 14 14:43:07 2020 -0700

    Check for Auth::user before trying to log id (for cli)

commit b999c50a2e
Merge: 9ca20e496 e3906b245
Author: snipe <snipe@snipe.net>
Date:   Wed Aug 12 12:37:47 2020 -0700

    Merge pull request #8316 from Godmartinz/bug/ch15028/missing-or-incorrect-error-message-translation

    Looks great, thank you!

commit e3906b245c
Author: Godfrey M <godmartinz@gmail.com>
Date:   Wed Aug 12 12:27:18 2020 -0700

    added translation for admin/licenses/message.not_found

commit 9ca20e4964
Merge: e0644dbbf 456a74d88
Author: Brady Wetherington <bwetherington@grokability.com>
Date:   Tue Aug 11 17:33:19 2020 -0700

    Merge pull request #8313 from snipe/improve_ldap_search_error_reporting

    Improve ldap search error reporting

commit 456a74d88c
Author: Brady Wetherington <uberbrady@gmail.com>
Date:   Tue Aug 11 16:41:20 2020 -0700

    De-merge out incorrectly merged files. Whoops!

commit 799c059070
Author: Brady Wetherington <uberbrady@gmail.com>
Date:   Tue Aug 11 16:21:18 2020 -0700

    Add internationalized version of LDAP error message

commit c62d43a778
Author: Brady Wetherington <uberbrady@gmail.com>
Date:   Mon Aug 10 17:04:17 2020 -0700

    Improve Exception management in Artisan LDAP Sync method. Still need to localize this better

commit b725bd0fae
Author: Brady Wetherington <uberbrady@gmail.com>
Date:   Mon Aug 10 17:23:04 2020 -0700

     Add @PeterUpfold as a contributor

commit e0644dbbf6
Merge: 5b6925b00 004ecad05
Author: Brady Wetherington <bwetherington@grokability.com>
Date:   Mon Aug 10 17:22:31 2020 -0700

    Merge pull request #8105 from PeterUpfold/PeterUpfold-7661workaround

    Propose workaround for #7661 — suppress E_DEPRECATED on ldap_control_paged_result()

commit 5b6925b00c
Author: snipe <snipe@snipe.net>
Date:   Tue Aug 4 21:00:37 2020 -0700

    Removed debugging :(

commit df17a859bf
Author: snipe <snipe@snipe.net>
Date:   Tue Aug 4 20:59:54 2020 -0700

    Changed modal IDs so manager creation modal works on user creation main page

commit 24c43056ba
Author: snipe <snipe@snipe.net>
Date:   Tue Aug 4 20:58:28 2020 -0700

    Moved pGenerator script to default layout footer

    This fixes an issue where the password generator wouldn’t load in a modal in Chrome

commit 606b7e905d
Author: snipe <snipe@snipe.net>
Date:   Fri Jul 31 17:02:33 2020 -0700

    Small edits to PR template

    Slight text changes to ask specifics about versions

commit d73ddad477
Author: snipe <snipe@snipe.net>
Date:   Fri Jul 31 16:59:26 2020 -0700

    Created a PR template

    First draft of the PR guidelines template

commit 9a39cf721e
Merge: 7410b1683 8994f3e15
Author: snipe <snipe@snipe.net>
Date:   Fri Jul 31 12:18:49 2020 -0700

    Merge pull request #8258 from ballertv/features/consumable-api

    This looks great, thank you!

commit 7410b16835
Merge: e955c983a b09e7d19b
Author: Brady Wetherington <bwetherington@grokability.com>
Date:   Fri Jul 24 16:22:44 2020 -0700

    Merge pull request #8270 from snipe/improve_ad_useraccountcontrol_v4

    Add new useraccountcontrol value for valid AD users

commit 8994f3e15e
Author: andres <andresgutierrez535@gmail.com>
Date:   Wed Jul 22 19:57:06 2020 -0400

    cleanup

commit d23f1a77ca
Author: andres <andresgutierrez535@gmail.com>
Date:   Wed Jul 22 18:46:02 2020 -0400

    implement checkout API

commit e955c983a3
Merge: 2fa17ac18 eed41e454
Author: snipe <snipe@snipe.net>
Date:   Wed Jul 22 13:43:29 2020 -0700

    Merge pull request #8250 from snipe/features/adds_addr_city_state_to_importer

    Added address, city, state and country to importer and city to bulk editor

commit b09e7d19b3
Author: Brady Wetherington <uberbrady@gmail.com>
Date:   Wed Jul 22 13:32:16 2020 -0700

    Add new useraccountcontrol value for valid AD users; document algorithm and values

commit 2fa17ac185
Merge: b90515437 3b1e46f72
Author: snipe <snipe@snipe.net>
Date:   Wed Jul 22 12:06:31 2020 -0700

    Merge pull request #8254 from Godmartinz/gmartinez_adds_email_formats

    Added firstinitial.lastname, lastname_firstinitial, firstnamelastname…

commit 3b1e46f72b
Author: Godfrey Martinez <47435081+Godmartinz@users.noreply.github.com>
Date:   Wed Jul 22 11:25:57 2020 -0700

    Update general.php

commit 0c1a1de2a2
Author: Godfrey Martinez <47435081+Godmartinz@users.noreply.github.com>
Date:   Wed Jul 22 11:24:36 2020 -0700

    Update general.php

    fixed typo

commit 20c9ae5818
Author: Godfrey M <godmartinz@gmail.com>
Date:   Wed Jul 22 10:21:19 2020 -0700

    Added firstinitial.lastname, lastname_firstinitial, firstnamelastname and firstnamelastinitial to username formats

commit eed41e4549
Author: snipe <snipe@snipe.net>
Date:   Tue Jul 21 16:57:32 2020 -0700

    Moved address down further, fixed broken HTML

commit b750f4754f
Author: snipe <snipe@snipe.net>
Date:   Tue Jul 21 16:49:54 2020 -0700

    Added city to bulk user importer

commit c17a06792a
Author: snipe <snipe@snipe.net>
Date:   Tue Jul 21 16:49:38 2020 -0700

    Added address, city, state, country to user importer

commit 4f76cc6cfb
Author: snipe <snipe@snipe.net>
Date:   Tue Jul 21 16:46:13 2020 -0700

    I don’t actually know what this file is for

commit b905154373
Author: snipe <snipe@snipe.net>
Date:   Mon Jul 20 14:29:32 2020 -0700

    Fixed #8247 - added notes field to user details display

commit daf748e531
Author: snipe <snipe@snipe.net>
Date:   Fri Jul 17 12:32:01 2020 -0700

    Bumped hash

commit 799a93c46a
Author: snipe <snipe@snipe.net>
Date:   Fri Jul 17 12:11:32 2020 -0700

    Allow for email/username search on users

commit 34aa12e229
Merge: 81a633288 897757bd0
Author: snipe <snipe@snipe.net>
Date:   Thu Jul 16 17:44:13 2020 -0700

    Merge pull request #8239 from snipe/fixes/api_rtd_to_location_on_create

    Set location_id to rtd_location_id on asset creation

commit 897757bd04
Author: snipe <snipe@snipe.net>
Date:   Thu Jul 16 17:43:44 2020 -0700

    Removed added line for location

commit c7125c3937
Author: snipe <snipe@snipe.net>
Date:   Thu Jul 16 16:34:39 2020 -0700

    Set location_id to rtd_location_id on asset creation

commit 81a6332889
Author: snipe <snipe@snipe.net>
Date:   Tue Jul 14 13:55:38 2020 -0700

    Removed license ID from seats table cookie info

    This typically wouldn’t be necessary, since most people would want to view the same *types* of data across licenses

commit 6e563f6e4b
Merge: 5320f5c67 7f69ae953
Author: snipe <snipe@snipe.net>
Date:   Mon Jul 13 21:16:54 2020 -0700

    Merge branch 'master' of https://github.com/snipe/snipe-it

commit 5320f5c67c
Author: snipe <snipe@snipe.net>
Date:   Mon Jul 13 21:16:45 2020 -0700

    Disallow non-super users from editing their own permissions

commit 7f69ae953b
Merge: c79f8c1ba 17f6fbabf
Author: snipe <snipe@snipe.net>
Date:   Mon Jul 13 21:16:00 2020 -0700

    Merge pull request #8227 from snipe/fix_select2_ajax_pulldowns

    Changes how we do AJAX calls via Select2 for dynamic drop-down menus

commit 17f6fbabfa
Author: Brady Wetherington <uberbrady@gmail.com>
Date:   Mon Jul 13 21:12:03 2020 -0700

    Switch to 'items' to maintain compatbility with other internal API's

commit c79f8c1baf
Merge: 12c92e30b 536401fe0
Author: snipe <snipe@snipe.net>
Date:   Mon Jul 13 17:42:16 2020 -0700

    Merge pull request #8207 from EDVLeer/patch-1

    Update snipeit.sh

commit e7a820f7c9
Author: Brady Wetherington <uberbrady@gmail.com>
Date:   Mon Jul 13 17:14:31 2020 -0700

    Changes how we do AJAX calls via Select2 for dynamic drop-down menus

commit 12c92e30b7
Author: snipe <snipe@snipe.net>
Date:   Fri Jul 10 16:21:27 2020 -0700

    Show whether or not the user was imported via LDAP in the view page

commit fd10b755b0
Author: snipe <snipe@snipe.net>
Date:   Fri Jul 10 11:30:01 2020 -0700

    Removed the sr-only tag in table headers

    It was breaking Bootstrap Tables column selector :(

commit dbbb7680d9
Author: snipe <snipe@snipe.net>
Date:   Thu Jul 9 21:12:50 2020 -0700

    A few more fixes for the cli

    Do not check out a piece of software if it’s already been checked out to the user

commit cf0dd5bbad
Author: snipe <snipe@snipe.net>
Date:   Thu Jul 9 20:43:13 2020 -0700

    Small fixes for cli tool

commit 25e53d8c7f
Merge: ec6ed256f 89d433b41
Author: snipe <snipe@snipe.net>
Date:   Thu Jul 9 20:27:01 2020 -0700

    Merge pull request #8216 from snipe/features/checkout_license_to_all_users

    Added CLI tool to checkout license to all users

commit 89d433b41a
Author: snipe <snipe@snipe.net>
Date:   Thu Jul 9 20:26:02 2020 -0700

    Removed duplicate seat call

commit e2570ada6f
Author: snipe <snipe@snipe.net>
Date:   Thu Jul 9 20:04:05 2020 -0700

    CLI tool to checkout a license to ALL users

commit 45afe725a1
Author: snipe <snipe@snipe.net>
Date:   Thu Jul 9 20:03:47 2020 -0700

    Only try to get the company if there is an auth’d user

    (Needed for command line tools, where no Auth::user() is present)

commit 536401fe0f
Author: EDVLeer <32170051+EDVLeer@users.noreply.github.com>
Date:   Tue Jul 7 08:21:36 2020 +0200

    Update snipeit.sh

    Ubuntu 20.04

commit ec6ed256fb
Author: snipe <snipe@snipe.net>
Date:   Mon Jul 6 18:45:43 2020 -0700

    Bumped minor version

commit 2aaa7bed2d
Merge: 339bdddc3 cc9f1577a
Author: snipe <snipe@snipe.net>
Date:   Thu Jun 25 18:37:41 2020 -0700

    Merge pull request #8183 from snipe/features/merge_users

    Added merge utility

commit cc9f1577a4
Author: snipe <snipe@snipe.net>
Date:   Thu Jun 25 17:43:53 2020 -0700

    Removed unused use directives

commit ab1fe8be0c
Author: snipe <snipe@snipe.net>
Date:   Thu Jun 25 17:42:39 2020 -0700

    Added merge utility

commit 339bdddc38
Author: snipe <snipe@snipe.net>
Date:   Thu Jun 25 11:00:33 2020 -0700

    Fix for Vue js not loading due to CSP :(

commit 35b9cf4b70
Author: snipe <snipe@snipe.net>
Date:   Tue Jun 23 02:41:59 2020 -0700

    Fixed missing db prefix on scopeDueOrOverdueForAudit

commit 7ccb41371e
Author: snipe <snipe@snipe.net>
Date:   Tue Jun 23 01:09:39 2020 -0700

    Removed unoptimized images directive

    securityheaders.com is claiming it’s onrecognized, even though I got that directive from their site, so… whatever. ¯\_(ツ)_/¯

commit 2e60a457bf
Author: snipe <snipe@snipe.net>
Date:   Tue Jun 23 01:07:00 2020 -0700

    Dumb fix for feature-policy being dumb.

commit 2390d2160b
Merge: b42801f6a 00b051b8c
Author: snipe <snipe@snipe.net>
Date:   Tue Jun 23 00:27:47 2020 -0700

    Merge pull request #8164 from snipe/features/additional_security_headers

    Additional security headers

commit 00b051b8c7
Author: snipe <snipe@snipe.net>
Date:   Tue Jun 23 00:26:09 2020 -0700

    Added a few more comments

commit 05b3a9ad7e
Author: snipe <snipe@snipe.net>
Date:   Mon Jun 22 23:17:27 2020 -0700

    Config variable for HSTS

commit 4fb880384f
Author: snipe <snipe@snipe.net>
Date:   Mon Jun 22 22:37:14 2020 -0700

    Changed comment

commit 43042ad841
Author: snipe <snipe@snipe.net>
Date:   Mon Jun 22 22:35:59 2020 -0700

    Consolidated ReferrerPolicy into new SecurityHeaders file

commit a716382ac4
Author: snipe <snipe@snipe.net>
Date:   Mon Jun 22 22:33:37 2020 -0700

    Removed CSP middleware (it’s added in the general header)

commit 36c8f7f4f1
Author: snipe <snipe@snipe.net>
Date:   Mon Jun 22 22:31:01 2020 -0700

    Additional security headers

commit b42801f6ae
Merge: de4934f21 946129f20
Author: snipe <snipe@snipe.net>
Date:   Mon Jun 22 20:47:35 2020 -0700

    Merge pull request #8163 from snipe/fixes/fix-for-css-on-column-selector

    Fixed weird padlock display in asset listing with encrypted custom fields

commit 946129f206
Author: snipe <snipe@snipe.net>
Date:   Mon Jun 22 20:45:20 2020 -0700

    Made quote style consistent

commit b941ef1e08
Author: snipe <snipe@snipe.net>
Date:   Mon Jun 22 20:41:40 2020 -0700

    Pulled CSS font awesome styles out of the blade and into overrides.css

commit d1aa11ec89
Author: snipe <snipe@snipe.net>
Date:   Mon Jun 22 20:29:19 2020 -0700

    Fix for weird padlock display in asset listing with encrypted custom fields

commit de4934f21d
Merge: af06e4205 b10076b01
Author: snipe <snipe@snipe.net>
Date:   Mon Jun 22 17:28:38 2020 -0700

    Merge pull request #8162 from Godmartinz/godfreymartinez-ghi-font-size-of-qr_text

    Fixed #8161 and #8114 - font-size for labels used static values in blade instead of using values from settings

commit b10076b015
Author: Godfrey M <godmartinz@gmail.com>
Date:   Mon Jun 22 17:04:39 2020 -0700

    corrected an error where font-size for labels were static in settings.

commit af06e42056
Author: snipe <snipe@snipe.net>
Date:   Wed Jun 17 11:17:25 2020 -0700

    Bumped version

commit 9a2440dc4b
Merge: beae8efb2 2ac1c1636
Author: snipe <snipe@snipe.net>
Date:   Tue Jun 16 20:20:07 2020 -0700

    Merge pull request #8141 from snipe/fixes/better_handling_when_license_is_invalid

    Better handle the logic to determine if we should display the license checkout blade [ch13792]

commit 2ac1c1636c
Author: snipe <snipe@snipe.net>
Date:   Tue Jun 16 16:12:57 2020 -0700

    Better handle the logic to determine if we should display the license checkout blade

commit 004ecad059
Author: Peter Upfold <pgithub@upfold.org.uk>
Date:   Wed Jun 3 08:59:50 2020 +0100

    Force suppress deprecation warning on ldap_control_paged_result()

commit beae8efb21
Merge: d14ab7e3e 9839e5e56
Author: snipe <snipe@snipe.net>
Date:   Wed May 27 23:01:33 2020 -0700

    Merge pull request #8088 from Godmartinz/Label_Woes

    Barcode resizing and text adjustment

commit 9839e5e566
Author: Godfrey M <godmartinz@gmail.com>
Date:   Wed May 27 12:27:40 2020 -0700

    adjusted for all label text, removed local variable

commit d14ab7e3e1
Author: snipe <snipe@snipe.net>
Date:   Wed May 27 00:22:44 2020 -0700

    Porting change from #8053 to master

    Signed-off-by: snipe <snipe@snipe.net>

commit e7f74d94c1
Author: Godfrey M <godmartinz@gmail.com>
Date:   Tue May 26 17:22:45 2020 -0700

    Label_Woes

commit e97cf011b6
Author: Godfrey M <godmartinz@gmail.com>
Date:   Tue May 26 17:15:39 2020 -0700

    Label_Woes

commit ed23505054
Author: Godfrey M <godmartinz@gmail.com>
Date:   Tue May 26 17:10:45 2020 -0700

    Label_Woes

commit 001e721530
Merge: f88683766 8210da6e8
Author: snipe <snipe@snipe.net>
Date:   Wed May 20 10:21:52 2020 -0700

    Merge pull request #8063 from dmeltzer/backport-8092

    BACKPORT: Fix Missing Category selection in Asset Model Modal dialog - [ch14635]

commit 8210da6e82
Author: Daniel Meltzer <dmeltzer.devel@gmail.com>
Date:   Wed May 20 10:29:27 2020 -0400

    Fix Missing Category selection in Asset Model Modal dialog.

    A select html tag needs a full closing tag. is not valid. This was causing the select2 js to barf and eat additional information.

commit f88683766b
Author: snipe <snipe@snipe.net>
Date:   Thu May 14 00:55:47 2020 -0700

    Roll back previous change

    Signed-off-by: snipe <snipe@snipe.net>

commit e4385c0f8c
Author: snipe <snipe@snipe.net>
Date:   Thu May 14 00:48:30 2020 -0700

    Fixes #8051 regression

    Signed-off-by: snipe <snipe@snipe.net>

commit 0550fe0ffa
Author: snipe <snipe@snipe.net>
Date:   Tue May 12 10:31:54 2020 -0700

    Fix for session fixation vulnerability

    Signed-off-by: snipe <snipe@snipe.net>

commit 7fb3a9b82c
Merge: 9a2ed804c ecb1e87fe
Author: snipe <snipe@snipe.net>
Date:   Mon May 11 22:41:36 2020 -0700

    Merge pull request #8043 from snipe/features/backup-optional-in-import-and-ldap

    Added option to disable backup in import

commit ecb1e87fe6
Author: snipe <snipe@snipe.net>
Date:   Mon May 11 20:45:15 2020 -0700

    Updated assets

    Signed-off-by: snipe <snipe@snipe.net>

commit f43df5f041
Author: snipe <snipe@snipe.net>
Date:   Mon May 11 20:44:46 2020 -0700

    Fixed form label

    Signed-off-by: snipe <snipe@snipe.net>

commit 95cc48e422
Author: snipe <snipe@snipe.net>
Date:   Mon May 11 20:41:10 2020 -0700

    Added option to disable backup in import

    Signed-off-by: snipe <snipe@snipe.net>

commit 9a2ed804ca
Author: snipe <snipe@snipe.net>
Date:   Mon May 11 20:28:42 2020 -0700

    Fixed mismatched HTML header tags

    Signed-off-by: snipe <snipe@snipe.net>

commit d20fad28e5
Author: snipe <snipe@snipe.net>
Date:   Mon May 11 20:28:24 2020 -0700

    Use more modern request helper

    Signed-off-by: snipe <snipe@snipe.net>

commit ae813ddf75
Author: snipe <snipe@snipe.net>
Date:   Mon May 11 18:11:16 2020 -0700

    Add @alek13 as a contributor

commit bb42109c0c
Author: snipe <snipe@snipe.net>
Date:   Mon May 11 18:10:45 2020 -0700

    Added a clarifying comment

    Signed-off-by: snipe <snipe@snipe.net>

commit f46ecf8ec0
Author: snipe <snipe@snipe.net>
Date:   Mon May 11 18:07:20 2020 -0700

    Updated composer lock

    Signed-off-by: snipe <snipe@snipe.net>

commit b9e821c0e6
Author: snipe <snipe@snipe.net>
Date:   Mon May 11 18:07:14 2020 -0700

    Small fix for Group Functional Tests

    Signed-off-by: snipe <snipe@snipe.net>

commit 9ee28c7513
Author: snipe <snipe@snipe.net>
Date:   Mon May 11 18:07:02 2020 -0700

    Switched to use info instead of danger on undeployable statuses

    Signed-off-by: snipe <snipe@snipe.net>

commit 1a8ba06702
Merge: 0fd232e70 ee4d69b1c
Author: snipe <snipe@snipe.net>
Date:   Mon May 11 17:53:32 2020 -0700

    Merge branch 'master' of https://github.com/snipe/snipe-it

commit 0fd232e70d
Author: snipe <snipe@snipe.net>
Date:   Mon May 11 17:53:24 2020 -0700

    Fixed group functional test

    (We had changed the minimum to 2 instead of 3)

    Signed-off-by: snipe <snipe@snipe.net>

commit ee4d69b1c5
Merge: 31c535094 d1ad11194
Author: snipe <snipe@snipe.net>
Date:   Mon May 11 17:52:45 2020 -0700

    Merge pull request #8041 from alek13/patch-1

    use supported package for slack

commit d1ad111949
Author: Alexander Chibrikin <alek13.me@gmail.com>
Date:   Mon May 11 20:31:13 2020 +0300

    use supported package for slack

    see https://github.com/maknz/slack/issues/94

commit 31c5350941
Author: snipe <snipe@snipe.net>
Date:   Fri May 1 01:05:48 2020 -0700

    Fixed incorrect route for groups edit

    Signed-off-by: snipe <snipe@snipe.net>

commit 7eb70e17e0
Merge: 5bb4f271a 3dfcb4699
Author: snipe <snipe@snipe.net>
Date:   Fri Apr 24 04:50:37 2020 -0700

    Merge pull request #7993 from snipe/fixes/7989_column_selector

    Fixed #7989 - Converted table heading icons in People to CSS glyphs

commit 3dfcb46991
Author: snipe <snipe@snipe.net>
Date:   Fri Apr 24 04:41:08 2020 -0700

    Minor formatting changes

    Signed-off-by: snipe <snipe@snipe.net>

commit 96eb96f964
Author: snipe <snipe@snipe.net>
Date:   Fri Apr 24 04:27:00 2020 -0700

    Removed stray val (typo)

    Signed-off-by: snipe <snipe@snipe.net>

commit a2f08bd3ba
Author: snipe <snipe@snipe.net>
Date:   Fri Apr 24 04:08:54 2020 -0700

    Added comments

    Signed-off-by: snipe <snipe@snipe.net>

commit e009fbe59f
Author: snipe <snipe@snipe.net>
Date:   Fri Apr 24 04:04:53 2020 -0700

    Converted table heading icons in People to CSS glyphs

    Signed-off-by: snipe <snipe@snipe.net>

commit 5bb4f271aa
Author: snipe <snipe@snipe.net>
Date:   Fri Apr 24 00:47:19 2020 -0700

    Fixed #7987 - allow toggle of required/optional in custom fields/fieldsets

    Signed-off-by: snipe <snipe@snipe.net>
2020-08-31 12:17:19 -07:00
snipe
e321aeabae Merge branch 'master' into integrations/2020-08-31-v5-rc
# Conflicts:
#	.all-contributorsrc
#	.nvmrc
#	README.md
#	app/Console/Commands/LdapSync.php
#	app/Http/Controllers/Api/ConsumablesController.php
#	app/Http/Controllers/Api/ImportController.php
#	app/Http/Controllers/Assets/AssetsController.php
#	app/Http/Controllers/Auth/LoginController.php
#	app/Http/Controllers/CustomFieldsetsController.php
#	app/Http/Controllers/LicensesController.php
#	app/Http/Controllers/UsersController.php
#	app/Importer/import_mappings.md
#	app/Models/Ldap.php
#	app/Models/Loggable.php
#	composer.json
#	composer.lock
#	config/version.php
#	public/css/build/all.css
#	public/css/dist/all.css
#	public/css/skins/skin-contrast.css
#	public/css/skins/skin-contrast.css.map
#	public/js/build/all.js
#	public/js/build/vue.js
#	public/js/build/vue.js.map
#	public/js/dist/all.js
#	public/mix-manifest.json
#	resources/assets/js/components/importer/importer-file.vue
#	resources/assets/less/overrides.less
#	resources/macros/macros.php
#	resources/views/custom_fields/fieldsets/view.blade.php
#	resources/views/hardware/edit.blade.php
#	resources/views/hardware/labels.blade.php
#	resources/views/hardware/view.blade.php
#	resources/views/layouts/default.blade.php
#	resources/views/modals/model.blade.php
#	resources/views/modals/user.blade.php
#	resources/views/users/index.blade.php
#	routes/api.php
#	routes/web/fields.php
#	tests/unit/UserTest.php
2020-08-31 12:14:44 -07:00
snipe
8ec99ff433 Merge pull request #8374 from snipe/fixes/moar_flysystem
WIP - More Flysystem fixes
2020-08-31 09:45:27 -07:00
snipe
f2c60d055b Updated docblock 2020-08-28 18:22:57 -07:00
snipe
e1cc003cec Fixed backup urls for download 2020-08-28 18:22:37 -07:00
snipe
5aaa2430b4 Fixes for backups 2020-08-28 14:10:43 -07:00
snipe
bc5a82e734 Small fixed for file mover artisan command 2020-08-28 14:10:28 -07:00
snipe
f83acf8378 Merge pull request #8383 from Godmartinz/develop
removed a duplicate date format in the settings.
2020-08-27 14:35:00 -07:00
Godfrey M
242af2c90b removed a duplicate date format in the settings. 2020-08-27 12:58:44 -07:00
snipe
fdafaf2802 Merge branch 'develop' of https://github.com/snipe/snipe-it into develop 2020-08-26 13:40:10 -07:00
snipe
9ba290e507 Add @jbiel as a contributor 2020-08-26 13:39:53 -07:00
snipe
9f5669e70a Merge pull request #8373 from snipe/tweak_v5_ldap_migration
Tweak v5 ldap migration for backwards-compatibility with working pre-v5 Active Directory setups
2020-08-26 13:34:25 -07:00
snipe
c23e28d0df Merge pull request #8372 from snipe/fix_adldap_sync
Fix adldap sync
2020-08-26 13:34:07 -07:00
snipe
5abd85003c Merge pull request #8371 from snipe/bushelpowered-develop
Fixed #7919 - LDAP Logins + query filters
2020-08-26 13:33:41 -07:00
Brady Wetherington
14da328dea Remove extraneous log line 2020-08-26 13:10:47 -07:00
Brady Wetherington
6e9f36be58 Update ad_append_domain setting for backwards-compatibility with v4 and earlier 2020-08-26 13:09:32 -07:00
Brady Wetherington
67a1d2fa5f Remove hardcoding of LDAP Auth query to 'uid=', use setting instead 2020-08-26 12:25:10 -07:00
snipe
24be73f76b Use image handling request for logo uploads 2020-08-26 12:17:50 -07:00
snipe
a86dc52695 Added fieldname to file name for better clarity on setting logos 2020-08-26 12:17:36 -07:00
snipe
1ff7e6b834 Use Storage facade for user presenter 2020-08-26 12:17:18 -07:00
snipe
fa2dfc3e87 Use updated request signature for models 2020-08-26 11:59:30 -07:00
snipe
d25a05d748 Misc Flysystem/image upload request fixes 2020-08-26 11:53:36 -07:00
snipe
139c874308 Fixed delete old image on upload 2020-08-26 02:48:07 -07:00
snipe
db385b5f6b Fixed assetmodels selectlist 2020-08-26 02:32:39 -07:00
snipe
f385f3e928 Fixed user image upload
TODO: We should probably rename the avatar field on the user’s table, to make it more consistent with the other model images
2020-08-26 02:30:23 -07:00
snipe
de21f00771 Fixed assetmodels upload 2020-08-26 02:29:37 -07:00
snipe
37568ae9ec Merge pull request #8365 from snipe/fixes/8338_google_maps_CSP
Fixed #8338 - Added google maps to CSP
2020-08-25 20:49:37 -07:00
snipe
32ad9050cf Added google maps to CSP 2020-08-25 20:48:53 -07:00
snipe
01a832169c Merge pull request #8364 from snipe/fixes/8335_assigned_to_null_on_status_assetlist
Fixed #8335 - added assignedTo scope on status labels API call for assetlist
2020-08-25 20:38:31 -07:00
snipe
3c6883489c Added assignedTo scope 2020-08-25 20:37:30 -07:00
Brady Wetherington
6c23e881c7 Merge branch 'develop' of https://github.com/bushelpowered/snipe-it into bushelpowered-develop 2020-08-24 21:42:04 -07:00
Brady Wetherington
b721a977c0 Fix PHP 7.4 deprecation warnings in ldap-sync script. 2020-08-24 21:35:00 -07:00
snipe
53c46ac8de Fixed stupid import layouts 2020-08-24 21:15:46 -07:00
snipe
3cba174dfb Merge pull request #8359 from snipe/fixes/misc_flysystem_fixes
Misc flysystem fixes
2020-08-24 19:28:40 -07:00
snipe
a90d2ba077 Fixed suppliers upload 2020-08-24 18:53:33 -07:00
snipe
e5dd6035b9 Fixed the other upload handleUploads signatures 2020-08-24 18:32:40 -07:00
snipe
66686f8080 Added some debugging - will remove at RC 2020-08-24 18:32:15 -07:00
snipe
041fc20955 Fixed Companies and Categories uploads 2020-08-24 15:43:11 -07:00
snipe
b97ff4e907 Fixed Depts uploads 2020-08-24 15:10:26 -07:00
snipe
232e3f30aa Fixed accessories “current image” path in edit form 2020-08-24 14:30:55 -07:00
snipe
5aeac3c9e0 Fixed parse error 2020-08-24 14:30:43 -07:00
snipe
0658f17359 Merge branch 'develop' of https://github.com/snipe/snipe-it into develop 2020-08-24 12:37:40 -07:00
snipe
bcad49ce79 Try to better handle slack “too many requests” issue 2020-08-14 16:10:22 -07:00
snipe
b5acca89d7 Check for admin for slack notifications 2020-08-14 16:02:15 -07:00
snipe
e52919cf1b Merge pull request #8327 from snipe/features/checkin_license_from_all_users
Checkin license from all users cli tool
2020-08-14 15:35:15 -07:00
snipe
29f3a5c48f Use more verbose annotation for Auth::user if/else 2020-08-14 15:27:40 -07:00
snipe
134e8e6fb9 Moved user email nulling until after the save 2020-08-14 15:25:07 -07:00
Brady Wetherington
714576be45 Merge pull request #8328 from snipe/fix_deprecation_report
Fix deprecation report for customers with many active assets
2020-08-14 15:24:03 -07:00
Brady Wetherington
fa291beaeb Merge pull request #8329 from snipe/fix_depreciation_report_v5
Fix deprecation report for customers with many active assets
2020-08-14 15:23:49 -07:00
Brady Wetherington
4b7f6a95e3 Fix deprecation report for customers with many active assets 2020-08-14 15:07:59 -07:00
Brady Wetherington
5128992940 Fix deprecation report for customers with many active assets 2020-08-14 15:03:03 -07:00
snipe
0291323502 Use the user as the target 2020-08-14 14:57:58 -07:00
Brady Wetherington
262a964760 [WIP] fix ldap-sync for v5 with AdLdap2 2020-08-14 14:45:05 -07:00
snipe
e0f6f9b839 Artisan command to check in licenses from all users 2020-08-14 14:43:37 -07:00
snipe
f1a6308002 Check for Auth::user before trying to log id (for cli) 2020-08-14 14:43:07 -07:00
Michael Pietsch
4f5374b2e8 enable use custom file based saml certificate/private key 2020-08-14 12:25:00 +02:00
snipe
19d8d7b146 Updated components and consumables to use storage facade 2020-08-12 13:02:54 -07:00
snipe
b999c50a2e Merge pull request #8316 from Godmartinz/bug/ch15028/missing-or-incorrect-error-message-translation
Looks great, thank you!
2020-08-12 12:37:47 -07:00
Godfrey M
e3906b245c added translation for admin/licenses/message.not_found 2020-08-12 12:27:18 -07:00
Brady Wetherington
9ca20e4964 Merge pull request #8313 from snipe/improve_ldap_search_error_reporting
Improve ldap search error reporting
2020-08-11 17:33:19 -07:00
Brady Wetherington
456a74d88c De-merge out incorrectly merged files. Whoops! 2020-08-11 16:41:20 -07:00
Brady Wetherington
799c059070 Add internationalized version of LDAP error message 2020-08-11 16:39:02 -07:00
Brady Wetherington
c62d43a778 Improve Exception management in Artisan LDAP Sync method. Still need to localize this better 2020-08-11 16:39:02 -07:00
Brady Wetherington
b725bd0fae Add @PeterUpfold as a contributor 2020-08-11 16:39:02 -07:00
snipe
09190e05ae Add @PeterUpfold as a contributor 2020-08-10 17:24:20 -07:00
Brady Wetherington
e0644dbbf6 Merge pull request #8105 from PeterUpfold/PeterUpfold-7661workaround
Propose workaround for #7661 — suppress E_DEPRECATED on ldap_control_paged_result()
2020-08-10 17:22:31 -07:00
snipe
5b6925b00c Removed debugging :( 2020-08-04 21:00:37 -07:00
snipe
df17a859bf Changed modal IDs so manager creation modal works on user creation main page 2020-08-04 20:59:54 -07:00
snipe
24c43056ba Moved pGenerator script to default layout footer
This fixes an issue where the password generator wouldn’t load in a modal in Chrome
2020-08-04 20:58:28 -07:00
snipe
4e0a9c7a94 Fart fix
I just…. don’t ask.
2020-08-03 12:35:34 -07:00
snipe
6a089f86f8 Fixed pathing for accessories 2020-08-03 11:17:56 -07:00
snipe
606b7e905d Small edits to PR template
Slight text changes to ask specifics about versions
2020-07-31 17:02:33 -07:00
snipe
d73ddad477 Created a PR template
First draft of the PR guidelines template
2020-07-31 16:59:26 -07:00
snipe
502b3c50a9 Fixed upload preview (fixed regression from #6736)
This change appears to have been stomped on in one of the merges. :(
2020-07-31 14:36:50 -07:00
snipe
9a39cf721e Merge pull request #8258 from ballertv/features/consumable-api
This looks great, thank you!
2020-07-31 12:18:49 -07:00
snipe
2bb5ac61a9 Add @sanjay900 as a contributor 2020-07-31 11:02:06 -07:00
snipe
3e62a6ea2d Merge branch 'develop' of https://github.com/snipe/snipe-it into develop 2020-07-31 11:01:35 -07:00
Brady Wetherington
7410b16835 Merge pull request #8270 from snipe/improve_ad_useraccountcontrol_v4
Add new useraccountcontrol value for valid AD users
2020-07-24 16:22:44 -07:00
andres
8994f3e15e cleanup 2020-07-22 19:57:06 -04:00
andres
d23f1a77ca implement checkout API 2020-07-22 19:56:31 -04:00
snipe
e955c983a3 Merge pull request #8250 from snipe/features/adds_addr_city_state_to_importer
Added address, city, state and country to importer and city to bulk editor
2020-07-22 13:43:29 -07:00
Brady Wetherington
b09e7d19b3 Add new useraccountcontrol value for valid AD users; document algorithm and values 2020-07-22 13:32:16 -07:00
snipe
2fa17ac185 Merge pull request #8254 from Godmartinz/gmartinez_adds_email_formats
Added firstinitial.lastname, lastname_firstinitial, firstnamelastname…
2020-07-22 12:06:31 -07:00
Godfrey Martinez
3b1e46f72b Update general.php 2020-07-22 11:25:57 -07:00
Godfrey Martinez
0c1a1de2a2 Update general.php
fixed typo
2020-07-22 11:24:36 -07:00
Godfrey M
20c9ae5818 Added firstinitial.lastname, lastname_firstinitial, firstnamelastname and firstnamelastinitial to username formats 2020-07-22 10:21:19 -07:00
snipe
eed41e4549 Moved address down further, fixed broken HTML 2020-07-21 16:57:32 -07:00
snipe
b750f4754f Added city to bulk user importer 2020-07-21 16:49:54 -07:00
snipe
c17a06792a Added address, city, state, country to user importer 2020-07-21 16:49:38 -07:00
snipe
4f76cc6cfb I don’t actually know what this file is for 2020-07-21 16:46:13 -07:00
snipe
b905154373 Fixed #8247 - added notes field to user details display 2020-07-20 14:29:32 -07:00
snipe
daf748e531 Bumped hash 2020-07-17 12:32:01 -07:00
snipe
799a93c46a Allow for email/username search on users 2020-07-17 12:11:32 -07:00
snipe
34aa12e229 Merge pull request #8239 from snipe/fixes/api_rtd_to_location_on_create
Set location_id to rtd_location_id on asset creation
2020-07-16 17:44:13 -07:00
snipe
897757bd04 Removed added line for location 2020-07-16 17:43:44 -07:00
snipe
c7125c3937 Set location_id to rtd_location_id on asset creation 2020-07-16 16:34:39 -07:00
snipe
0238c88a3e Merge pull request #8228 from snipe/fix_select2_ajax_pulldowns_v5
Fix Select2 'infinite scroll' drop-downs for Snipe-IT v5
2020-07-16 15:37:42 -07:00
Brady Wetherington
145dfe5847 Rebuild assets 2020-07-16 15:36:10 -07:00
Brady Wetherington
68263ff806 Changed selectlist results to be 'items' for internal consistency 2020-07-16 15:33:38 -07:00
snipe
81a6332889 Removed license ID from seats table cookie info
This typically wouldn’t be necessary, since most people would want to view the same *types* of data across licenses
2020-07-14 13:55:38 -07:00
snipe
6e563f6e4b Merge branch 'master' of https://github.com/snipe/snipe-it 2020-07-13 21:16:54 -07:00
snipe
5320f5c67c Disallow non-super users from editing their own permissions 2020-07-13 21:16:45 -07:00
snipe
7f69ae953b Merge pull request #8227 from snipe/fix_select2_ajax_pulldowns
Changes how we do AJAX calls via Select2 for dynamic drop-down menus
2020-07-13 21:16:00 -07:00
Brady Wetherington
17f6fbabfa Switch to 'items' to maintain compatbility with other internal API's 2020-07-13 21:12:03 -07:00
Brady Wetherington
318da67230 Fix Select2 'infinite scroll' drop-downs for Snipe-IT v5 2020-07-13 17:43:15 -07:00
snipe
c79f8c1baf Merge pull request #8207 from EDVLeer/patch-1
Update snipeit.sh
2020-07-13 17:42:16 -07:00
Brady Wetherington
e7a820f7c9 Changes how we do AJAX calls via Select2 for dynamic drop-down menus 2020-07-13 17:14:31 -07:00
snipe
9c9fc2754c Merge pull request #8226 from inietov/fixes/edit_asset_error_php74
Change the form input name for serials in the view
2020-07-13 12:59:28 -07:00
Ivan Nieto
8fd4529fad Change the form input name for serials in the view 2020-07-13 13:49:21 -05:00
snipe
12c92e30b7 Show whether or not the user was imported via LDAP in the view page 2020-07-10 16:21:27 -07:00
snipe
5b02cfade4 Merge pull request #8220 from sean-borg/sean/expected-checkin-dates
This looks great, thanks!
2020-07-10 13:07:15 -07:00
snipe
fd10b755b0 Removed the sr-only tag in table headers
It was breaking Bootstrap Tables column selector :(
2020-07-10 11:30:01 -07:00
Sean Borg
567a9639f4 Enhanced #5762 Able to bulk edit expected checkin date
In light of the need to edit 500+ devices #5762 (comment)
I added the expected checkin date to the bulk edit page for assets
2020-07-10 19:21:34 +01:00
Sean Borg
7a433f8598 Updated purchase date format in hardware/bulkedit
The Purchase date box in hardware/bulkedit was a different style
to the normal hardware/{id}/edit

It also prevents a strange bug I see in firefox when clicking the old datepicker
it presented 2 datepicker boxes
2020-07-10 19:21:22 +01:00
Sean Borg
3d8823ede5 Added #5762 Modify expected checkin dates
It is now possible to edit expected checkin dates for assets in Actions > Edit Asset
2020-07-10 19:21:04 +01:00
snipe
dbbb7680d9 A few more fixes for the cli
Do not check out a piece of software if it’s already been checked out to the user
2020-07-09 21:12:50 -07:00
snipe
cf0dd5bbad Small fixes for cli tool 2020-07-09 20:43:13 -07:00
snipe
25e53d8c7f Merge pull request #8216 from snipe/features/checkout_license_to_all_users
Added CLI tool to checkout license to all users
2020-07-09 20:27:01 -07:00
snipe
89d433b41a Removed duplicate seat call 2020-07-09 20:26:02 -07:00
snipe
e2570ada6f CLI tool to checkout a license to ALL users 2020-07-09 20:04:05 -07:00
snipe
45afe725a1 Only try to get the company if there is an auth’d user
(Needed for command line tools, where no Auth::user() is present)
2020-07-09 20:03:47 -07:00
EDVLeer
536401fe0f Update snipeit.sh
Ubuntu 20.04
2020-07-07 08:21:36 +02:00
snipe
ec6ed256fb Bumped minor version 2020-07-06 18:45:43 -07:00
snipe
2aaa7bed2d Merge pull request #8183 from snipe/features/merge_users
Added merge utility
2020-06-25 18:37:41 -07:00
snipe
cc9f1577a4 Removed unused use directives 2020-06-25 17:43:53 -07:00
snipe
ab1fe8be0c Added merge utility 2020-06-25 17:42:39 -07:00
snipe
339bdddc38 Fix for Vue js not loading due to CSP :( 2020-06-25 11:00:33 -07:00
snipe
35b9cf4b70 Fixed missing db prefix on scopeDueOrOverdueForAudit 2020-06-23 02:41:59 -07:00
snipe
7ccb41371e Removed unoptimized images directive
securityheaders.com is claiming it’s onrecognized, even though I got that directive from their site, so… whatever. ¯\_(ツ)_/¯
2020-06-23 01:09:39 -07:00
snipe
2e60a457bf Dumb fix for feature-policy being dumb. 2020-06-23 01:07:00 -07:00
snipe
2390d2160b Merge pull request #8164 from snipe/features/additional_security_headers
Additional security headers
2020-06-23 00:27:47 -07:00
snipe
00b051b8c7 Added a few more comments 2020-06-23 00:26:09 -07:00
snipe
05b3a9ad7e Config variable for HSTS 2020-06-22 23:17:27 -07:00
snipe
4fb880384f Changed comment 2020-06-22 22:37:14 -07:00
snipe
43042ad841 Consolidated ReferrerPolicy into new SecurityHeaders file 2020-06-22 22:35:59 -07:00
snipe
a716382ac4 Removed CSP middleware (it’s added in the general header) 2020-06-22 22:33:37 -07:00
snipe
36c8f7f4f1 Additional security headers 2020-06-22 22:31:01 -07:00
snipe
b42801f6ae Merge pull request #8163 from snipe/fixes/fix-for-css-on-column-selector
Fixed weird padlock display in asset listing with encrypted custom fields
2020-06-22 20:47:35 -07:00
snipe
946129f206 Made quote style consistent 2020-06-22 20:45:20 -07:00
snipe
b941ef1e08 Pulled CSS font awesome styles out of the blade and into overrides.css 2020-06-22 20:41:40 -07:00
snipe
d1aa11ec89 Fix for weird padlock display in asset listing with encrypted custom fields 2020-06-22 20:29:19 -07:00
snipe
de4934f21d Merge pull request #8162 from Godmartinz/godfreymartinez-ghi-font-size-of-qr_text
Fixed #8161 and #8114 - font-size for labels used static values in blade instead of using values from settings
2020-06-22 17:28:38 -07:00
Godfrey M
b10076b015 corrected an error where font-size for labels were static in settings. 2020-06-22 17:04:39 -07:00
snipe
af06e42056 Bumped version 2020-06-17 11:17:25 -07:00
snipe
9a2440dc4b Merge pull request #8141 from snipe/fixes/better_handling_when_license_is_invalid
Better handle the logic to determine if we should display the license checkout blade [ch13792]
2020-06-16 20:20:07 -07:00
snipe
2ac1c1636c Better handle the logic to determine if we should display the license checkout blade 2020-06-16 16:12:57 -07:00
snipe
a7eb89f6b6 Misc fixes for flysystem paths 2020-06-16 16:06:25 -07:00
Peter Upfold
004ecad059 Force suppress deprecation warning on ldap_control_paged_result() 2020-06-03 08:59:50 +01:00
snipe
1267c68f28 Removed barcodes from S3 uploader
Signed-off-by: snipe <snipe@snipe.net>
2020-05-28 19:56:18 -07:00
snipe
262eb79471 WIP - this needs refactoring
We have to use Storage::get() if the filesystem is local, since the method does a file_get_contents() and the file isn’t accessible via a URL since it’s private and doesn’t live on the web root. (We do this slightly differently than Laravel out of the box)

Signed-off-by: snipe <snipe@snipe.net>
2020-05-28 01:59:01 -07:00
snipe
7a785b4952 Updated a few flysystem settings
Signed-off-by: snipe <snipe@snipe.net>
2020-05-28 01:54:29 -07:00
snipe
beae8efb21 Merge pull request #8088 from Godmartinz/Label_Woes
Barcode resizing and text adjustment
2020-05-27 23:01:33 -07:00
snipe
3c0a6292c4 Clarified env example with flysystem examples
Signed-off-by: snipe <snipe@snipe.net>
2020-05-27 22:47:53 -07:00
snipe
8ccc1c6515 Fixed weird merge in Bulk Users Controller
Signed-off-by: snipe <snipe@snipe.net>
2020-05-27 22:46:42 -07:00
Godfrey M
9839e5e566 adjusted for all label text, removed local variable 2020-05-27 12:27:40 -07:00
snipe
d54acd908c Made logo file have a better name for multiple tries in the same day
Signed-off-by: snipe <snipe@snipe.net>
2020-05-27 02:31:04 -07:00
snipe
42fe1ea398 Set public files specifically to public
Signed-off-by: snipe <snipe@snipe.net>
2020-05-27 02:30:43 -07:00
snipe
bb062b20a1 Switched env to public
Signed-off-by: snipe <snipe@snipe.net>
2020-05-27 02:30:30 -07:00
snipe
a93810e301 Updated example config
Signed-off-by: snipe <snipe@snipe.net>
2020-05-27 00:39:28 -07:00
snipe
d14ab7e3e1 Porting change from #8053 to master
Signed-off-by: snipe <snipe@snipe.net>
2020-05-27 00:22:44 -07:00
snipe
f137c1ca09 Merge pull request #8044 from snipe/flysystem_tweaks
Tweak to Flysystem's filesystems.php to make it work with Snipe-IT
2020-05-27 00:22:28 -07:00
snipe
f196b5bd94 Merge pull request #8077 from dmeltzer/more-paving
Sync paveit command with new database tables.
2020-05-26 21:18:22 -07:00
snipe
e0d9cc4e73 Merge pull request #8053 from CharlotteDunoisLabs/fix-gravatar
Take gravatar email into account in presenter
2020-05-26 19:58:45 -07:00
snipe
5b4e4c8dcd Merge pull request #8061 from Godmartinz/develop
fixed a table header error
2020-05-26 19:52:14 -07:00
snipe
dee1f5ec35 Merge pull request #8078 from dmeltzer/wrong-id
Fix incorrectly named parameter.
2020-05-26 19:51:38 -07:00
snipe
850bfc40d4 Merge pull request #8079 from dmeltzer/misc-fixes
Misc fixes
2020-05-26 19:50:39 -07:00
Godfrey M
e7f74d94c1 Label_Woes 2020-05-26 17:22:45 -07:00
Godfrey M
e97cf011b6 Label_Woes 2020-05-26 17:15:39 -07:00
Godfrey M
ed23505054 Label_Woes 2020-05-26 17:10:45 -07:00
Daniel Meltzer
b3fe47bfa7 Remove/Reorganize logic to make codacy happier. 2020-05-23 15:24:10 -04:00
Daniel Meltzer
1e5d40f32e Clean up extra code in notifications files. 2020-05-23 15:24:10 -04:00
Daniel Meltzer
f0546bf689 Clean up Transformers and extract an isDeletable() method to models where it makes sense. 2020-05-23 15:24:10 -04:00
Daniel Meltzer
136df9418f Deadcode-- 2020-05-23 15:24:10 -04:00
Daniel Meltzer
7ea862787c Refactor controller to use one method that shows all modals based on name. 2020-05-23 15:24:00 -04:00
Daniel Meltzer
25d6ceee6e Remove old code. 2020-05-23 12:18:27 -04:00
Daniel Meltzer
4fef065010 Refactor big switch to lookup in array. A bit cleaner/codacy happier. 2020-05-23 12:17:56 -04:00
Daniel Meltzer
fe74394ae6 Short circuit checkout logic to prevent iterating if we're not checking out to an asset 2020-05-23 11:48:02 -04:00
Daniel Meltzer
7a76cb08a0 We accept xlsx in uploads 2020-05-23 11:36:47 -04:00
Daniel Meltzer
c70bd62a0f Missing includes. Fix by using the request object instead of facade. 2020-05-23 11:36:16 -04:00
Daniel Meltzer
ad1db2c640 Fix incorrectly named parameter. 2020-05-23 10:26:56 -04:00
Daniel Meltzer
2e936a9883 Sync paveit command with new database tables. 2020-05-23 09:08:32 -04:00
snipe
3db4480bba Merge pull request #8062 from dmeltzer/fix-modal-select-html
Fix Missing Category selection in Asset Model Modal dialog.
2020-05-20 10:24:20 -07:00
snipe
001e721530 Merge pull request #8063 from dmeltzer/backport-8092
BACKPORT: Fix Missing Category selection in Asset Model Modal dialog - [ch14635]
2020-05-20 10:21:52 -07:00
Daniel Meltzer
8210da6e82 Fix Missing Category selection in Asset Model Modal dialog.
A select html tag needs a full closing tag. is not valid. This was causing the select2 js to barf and eat additional information.
2020-05-20 10:29:27 -04:00
Daniel Meltzer
6a80f95769 Fix Missing Category selection in Asset Model Modal dialog.
A select html tag needs a full closing tag.  <select /> is not valid.
This was causing the select2 js to barf and eat additional information.
2020-05-20 10:23:04 -04:00
Godfrey M
edd4797178 fixed a table header error 2020-05-19 16:59:09 -07:00
snipe
f88683766b Roll back previous change
Signed-off-by: snipe <snipe@snipe.net>
2020-05-14 00:55:47 -07:00
snipe
e4385c0f8c Fixes #8051 regression
Signed-off-by: snipe <snipe@snipe.net>
2020-05-14 00:48:30 -07:00
Charlotte Dunois
7f8c6fe282 Take gravatar email into account in presenter 2020-05-13 20:30:47 +02:00
snipe
8cc9e61983 Ugh
Sorry, my local testing environment is fscked right now :(

Signed-off-by: snipe <snipe@snipe.net>
2020-05-12 20:38:32 -07:00
snipe
c5560e466e Removed fieldset from test
Signed-off-by: snipe <snipe@snipe.net>
2020-05-12 20:17:35 -07:00
snipe
157a2ee869 Merge pull request #8048 from dmeltzer/license-importer-checkout-fix
License importer checkout fixes
2020-05-12 13:51:36 -07:00
snipe
de7ee40863 Fixed failing test
Signed-off-by: snipe <snipe@snipe.net>
2020-05-12 11:52:08 -07:00
Daniel Meltzer
a6f90cb3fc Assorted licenses UI fixes while testing.
* Rename licenses route checkin parameter to clarify it's purpose and
fix incorrect route in users view page.
* Checkin note can be nullable for checking in a license.
* License Seat view was only showing 20 license seats due to faulty
transformer logic.
2020-05-12 14:38:21 -04:00
Daniel Meltzer
1321304720 Importer UI: Removed misleading checked out to field. Add full name and asset tag fields to licenses. 2020-05-12 14:38:21 -04:00
Daniel Meltzer
e4888b23e2 Save User ID when checking out a license. Also buff up importing tests to confirm license can be checked out. 2020-05-12 14:38:20 -04:00
snipe
274f82893f Regenerate session ID on logout
Signed-off-by: snipe <snipe@snipe.net>
2020-05-12 10:38:00 -07:00
snipe
0550fe0ffa Fix for session fixation vulnerability
Signed-off-by: snipe <snipe@snipe.net>
2020-05-12 10:31:54 -07:00
snipe
730632e2eb Apply PR #8043 to develop
Signed-off-by: snipe <snipe@snipe.net>
2020-05-11 22:57:55 -07:00
snipe
7fb3a9b82c Merge pull request #8043 from snipe/features/backup-optional-in-import-and-ldap
Added option to disable backup in import
2020-05-11 22:41:36 -07:00
Brady Wetherington
b03f8a2425 Tweak to Flysystem's filesystems.php to make it work with Snipe-IT 2020-05-11 21:41:56 -07:00
snipe
ecb1e87fe6 Updated assets
Signed-off-by: snipe <snipe@snipe.net>
2020-05-11 20:45:15 -07:00
snipe
f43df5f041 Fixed form label
Signed-off-by: snipe <snipe@snipe.net>
2020-05-11 20:44:46 -07:00
snipe
95cc48e422 Added option to disable backup in import
Signed-off-by: snipe <snipe@snipe.net>
2020-05-11 20:41:10 -07:00
snipe
9a2ed804ca Fixed mismatched HTML header tags
Signed-off-by: snipe <snipe@snipe.net>
2020-05-11 20:28:42 -07:00
snipe
d20fad28e5 Use more modern request helper
Signed-off-by: snipe <snipe@snipe.net>
2020-05-11 20:28:24 -07:00
snipe
ae813ddf75 Add @alek13 as a contributor 2020-05-11 18:11:16 -07:00
snipe
bb42109c0c Added a clarifying comment
Signed-off-by: snipe <snipe@snipe.net>
2020-05-11 18:10:45 -07:00
snipe
f46ecf8ec0 Updated composer lock
Signed-off-by: snipe <snipe@snipe.net>
2020-05-11 18:07:20 -07:00
snipe
b9e821c0e6 Small fix for Group Functional Tests
Signed-off-by: snipe <snipe@snipe.net>
2020-05-11 18:07:14 -07:00
snipe
9ee28c7513 Switched to use info instead of danger on undeployable statuses
Signed-off-by: snipe <snipe@snipe.net>
2020-05-11 18:07:02 -07:00
snipe
1a8ba06702 Merge branch 'master' of https://github.com/snipe/snipe-it 2020-05-11 17:53:32 -07:00
snipe
0fd232e70d Fixed group functional test
(We had changed the minimum to 2 instead of 3)

Signed-off-by: snipe <snipe@snipe.net>
2020-05-11 17:53:24 -07:00
snipe
ee4d69b1c5 Merge pull request #8041 from alek13/patch-1
use supported package for slack
2020-05-11 17:52:45 -07:00
snipe
d22be8ee0e Merge pull request #8036 from johnson-yi/features/saml_auth
Additional updates/fixes for saml
2020-05-11 17:04:37 -07:00
Alexander Chibrikin
d1ad111949 use supported package for slack
see https://github.com/maknz/slack/issues/94
2020-05-11 20:31:13 +03:00
Johnson Yi
572185ac96 Revised how saml sp info is displayed 2020-05-09 09:44:51 +10:00
Johnson Yi
3d8fce50d0 Removed unnecessary default saml settings 2020-05-09 01:51:48 +10:00
snipe
6018a9c6ee Add @johnson-yi as a contributor 2020-05-06 19:21:56 -07:00
snipe
c3d8024e1f Merge pull request #8023 from johnson-yi/features/saml_auth
Added #542: add saml authentication
2020-05-06 17:28:30 -07:00
Johnson Yi
c1c37d521c Allow downloading sp metadata without idp 2020-05-06 19:50:50 +10:00
Johnson Yi
b2930d6069 Added #542: add saml authentication 2020-05-06 00:06:19 +10:00
snipe
8ecb7969df Fixed incorrect route for saving groups
Signed-off-by: snipe <snipe@snipe.net>
2020-05-01 01:26:15 -07:00
snipe
31c5350941 Fixed incorrect route for groups edit
Signed-off-by: snipe <snipe@snipe.net>
2020-05-01 01:05:48 -07:00
snipe
85712a1960 Only override fieldset_id with custom_fieldset_id if it’s present
This is mostly to support prior versions. I have NFC why we did this in the first place. I’m sure I had a stellar reason, but couldn’t tell you what it is today.

Signed-off-by: snipe <snipe@snipe.net>
2020-04-30 20:59:42 -07:00
snipe
e9cb17394c Small validation fix on reset password
Signed-off-by: snipe <snipe@snipe.net>
2020-04-30 19:10:07 -07:00
snipe
8507bcd16b Merge pull request #8008 from dmeltzer/component-checkinout-fixes
Component checkout/checkin fixes.
2020-04-30 17:49:22 -07:00
snipe
e47c44d055 Merge pull request #8007 from dmeltzer/permissions-form-cleanup
Permissions edit cleanups.
2020-04-30 17:48:24 -07:00
snipe
b488cffc7e Merge pull request #8006 from dmeltzer/api-test-fixes
Test fixes pt 2.
2020-04-30 17:46:25 -07:00
snipe
8bb3c01f78 Addressed merge issue for reset password for #7997
Signed-off-by: snipe <snipe@snipe.net>
2020-04-30 17:45:05 -07:00
snipe
82e02490fd Removed duplicate update method (per #7997)
Signed-off-by: snipe <snipe@snipe.net>
2020-04-30 17:23:56 -07:00
Daniel Meltzer
bfba30058c Fix incorrect routing. 2020-04-30 10:35:26 -04:00
Daniel Meltzer
debdccf5f1 Remove old help text translation that doesn't exist any more 2020-04-30 10:35:11 -04:00
Daniel Meltzer
441049d8ac Sort license seats by their number only, making the sort order more logical 2020-04-30 10:34:30 -04:00
Daniel Meltzer
b28a4f3108 Add component unit test and unify some validation. 2020-04-30 09:50:12 -04:00
Daniel Meltzer
68224757f4 Validate when editing the quantity of a component that the new quantity is > the amount checked out 2020-04-29 13:25:04 -04:00
Daniel Meltzer
358609720a Component checkout/checkin fixes.
- Provide proper translated messages for checkin vs checkout
- Pass appropriate methods to the Checkout event, fixes an error on
checkin.
- Default to a value of 1 on checkin in UI to save a click sometimes.
2020-04-29 12:50:09 -04:00
Daniel Meltzer
42e1e9a0bd Permissions edit cleanups.
- Make each section of permissions it's own tbody for better styling
- Remove extra separators when theres nothing to separate
- Vertically center radio buttons in header rows.

Still on the ideal list:
 - Unify code between users and groups into one partial with
conditionals.
 - Sticky header row or put the header row in each section.
2020-04-29 12:33:50 -04:00
Daniel Meltzer
1f8c3cc670 Test fixes. 2020-04-29 11:03:07 -04:00
Daniel Meltzer
f8d18a8eb0 Revert asset-checkout-different validation.
This was causing issues when trying to check an item out to a user or a
location because of the way laravel handles validation.

Instead, rely on the exception check we had in the controller.  I moved
this exception up to the model checkout method so that it would work
for anywhere that that method was called, even if it avoided the
controller.
2020-04-29 10:59:00 -04:00
snipe
c34650458f Merge pull request #8003 from dmeltzer/test-fixes
Test fixes
2020-04-28 16:33:51 -07:00
Daniel Meltzer
c65b8f97bb Laravel 6 drops support for php7.1, add php7.4 instead. 2020-04-28 12:16:37 -04:00
Daniel Meltzer
61a216a531 Rearrange seeder order so that users validate properly on first seed run. This hopefully fixes the actionlog seeder error. 2020-04-28 12:14:23 -04:00
Daniel Meltzer
3e7fbb02b7 Notes and style cleanups 2020-04-28 11:44:17 -04:00
Daniel Meltzer
9520ccae47 Unit test fix. Cleaner this way. 2020-04-28 11:39:53 -04:00
Daniel Meltzer
05187eb27f Fix Functional Tests. 2020-04-28 11:39:53 -04:00
Daniel Meltzer
bb50828ca0 Remove General serial field now that the serial is part of the multi asset creation. 2020-04-28 11:39:53 -04:00
Daniel Meltzer
c74b904f14 Fix Location parent different validation on new location creation. 2020-04-28 11:39:52 -04:00
Daniel Meltzer
82de51f23e Some unittest fixes for local running adapting to various factory changes. 2020-04-28 11:39:52 -04:00
snipe
c2f1fd4942 Make user form a little nicer looking
Signed-off-by: snipe <snipe@snipe.net>
2020-04-28 00:01:47 -07:00
snipe
412caebf69 Fixed logo uploads
Signed-off-by: snipe <snipe@snipe.net>
2020-04-27 23:22:52 -07:00
snipe
3613da3685 Fixed dashboard boxes
Signed-off-by: snipe <snipe@snipe.net>
2020-04-27 23:05:04 -07:00
snipe
b433b49469 Ficing webpack, CSS and JS (*whew* that sucked)
Signed-off-by: snipe <snipe@snipe.net>
2020-04-27 22:41:33 -07:00
snipe
72a1616b3c Removed wonky assets
Signed-off-by: snipe <snipe@snipe.net>
2020-04-27 21:02:42 -07:00
snipe
f172747495 Handle parse error in custom fields edit per #7997
Signed-off-by: snipe <snipe@snipe.net>
2020-04-27 19:36:07 -07:00
snipe
6427f46a6b Removed mix (switched to url()) for now until assets are fixed
Signed-off-by: snipe <snipe@snipe.net>
2020-04-27 19:35:21 -07:00
snipe
b76b97d89b Fix path in seeder
Signed-off-by: snipe <snipe@snipe.net>
2020-04-27 18:17:44 -07:00
snipe
6847a331a7 Backport the column icon fix from master
Signed-off-by: snipe <snipe@snipe.net>
2020-04-24 05:55:38 -07:00
snipe
7eb70e17e0 Merge pull request #7993 from snipe/fixes/7989_column_selector
Fixed #7989 - Converted table heading icons in People to CSS glyphs
2020-04-24 04:50:37 -07:00
snipe
3dfcb46991 Minor formatting changes
Signed-off-by: snipe <snipe@snipe.net>
2020-04-24 04:41:08 -07:00
snipe
96eb96f964 Removed stray val (typo)
Signed-off-by: snipe <snipe@snipe.net>
2020-04-24 04:27:00 -07:00
snipe
a2f08bd3ba Added comments
Signed-off-by: snipe <snipe@snipe.net>
2020-04-24 04:08:54 -07:00
snipe
e009fbe59f Converted table heading icons in People to CSS glyphs
Signed-off-by: snipe <snipe@snipe.net>
2020-04-24 04:04:53 -07:00
snipe
5bb4f271aa Fixed #7987 - allow toggle of required/optional in custom fields/fieldsets
Signed-off-by: snipe <snipe@snipe.net>
2020-04-24 00:47:19 -07:00
snipe
bea3a7b982 Fixed #7987 - allow toggle of required/optional in custom fields/fieldsets
Signed-off-by: snipe <snipe@snipe.net>
2020-04-24 00:39:32 -07:00
snipe
88d39b4287 Updated generated assets
Signed-off-by: snipe <snipe@snipe.net>
2020-04-23 22:46:41 -07:00
snipe
f66ce02756 Added debugging logs
Signed-off-by: snipe <snipe@snipe.net>
2020-04-23 22:46:02 -07:00
snipe
c7b300a50d Updated LDAP sync controller to use new Adldap2 connections
Signed-off-by: snipe <snipe@snipe.net>
2020-04-23 22:45:44 -07:00
snipe
44962d1eb9 Switched to use Primary button
Signed-off-by: snipe <snipe@snipe.net>
2020-04-23 22:44:48 -07:00
snipe
e69461d797 Cleaned up LDAP sync blade
Signed-off-by: snipe <snipe@snipe.net>
2020-04-23 22:44:28 -07:00
snipe
796e693dda Removed duplicate signature padd css files
Signed-off-by: snipe <snipe@snipe.net>
2020-04-23 22:44:17 -07:00
snipe
c9ed205bb0 Added @throws to documentation
Signed-off-by: snipe <snipe@snipe.net>
2020-04-23 14:41:37 -07:00
snipe
b01e8720dc Fixed ldap settings JS error
Signed-off-by: snipe <snipe@snipe.net>
2020-04-23 14:41:20 -07:00
snipe
e9135eceb3 Better json formatting
Signed-off-by: snipe <snipe@snipe.net>
2020-04-22 11:16:31 -07:00
snipe
c50b81ff19 Added resources
Signed-off-by: snipe <snipe@snipe.net>
2020-04-22 07:15:24 -07:00
snipe
b5cc845216 Removed vendor.js from setup blade
Signed-off-by: snipe <snipe@snipe.net>
2020-04-22 07:15:12 -07:00
snipe
599cf23d63 Added icheck icons to resources
Signed-off-by: snipe <snipe@snipe.net>
2020-04-22 07:14:23 -07:00
snipe
b0d848caec Updated wedbpack to only pull from resources or node_modules
Signed-off-by: snipe <snipe@snipe.net>
2020-04-22 07:13:32 -07:00
snipe
94e8343f63 Generated skins in css/dist/skins
Signed-off-by: snipe <snipe@snipe.net>
2020-04-22 07:13:09 -07:00
snipe
cdd0e405be Fixed weird merge
Signed-off-by: snipe <snipe@snipe.net>
2020-04-22 07:12:29 -07:00
snipe
eb8c20880a Updated package.json
Signed-off-by: snipe <snipe@snipe.net>
2020-04-22 07:12:12 -07:00
snipe
af6dc0068b Updated node, set min requirement
Signed-off-by: snipe <snipe@snipe.net>
2020-04-22 07:12:00 -07:00
snipe
a160da6619 Removed unused styles
Signed-off-by: snipe <snipe@snipe.net>
2020-04-22 07:11:38 -07:00
snipe
3435485a46 Updated path to skin css
Signed-off-by: snipe <snipe@snipe.net>
2020-04-22 06:41:19 -07:00
snipe
3a446e6396 Updated variables.less with additional values
Signed-off-by: snipe <snipe@snipe.net>
2020-04-22 06:40:27 -07:00
snipe
b725e788ec Applied new selectlist search to locations
Signed-off-by: snipe <snipe@snipe.net>
2020-04-22 06:39:41 -07:00
snipe
fa5134603f Added type casting and a few more validation rules
Signed-off-by: snipe <snipe@snipe.net>
2020-04-22 06:37:40 -07:00
snipe
a44d1cc0cf Fixed iCheck
Signed-off-by: snipe <snipe@snipe.net>
2020-04-22 06:02:55 -07:00
snipe
69a1732245 Removed duplicate form request in asset models controller
Signed-off-by: snipe <snipe@snipe.net>
2020-04-22 03:51:10 -07:00
snipe
7e9e5214ef Fixed status label create error
Signed-off-by: snipe <snipe@snipe.net>
2020-04-22 03:50:43 -07:00
snipe
e1784394b3 Moved js, skins and primary CSS into dist directory
Signed-off-by: snipe <snipe@snipe.net>
2020-04-22 03:39:42 -07:00
snipe
edc29bf6d5 Moved font-awesome fonts to make life easier
Signed-off-by: snipe <snipe@snipe.net>
2020-04-22 03:33:14 -07:00
snipe
6103524ebc Moved skins into css/dist directory
Signed-off-by: snipe <snipe@snipe.net>
2020-04-22 03:32:52 -07:00
snipe
2db527f4d2 Removed CSS skins (these are generated in the css dir)
Signed-off-by: snipe <snipe@snipe.net>
2020-04-22 03:27:51 -07:00
snipe
60851c2eb2 Fixed AssetsController namespace in route
Signed-off-by: snipe <snipe@snipe.net>
2020-04-22 03:15:54 -07:00
snipe
905fb09c5b Removed unused light skins 2020-04-22 01:56:22 -07:00
snipe
82b6d2b31b Fixed a few more tests 2020-04-21 21:13:00 -07:00
snipe
c5e587f33b Added codeception testing modules for —dev 2020-04-21 20:15:45 -07:00
snipe
7a33e335d4 Fixes PSR autoloading issue 2020-04-21 20:15:24 -07:00
snipe
bbc2ac2f9d Updated tests with new location.id!=location.parent_id rule 2020-04-21 19:51:42 -07:00
snipe
c02adace61 Ensure at the model level that location.id/user.id and location.parent_id/user.manager_id cannot be the same 2020-04-21 19:51:20 -07:00
snipe
5dc64ea91b Re-added EasySlugger to fix tests 2020-04-21 19:28:24 -07:00
snipe
1c5486e588 Updated test method for newer codeception from assertContains to assertStringContainsString 2020-04-21 19:28:06 -07:00
snipe
05e9861b71 Checkin/checkout fixes 2020-04-21 11:28:31 -07:00
snipe
cff2a65f62 Fixed broken if/else in view from bad merge 2020-04-21 11:13:29 -07:00
snipe
7a6ca5cb40 Tempt fix for css weirdness
TODO: figure out why overrides isn’t being compiled into css/dist/all.css
2020-04-21 11:03:32 -07:00
snipe
63259418b2 Package updates 2020-04-21 10:43:25 -07:00
snipe
1d8c3a73ea Use non-min version of skin until we can get the other webpack stuff sorted 2020-04-21 10:43:04 -07:00
snipe
e786ef8290 Pull branding back to develop normal 2020-04-21 10:42:37 -07:00
snipe
64b0dbdafe Fixed mismatched html tag 2020-04-21 10:42:09 -07:00
snipe
381d2369b6 Updated CSS assets 2020-04-21 06:33:44 -07:00
snipe
29b05d2020 Fixed syntax error in image upload request from mangled merge 2020-04-21 06:29:57 -07:00
snipe
c38bbfc8bd Removed title from more info link 2020-04-21 06:29:34 -07:00
snipe
be446eedb0 Updated html styles on settings index 2020-04-21 06:29:08 -07:00
snipe
dc6e329d96 Fixed name in comments 2020-04-21 06:18:24 -07:00
snipe
72b3228d82 Fixed HTML tags 2020-04-21 06:15:31 -07:00
snipe
f6446bae79 Bumped vendor libraries 2020-04-21 04:34:11 -07:00
snipe
aaaf5f8b42 Missed a mismatched h2 2020-04-21 04:23:53 -07:00
snipe
4fe32e1c9c Fixed broken h2 tag 2020-04-21 04:22:09 -07:00
snipe
066e5588b5 Fixed slugging in custom fields to no longer use old library 2020-04-21 04:14:23 -07:00
snipe
c17106d1b3 Fixes for settings controller 2020-04-21 04:08:25 -07:00
snipe
cb71bcc4af Switch to old() helper 2020-04-21 03:58:31 -07:00
snipe
58f6b2da5a Fixing assets 2020-04-21 03:42:35 -07:00
snipe
b670371e0b Ugggh… fixing a donked merge 2020-04-21 03:30:21 -07:00
snipe
f532e9b462 Fixing assets :(
Not sure what happened in tbis merge exactly
2020-04-21 03:07:11 -07:00
snipe
3cb4672ffe Updated composer 2020-04-21 02:47:12 -07:00
snipe
87464e6ec0 Merge branch 'develop' into integrations/2020-04-15-v5-merge
# Conflicts:
#	README.md
#	app/Http/Controllers/AccessoriesController.php
#	app/Http/Controllers/Api/AssetsController.php
#	app/Http/Controllers/Api/LicensesController.php
#	app/Http/Controllers/Api/LocationsController.php
#	app/Http/Controllers/Api/SettingsController.php
#	app/Http/Controllers/Api/UsersController.php
#	app/Http/Controllers/AssetModelsController.php
#	app/Http/Controllers/Assets/AssetsController.php
#	app/Http/Controllers/Auth/ForgotPasswordController.php
#	app/Http/Controllers/CategoriesController.php
#	app/Http/Controllers/CompaniesController.php
#	app/Http/Controllers/ComponentsController.php
#	app/Http/Controllers/ConsumablesController.php
#	app/Http/Controllers/CustomFieldsetsController.php
#	app/Http/Controllers/DepartmentsController.php
#	app/Http/Controllers/LicensesController.php
#	app/Http/Controllers/LocationsController.php
#	app/Http/Controllers/ManufacturersController.php
#	app/Http/Controllers/SettingsController.php
#	app/Http/Controllers/SuppliersController.php
#	app/Http/Controllers/UsersController.php
#	app/Http/Requests/AssetRequest.php
#	app/Http/Requests/ImageUploadRequest.php
#	app/Models/LicenseSeat.php
#	app/Models/Location.php
#	app/Models/Setting.php
#	composer.json
#	composer.lock
#	config/database.php
#	config/version.php
#	npm-shrinkwrap.json
#	package.json
#	public/css/AdminLTE.css
#	public/css/AdminLTE.css.map
#	public/css/overrides.css
#	public/css/overrides.css.map
#	public/css/skins/skin-blue-light.css
#	public/css/skins/skin-blue.css
#	public/css/skins/skin-green-dark.min.css
#	public/js/app.js
#	public/js/bootstrap-table.js
#	public/js/bootstrap/js/bootstrap.js
#	public/js/bootstrap/js/bootstrap.min.js
#	public/js/build/all.js
#	public/js/build/vue.js
#	public/js/build/vue.js.map
#	public/js/demo.js
#	public/js/ekko-lightbox.js
#	public/js/ekko-lightbox.min.js
#	public/js/extensions/export/bootstrap-table-export.js
#	public/js/extensions/multiple-sort/bootstrap-table-multiple-sort.js
#	public/js/extensions/multiple-sort/bootstrap-table-multiple-sort.min.js
#	public/js/extensions/toolbar/bootstrap-table-toolbar.min.js
#	public/js/plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.all.js
#	public/js/plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.all.min.js
#	public/js/plugins/timepicker/bootstrap-timepicker.js
#	public/js/plugins/timepicker/bootstrap-timepicker.min.js
#	public/js/vue.js
#	public/mix-manifest.json
#	resources/assets/js/bootstrap-js.js
#	resources/assets/js/bootstrap.min.js
#	resources/assets/js/ekko-lightbox.js
#	resources/assets/js/ekko-lightbox.min.js
#	resources/assets/js/plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.all.js
#	resources/assets/js/plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.all.min.js
#	resources/assets/js/plugins/chartjs/Chart.js
#	resources/assets/js/plugins/timepicker/bootstrap-timepicker.js
#	resources/assets/js/plugins/timepicker/bootstrap-timepicker.min.js
#	resources/assets/less/AdminLTE.less
#	resources/assets/less/overrides.less
#	resources/assets/less/skins/_all-skins.less
#	resources/assets/less/skins/skin-black.less
#	resources/assets/less/skins/skin-blue.less
#	resources/assets/less/skins/skin-green.less
#	resources/assets/less/skins/skin-purple.less
#	resources/assets/less/skins/skin-red.less
#	resources/assets/less/skins/skin-yellow.less
#	resources/assets/less/variables.less
#	resources/js/components/importer/importer-file.vue
#	resources/lang/en/auth/message.php
#	resources/lang/en/passwords.php
#	resources/lang/es-CO/general.php
#	resources/lang/es-ES/general.php
#	resources/lang/es-VE/general.php
#	resources/less/skins/skin-black-dark.less
#	resources/less/skins/skin-blue-dark.less
#	resources/less/skins/skin-contrast.less
#	resources/less/skins/skin-green-dark.less
#	resources/less/skins/skin-orange-dark.less
#	resources/less/skins/skin-orange.less
#	resources/less/skins/skin-purple-dark.less
#	resources/less/skins/skin-red-dark.less
#	resources/less/skins/skin-yellow-dark.less
#	resources/views/accessories/checkin.blade.php
#	resources/views/accessories/checkout.blade.php
#	resources/views/accessories/edit.blade.php
#	resources/views/account/profile.blade.php
#	resources/views/account/view-assets.blade.php
#	resources/views/asset_maintenances/edit.blade.php
#	resources/views/auth/passwords/email.blade.php
#	resources/views/auth/passwords/reset.blade.php
#	resources/views/categories/edit.blade.php
#	resources/views/companies/edit.blade.php
#	resources/views/components/checkin.blade.php
#	resources/views/components/checkout.blade.php
#	resources/views/components/edit.blade.php
#	resources/views/consumables/checkout.blade.php
#	resources/views/consumables/edit.blade.php
#	resources/views/custom_fields/fields/edit.blade.php
#	resources/views/custom_fields/fieldsets/edit.blade.php
#	resources/views/dashboard.blade.php
#	resources/views/departments/edit.blade.php
#	resources/views/groups/edit.blade.php
#	resources/views/hardware/audit.blade.php
#	resources/views/hardware/bulk-checkout.blade.php
#	resources/views/hardware/bulk.blade.php
#	resources/views/hardware/checkin.blade.php
#	resources/views/hardware/checkout.blade.php
#	resources/views/hardware/edit.blade.php
#	resources/views/hardware/index.blade.php
#	resources/views/hardware/quickscan.blade.php
#	resources/views/hardware/view.blade.php
#	resources/views/importer/import.blade.php
#	resources/views/layouts/basic.blade.php
#	resources/views/layouts/default.blade.php
#	resources/views/layouts/edit-form.blade.php
#	resources/views/licenses/checkin.blade.php
#	resources/views/licenses/checkout.blade.php
#	resources/views/licenses/edit.blade.php
#	resources/views/locations/edit.blade.php
#	resources/views/manufacturers/edit.blade.php
#	resources/views/modals/upload-file.blade.php
#	resources/views/models/bulk-edit.blade.php
#	resources/views/models/custom_fields_form.blade.php
#	resources/views/models/edit.blade.php
#	resources/views/partials/bootstrap-table.blade.php
#	resources/views/partials/forms/edit/address.blade.php
#	resources/views/partials/forms/edit/asset-select.blade.php
#	resources/views/partials/forms/edit/category-select.blade.php
#	resources/views/partials/forms/edit/category.blade.php
#	resources/views/partials/forms/edit/company-select.blade.php
#	resources/views/partials/forms/edit/company.blade.php
#	resources/views/partials/forms/edit/department-select.blade.php
#	resources/views/partials/forms/edit/depreciation.blade.php
#	resources/views/partials/forms/edit/email.blade.php
#	resources/views/partials/forms/edit/image-upload.blade.php
#	resources/views/partials/forms/edit/item_number.blade.php
#	resources/views/partials/forms/edit/location-profile-select.blade.php
#	resources/views/partials/forms/edit/location-select.blade.php
#	resources/views/partials/forms/edit/location.blade.php
#	resources/views/partials/forms/edit/maintenance_type.blade.php
#	resources/views/partials/forms/edit/manufacturer-select.blade.php
#	resources/views/partials/forms/edit/manufacturer.blade.php
#	resources/views/partials/forms/edit/minimum_quantity.blade.php
#	resources/views/partials/forms/edit/model-select.blade.php
#	resources/views/partials/forms/edit/model_number.blade.php
#	resources/views/partials/forms/edit/name.blade.php
#	resources/views/partials/forms/edit/notes.blade.php
#	resources/views/partials/forms/edit/order_number.blade.php
#	resources/views/partials/forms/edit/phone.blade.php
#	resources/views/partials/forms/edit/purchase_cost.blade.php
#	resources/views/partials/forms/edit/purchase_date.blade.php
#	resources/views/partials/forms/edit/quantity.blade.php
#	resources/views/partials/forms/edit/serial.blade.php
#	resources/views/partials/forms/edit/status.blade.php
#	resources/views/partials/forms/edit/submit.blade.php
#	resources/views/partials/forms/edit/supplier-select.blade.php
#	resources/views/partials/forms/edit/supplier.blade.php
#	resources/views/partials/forms/edit/user-select.blade.php
#	resources/views/reports/custom.blade.php
#	resources/views/settings/alerts.blade.php
#	resources/views/settings/asset_tags.blade.php
#	resources/views/settings/barcodes.blade.php
#	resources/views/settings/branding.blade.php
#	resources/views/settings/general.blade.php
#	resources/views/settings/labels.blade.php
#	resources/views/settings/ldap.blade.php
#	resources/views/settings/localization.blade.php
#	resources/views/settings/security.blade.php
#	resources/views/setup/user.blade.php
#	resources/views/suppliers/edit.blade.php
#	resources/views/users/bulk-edit.blade.php
#	resources/views/users/edit.blade.php
#	resources/views/users/ldap.blade.php
#	resources/views/users/print.blade.php
#	resources/views/users/view.blade.php
#	routes/api.php
#	routes/web/hardware.php
#	webpack.mix.js
2020-04-20 23:20:34 -07:00
snipe
154db9a416 This literally never fucking worked. Ever. Shoot me. 2020-04-09 22:20:05 -07:00
snipe
cf9d0201e0 Catch weird edge case where target wouldn’t have an ID (?!) 2020-04-09 20:23:02 -07:00
snipe
7ebd21bc04 Added sr-only to the unstyles image upload button 2020-04-09 19:29:16 -07:00
snipe
5707df0239 Check that location isset in checkout 2020-04-09 18:32:34 -07:00
snipe
197a84be94 Commented out rtd_location_id override - why did we do that? 2020-04-09 14:17:39 -07:00
snipe
b4fa4c77d7 Check for rtd_location_id before trying to assign 2020-04-09 14:14:30 -07:00
snipe
cfec142c3b Better handle models without a fieldset in the asset request [RB 9935] 2020-04-09 11:18:54 -07:00
snipe
48dfc699d7 Bumped version 2020-04-09 10:49:50 -07:00
snipe
ec723a3da1 Changed LDAP messaging 2020-04-09 10:37:51 -07:00
snipe
f8a72db696 Changed LDAP 600 to 500, clearer error messages on LDAP test 2020-04-09 09:55:44 -07:00
snipe
83ee64f155 Added missing CSS class to text-only logo 2020-04-08 17:25:14 -07:00
snipe
b7d12ff944 Changed placeholder text back to lighter grey - it was confusing when darker 2020-04-08 17:24:59 -07:00
snipe
0858fec7f1 Fixed CSS issue where text-only logos at the top would be the wrong color 2020-04-08 17:24:38 -07:00
snipe
206bd675f2 Pulled slack validation out of setting model validation so it doesn’t fail mysteriously on other pages 2020-04-08 15:07:02 -07:00
snipe
92695782ff Add @anthonypburns as a contributor 2020-04-08 11:48:18 -07:00
snipe
c447e4d29b Add @joshi-redbridge as a contributor 2020-04-08 11:48:03 -07:00
snipe
811f89b1de Add @JoKneeMo as a contributor 2020-04-08 11:47:37 -07:00
snipe
be3e572440 Bumped version 2020-04-08 11:24:30 -07:00
snipe
824ebc19c0 Updated assets 2020-04-08 11:24:17 -07:00
snipe
a0f7fdc57a Merge branch 'fixes/accessibility_fixes'
# Conflicts:
#	public/css/build/all.css
#	public/css/dist/all.css
#	public/js/build/all.js
#	public/js/build/vue.js
#	public/js/build/vue.js.map
#	public/js/dist/all.js
#	public/mix-manifest.json
#	resources/assets/js/components/importer/importer-file.vue
2020-04-08 11:19:42 -07:00
snipe
450c1b9d56 Updated faker library to be compatible with PHP 7.4 2020-04-08 11:13:15 -07:00
snipe
79232fc434 Fixed #7947 - Added rtd_location_id to API search 2020-04-08 11:00:04 -07:00
snipe
0b3f511534 Fixed compact() errors 2020-04-07 17:26:56 -07:00
snipe
7f18983a49 Update local instance of composer.phar on upgrade. (#7940)
Co-authored-by: Johnny Moore <jmoore@eventide.com>
2020-04-07 13:21:55 -07:00
snipe
b7d9790acb Fixed color style for btn-sm.btn-warning and btn-sm.btn-danger 2020-04-06 21:59:30 -07:00
snipe
1a5785a8d3 Fixed dashboard header size 2020-04-06 21:30:28 -07:00
snipe
320d660e83 Updated chartjs 2020-04-06 21:17:26 -07:00
snipe
fb903b2fda Added comments, better indenting 2020-04-06 21:05:42 -07:00
snipe
c18646d096 Yellow highlight on selected rows 2020-04-06 21:00:11 -07:00
snipe
7bf398aca4 More settings filter fixes 2020-04-06 20:47:05 -07:00
snipe
f6bb655383 Prevent form submission 2020-04-06 20:17:44 -07:00
snipe
19f71face9 Added filtering to settings page 2020-04-06 20:11:13 -07:00
snipe
d82b94e281 Pull blue stylesheet if no skin was selected 2020-04-06 19:04:49 -07:00
snipe
893944403e Check for location_id being set before trying to set it on checkout via API 2020-04-06 15:54:40 -07:00
snipe
0d3c18d1df Fixed importer vue code for niceer layout 2020-04-06 15:09:37 -07:00
snipe
d7873f257d Fixed CSP for importer 2020-04-06 14:18:45 -07:00
Johnny Moore
7e3f718797 Update local instance of composer.phar on upgrade. 2020-04-03 13:13:30 -04:00
snipe
be79a1f3d6 Bumped hash 2020-04-02 19:27:41 -07:00
snipe
a8032ac388 Switched to btn-primary for submit 2020-04-02 18:38:54 -07:00
snipe
21d8225696 Use button primary for higher contrast 2020-04-02 18:33:26 -07:00
snipe
766c2b22cb Removed stray tag 2020-04-02 18:33:10 -07:00
snipe
db79f92423 Updatedb select2 to latest for aria fixes 2020-04-02 18:22:25 -07:00
snipe
bdddab5b8b Added role=“option” to option items, additional icon font fixes 2020-04-02 18:17:21 -07:00
snipe
031adc3be4 Small display fixes to importer table 2020-04-01 19:51:36 -07:00
snipe
e7c1418314 Fixed possible typo in CSP 2020-04-01 19:47:42 -07:00
snipe
c906026acd Merge branch 'master' into fixes/accessibility_fixes 2020-04-01 14:04:02 -07:00
snipe
56c2740b68 Radio button tweaks 2020-04-01 06:56:27 -07:00
snipe
4688d62b9f Small UI fixes 2020-04-01 06:50:37 -07:00
snipe
99686bd73a Added labels for bulk actions 2020-04-01 06:48:02 -07:00
snipe
120e224961 Add the ability to remove all group memberships in bulk 2020-04-01 06:35:13 -07:00
snipe
e27d69a31d Remove viewport restrictions 2020-04-01 06:18:37 -07:00
Ivan Nieto
c492ba7245 Adding changes to 'upload-table' for being painted in CSS (#7934) 2020-04-01 05:24:05 -07:00
snipe
53658e365f Removed duplicate HTML tag 2020-04-01 04:36:28 -07:00
snipe
4cfa0e36b1 Added labels to password reset 2020-04-01 04:30:54 -07:00
snipe
9d9b5d3885 Added form labels to auth screens 2020-04-01 04:29:54 -07:00
snipe
36f9905be0 Removed test code 2020-04-01 04:29:35 -07:00
snipe
a815e0ab8c Fixed stupid curly quotes 2020-04-01 03:55:44 -07:00
snipe
6bfec08a8c Updated vue files with aria tags and labels 2020-04-01 03:53:05 -07:00
snipe
2d2cd68061 Switched to h2 from h4 2020-04-01 03:51:08 -07:00
snipe
fd642e95eb Hide success icons from screen readers 2020-04-01 03:25:07 -07:00
snipe
9ab3370be5 Hide icons in error messages 2020-04-01 03:21:15 -07:00
snipe
4dcc1ffdbc More form labels 2020-04-01 02:22:24 -07:00
snipe
7d466f3584 Update user uploads for more data to work with recport 2020-04-01 02:22:16 -07:00
snipe
7718abaa72 Added aria-hidden 2020-04-01 01:26:44 -07:00
snipe
59c5a1ea87 Added aria label to form helper 2020-04-01 01:26:32 -07:00
snipe
0cf70c9e16 Fixed select2 placeholder 2020-04-01 01:26:19 -07:00
snipe
6174f9b93f Check that there is actually a filed ID submitted 2020-04-01 01:25:31 -07:00
snipe
c3d2e8ff26 Added aria-hidden to inline form error text 2020-04-01 00:18:20 -07:00
snipe
192f703885 Trying placeholder CSS styling for the high contrast skin
Doesn’t seem to work :(
2020-04-01 00:15:58 -07:00
snipe
be93b23488 Added aria-label to form fields 2020-04-01 00:15:33 -07:00
snipe
b079d0d6d5 Use btn-primary for submit button 2020-03-31 23:38:10 -07:00
snipe
c6c75cc11f Fixed missing </h3 tags 2020-03-31 23:36:56 -07:00
snipe
b188285bc9 Fixed empty table headings 2020-03-31 23:02:24 -07:00
snipe
6d659a84b8 Removed extra div tag 2020-03-31 22:53:58 -07:00
snipe
3e3828229d Removed _tab from tab names 2020-03-31 22:52:21 -07:00
snipe
bf6a0f8d2f Added aria-hidden 2020-03-31 22:50:38 -07:00
snipe
3873c4b253 Added aria form labels to upload modal 2020-03-31 22:50:29 -07:00
snipe
6cc23f69f9 Added aria form labels 2020-03-31 22:50:14 -07:00
snipe
a467a6999e Use upload modal 2020-03-31 22:50:07 -07:00
snipe
e0eb10ca1e Added aria-hidden tags 2020-03-31 22:49:49 -07:00
snipe
99c4c73c09 Fixed aria labels on dropdowns 2020-03-31 21:53:26 -07:00
snipe
bde45cbb34 Fixed h3 to h2 for semantic header levels 2020-03-31 21:30:24 -07:00
snipe
c408c27bf4 Updated dark skins 2020-03-31 21:10:55 -07:00
Joshi
b14f37d966 Purposal for fix on issue 6251 - max upload filesize (#7930)
* Added a check and sed to startup.sh for managing max upload size inside the docker container. Issue encountered in 6251

* Changed startup.sh to bash instead of sh to have better variable control. Changed single ticks to double ticks for the sed so that the variable PHP_UPLOAD_LIMIT is expanded
2020-03-31 21:02:10 -07:00
snipe
bfa9c0c528 Updated dark skins with updated styles 2020-03-31 20:58:54 -07:00
snipe
9cc9cddd68 Fixed visited button text color 2020-03-31 20:39:41 -07:00
snipe
fe2261c88d A few more aria-hidden fixes 2020-03-31 19:34:01 -07:00
snipe
6aeb3c0a47 Use divs instead of layout table on view 2020-03-31 19:27:21 -07:00
snipe
dfaa1c9578 Use the same “no results” treatment for each tab 2020-03-31 18:45:43 -07:00
snipe
0ef1dfe061 Switched from layout tables to decorated divs for asset detail page 2020-03-31 18:39:58 -07:00
snipe
ba8bcd6413 Slight tweaks to div table styles 2020-03-31 18:39:41 -07:00
snipe
7854003ec2 Added sr-only text to “made with love” footer 2020-03-31 17:29:20 -07:00
snipe
c71dd9b68a Added sr-only text 2020-03-31 17:29:06 -07:00
snipe
dfeabbc85d Added table-styles div CSS
(Still needs to be applied for dark mode skins)
2020-03-31 17:28:40 -07:00
snipe
b8b9ac8a1b Fixed mismatched <b>/<strong> tags 2020-03-28 18:00:46 -07:00
snipe
80ac2607cd Added alt tags to assigned assets view 2020-03-28 18:00:19 -07:00
snipe
3552fb1fd8 Added alt tags to profile image 2020-03-28 18:00:05 -07:00
snipe
54a96b8453 Fixed <b> to <strong> 2020-03-28 17:30:17 -07:00
snipe
03be4e74df Higher contrast pagination 2020-03-28 04:00:46 -07:00
snipe
e9ddd1af81 Added th content on activity report 2020-03-28 04:00:26 -07:00
snipe
f305885e8e Regenerated assets 2020-03-28 03:43:35 -07:00
snipe
f0b9cd7820 Changed header for h2 2020-03-28 03:43:24 -07:00
snipe
59accca89d Added form labelss 2020-03-28 03:43:08 -07:00
snipe
e72ebfb94b Added placeholder text for modal header 2020-03-28 03:42:45 -07:00
snipe
0b7316d548 Changed side heading to h2 2020-03-28 03:42:27 -07:00
snipe
d0cf76989a Fixed table headers for custom fields 2020-03-28 02:52:14 -07:00
snipe
90a2bf7c9c Regenerated high contrast menu 2020-03-28 02:42:34 -07:00
snipe
95945412b1 Fixed label 2020-03-28 02:42:04 -07:00
snipe
c299efca0c Darkened the home screen boxes for high contrast 2020-03-28 02:41:43 -07:00
snipe
5e4918579a Added table headers 2020-03-28 02:41:27 -07:00
snipe
db75f0e894 Regenerated assets 2020-03-28 01:38:01 -07:00
snipe
5a6c13e364 Added aria-hidden and sr-only tags to minus/collapse symbol 2020-03-28 01:37:49 -07:00
snipe
4b22f07dd7 Fixed less attribute names 2020-03-28 01:37:27 -07:00
snipe
57cb5146fc Just use navy for links 2020-03-28 01:37:13 -07:00
snipe
07708f530e Use label for field in column dropdown 2020-03-28 01:36:55 -07:00
snipe
5c68353e62 Use non-min bs tables for now 2020-03-28 01:36:35 -07:00
snipe
53728e5c71 Removed whitespace 2020-03-28 01:36:22 -07:00
snipe
b965d170ab Added accessibility features to bootstrap tables 2020-03-28 00:51:26 -07:00
snipe
34a1bb7152 Fixed contrast skin 2020-03-28 00:24:37 -07:00
snipe
8787f228d9 Fixed asset build 2020-03-28 00:16:28 -07:00
snipe
03cde9a72c Added less processing for skin files 2020-03-28 00:08:21 -07:00
snipe
623655b6f6 New dark background skins 2020-03-28 00:07:34 -07:00
snipe
da6830225a Remove light colored less files - it looks crappy 2020-03-28 00:06:51 -07:00
snipe
a729410fe8 Regenerated JS 2020-03-27 22:03:30 -07:00
snipe
bba4036e53 Updated skin theme 2020-03-27 22:03:09 -07:00
snipe
39c71c6027 Regenerate new skin css files 2020-03-27 22:02:57 -07:00
snipe
03a9219a7c Fixed duplicate color: attribute 2020-03-27 22:01:43 -07:00
snipe
a8f6bbd86a Added alt text to image formatter in bootstrap tables 2020-03-27 22:01:24 -07:00
snipe
9a2ee2638b Updated color-specific skins 2020-03-27 21:46:00 -07:00
snipe
2a813244a2 Wrapped text in h5s, added aria hidden to icons 2020-03-27 21:45:27 -07:00
snipe
b50894fca1 Use a variable in the settings to determine what css classes to use 2020-03-27 21:44:50 -07:00
snipe
41fa2d1aa1 Added aria handlers and sr-only text 2020-03-27 21:44:32 -07:00
snipe
54d39c04ad Added additional themes to dropdown 2020-03-27 21:44:18 -07:00
snipe
3c1365b2c8 Added color variables 2020-03-27 21:44:00 -07:00
snipe
5858c90e71 Minor formatting change (spacing) 2020-03-27 15:50:01 -07:00
snipe
f0ef06ebe1 Added more alt tags 2020-03-27 15:35:29 -07:00
snipe
700f7de748 Added alt text to logo 2020-03-27 14:10:56 -07:00
snipe
af2ea7ac03 Added aria-hidden="true" to create dropdown in topnav
Since it’s technically duplicated content
2020-03-27 14:08:01 -07:00
snipe
690d8255c9 Removed the title attribute from the select2 output
It contains duplicate info since its auto-generated by select2
2020-03-27 14:07:30 -07:00
snipe
aded2193a2 Added aria-hidden="true" to top navigation elements 2020-03-27 13:29:00 -07:00
snipe
6d99b2a68c Added “skip to content” link 2020-03-27 13:28:48 -07:00
snipe
55a619778f Added language header 2020-03-25 16:32:33 -07:00
Jared Biel
bbeb51461f Fix LDAP logins 2020-03-24 16:27:14 -05:00
snipe
6066c249d5 Moved gate to the top of the method 2020-03-06 16:01:13 -08:00
Ivan Nieto
025ea93f05 Fix for when a user with the correct permissions couldn't update Manufacturers. (#7882)
* Changed the ability name from 'edit' to 'update'. Changed the order of execution: first checks if the manufacturer exists, then checks permissions

* Handles the update method, that also has the ability parameter as edit instead of update"
q

* Revert "Handles the update method, that also has the ability parameter as edit instead of update""

This reverts commit d7dc0e451e.

* Handles the update method, that also has the ability parameter as 'edit' instead of 'update'
2020-03-06 15:59:51 -08:00
snipe
54fd8f81ff Added permissions on user api (#7883)
* Add permissions to user edit API

* Add user permissions on user create/update API endpoint
2020-03-06 15:28:46 -08:00
snipe
ca43554327 Fixes search by serial or tag even if they have slashes in them (#7879)
* Fixes search by serial or tag even if they have slashes in them

* Added support for url param byTag and bySerial

* Fixed typo comments

* Sojme additional comments to clarify use-cases

* Updated comments for clarity
2020-03-06 14:55:20 -08:00
snipe
039f5da0e1 Add image upload to user edit [ch10508] (#7877)
* Use correct Request include

* Updated to use additional form request

* Added SVG sanitizer

* Added response method to form request

* Allow ImageUploadRequest to accept fieldname params, added SVG sanitization, fixed delete

* Fixed upload path for avatars

* Added fieldname variable to blade partial for image upload

* Added enctype="multipart/form-data"  to form to allow uploads

* Added image field

* Updated Request::old() to use $request->old()

* Fixed derp in edit blade referring to $item when it should be $user

* Added svg+xml to image rule
2020-03-05 18:00:24 -08:00
snipe
9aed12c5aa Update composer package with newer SVG package 2020-03-05 13:28:07 -08:00
snipe
61bdb88ba5 Add @ColinMcNeil as a contributor 2020-03-04 22:38:09 -08:00
snipe
36696ab56e Add @bigtreeEdo as a contributor 2020-03-04 22:37:57 -08:00
snipe
f0f9b93652 Add @Godmartinz as a contributor 2020-03-04 22:37:45 -08:00
snipe
a2fae76eaf Bumped version 2020-03-04 22:37:17 -08:00
snipe
8b2f8ef3cb Spelling is hard :( 2020-03-04 22:19:59 -08:00
snipe
5307e57bd9 Fix for CVE-2019-10772
Vuln in SVG sanitizer library
2020-03-04 22:15:31 -08:00
snipe
15518852aa Added validation to reject email addresses over 250 characters 2020-03-04 22:08:07 -08:00
snipe
60fc1d3f6d Added/matched forgotten password strings in lang files 2020-03-04 22:07:35 -08:00
snipe
d1a8d76d85 Set maxlength in password reset form to 250 2020-03-04 22:06:43 -08:00
snipe
803f5ad0ab Fixed #7870: fixed SSL connectivity for PaaS DBs (#7874) 2020-03-04 19:39:23 -08:00
snipe
663c0f3713 Fixed typo 2020-02-11 22:09:46 -08:00
snipe
dfb9e430fa Removed debug line 2020-02-11 22:09:37 -08:00
snipe
03c5a42f5a Fixes for flysystem paths :( 2020-02-11 20:22:55 -08:00
snipe
c33970e3e3 Added timestamp to uploaded files so they are unique and don’t overwrite
Laravel 6 now does this automaically, so we should switch to their way
2020-02-11 20:19:59 -08:00
snipe
0ea8125f31 Default favicon 2020-02-11 20:19:24 -08:00
snipe
841d0cdbbe Added default logo/favicon 2020-02-11 20:15:35 -08:00
Godfrey Martinez
0e0fe967e4 BadMethodCallException Method update does [ch10544] (#7804) 2020-02-10 19:27:23 -08:00
snipe
192917cc84 Slightly better fix for requestable import bug 2020-02-10 17:34:32 -08:00
snipe
46a138c64b Fixed id to statuslabel in sidenav 2020-02-10 12:36:48 -08:00
snipe
60b271c6a8 Use import instead of direct model call 2020-02-10 12:36:40 -08:00
snipe
81880645ed Possible requestable fix 2020-02-10 11:40:39 -08:00
snipe
9eb4b0dda7 Disallow 0 as a number for labels per page 2020-02-04 19:14:58 -08:00
snipe
2f0ed129f0 Use “invalid barcode” image and suppress errors when barcode format is wrong 2020-02-04 18:15:01 -08:00
Fabian Grutschus
5becb93e6c Added: allow appending of domain name to username when user tries to login (#7790) 2020-02-04 12:47:49 -08:00
snipe
3361b859c0 Changes offset to use the actual item count as override instead of 0 (#7788) 2020-02-04 12:32:24 -08:00
bigtreeEdo
e27a9b137b added 'requestable' to fillable attributes. (#7787) 2020-02-03 19:37:03 -08:00
snipe
89e2a3ae3c Fixed #7752 - reformat /api/v1/users/me to use transformer 2020-01-30 13:12:43 -08:00
snipe
5f85d8132b Fix for weird JSON parsing in actionlogs (#7753)
* Fix for weird JSON parsing in actionlogs

* Removed debugging code

* Check for the meta array

(If no fields, no array)
2020-01-24 17:31:43 -08:00
snipe
ca1285ec08 Updated favicon 2020-01-23 19:49:46 -08:00
snipe
56582614b6 Merge branch 'develop' of https://github.com/snipe/snipe-it into develop 2020-01-22 16:07:46 -08:00
Ivan Nieto
313cacdb71 Select Import File fails in Develop [ch10598] (#7718)
* Delete an unused import, then replace a deprecated facade with the needed one for uploading files

* Added the needed use for the Request Facade
2020-01-17 16:12:51 -08:00
Ivan Nieto
75bf8f3d58 Remove not existent variable 'id' in the redirect causing [ch10602] (#7732) 2020-01-17 16:12:24 -08:00
Ivan Nieto
ab36784edd Added a parameter that http://snipe-it.app/fields expected, without it that functionality was broken (#7687)
Nice!
2019-12-30 20:18:47 -08:00
snipe
324da7c0c8 Include correct license, asset, etc count on user show API call 2019-12-19 18:09:53 -08:00
snipe
779fc6d195 Added license endpoint for users 2019-12-19 18:00:36 -08:00
snipe
159acf6788 Removed extra space 2019-12-19 17:47:50 -08:00
Colin McNeil
db59106c3e Move ldap import ini settings to config (#7679) 2019-12-19 11:51:55 -08:00
Ivan Nieto
7b7e097922 Added correct route for AssetsController from http://snipe-it.app/hardware/audit/due endpoint (#7673) 2019-12-18 11:52:01 -08:00
snipe
5ef40340fb Bumped version 2019-12-11 19:38:04 -08:00
snipe
aa4d0c4a6b Ugh. NPM is the fucking worst. 2019-12-11 19:36:55 -08:00
snipe
7f53462d0f Bumped composer lock 2019-12-11 15:21:37 -08:00
snipe
94ce8cad64 Make sure $user->item exists before trying to count on it 2019-12-11 14:43:46 -08:00
snipe
4d38c44a93 Fixed groups request 2019-12-11 11:26:58 -08:00
snipe
c31e150935 Use $request->input over Request::get() 2019-12-11 11:09:54 -08:00
snipe
a5b180a9c6 Fixed Call to a member function count() on null for location delete 2019-12-11 10:46:07 -08:00
snipe
a8bbb951bc Use Request instead of Input 2019-12-10 22:05:49 -08:00
snipe
df778cdb80 Include storage in use statements 2019-12-10 22:03:15 -08:00
snipe
b55d9113d4 Moved bootstrap directive to avoid warning on codeception 2019-12-10 21:47:01 -08:00
snipe
d7c51f1a2c Added Request to use statements 2019-12-10 20:39:29 -08:00
snipe
b5db0b22f8 Switched to Request facade
I don’t know why my greps keep missing this shit.
2019-12-10 19:47:54 -08:00
snipe
296de34e8a WIP: Upgrade develop to Laravel 6.6.1 (#7637)
I'm going ahead and merging this, since the upgrade doesn't break Flysystem any worse than the current develop is broken, so far as I can tell. 


* Upgraded framework to Laravel 6

### TO DO:

- Fix password restriction rules- the old library isn’t compatible with Laravel 6 :(
- Figure out why in-app API calls are returning “Unauthorized”

* More updates from Input:: to Request:: helper

* Switch to Request:: from Input

* Added passport config

* Fixed goofy password minimum in seeder

* Added laravel/helpers

* Changed ($item)  to ($item->id) in forms

I have no idea why this is necessary

* Changed ($item) to ($item->id) in forms

* Updated API middleware to auth:api

* Updated with added laravel auth.php values

* FIxed *&!^$%^&$^%!!!! ajax issue

* Switch to Request::get from Input::get

* Switched to Request facade

* Added password security minimums back in

The package we were using has not been updated to Laravel v6, so I created custom validators instead

* Added language strings for error messages for password rules

* Fixed `($item)` issue in formActions for partials
2019-12-10 19:32:50 -08:00
snipe
88fb1370f0 Added slightly friendlier error handling for assets without models
This scenario should never happen, barring someone manually editing their data, but better to handle that scenario in a more user-friendly way.
2019-12-06 18:17:03 -08:00
snipe
943cf40247 Merge branch 'master' of https://github.com/snipe/snipe-it 2019-12-06 13:14:31 -08:00
snipe
ff57f10e9f Fix for searching on child location names (#7646)
* Fix for child locations

* Reverts temp changes to indenter
2019-12-06 13:14:10 -08:00
snipe
91bb76fd8a Bumped version 2019-12-06 13:05:20 -08:00
snipe
893454dca7 Updated translations 2019-12-06 12:03:04 -08:00
Ivan Nieto
9291e3ada3 Added a validation to Transformers/LocationsTransformer.php:transformLocations() in case location doesn't have children location (#7640) 2019-12-06 11:42:36 -08:00
Yorick Terweijden
2a6a381bc7 Return real Asset error (#7054) 2019-12-06 11:07:12 -08:00
snipe
de0b5a6149 Fixes #6440 - quote marks in the right place 2019-12-06 11:04:16 -08:00
Dustin B
8fd4e35244 Closes #6440 Print All Assigned - New Tab (#7135)
Should add the functionality to, by default open in a new tab and not reference back to the source page. Reduces overhead and should resolve #6440. 

Untested, need confirmation.
2019-12-06 11:00:01 -08:00
Valentyn Tulub
6ad1f51673 Added #6489: show asset assignments under user assignments (#7293)
* Add a setting to show assets assigned to other assets #6489

* Update user's views to show assets assigned to other assets #6489

* Add ukrainian and russian translation for the feature #6489 in settings
2019-12-06 10:57:48 -08:00
herroworrd
3fbfb0c658 Add requestable to asset model api results (#7577)
Nice, thanks!
2019-12-06 10:33:06 -08:00
Lorenzo P
7225b53986 fix syntax error in CustomFieldsetsController::show() (#7595)
That someone was probably me :D Thanks for this, good catch!
2019-12-06 10:31:00 -08:00
snipe
e71e57f16a Fixed XSS vulnerability in SVG image uploads [ch10476] (#7639)
* Added enshrined/svg-sanitize

* Added modular image resizing/SVG cleaning method

(This already exists in v5, so I mostly ported it forward and added the SVG sanitizer.)

* Use improved handleImages method to upload/resize/clean images

* Removed $old_image

This is handled in the ImageUpload request now
2019-12-05 22:23:05 -08:00
snipe
3f5840d390 Bumped vendor files 2019-12-05 19:53:01 -08:00
dependabot[bot]
d3f4205f09 Bump symfony/http-foundation from 3.4.30 to 3.4.36 (#7638)
Bumps [symfony/http-foundation](https://github.com/symfony/http-foundation) from 3.4.30 to 3.4.36.
- [Release notes](https://github.com/symfony/http-foundation/releases)
- [Changelog](https://github.com/symfony/http-foundation/blob/master/CHANGELOG.md)
- [Commits](https://github.com/symfony/http-foundation/compare/v3.4.30...v3.4.36)

Signed-off-by: dependabot[bot] <support@github.com>
2019-12-05 19:37:00 -08:00
Godfrey Martinez
5b946087c4 added a proper response for password errors (#7636) 2019-12-05 17:49:56 -08:00
snipe
9a2378586c Added new data directory for Laravel 5.7 upgrade 2019-12-04 17:06:15 -08:00
snipe
e820d4bc4d Moved js/css/less out of resources/assets
Per https://laravel.com/docs/5.7/upgrade
2019-12-04 17:03:16 -08:00
snipe
8e3e48da14 New composer lock with slack library edits 2019-12-04 16:48:19 -08:00
snipe
ff8d98c97c Update child assets to reflect asset parent location (#7458) 2019-12-04 16:19:25 -08:00
snipe
04cf8d7fbf Removed Helper reference since it’s autoloaded 2019-12-04 15:56:55 -08:00
snipe
7f8f1ff35a Specifically require slack notification channel for laravel 5.8 upgrade 2019-12-04 15:56:45 -08:00
snipe
c635db0a76 Fixed upload parh for asset models 2019-12-04 15:23:49 -08:00
snipe
704c696711 Fixed parse error in settings controller 2019-12-04 14:54:36 -08:00
snipe
2fbbe430b5 Removed escaping on custom fields in presenter (#7631) 2019-12-03 17:42:13 -08:00
Godfrey Martinez
f0af750b0a Fixed comment (#7617)
* Set theme jekyll-theme-hacker

* fixed commenty about scopebyDeprecationID being identified as a method to location ID

* fixed commenty about scopebyDeprecationID being identified as a method to location ID
2019-11-22 16:13:42 -08:00
snipe
88cf456386 Adding Dept to license seats (#7609)
* Adding Dept to license seats

* Added query scope to order by department

* Make license seat department sortable

* Disable license seat internal search - this never actually worked
2019-11-21 22:03:56 -08:00
snipe
d8049209ca Fixed bug where deleted consumable would throw an error on print page 2019-11-21 21:43:54 -08:00
snipe
dd40ddf5a5 Fixed an error on audit due list when no audit_warning_days had been set [ch9764] 2019-11-21 21:34:41 -08:00
snipe
5065164c40 Bumped Carbon version 2019-11-21 13:14:18 -08:00
snipe
8127fdc5bc Min password requirement set to 8 characters 2019-11-18 21:17:51 -08:00
snipe
38ed73a2b4 Bumped to Laravel 5.8 2019-11-18 21:17:36 -08:00
snipe
5290c47e2a Merge branch 'develop' into v5-master-develop-integration
# Conflicts:
#	.env.example
#	.travis.yml
#	Dockerfile
#	README.md
#	app/Console/Commands/LdapSync.php
#	app/Console/Kernel.php
#	app/Http/Controllers/AccessoriesController.php
#	app/Http/Controllers/Api/AccessoriesController.php
#	app/Http/Controllers/Api/AssetsController.php
#	app/Http/Controllers/Api/LocationsController.php
#	app/Http/Controllers/Api/SettingsController.php
#	app/Http/Controllers/Api/UsersController.php
#	app/Http/Controllers/AssetModelsController.php
#	app/Http/Controllers/Assets/AssetFilesController.php
#	app/Http/Controllers/Assets/AssetsController.php
#	app/Http/Controllers/CategoriesController.php
#	app/Http/Controllers/CompaniesController.php
#	app/Http/Controllers/ComponentsController.php
#	app/Http/Controllers/ConsumablesController.php
#	app/Http/Controllers/DepartmentsController.php
#	app/Http/Controllers/LicensesController.php
#	app/Http/Controllers/LocationsController.php
#	app/Http/Controllers/ManufacturersController.php
#	app/Http/Controllers/ReportsController.php
#	app/Http/Controllers/SettingsController.php
#	app/Http/Controllers/SuppliersController.php
#	app/Http/Controllers/UsersController.php
#	app/Http/Middleware/EncryptCookies.php
#	app/Http/Requests/AssetRequest.php
#	app/Http/Transformers/AssetMaintenancesTransformer.php
#	app/Importer/AssetImporter.php
#	app/Models/AssetMaintenance.php
#	app/Models/Location.php
#	app/Models/User.php
#	composer.json
#	composer.lock
#	config/backup.php
#	config/database.php
#	config/version.php
#	public/mix-manifest.json
#	resources/lang/en-ID/general.php
#	resources/lang/vi/admin/settings/general.php
#	resources/views/accessories/edit.blade.php
#	resources/views/hardware/view.blade.php
#	resources/views/layouts/default.blade.php
#	tests/api/ApiCategoriesCest.php
2019-11-18 19:49:39 -08:00
snipe
957c7f4e79 Merge branch 'develop' of https://github.com/snipe/snipe-it into develop 2019-11-18 19:01:35 -08:00
snipe
a73fd24695 Fix maintenances permissions check to allow users who can edit assets to edit maintenances 2019-11-08 17:02:17 -08:00
snipe
70c8ad9797 Bumped minor version 2019-10-28 13:55:21 -07:00
snipe
0290257734 Limit license seats to 999 to prevent latency 2019-10-28 13:48:18 -07:00
Marián Skrip
53eae6fbfd Fix issues with update permission naming (#7493)
This solves an issue when admin would be able to create and delete
categories but not edit them.
2019-10-28 11:44:48 -07:00
Alexandr Hacicheant
a90149940a Update UsersController.php (#7528)
Returned missed bracket after merge master to develop
2019-10-28 11:43:29 -07:00
snipe
4fe689dc5d Merge branch 'master' of https://github.com/snipe/snipe-it 2019-10-21 15:45:17 -07:00
snipe
0769f585ea Disallow locations from being their own parents 2019-10-21 15:45:05 -07:00
snipe
04562e6d4a Added 4260352 to ldapsync enabled account constraint 2019-10-18 17:48:50 -07:00
snipe
22d2ad9248 Fixes nested location selectlist (#7483)
* Rename child locations method

* Use Ajax dropdown for locations selectlist for edit/create

* Removed locations database call on edit/create blades for faster loading

* Updated locations controller to use the new iterator

* Increase pagination on locations controller to 500

We’re already loading all of that data up beforehand anyway, so no point in keeping the query smaller.

* Fixed the else to make codacy happy

* Improve the design and performance of the nested location selectlist (#7484)

* Improve the design and performance of the nested location selectlist

* Fixed parse errors

* Removed debugging code/comments
2019-10-02 03:56:56 -07:00
snipe
6deb26fafe Remove unused variable 2019-09-30 19:37:52 -07:00
snipe
6c1de7ff05 Apply fix for #6642 to master 2019-09-30 19:21:57 -07:00
snipe
ab05a44e0b Merge branch 'develop' of https://github.com/snipe/snipe-it into develop 2019-09-30 19:18:54 -07:00
snipe
7f5f4a1297 Added softwarew support and hardware support to maintenance types 2019-09-24 01:34:23 -07:00
snipe
c68c0e1208 Account for limit if none is passed in the request 2019-09-03 20:28:49 -07:00
snipe
c256536d21 Math is hard 2019-09-03 14:29:58 -07:00
snipe
4159a0effa Bumped version 2019-09-03 14:12:13 -07:00
snipe
b8f7cd81eb Limit API request results per page (#7405) 2019-09-03 14:02:08 -07:00
Martin Berg
3dcef9aac9 Add support for custom remote user header (#7370) 2019-09-03 11:07:26 -07:00
snipe
b381528668 Added console rekey tool (#7330)
* Removed console command specifications, since they’re pulled dynamically now

* Added rekey console command

* Removed unused code

* Comment clarifiction

* Handle LDAP password
2019-09-03 11:03:32 -07:00
Logan Swartzendruber
4c8b26f732 Implement #3088: Add "Generate Label" option to "Actions" dropdown menu in individual Asset Details view. (#7388)
* Implement #3088: Add "Generate Label" option to "Actions" dropdown menu in individual Asset Details view.

* Add conditional for including the asset number in the URL of the barcode image.

* Change case of variables to pass Codacy PR review standards.
2019-09-03 11:02:55 -07:00
Rick Heil
7b0b28aed0 Add #7393 - next_audit_date set on asset creation if an audit interval is configured in settings (#7394) 2019-09-03 10:58:51 -07:00
snipe
6d66d7e215 Removed withErrors on JSON response 2019-08-22 21:36:47 -07:00
snipe
0544164015 Fixed Eloquent Builder path in docblock 2019-08-20 18:10:36 -07:00
snipe
b6a188a87b Removed erroneous linebreak 2019-08-20 18:10:21 -07:00
snipe
b5bf8e9a37 Smaller chunking for custom report, add max_execution_time 2019-08-15 06:14:25 -07:00
snipe
ba197c8857 Fixed #7259 - upgraded phpdocumentor/reflection-docblock to v4 2019-08-15 03:02:24 -07:00
snipe
124b249df4 Fixed #7289 - git fetch before checkout in upgrade.php 2019-08-15 01:32:20 -07:00
snipe
2a6919c438 Fixed #7321 - added link to Helm Chart repo 2019-08-15 01:07:30 -07:00
snipe
60bb385cf7 Make status label required 2019-08-14 23:46:09 -07:00
snipe
47724d7268 Make error text color match 2019-08-14 23:46:00 -07:00
snipe
c9f9a60354 Fixed asset tag error message alignment 2019-08-14 23:28:01 -07:00
snipe
da52511bf9 Use asset tags 2019-08-14 23:13:23 -07:00
snipe
7899d2284c Fixed parse error in API routes 2019-08-14 22:33:56 -07:00
snipe
c5e6f06e9b Revert import history to master version to fix errors 2019-08-14 22:27:17 -07:00
snipe
6db915b7f0 Removed serialize duplicate 2019-08-14 22:22:50 -07:00
snipe
756361584a Updated assets 2019-08-14 22:22:33 -07:00
snipe
a6d486ea8a Fix invalidJSON exception 2019-08-14 22:18:48 -07:00
snipe
f1143d701a Updated composer.lock 2019-08-14 21:55:38 -07:00
snipe
b65fd4adba Fixed syntax in composer.json
(Our merge tool is teh sux0r)
2019-08-14 21:51:37 -07:00
snipe
441ae69f5c Integrations/develop into master (#7352)
* Fixes #6204 - added email alerts and web/API access to assets due for audits (#6992)

* Added upcoming audit report

TODO: Fid diff/threshold math

* Added route to list overdue / upcoming assets via API

* Controller/API methods for due/overdue audits

We could probably skip this and just handle it via view in the routes…

* Added query scopes for due and overdue audits

* Added audit due console command to kernel

* Added ability to pass audit specs to main API asset search method

* Added audit presenter

* Added bootstrap-tables presenter formatter to display an audit button

* Added gated sidenav items to left nav

* Added audit due/overdue blades

* Cleanup on audit due/overdue console command

* Added language strings for audit views

* Fixed :threshold placeholder

* Removed unused setting variable

* Fixed next audit date math

* Added scope for both overdue and upcoming

* Derp. Wrong version

* Bumped version

(I will release this version officially tomorrow)

* Leave the activated state for users alone in normal LDAP synchronisation. (#6988)

* Fixed #7003 - crash when warranty months or purchase date is null

* Fixed #6956 - viewKeys policy inconsistent  (#7009)

* Fixed #6956 - Added additional gates show showing/hiding license keys

* Modified gate to allow user to see licenses if they can create or edit the license as well

* Added API middleware to API routes to enable throttling

TODO: Figure out how to make this costumizable without touching the code

* Import locations from CSV via command line (#7021)

* Added import locations command

* Small fixes to location importer

* Added country, LDAP OU

* Cleaned up comments, added more clarification to what the script does

* Added ability to update groups via API

Fixes [ch9139]

* Bumped version

* Fixed #6883 - remove escaping of fields on LDAP import

* Fixed #6880 - correctly encrypt encrypted fields via the API

* Fixes #5054: LDAP users deactivated for none-ad (#7032)

When using none-AD ldap, users are automatically deactivated every LDAP
sync.  This commit changes the behaviour so that if the active flag isn't set,
the users are enabled.

Fixed #5054, at least for 4.X

* Updated packages

  - Updating erusev/parsedown (v1.7.2 => 1.7.3): Downloading (100%)
  - Updating squizlabs/php_codesniffer (3.4.1 => 3.4.2): Downloading (100%)
  - Updating symfony/polyfill-mbstring (v1.10.0 => v1.11.0): Downloading (100%)
  - Updating symfony/var-dumper (v3.4.23 => v3.4.27): Downloading (100%)
  - Updating league/flysystem (1.0.50 => 1.0.51): Downloading (100%)
  - Updating symfony/translation (v3.4.23 => v3.4.27): Downloading (100%)
  - Updating nesbot/carbon (1.36.2 => 1.37.1): Downloading (100%)
  - Updating symfony/debug (v3.4.23 => v3.4.27): Downloading (100%)
  - Updating symfony/console (v3.4.23 => v3.4.27): Downloading (100%)
  - Updating symfony/finder (v3.4.23 => v3.4.27): Downloading (100%)
  - Updating symfony/polyfill-ctype (v1.10.0 => v1.11.0): Downloading (100%)
  - Updating symfony/polyfill-php70 (v1.10.0 => v1.11.0): Downloading (100%)
  - Updating symfony/http-foundation (v3.4.23 => v3.4.27): Downloading (100%)
  - Updating symfony/event-dispatcher (v3.4.23 => v3.4.27): Downloading (100%)
  - Updating symfony/http-kernel (v3.4.23 => v3.4.27): Downloading (100%)
  - Updating symfony/process (v3.4.23 => v3.4.27): Downloading (100%)
  - Updating symfony/routing (v3.4.23 => v3.4.27): Downloading (100%)
  - Updating symfony/polyfill-util (v1.10.0 => v1.11.0): Downloading (100%)
  - Updating symfony/polyfill-php56 (v1.10.0 => v1.11.0): Downloading (100%)
  - Updating symfony/psr-http-message-bridge (v1.1.1 => v1.1.2): Downloading (failed)
Downloading (100%)
  - Updating rollbar/rollbar (v1.7.5 => v1.8.1): Downloading (100%)
  - Updating symfony/yaml (v3.4.23 => v3.4.27): Downloading (100%)
  - Updating symfony/browser-kit (v3.4.23 => v3.4.27): Downloading (100%)

* Fixed #7044 - API update deleted custom fields if they are not re-presented

* Fixed XSS vulnerability when creating a new categories, etc via modal on create

Same fix as before, because of the weird select2 post-parsing ajax behavior

* Updated email strings

* Fixed #7046 - added user website url back into UI

* Updated language strings

* Bumped version

* Updated packages

* New backups config for spatie

* Removed debugbar service provider (autodiscovery)

* Use laravel v5.5 withCount manual aliases

* Added spatie language files

* Removed old laravel backups config

This config file was renamed in a newer version of spatie laravel-backup

* Set the serialization

* Added the command loader to console kernel

* Renamed fire() to handle()

* Updated withCount to use manual naming

* Updated backup path in backup admin

* Updated travis with new php versions

* Bumped laravel version in readme

* Fixed custom field edit screen

* Fixed baseUrl is undefined error

I literally cannot figure out how this ever worked before.

* Fix for included files in backup

* Bumped version

* Switch has() to filled()

* Change ->has() to ->filled()

* Removed cosole log

* Bumped packages

* Use getReader instead of fetchAssoc for CSV parser

https://csv.thephpleague.com/9.0/upgrading/

* Handle JSON validation errors like 5.4

* Handle JSON validation errors like 5.4

* Handle JSON validation errors like 5.4

* Trying to fix ajax asset validation

This I think gets us closer, but still not handling the validation on the asset properly.

When I do a print_r of the validation in the other items, its looking for an error bag that looks something like this:

```
Illuminate\Support\MessageBag Object
(
    [messages:protected] => Array
        (
            [name] => Array
                (
                    [0] => The name field is required.
                )

            [seats] => Array
                (
                    [0] => The seats field is required.
                )

            [category_id] => Array
                (
                    [0] => The category id field is required.
                )

        )

    [format:protected] => :message
)
```

Currently the Assets ajax returns:

```
[2019-05-24 06:52:06] develop.ERROR: array (
  'messages' =>
  array (
    'model_id' =>
    array (
      0 => 'The model id field is required.',
    ),
    'status_id' =>
    array (
      0 => 'The status id field is required.',
    ),
    'asset_tag' =>
    array (
      0 => 'The asset tag field is required.',
    ),
  ),
)
```

So not sure why it’s not working.

* Fixed missing asset validation

* Check that a model exists before trying to fiddle with fieldsets

* Tidied up license check

* Removed extra escaping on checkin

* Updated importer to work with newer CSV Reader::getRecords() method

* Fixed field mapping

* Small fix for reordering fields

Fixes Illuminate\Database\QueryException: SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'order' cannot be null (SQL: insert into `custom_field_custom_fieldset` (`custom_field_id`, `custom_fieldset_id`, `order`, `required`) values (12, 7, , 0)) [ch1151]

This needs revisiting for a more solid fix, especially for data that was already entered bad.

* Fixed bug where sorting by company name in Users API did not work

Fixes [ch9200]

* Removed custom fields from AssignedSearch to prevent confusing data in selectlist

Fixes [ch9193]

* Removed alert-danger from tests

* Fixed missed consumables_count withCount() statement

* Fixed Undefined variable user in $backto if checked out to a non-user

Fixes [ch9194]

* Check for valid model before attempting to access fieldsets

Fixes [ch1249]

* Only build the log upload destination path if there is a matching record

Fixes [ch1232]

* Fixed free_seats_count variable name

(I forgot that Laravel switched camel case to snake case for their old 5.4 withCount variables)

* Only gtry to delete the file if a record is found in the log

* Only try to get fieldset if model is valid

* Fixed more camel-casing -> snake-casing

* Only display the file if the log record can be found

* Fixed casing in sync command

* Updated README

* Derp - typo

* Added link to Atlassian plugin

* More Atlassian clarifications

* Show accessory image on view page

* Increased image size to 800px, added lightboxes

* Fixed #7083 - Removed user_exists constraint on department save

If the user has been deleted, this prevented the department from being successfully saved on edit

* Updated branch in version file

* Dockerfile update to bring us up to php v7.1 for Laravel 5.5 (#7084)

* bump up to php7.1

& change deprecated MAINTAINER to a LABEL so it is visible with `docker inspect`

* AND modapache ><

* 2 updates required to get software-properties+ppa

* Bumped version

* Bumped release again :(

* Missed one

* Fixed #7098 - updated backup config for deleteFile() method

* Fixed #7092 -  handle weird port forwarding/port numbers for baseUrl

* Bumped version

* Fixed #7099 - set email to null by default for backup notifications

* Removed old comments

* Fixed #7100 - Check if $user isset on checkin

* Increased throttle to 120 requests per minute

* Added Filipino, corrected order for Spanish variations

* Update language strings

* Bumped hash

* Changed has to filled to fix bulk asset editing

* Bumped point version

* Small fixes for phpleague CSB reader v9

* Improved error checking in locations importer

* Fixed #7145 - rename groups table to permissions_group for mysql 8 reserved word compatibility

* Reduce minimum group name length to 2 (from 3)

eg: IT

* Back in time fix FOR #7145 for new installs on MySQL 8+

* Fixed permission insert

//TODO

Handle this via model

* Possible fix for reporting/admin migration back in time

* Fixed #7164 - change table name to permission_groups

* Fixed LDAP password blanking on save

* fixing previous commit's actual wiping of password (#7183)

replaced Input::fille('ldap_pword') with _filled_.   Should be good to go.  

https://github.com/snipe/snipe-it/issues/7179

https://github.com/snipe/snipe-it/issues/7169

* Bumped version

* Downgrading rollbar for Laravel 5.5

* Spelling Correction (#7206)

Fixed Spelling for the word reqrite, to be rewrite.

* Fix #6910: Add logic to manipulate the eloquent query. (#7006)

* Added company_id to consumables_users table

* Added logic to manage when a pivot table doesn't have the column company_id trough a join with users

* Remove a migration that tries to fix this problem, but is not longer necessary

* Addresses #7238 - add PWA code to layout

Needs additional UX testing

* Better log message for bad LDAP connection

* Fixed #7186 - has vs filled in User’s API blanking out groups if no group_ids are passed

* Comment clarification on #7186

* Check for valid seat on hardware view

* Added space between footer and custom message

* Cap warranty months to three characters

Filles rollbar 209

* Cap warranty months to 3 on the frontend blade

* Fixed countable() strings on user destroy

* Check that the user has assets and that the aset model is valid

* Bumped hash

* Caps asset warranty to 20 years

* Command to fix custom field unicode conversion differences between PHP versions (#7263)

* Fixes #7252 form request changes (#7272)

* Fixes for #7252 - custom fields not validating / no validaton messages in API w/form requests

* Removed debug info

* More fixes for #7252

This is mostly working as intended, if not yet the way Laravel wants us to do it.

Right now, the API returns correctly, and the form UI will return highlighted errors, with the input filled in ~sometimes~. I’m not sure why it’s only sometimes yet, but this is potentially progress.

* Removed experimental method

* Check for digits_between:0,240 for warranty

* Removed debug code

* Apply fix from PR #7273 to master

* Bumped hash

* Fixed #7250 - permission issue for API fieldsets and fields endpoints

This applies the change from #7294 to master

* Add @mskrip as a contributor

* Fixed #7270 - Checking-in Assets via API Removes the Item's Asset Name

* CORS for api (#7292)

* Added CORS support to API

* Changed order so CORS will still work if throttle hit

* Added APP_CORS_ALLOWED_ORIGINS env option

* Fixed typo

* Clarified header comments

* More clarification

* DIsable CORS allowed origins by default to replicate existing behavior

* Change variable name to be clearer

* Bumped version

* Added condition to deal with fieldname 'rtd_location' which can be tried to be queried in some places and doesn't exist in database (#7317)

* Added comments to the ByFilter query scope for clarity

* Added accessories checkout/checkin API endpoint

* Fixed CVE-2019-10742

https://nvd.nist.gov/vuln/detail/CVE-2019-10742

* Update README.md (#7334)

Add reference to CSV importer.

* Group related variables in .env

* History importer fixes

* Fixes to history importer
2019-08-14 21:48:14 -07:00
snipe
8b4a9aa382 Fixes to history importer 2019-08-13 18:15:42 -07:00
snipe
99cd552d5c History importer fixes 2019-08-13 18:00:21 -07:00
snipe
6c7e5cb9cf Merge branch 'master' of https://github.com/snipe/snipe-it 2019-08-10 17:49:23 -07:00
snipe
6ebb01a081 Group related variables in .env 2019-08-10 17:48:03 -07:00
Greg Stamper
5591c861b9 Update README.md (#7334)
Add reference to CSV importer.
2019-08-07 23:12:46 -07:00
snipe
d37280567d Fixed CVE-2019-10742
https://nvd.nist.gov/vuln/detail/CVE-2019-10742
2019-08-06 21:11:38 -07:00
snipe
e7b0ee2539 Added accessories checkout/checkin API endpoint 2019-08-02 15:08:26 -07:00
snipe
1608dba7dd Commenting again? 2019-07-31 14:29:19 -07:00
snipe
f721dac2ca Merge branch 'develop' of https://github.com/snipe/snipe-it into develop
# Conflicts:
#	app/Models/Asset.php
2019-07-31 14:26:46 -07:00
snipe
a4629977e7 Added comments to the ByFilter query scope for clarity 2019-07-31 14:24:38 -07:00
snipe
c593b3645c Added comments to the ByFilter query scope for clarity 2019-07-31 14:24:01 -07:00
Ivan Nieto
28ae90fa8a Added condition to deal with fieldname 'rtd_location' which can be tried to be queried in some places and doesn't exist in database (#7317) 2019-07-31 13:55:21 -07:00
Ivan Nieto
f407b86aa8 Added condition to deal with fieldname 'rtd_location' which can be tried to be queried in some places and doesn't exist in database (#7318)
💥 Nice work, Ivan!
2019-07-31 13:54:55 -07:00
snipe
c7be25078e Bumped version 2019-07-26 13:02:47 -07:00
snipe
3dc2cc9f22 CORS for api (#7292)
* Added CORS support to API

* Changed order so CORS will still work if throttle hit

* Added APP_CORS_ALLOWED_ORIGINS env option

* Fixed typo

* Clarified header comments

* More clarification

* DIsable CORS allowed origins by default to replicate existing behavior

* Change variable name to be clearer
2019-07-26 12:38:31 -07:00
snipe
ab86e42b2e Fixed #7270 - Checking-in Assets via API Removes the Item's Asset Name 2019-07-26 12:37:38 -07:00
snipe
9af9ed9eb9 Add @mskrip as a contributor 2019-07-24 11:01:28 -07:00
snipe
250a797339 Fixed #7250 - permission issue for API fieldsets and fields endpoints
This applies the change from #7294 to master
2019-07-24 11:00:42 -07:00
Marián Skrip
8a1f6b74e8 Fix permission issue for API fieldsets and fields endpoints (#7294)
Close snipe/snipe-it#7250
2019-07-24 10:57:09 -07:00
snipe
a0f3fc6d76 Bumped hash 2019-07-18 14:37:54 -07:00
snipe
74e647fea7 Apply fix from PR #7273 to master 2019-07-18 14:37:48 -07:00
snipe
55ee90b25d Fixes #7252 form request changes (#7272)
* Fixes for #7252 - custom fields not validating / no validaton messages in API w/form requests

* Removed debug info

* More fixes for #7252

This is mostly working as intended, if not yet the way Laravel wants us to do it.

Right now, the API returns correctly, and the form UI will return highlighted errors, with the input filled in ~sometimes~. I’m not sure why it’s only sometimes yet, but this is potentially progress.

* Removed experimental method

* Check for digits_between:0,240 for warranty

* Removed debug code
2019-07-18 14:32:23 -07:00
snipe
eec445fcf5 Command to fix custom field unicode conversion differences between PHP versions (#7263) 2019-07-18 14:30:18 -07:00
Ivan Nieto
af1857b6ee Fix for the issue when the user tries to query assets due for audit without appropiate configuration [ch9625] (#7273)
* Added propper routes to the controller

* Logic to handle the not setted ->audit_warning_days variable

* Change the variable name for more clarity

* Got rid of the unnecesary if sentence in sake of brevity

* Adding the null coalesce operator so it can properly handle when the setting is null
2019-07-18 14:08:55 -07:00
snipe
cef22c3158 Caps asset warranty to 20 years 2019-07-18 09:49:58 -07:00
snipe
61fb38087e Bumped hash 2019-07-17 17:55:53 -07:00
snipe
0e93495ca2 Check that the user has assets and that the aset model is valid 2019-07-17 17:51:35 -07:00
snipe
444e250609 Fixed countable() strings on user destroy 2019-07-17 17:51:13 -07:00
snipe
77a6f6f400 Cap warranty months to 3 on the frontend blade 2019-07-17 12:15:15 -07:00
snipe
15bfd07f30 Cap warranty months to three characters
Filles rollbar 209
2019-07-17 12:13:15 -07:00
snipe
fecf8015a1 Added space between footer and custom message 2019-07-17 12:09:32 -07:00
snipe
79ab0d8dc2 Check for valid seat on hardware view 2019-07-17 12:09:18 -07:00
snipe
b4b6d6b571 Comment clarification on #7186 2019-07-15 15:31:09 -07:00
snipe
8c73a47afb Fixed #7186 - has vs filled in User’s API blanking out groups if no group_ids are passed 2019-07-15 15:27:02 -07:00
snipe
f82ffe378c Merge branch 'master' of https://github.com/snipe/snipe-it 2019-07-15 14:11:18 -07:00
snipe
984c2a8fd4 Better log message for bad LDAP connection 2019-07-15 14:10:57 -07:00
snipe
6736b1c4e7 Addresses #7238 - add PWA code to layout
Needs additional UX testing
2019-07-15 13:49:56 -07:00
Ivan Nieto
d409be6d43 Fix #6910: Add logic to manipulate the eloquent query. (#7006)
* Added company_id to consumables_users table

* Added logic to manage when a pivot table doesn't have the column company_id trough a join with users

* Remove a migration that tries to fix this problem, but is not longer necessary
2019-07-15 13:02:44 -07:00
Thomas Misilo
e1b33f3087 Spelling Correction (#7206)
Fixed Spelling for the word reqrite, to be rewrite.
2019-06-27 18:33:13 -07:00
snipe
740d5a6846 Downgrading rollbar for Laravel 5.5 2019-06-25 18:07:21 -07:00
snipe
d19df4ded8 Bumped version 2019-06-24 14:43:44 -07:00
Kasey
03a4512406 fixing previous commit's actual wiping of password (#7183)
replaced Input::fille('ldap_pword') with _filled_.   Should be good to go.  

https://github.com/snipe/snipe-it/issues/7179

https://github.com/snipe/snipe-it/issues/7169
2019-06-19 14:21:53 -07:00
snipe
de992e4df3 Fixed LDAP password blanking on save 2019-06-14 17:20:37 -07:00
snipe
a85251aa83 Fixed #7164 - change table name to permission_groups 2019-06-14 10:37:20 -07:00
Diogenes S. Jesus
4c61d330e6 fix Paginator (#7157) 2019-06-14 09:54:09 -07:00
snipe
26a1181765 Possible fix for reporting/admin migration back in time 2019-06-12 18:53:53 -07:00
snipe
cef030cf55 Fixed permission insert
//TODO

Handle this via model
2019-06-12 18:39:55 -07:00
snipe
2bfa05fd2d Back in time fix FOR #7145 for new installs on MySQL 8+ 2019-06-12 16:24:55 -07:00
snipe
30904dd019 Reduce minimum group name length to 2 (from 3)
eg: IT
2019-06-12 15:56:19 -07:00
snipe
1d0d25db37 Fixed #7145 - rename groups table to permissions_group for mysql 8 reserved word compatibility 2019-06-12 15:51:47 -07:00
snipe
cbff66c9db Improved error checking in locations importer 2019-06-10 18:50:41 -07:00
snipe
27231d49ea Small fixes for phpleague CSB reader v9 2019-06-03 22:05:16 -07:00
snipe
765417c0be Bumped point version 2019-05-31 14:17:26 -07:00
snipe
49a255c8fb Changed has to filled to fix bulk asset editing 2019-05-31 14:11:43 -07:00
snipe
925d3a23c6 Bumped hash 2019-05-31 13:11:07 -07:00
snipe
6966c132d0 Update language strings 2019-05-31 12:17:09 -07:00
snipe
c29ab90029 Added Filipino, corrected order for Spanish variations 2019-05-31 11:58:14 -07:00
snipe
d2bbc09892 Increased throttle to 120 requests per minute 2019-05-31 11:57:57 -07:00
vicleos
c6039cbc1d Vicleos fix storage namespace (#6901)
* Update CompaniesController.php

fixed companies destroy error

* fix Storage namespace loss
2019-05-30 19:10:04 -07:00
snipe
74a2c29bc2 Fixed #7100 - Check if $user isset on checkin 2019-05-30 19:06:30 -07:00
snipe
2c64739e8f Removed old comments 2019-05-30 19:02:20 -07:00
snipe
37f950ab42 Fixed #7099 - set email to null by default for backup notifications 2019-05-29 19:09:37 -07:00
snipe
b07a254e60 Bumped version 2019-05-29 15:51:54 -07:00
snipe
087cdd859e Fixed #7092 - handle weird port forwarding/port numbers for baseUrl 2019-05-29 14:57:58 -07:00
snipe
829d44bd27 Fixed #7098 - updated backup config for deleteFile() method 2019-05-29 14:47:55 -07:00
Steffen
27dcb4d27b Allow empty filter (=== '' doesn't work) (#6999) 2019-05-23 19:59:27 -07:00
sreyemnayr
f85ac97d8c Feedback for Kits; Fix checkins for accessories (#7060)
* Kits feedback

* Fix accessory checkin
2019-05-23 19:39:30 -07:00
Ivan Nieto
e40a5a70a5 RTF support added (#7024)
* Added the Gatte Facade to AssetsController

* Added the filetype RTF in the modal to upload files

* Added validation of RTF files
2019-05-15 15:47:40 -07:00
snipe
407445456a Merge branch 'features/6204_email_audit-alerts' into develop
# Conflicts:
#	app/Console/Commands/LdapSync.php
#	app/Console/Kernel.php
#	app/Http/Controllers/Auth/LoginController.php
#	app/Http/Controllers/LicensesController.php
#	composer.json
#	composer.lock
#	config/version.php
#	resources/views/auth/two_factor_enroll.blade.php
2019-05-06 08:45:13 -04:00
snipe
c6d3c031c7 Bumped version
(I will release this version officially tomorrow)
2019-05-05 22:32:01 -04:00
snipe
a86409868e Derp. Wrong version 2019-05-05 22:31:43 -04:00
snipe
e4a298ca2a Added scope for both overdue and upcoming 2019-05-05 22:13:30 -04:00
vicleos
ab8792a13d Update CompaniesController.php (#6900)
fixed companies destroy error
2019-05-05 20:57:28 -04:00
snipe
00a8a2aff3 Fixed next audit date math 2019-05-05 20:00:05 -04:00
snipe
7497eaf302 Removed unused setting variable 2019-05-05 19:58:08 -04:00
snipe
7d416d1175 Fixed :threshold placeholder 2019-05-05 19:57:23 -04:00
snipe
e9b9301efb Added language strings for audit views 2019-05-05 19:35:20 -04:00
snipe
7b194c678c Cleanup on audit due/overdue console command 2019-05-05 19:22:08 -04:00
snipe
4369d6adc6 Added audit due/overdue blades 2019-05-05 19:21:48 -04:00
snipe
69614a7db4 Added gated sidenav items to left nav 2019-05-05 19:21:26 -04:00
snipe
8154d1116c Added bootstrap-tables presenter formatter to display an audit button 2019-05-05 19:21:06 -04:00
snipe
05a85c628f Added audit presenter 2019-05-05 19:20:17 -04:00
snipe
0f0ffd39a8 Added ability to pass audit specs to main API asset search method 2019-05-05 19:19:56 -04:00
snipe
996a4cc29b Added audit due console command to kernel 2019-05-05 19:15:24 -04:00
snipe
0e234bac70 Added query scopes for due and overdue audits 2019-05-05 19:14:02 -04:00
snipe
ab060288fa Controller/API methods for due/overdue audits
We could probably skip this and just handle it via view in the routes…
2019-05-05 19:13:37 -04:00
snipe
52c9e8ad96 Added route to list overdue / upcoming assets via API 2019-05-05 19:11:28 -04:00
snipe
e46cccdf90 Added upcoming audit report
TODO: Fid diff/threshold math
2019-05-04 17:52:17 -04:00
ajsy
a714cd357f Update web.php 2019-05-03 15:22:05 +03:00
ajsy
0cdc7af611 Update print.blade.php 2019-05-03 15:22:01 +03:00
ajsy
9b3a8c046c Update LocationsController.php 2019-05-03 15:21:57 +03:00
ajsy
878cfee5a2 Revert "Delete print.blade.php"
This reverts commit a0721412fa.
2019-04-20 09:28:48 +03:00
ajsy
a0721412fa Delete print.blade.php 2019-04-19 15:50:05 +03:00
ajsy
52add03e56 Update print.blade.php
replace string in serial number with x except last five character
2019-04-19 15:43:40 +03:00
ajsy
c974968821 Update view.blade.php 2019-04-19 14:03:09 +03:00
ajsy
5dcf9fbb50 Update web.php 2019-04-19 13:20:44 +03:00
ajsy
f2242fa32e Update view.blade.php 2019-04-19 13:20:41 +03:00
ajsy
38e8028300 Update LocationsController.php 2019-04-19 13:20:37 +03:00
ajsy
7a68187466 Update table.php 2019-04-19 13:20:31 +03:00
snipe
ded1a59914 Removed help text for email images (since we embed them by default now)
Added help text for username format
2019-04-02 18:22:31 -07:00
snipe
fe553aec02 Added first-initial dot lastname format for usernames/email
Fixed [ch1379]
2019-04-02 18:21:54 -07:00
snipe
37b8029d04 Fixed parse error on label settings
Also fixed [ch1362] - moving left/right
2019-04-02 18:04:31 -07:00
Ivan Nieto
b1f96448af Remove old redundant code in LicensesController, added an offset to AccessoriesController for pagination to work correctly (#6847) 2019-04-02 10:13:58 -07:00
Martin Meredith
b779e274cc Fix usage of Google2FA Facade (#6864) 2019-03-27 22:01:38 -07:00
Martin Meredith
83257af267 Fix imports for 2FA Login (#6855) 2019-03-26 14:10:56 -07:00
snipe
109a29b5fc Fix error in tests 2019-03-20 04:39:50 -07:00
snipe
d01f9a701c Fix double-encoding issue?
I assume there’s something new in Laravel 5.7/5.8 that’s causing the double escaping. I’m not seeing it everywhere, which is more confusing, TBH. :-/
2019-03-20 04:12:03 -07:00
snipe
53419b33a5 Compiled assets 2019-03-20 02:35:32 -07:00
snipe
d429a1c423 Bumped version 2019-03-20 02:32:32 -07:00
snipe
fe0bda0d04 Updated composer 2019-03-20 02:31:13 -07:00
snipe
acb90c7aee Horrible master -> dev merge that makes baby jesus cry :(
# Conflicts:
#	app/Http/Controllers/Auth/LoginController.php
#	composer.json
#	composer.lock
#	resources/views/auth/two_factor_enroll.blade.php
2019-03-20 02:24:23 -07:00
snipe
bca82684a1 Merge branch 'hotfixes/2fa_qr' into develop
# Conflicts:
#	.all-contributorsrc
#	Dockerfile
#	README.md
#	app/Console/Commands/LdapSync.php
#	app/Http/Controllers/Api/ImportController.php
#	app/Http/Controllers/AssetModelsController.php
#	app/Http/Controllers/Assets/AssetsController.php
#	app/Http/Controllers/Auth/LoginController.php
#	app/Http/Controllers/CategoriesController.php
#	app/Http/Controllers/CompaniesController.php
#	app/Http/Controllers/DepartmentsController.php
#	app/Http/Controllers/ImportsController.php
#	app/Http/Controllers/LocationsController.php
#	app/Http/Controllers/ManufacturersController.php
#	app/Http/Controllers/SuppliersController.php
#	app/Http/Requests/ItemImportRequest.php
#	app/Http/Transformers/ActionlogsTransformer.php
#	composer.json
#	composer.lock
#	config/app.php
#	config/version.php
#	docker/startup.sh
#	public/css/build/all.css
#	public/css/dist/all.css
#	public/js/build/all.js
#	public/js/build/vue.js
#	public/js/build/vue.js.map
#	public/js/dist/all.js
#	public/mix-manifest.json
2019-03-20 02:17:02 -07:00
snipe
335e8ffaaa Typo 2019-03-20 01:22:20 -07:00
snipe
8d0ee9e531 Moar comments 2019-03-20 01:21:34 -07:00
snipe
cc5c7d33e7 Added comments 2019-03-20 01:14:58 -07:00
snipe
69c61420f6 Updated composer lock 2019-03-20 00:50:15 -07:00
snipe
5699e021de Update auth controllers to use translations 2019-03-20 00:50:09 -07:00
snipe
cf92618c70 Fixed #6834 and #6402 - use inline QR code generation for 2019-03-20 00:49:44 -07:00
snipe
a874dbb0d0 Working attempt, but will try with old library for mininal footprint 2019-03-19 23:18:16 -07:00
snipe
0614ab4362 Upgraded pragmarx/google2fa 2019-03-19 23:10:49 -07:00
snipe
8ed268819e Fixed XSS 2019-03-18 21:09:57 -07:00
Martin Meredith
1d26195821 Add models IDE helper to .gitignore (#6829) 2019-03-18 11:58:33 -07:00
Ivan Nieto
bebdbdfb87 Fix #6763. Import Stuck Processing - Error - Can only flip STRING and INTEGER values! (#6804)
* Added validation for errors when the Import Field to map isn't setted

* A slightly correction to the error message

* Added the translation strings for the Error Message
2019-03-14 12:32:40 -07:00
snipe
26c0cf5d33 Allow null for logCheckin $action_date 2019-03-14 01:22:29 -07:00
snipe
239f21b0d7 Set null option for $action_date 2019-03-14 01:09:16 -07:00
snipe
0b927623e8 Added “record created” string for clarification in asset/license history 2019-03-13 22:06:57 -07:00
snipe
96f069c417 Change action_datwe to datetime in transformer 2019-03-13 21:57:06 -07:00
snipe
60e52cc927 Make action_date a datetime 2019-03-13 21:53:56 -07:00
snipe
9f79028391 Fixed copypasta in email_logo down() method 2019-03-13 21:53:45 -07:00
Ivan Nieto
c7f48951a9 Valo/checkin date in history of asset (#6733)
* To see checkin/checkout Date in History of Asset

* Added some logic to get today's date if the checkin_at input is blank

* Updating the action_date taking the value from the action_log table

* Hide created_at field and rename 'Action Date' as only 'Date'
2019-03-13 21:36:32 -07:00
Marián Skrip
8d63533205 Add write-only image_source field for asset create/edit API endpoint (#6146)
`image_source` should contain base64 encoded image data with mime-type.
2019-03-13 21:00:40 -07:00
Ivan Nieto
8c65214b1f Ignore the soft deleted assets in the eloquent query (#6824) 2019-03-13 20:14:30 -07:00
Martin Meredith
e3e0d57f56 Minor code cleanup bits and bobs (#6805)
* Add IDE Helper files

* Cleanup imports

- Alphabetises imports
- Removes unused imports

* Add Platform requirements

* Move filling asset into block where asset exists

* Remove duplicate array keys
2019-03-13 20:12:03 -07:00
snipe
55f727ef28 Fixed HTML labels on alerts setting page
Originally https://github.com/snipe/snipe-it/pull/6808/ by @timothyfarmer - I also updated the error class logic in the same block
2019-03-13 19:53:23 -07:00
snipe
6c71e72dcd Fixed labels labels (wha?)
Wrong HTML labels for some fields in the Settings > Labels page.

Originally https://github.com/snipe/snipe-it/pull/6809 by @timothyfarmer but it was made against the wrong branch
2019-03-13 19:50:35 -07:00
snipe
79f4f46e3a Add @timothyfarmer as a contributor 2019-03-13 19:45:40 -07:00
snipe
fddf0cdd15 Added hungary time format 2019-03-13 19:45:30 -07:00
snipe
8efbde61c9 Merge branch 'fixes/kit_fixes' into develop 2019-03-13 12:16:20 -07:00
snipe
2c79ed5fc1 Added kit permissions 2019-03-13 12:15:54 -07:00
snipe
1b0d855c00 Added translation, removed commented out code 2019-03-13 12:15:48 -07:00
Martin Meredith
f403db274a (develop) Fix asset auto-incrementation (#6806)
* Fix auto-increment not updating

This is due to the addition of caching for settings.  If we're not
explicitly saving the Settings model, then the cache isn't getting
updated, causing the asset tag auto-increment to get an old cached
version with the wrong number

* Move Setting cache clear to an observer
2019-03-13 10:58:35 -07:00
Martin Meredith
a462e91983 (develop): Fix failing Unit Tests (#6807)
* Reference correct class for Licence Model

* Make sure we activate users in test to send Welcome Notification
2019-03-13 10:57:43 -07:00
ajsy
57c0f69286 Update LocationsController.php 2019-03-09 13:45:19 +03:00
ajsy
03c5b8e4ab Create print.blade.php 2019-03-09 11:36:42 +03:00
ajsy
311dd18443 Update LocationsController.php 2019-03-09 11:34:47 +03:00
ajsy
a958d56590 Update view.blade.php 2019-03-09 11:29:06 +03:00
ajsy
c11e93b72f Update web.php 2019-03-09 11:14:24 +03:00
snipe
7e8d337ed5 Moved kit icon 2019-03-08 16:49:05 -08:00
snipe
400907cc40 Merge branch 'develop' of https://github.com/snipe/snipe-it into develop 2019-03-08 16:24:12 -08:00
snipe
74f33441d3 Merge branch 'VELIKII-DIVAN-develop' into develop 2019-03-08 16:23:53 -08:00
snipe
61afdeac2e Merge branch 'develop' of https://github.com/VELIKII-DIVAN/snipe-it into VELIKII-DIVAN-develop 2019-03-08 16:18:48 -08:00
Martin Meredith
55cbbf2b00 Fixes #6794: Fix URLs to access some 'missing' images (#6795)
* Fix image path for Model view

* Fix URLs for images in account view

* Fix Supplier view Image URL
2019-03-08 12:47:37 -08:00
Martin Meredith
daf6d98a3b Remove test data for Pie (#6793) 2019-03-08 12:46:47 -08:00
snipe
ab1f34604e Add @Mezzle as a contributor 2019-03-06 18:46:36 -08:00
Martin Meredith
0840ab41d5 Hotfix: Fix ability to create assets (#6790) 2019-03-06 16:37:58 -08:00
snipe
5293cb30bd Merge branch 'fixes/only_present_image_url_if_image_present_in_profile_api' into develop 2019-03-05 23:54:08 -08:00
snipe
0b0813b260 Fixed error if item requested or request was deleted
ch628
2019-03-05 23:46:40 -08:00
snipe
6f1a70ee09 Fixed ch1086 - Merge branch 'fixes/search_consumables_by_item_number' into develop
# Conflicts:
#	app/Http/Controllers/Api/UsersController.php
2019-03-05 23:23:46 -08:00
snipe
3b41aa52c8 Added ability to search consumables by item number
Fixes ch1086
2019-03-05 23:20:16 -08:00
snipe
c211cc733c Bumped hash 2019-03-05 21:26:24 -08:00
snipe
6696685d0b Merge branch 'fixes/full_name_search_user_selectlist' into develop
# Conflicts:
#	app/Http/Controllers/Api/UsersController.php
#	routes/api.php
2019-03-05 20:57:10 -08:00
snipe
f065bd7784 Added ability to do full name search in user dropdown selectlist 2019-03-05 20:40:05 -08:00
Steffen
de39906cae Put file contents instead of file object (creates subdirectory with a single file) (#6760) 2019-03-05 12:08:18 -08:00
snipe
27280b8866 Added link to marksman 2019-03-01 17:41:02 -08:00
snipe
288cc01c41 Merge branch 'features/accessories_users' into develop
# Conflicts:
#	app/Http/Controllers/Api/UsersController.php
#	config/version.php
#	routes/api.php
2019-03-01 17:30:03 -08:00
snipe
348c13f318 Add accessories endpoint to user API 2019-03-01 16:31:22 -08:00
Steffen
e1907e30b1 Allow multiple upload fields and add logo option to labels (#6736)
* Change upload js to work with multiple upload elements on a single page

* Change uploadFile in upload modal and form partial

* Change uploadFile to js-uploadFile to avoid potential issues in the future

* Remove duplicate style attribute causing webpack to fail

* Missed a css class in rename to js- prefix

* - Move logo uploads to partial for eaiser usage
- Add label logo
- Add css classes to label elements
- Change label prefix text (M: S: ...) to css::before content for easy removal in config

* Add more css classes to labels

* Allow unescaped " (quot) in css ouput

* Add max size param to partial, set defaults for allowedType and size
2019-03-01 15:25:42 -08:00
Dmitrii Minaev
16bb784e78 Codestyle & bug fixes 2019-02-28 01:37:58 +03:00
snipe
c47fa5ad1c Fixed missing @endcan 2019-02-26 19:14:28 -08:00
Dmitrii Minaev
d3c320e56f Code comments and format 2019-02-23 22:44:03 +03:00
snipe
983a9a4e0e Fixes/integrity constraint (#6755)
* Migration to fix nullables

This should fix an issue introduced in 90cddb7aee where we’re passing null instead of an empty string (necessary to nullify values via the API)

* Removed asset migration - serial was already fixed
2019-02-22 13:21:31 -08:00
snipe
d0659bed35 Removed duplicate migration 2019-02-20 21:39:52 -08:00
snipe
f7e976cce9 Merge branch 'fixes/make_serial_nullable' into develop 2019-02-20 21:05:18 -08:00
snipe
1573e2a91f Bumped hash 2019-02-20 20:52:08 -08:00
snipe
86a6322562 Merge branch 'fixes/make_serial_nullable' into develop
# Conflicts:
#	app/Http/Controllers/Api/ConsumablesController.php
#	config/version.php
2019-02-20 20:48:51 -08:00
Dmitrii Minaev
5f3a0bdea5 app\Services\PredefinedKitService.php rename to app\Services\PredefinedKitCheckoutService.php
add accessories and consumables tables
add selectlist api to:
 app\Http\Controllers\Api\AccessoriesController.php
 app\Http\Controllers\Api\ConsumablesController.php
 app\Http\Controllers\Api\LicensesController.php
templates for selectlist
apply kit to user works
2019-02-19 22:19:00 +03:00
snipe
b91ba47b0e Fixed migration 2019-02-16 11:42:35 -08:00
snipe
0242b3ec74 Handled JS cookie offset issue on the server side
We may want to handle this via the blades instead, as I’m not sure if API users will run into weirdness here.
2019-02-14 15:01:34 -08:00
snipe
2b6675138e Added autolabeler for PRs
https://github.com/probot/autolabeler
2019-02-14 13:57:07 -08:00
snipe
2624b8c827 Added weekly digest app for repo
https://github.com/apps/weekly-digest
2019-02-14 13:52:56 -08:00
snipe
bfc1ebc4ba Merge branch 'fixes/auto_increment_prefix' into develop 2019-02-14 13:09:40 -08:00
snipe
6b106e48e9 Added migration to make auto_increment_prefix explicitly nullable 2019-02-14 12:45:21 -08:00
snipe
18c591f993 Possible fix for #6710 - explicitly make auto_increment_prefix nullable 2019-02-14 12:30:18 -08:00
snipe
0000f487ac Merge remote-tracking branch 'origin/fixes/password_confirmation_6703' into develop
# Conflicts:
#	config/version.php
2019-02-13 23:02:21 -08:00
snipe
c3c4ad1ae6 One more try to fix tests - confirmation won’t validate until password validates 2019-02-13 22:45:05 -08:00
snipe
a4420efb7d I guess we use 10 as the settings for password min in tests 2019-02-13 22:13:32 -08:00
snipe
d24851c5d8 Merge branch 'develop' of https://github.com/snipe/snipe-it into develop 2019-02-13 22:04:58 -08:00
snipe
794bc45cc0 Fixed tests 2019-02-13 21:59:24 -08:00
snipe
d893837c86 Removed debugging 2019-02-13 21:32:26 -08:00
snipe
230c9da1df Fixed #6703 - fixes password confirmation 2019-02-13 21:30:15 -08:00
snipe
b5aadd4b74 Add @lubo as a contributor 2019-02-13 20:50:25 -08:00
Ľubomír Kučera
9183de578d docker: Fix upgrades (#6680)
Until now, the Docker image was not performing actions that are
necessary for an upgrade completion. That is considered an
anti-pattern.

See https://snipe-it.readme.io/docs/upgrading for more information.
2019-02-13 20:49:36 -08:00
snipe
cd1ef1d316 Literally no idea where that folder came from 2019-02-13 07:58:11 -08:00
snipe
9247dc592b Removed debugging statements 2019-02-13 07:09:49 -08:00
snipe
35898e4ca0 Added asset tag to maintenances report 2019-02-13 07:09:16 -08:00
snipe
cd333fa93b Fixed wonky merge :( 2019-02-13 06:52:36 -08:00
snipe
533649f24e Merge branch 'develop' into dev-master-integration
# Conflicts:
#	.gitignore
#	.travis.yml
#	app/Console/Commands/LdapSync.php
#	app/Console/Commands/SendExpectedCheckinAlerts.php
#	app/Console/Commands/SendExpirationAlerts.php
#	app/Console/Commands/SendInventoryAlerts.php
#	app/Console/Kernel.php
#	app/Http/Controllers/Api/AssetsController.php
#	app/Http/Controllers/Api/ManufacturersController.php
#	app/Http/Controllers/Api/StatuslabelsController.php
#	app/Http/Controllers/Api/UsersController.php
#	app/Http/Controllers/AssetMaintenancesController.php
#	app/Http/Controllers/Assets/AssetsController.php
#	app/Http/Controllers/Auth/ForgotPasswordController.php
#	app/Http/Controllers/Auth/LoginController.php
#	app/Http/Controllers/Auth/ResetPasswordController.php
#	app/Http/Controllers/ReportsController.php
#	app/Http/Controllers/SettingsController.php
#	app/Http/Controllers/UsersController.php
#	app/Http/Transformers/AssetMaintenancesTransformer.php
#	app/Importer/Importer.php
#	app/Importer/ItemImporter.php
#	app/Importer/UserImporter.php
#	app/Importer/import_mappings.md
#	app/Models/Ldap.php
#	app/Models/License.php
#	app/Models/Location.php
#	app/Models/Recipients/AlertRecipient.php
#	app/Models/User.php
#	app/Providers/AppServiceProvider.php
#	composer.json
#	composer.lock
#	config/trustedproxy.php
#	config/version.php
#	public/js/build/all.js
#	public/js/build/vue.js
#	public/js/build/vue.js.map
#	public/js/dist/all.js
#	public/mix-manifest.json
#	resources/assets/js/components/importer/importer-file.vue
#	resources/lang/ar/admin/settings/general.php
#	resources/lang/bg/admin/settings/general.php
#	resources/lang/en-ID/admin/settings/general.php
#	resources/lang/en-ID/passwords.php
#	resources/lang/en/passwords.php
#	resources/lang/es-CO/passwords.php
#	resources/lang/es-ES/passwords.php
#	resources/lang/es-MX/passwords.php
#	resources/lang/es-VE/passwords.php
#	resources/lang/fi/admin/settings/general.php
#	resources/lang/id/admin/settings/general.php
#	resources/lang/id/passwords.php
#	resources/lang/ja/passwords.php
#	resources/lang/nl/passwords.php
#	resources/lang/pl/admin/settings/general.php
#	resources/lang/pl/passwords.php
#	resources/lang/pt-BR/admin/settings/general.php
#	resources/lang/pt-BR/passwords.php
#	resources/lang/ru/admin/settings/general.php
#	resources/lang/ru/admin/statuslabels/table.php
#	resources/lang/ru/passwords.php
#	resources/lang/sr-CS/general.php
#	resources/lang/sr-CS/mail.php
#	resources/lang/sv-SE/admin/settings/general.php
#	resources/lang/tr/admin/settings/general.php
#	resources/lang/tr/passwords.php
#	resources/lang/vi/admin/models/message.php
#	resources/lang/vi/admin/users/general.php
#	resources/lang/zh-CN/admin/settings/general.php
#	resources/views/importer/import.blade.php
#	resources/views/partials/bootstrap-table.blade.php
#	resources/views/partials/forms/edit/image-upload.blade.php
#	resources/views/users/edit.blade.php
#	resources/views/users/view.blade.php
#	tests/unit/ImporterTest.php
2019-02-13 06:42:52 -08:00
snipe
3b525f0009 Fixed #6705 - undefined is not a function (near '...$.validate...')
Not sure what happened here, but re-running webpack seems to have resolved it.
2019-02-13 05:16:12 -08:00
snipe
f1fa5bdaa9 Fixed (develop) #6704 - don’t apply gate to $arrays collection, just check that they can view assets 2019-02-13 04:56:13 -08:00
snipe
2768ea692e Removed extraneous js call 2019-02-13 04:24:37 -08:00
snipe
83c511e1c8 Removed gh-changelog - we don’t use it anymore 2019-02-13 04:24:23 -08:00
snipe
35e60fd151 Updated languages 2019-02-13 03:56:18 -08:00
snipe
471fcd1272 Set beta version tag 2019-02-13 02:27:56 -08:00
snipe
1e1d32dc85 Make user notes field editable via API 2019-02-13 01:32:00 -08:00
snipe
b317fb8d83 Fixed #6367 - pass table name and column_id to scopeCompanyables 2019-02-13 01:29:53 -08:00
snipe
245b3ca09f Fixed #6061 - Assigned user group cannot be removed 2019-02-12 23:49:42 -08:00
snipe
da34b82b3e Do not count deleted locations in managedLocation check on user delete 2019-02-12 23:33:01 -08:00
snipe
8e358faebc Fixed #6113 - use $asset->fill vs filled() to allow blanking values via API 2019-02-12 22:15:32 -08:00
herroworrd
3f7d2aebc7 Fixed #6634: Asset Import History fixes and optimizations (#6657)
* Starting work on asset history importer.

* Starting work on asset history importer.

* Added checkin target.

* Last change... importing history should also probably be an admin only task.

* Added caching for user and asset queries.

* Updated cache keepalive time to DateTimeInterface

* Updated cache keepalive time to DateTimeInterface
2019-02-08 16:05:56 -08:00
Steffen
5624ea14e7 Fix accessories edit error (#6698)
* Add accessories_upload_path singleton (used in accessories/edit)

* Fix indent
2019-02-08 15:43:11 -08:00
Steffen
3530603797 Simplify slack channel regexp and allow private (no # prefix) channels and direct messages (@ prefix) (#6699) 2019-02-08 15:41:54 -08:00
snipe
4fd469e07b Prevent editing special users demo mode 2019-02-04 19:13:55 -08:00
snipe
59cb1e561e Merge branch 'develop' of https://github.com/snipe/snipe-it into develop 2019-02-04 18:59:53 -08:00
snipe
4fe63d2966 Fixed #6633 - return 200 status code on asset API 2019-02-04 18:59:49 -08:00
Ivan Nieto
9ac40f705c Valo/ch37/cannot log in with generated password from (#6655)
* Cannot log in with generated password from [ch37]

* Cannot log in with generated password from [ch37]. Light cleanup

* Added the fetchHumanBoolean() method.

* Cleaning up the ternary
2019-01-31 19:58:54 -08:00
Colin Campbell
ef8e20f66b Alpine linux docker image (#6645)
* docker-alpine: Alpine linux container + apache 2.4 support

* docker-alpine: Force passport migrations (production mode Exception)

* docker-alpine: Copy default env in Dockerfile
2019-01-30 14:45:36 -08:00
Dmitrii Minaev
e01e0c5596 Add licenses, accessories and consumables table presenters app\Presenters\PredefinedKitPresenter.php resources\views\partials\bootstrap-table.blade.php
Add refresh licenses, accessories and consumables tables refresh when add a new element resources\assets\js\snipeit_modals.js
Some design fixes resources\views\kits\edit.blade.php
Add default value to form (template) resources\views\modals\kit-model.blade.php
New routes for kit accessories and kit consumables routes\api.php
New routes for kit models, kit accessories and kit consumables routes\web\kits.php
New templates
2019-01-27 23:19:24 +03:00
snipe
9d21fc85bc Fixed #6644 - asset name not linked in Reports > Asset Maintenance Report 2019-01-25 20:59:54 -08:00
Ivan Nieto
79b41ee662 Importing with CSV into Encrypted Custom [ch86] (#6642) 2019-01-25 14:26:59 -08:00
Colin Campbell
f8d9301bd4 fix-docker-pecl: Fix Dockerfile after pear.php.net hack (#6641) 2019-01-25 13:41:39 -08:00
snipe
c1a4fbee16 Merge branch 'develop' of https://github.com/snipe/snipe-it into develop 2019-01-25 13:34:57 -08:00
Colin Campbell
8c632f63b0 Misc ldap fixes (#6631)
* misc_ldap_fixes: Map location from OU, not group

* misc_ldap_fixes: Ensure ldap is initialised for import

* misc_ldap_fixes: Import Job Title

* misc_ldap_fixes: Import telephone, fix field select from schema

* misc_ldap_fixes: Cleanup login error-handling, fix boolean tests
2019-01-24 16:15:44 -08:00
Ivan Nieto
7d982c9ea6 Import page is blank [ch90] (#6636) 2019-01-24 15:34:50 -08:00
snipe
ec4161a959 Fixed typo 2019-01-24 15:21:38 -08:00
snipe
b326d8593b Fixed bad groups route on error 2019-01-24 14:56:47 -08:00
snipe
d1fe7abb18 Replaced custom deleted query scopes with onlyTrashed() 2019-01-24 14:47:44 -08:00
snipe
ffc51d6db6 Specify table name in deleted user display 2019-01-24 14:33:54 -08:00
snipe
394e51029e Only try to upload the audit file if one is provided 2019-01-24 14:04:06 -08:00
snipe
4b8f9d810b Fixed #6625 - include fully depreciated date in custom asset report 2019-01-24 12:38:17 -08:00
snipe
89a2ce1c6c Add @jackka as a contributor 2019-01-23 14:12:15 -08:00
snipe
c6ad7f80a8 Add @omyno as a contributor 2019-01-23 14:12:03 -08:00
snipe
7e6a59bdcc Add @KeenRivals as a contributor 2019-01-23 14:11:37 -08:00
snipe
8ebd9afd15 Add @reuser as a contributor 2019-01-23 14:11:23 -08:00
snipe
d1b9eddb34 Add @shinayoshi as a contributor 2019-01-23 14:11:11 -08:00
snipe
0394dd7ee5 Add @andreybolonin as a contributor 2019-01-23 14:10:59 -08:00
snipe
53c6c74a43 Add @fanta8897 as a contributor 2019-01-23 14:10:46 -08:00
snipe
65c5378a10 Add @Sxderp as a contributor 2019-01-23 14:10:35 -08:00
snipe
1c6cbbf8ee Add @smb as a contributor 2019-01-23 14:10:21 -08:00
snipe
10cb4ec401 Add @NMathar as a contributor 2019-01-23 14:10:06 -08:00
bricelabelle
5281713fd9 Added #6617: View licenses checked out to an asset with the hardware API (#6621) 2019-01-22 14:47:40 -08:00
snipe
7982b3f237 Merge branch 'develop' of https://github.com/snipe/snipe-it into develop 2019-01-22 14:13:39 -08:00
snipe
07eead2dbf Fixed bug where assets could be deleted without being checked back in [ch38] 2019-01-22 14:13:30 -08:00
Ivan Nieto
3fa5976315 Language of mail doesn't show as intended by the settings. [ch87] (#6619)
* Fixes #5554. Language of mail doesn't show as intended by the settings.
2019-01-22 14:02:08 -08:00
NMathar
66f557d436 add user license api endpoint fix #6241 (#6616) 2019-01-22 13:48:15 -08:00
snipe
fdd6ddf61b Fixed favicon upload
[ch309]
2019-01-18 14:05:52 -08:00
snipe
4129463923 Added filesstem cache 2019-01-18 14:05:10 -08:00
Ivan Nieto
310ed0f1d3 Fix an issue when trying to checkin a license seat. [ch46] (#6599)
* Fix an issue when trying to checkin a license seat.

* Minor changes in the checkin view, so it can returns to the expected place where the checkin is launched.
2019-01-17 20:36:40 -08:00
snipe
1eace04ad9 Handle asset maintenances that do not have a valid asset associated 2019-01-16 02:26:42 -08:00
Steffen
74c099f0b3 fix LDAP/AD sync: function calls for password creation (#6581)
* - change generatePassword to be more secure (allow duplicate chars)
- move generatePassword from trait to helper
- fix summary output for sync command

* - Don't treat ldap_active_flag as boolean - fixes sync not working at all when ldap field is set
- Sync non activated users (But set activated=0)

* - Read user first before checking against user settings

* Fix failed logins to not throw exceptions
2019-01-15 14:05:47 -08:00
omyno
f0500e9797 Show user's signature in print view (#6471) 2019-01-15 14:03:40 -08:00
Wes Hulette
3e19509a49 Fixed: #6395 - Adjusted graph size (#6518)
* Fixed missing oauth tables during setup.

* Merge remote-tracking branch 'snipe-it-upstream/develop' into develop

* Merge remote-tracking branch 'snipe-it-upstream/develop' into develop



Merge remote-tracking branch 'origin/develop' into develop

* Fixed Pie Graph sizing on dashboard

Updated chart.js to 2.7.3
Added height to canvas
2019-01-15 14:02:49 -08:00
snipe
125938762b Patched #6565 to develop 2019-01-15 14:02:10 -08:00
Steffen
61c619660d Initialize customFormat to prevent Blade error when creating new fields (#6596) 2019-01-15 13:56:56 -08:00
Steffen
1de9087427 LDAP fixes (#6533)
* Add iCheck png files to webpack config (inconsistency for css <> png) and blue.png to public folder

* php 7.3 collect() fix (undefined variable)

* Fix travis ci

* Add iCheck png files to webpack config (inconsistency for css <> png) and blue.png to public folder

* php 7.3 collect() fix (undefined variable)

* change LDAP implementation from model to (singleton) service

* Re-apply check for content in ldap_server variable before parsing

* Update LDAP implementation

* Switch iCheck to minimal as referenced in js

* Don't init on load but on first access via init (returns ldap enabled status)

* Re-Enable notifications

* Re-add missing test target php versions

* Only init() once (singleton class, so ldap variable is already set)
2019-01-10 13:20:43 -08:00
shinayoshi
c23cdb0e31 Support Raspbian 9.x installs. (#6554)
* Updated code related to Raspbian.

Tested on Raspbian 9.6.
2019-01-10 13:18:30 -08:00
Kasey
5e06d53d8c buildable dockerfile (#6525)
Awesome, thanks!
2018-12-17 15:29:05 -08:00
Brady Wetherington
89a325c0ea Handle missing Flysystem env vars; let Debugbar autodiscover (#6514) 2018-12-17 14:04:56 -08:00
Brady Wetherington
1fdb057199 New LDAP system tries to load LDAP configuration before determining (#6512)
whether or not LDAP is actually enabled
2018-12-17 14:04:35 -08:00
Ivan Nieto
876ff2ef72 Fixes #6341. Some style changes in this fix. (#6492) 2018-12-14 18:08:33 -08:00
KeenRivals
f5ba2106cd Fix snipeit:unescape not unescaping quotes (#6506) 2018-12-14 18:08:00 -08:00
snipe
67f6df2be3 Fixed (develop) #4568 - escaping values in custom report 2018-12-12 19:40:15 -08:00
snipe
71f2440ddf Moved contributors to the bottom of the README 2018-12-12 18:52:45 -08:00
snipe
426dae0310 Fixed methods for PHP 7.3 compact() 2018-12-12 18:16:39 -08:00
snipe
f91fd3c91f Updated language string to include XML 2018-12-12 17:46:19 -08:00
snipe
86cc1a228d Fixed typo 2018-12-12 16:45:49 -08:00
snipe
394d265b96 Added XML to uploadable file type - re: #6099 2018-12-12 16:45:09 -08:00
snipe
6a6923b1d8 Fixed parse_url() expects parameter 1 to be string, null given 2018-12-12 16:37:27 -08:00
Steffen
28edf13457 WIP develop ldap fixes (errors, check if disabled, parsing in one place) (#6500)
* Fix errors and exception when ldap settings are empty (even with ldap disabled)

* Re-add newline at the end of file
2018-12-11 21:01:11 -08:00
snipe
93947b09c5 Small fix for #6484 - corrected LDAP sync command name 2018-12-11 15:18:30 -08:00
snipe
8b8ce256f5 Merge branch 'develop' of https://github.com/snipe/snipe-it into develop 2018-12-11 13:07:48 -08:00
snipe
4cc82a808f Updated composer 2018-12-11 13:07:23 -08:00
snipe
8313a069bf Temp fix for blank LDAP values when LDAP is disabled 2018-12-11 13:07:14 -08:00
Wes Hulette
b38d07064b Fixed: #5896 Custom fields of type "CUSTOM REGEX" are always saved as "ANY" (#6381)
* Fixed missing oauth tables during setup.

* Custom fields of type "CUSTOM REGEX" are always saved as "ANY" 

Fixes #5896

* Updated per PR

Fixed spelling

* Fixed logic error

Moved conditional code from view to controller
Added getFromatType function for dropdown
2018-12-06 20:05:04 -08:00
snipe
886b6dd265 Add @benrubson as a contributor 2018-12-06 15:19:16 -08:00
snipe
3d6bd73ed3 Port PR #6485 to develop 2018-12-06 14:40:28 -08:00
snipe
a874cc32a8 Fixed bonked merge conflict 2018-12-06 14:20:01 -08:00
Wes Hulette
34246ee4ef [WIP] v5 Develop: New LDAP implementation (#6352)
* Fixed missing oauth tables during setup.

* WIP New LDAP implementation

* WIP New LDAP implementation

* WIP New LDAP implementation


Merge remote-tracking branch 'origin/WIP_LDAP' into WIP_LDAP

* WIP New LDAP implementation

Added Adldap2 to handle ldap intergration.

* Updated per PR quality review

* Added specific LDAP settings method

* Corrected version number

* Added return documentation

* Added imports

* Changed class to be injected into controller

* Updated with PR suggestions
2018-12-06 14:05:43 -08:00
snipe
3ed2f55696 Merge branch 'develop' of https://github.com/snipe/snipe-it into develop 2018-12-05 19:56:18 -08:00
snipe
09c4dd4891 Added ability to upload favicon and email logo
todo: refactor the image upload/resize for less copypasta
2018-12-05 19:56:12 -08:00
snipe
81f9f717dc Updated favicon with new branding 2018-12-05 18:55:23 -08:00
snipe
fb502df089 Fixed dumb code indenting 2018-12-05 18:36:39 -08:00
Ivan Nieto
f91e340178 Fixes #6341. Adding condition that checks offset of licenses seats when the user looks other page than the first. (#6392) 2018-12-05 18:09:54 -08:00
snipe
f6c0e7cc9c Fixed #6464 - added company name to searchable field in user search 2018-12-05 17:20:22 -08:00
snipe
9f73fcf308 Added #6463 - ability to override session path in .env 2018-12-05 17:17:11 -08:00
Minaev Dmitriy
0bbe499414 Kits checkout. But only with models. 2018-11-13 20:33:32 +03:00
Evgeny
dd7db95135 A couple hardcoded strings replaced in according with #6406 (#6412)
Hardcoded strings was replaced with corresponding placeholders.
Log statuses mentioned in #6406 wasn't translated cause it needs more separate complicated development
2018-11-08 15:20:44 -08:00
Minaev Dmitriy
79d979f47f Full kits manipulation without users intagration 2018-11-06 19:27:28 +03:00
snipe
b6daad7573 Merge branch 'develop' of https://github.com/snipe/snipe-it into develop 2018-11-02 17:15:08 -07:00
snipe
67d2953080 Fixed #6386 - licenses not searching on category name 2018-11-02 17:15:04 -07:00
Wes Hulette
0d2eef5894 v5 Develop Fixed: Setup error because setting table does not exist (#6390)
* Fixed missing oauth tables during setup.

* Merge remote-tracking branch 'snipe-it-upstream/develop' into develop

* Merge remote-tracking branch 'snipe-it-upstream/develop' into develop



Merge remote-tracking branch 'origin/develop' into develop

* Fixed error during setup when settings table is not present
2018-11-02 12:23:41 -07:00
Wes Hulette
88b1da4260 Added: Caching of settings (#6378)
* Fixed missing oauth tables during setup.

* Cache settings

Cache the setting to reduce unnecessary database calls
2018-11-01 19:59:50 -07:00
Wes Hulette
0730685c29 v5 Develop Fixed: LDAP Settings Password being updated when field is empty (#6384)
* Fixed missing oauth tables during setup.

* Fixed password saving

Previous Input::has always returned true, even if password was an empty string.
2018-11-01 13:36:30 -07:00
snipe
ea91d59ffc Use username instead of email address in password reset (#6382)
* Switch to use username instead of email

* Fixed indenting

* Updated password language

* Updated blades to reflect username instead of email

* Changed password/reset controllers to use username instead of email

* Redirect to login page instead of repeating the password reset form
2018-10-31 18:03:24 -07:00
snipe
ce8d47b2b4 Merge branch 'develop' of https://github.com/snipe/snipe-it into develop 2018-10-31 15:19:18 -07:00
snipe
65aef11ae3 Fixed #5879 - added user department filter for custom report 2018-10-31 15:19:13 -07:00
snipe
8f22cf7c3c Added dept update API endpoint 2018-10-31 14:31:57 -07:00
Tim Bishop
7835cc34c8 Insert audited items to the top of the list. (#6376)
When doing a large number of items they soon disappear off the bottom of
the screen. It's handy to be able to check the result as it's happening
so adding them to the top of the list keeps the most recent items visible.

Move the "Processing..." spinner to the header so it stays at the top.
2018-10-31 11:13:08 -07:00
snipe
2cecd5e056 One more fix for #6175 (non-accessories) 2018-10-31 10:23:47 -07:00
snipe
5da9120870 Fixed #6175 - crashing when accessory has been deleted
My guess would be this crash (reported in #6175) was happening because of deleted accessories/accessory rows.
2018-10-31 10:23:32 -07:00
Minaev Dmitriy
9d5cd27575 New save mechanic 2018-10-31 16:06:38 +03:00
snipe
5faf8bfcd0 Fixed error on unaccepted asset report 2018-10-29 14:39:42 -07:00
snipe
f0e6a5c905 Fixed error on asset creation 2018-10-29 14:35:34 -07:00
snipe
a483e9365b Add APP_LOG_LEVEL to new logging config 2018-10-25 21:01:14 -07:00
snipe
e443a576f7 Merge branch 'develop' of https://github.com/snipe/snipe-it into develop 2018-10-19 16:46:53 -07:00
snipe
20b26effdb Fixed #6349 - add view permission for print all assigned 2018-10-19 16:46:46 -07:00
Minaev Dmitriy
f1f7694835 Merge remote-tracking branch 'remotes/upstream/develop' into develop 2018-10-19 19:00:53 +03:00
Minaev Dmitriy
0e66c3cb56 Predefined kits test 2018-10-19 17:30:25 +03:00
Wes Hulette
b3672d6365 Fixed: Settings seeder error (#6334)
* Fixed missing oauth tables during setup.

* Fixed seeding error

Required setting pwd_secure_min was missing from seeder.
2018-10-17 13:38:27 -07:00
Wes Hulette
a975117eaf Fixed: #6325 & #6317 (#6335)
* Fixed missing oauth tables during setup.

* Fixed missing manager_id and department_id
2018-10-17 13:38:13 -07:00
Wes Hulette
465b69516d Fixed: #6259 - Remove remote JS/CSS file loading (#6330)
* Fixed missing oauth tables during setup.

* Remove remote JS/CSS file loading


Updated gravatar to return to default image

* Updated default avatar path to user url

Removed local html5shim & response js files.
Removed copying html5shim & respond js file to public directory
2018-10-17 12:52:01 -07:00
snipe
2ded2ff53a Make dashboard snapshots clickable 2018-10-15 18:19:30 -07:00
snipe
74c20e62d5 Fixed - suppress the asset create button if the user is not allowed to create assets 2018-10-15 17:57:47 -07:00
snipe
0dbce93d1b Better logic for disallowing company selection when user is not a superadmin and FCS is enabled 2018-10-15 17:57:28 -07:00
snipe
9797412d23 Merge branch 'develop' of https://github.com/snipe/snipe-it into develop 2018-10-15 17:02:39 -07:00
snipe
6b6cf06530 Display asset name if one exists and the user cannot edit 2018-10-15 17:02:31 -07:00
snipe
539c3023b9 Added - check whether the user can edit an asset before allowing them to change the name on checkout 2018-10-15 16:52:45 -07:00
snipe
78b6e84774 Allow min:0 for consumables 2018-10-15 16:52:20 -07:00
Joe Ferguson
704209de9c Fixed #6301: Do not allow duplicate asset tags (#6324)
* Fixed #6301: Do not allow duplicate asset tags

* Display error message for single asset_tag failure
2018-10-11 17:15:09 -07:00
snipe
b8f8d49927 Merge branch 'develop' of https://github.com/snipe/snipe-it into develop 2018-10-11 15:29:48 -07:00
snipe
63a2727077 Fixed #6323 - typo in link for low inventory 2018-10-11 15:29:38 -07:00
Ivan Nieto
5516978f2e #5696 proposed fix (#6314)
* Another 'or' caught in a blade template

* Added the requireAcceptance() method in LicenseSeat.php. Changed the permission in checkout-license mail to view.

* Getting right the permission in the view checkout-license
2018-10-11 14:08:09 -07:00
Wes Hulette
19ee62f704 Fixed: Missing JS file import (#6320)
* Fixed missing oauth tables during setup.

* Fixed missing JS import
2018-10-11 13:51:37 -07:00
snipe
dff674b4ab Production assets 2018-10-09 16:12:43 -07:00
snipe
73788817ff Fixed #6306 - seed settings if no record exists 2018-10-09 16:12:26 -07:00
Wes Hulette
d715ecf41d Fixed: Tooltips (#6309)
* Fixed missing oauth tables during setup.

* Fixed missing tooltips

Updated spelling in bootstrap-table.blade.php to use bootstrap data element. 
Using custom jquery-ui without tooltips to fix conflict issue.

* Removed custom jQuery ui file added fix in bootstrap.js file
2018-10-09 15:20:27 -07:00
Wes Hulette
6818901f7d Fixed: Admin LTE left menu bar not working (#6308)
* Fixed missing oauth tables during setup.

* Updated per AdminLTE upgrade guide.
2018-10-09 15:20:12 -07:00
Wes Hulette
19bc158ff4 Fixed tooltips and iCheck (#6303)
* Fixed missing oauth tables during setup.

* Fixed duplicate style tag

This was causing webpack issues.

* Deleted erroneously created directory

* Removed duplicate imports

* Fixed tooltips, iCheck audit page

https://github.com/snipe/snipe-it/pull/6285#issuecomment-427235280

* Merge remote-tracking branch 'origin/#6285-Fixes' into #6285-Fixes
Fixed Manifest file
2018-10-05 07:41:04 -07:00
snipe
a516e4278e Remove company select option if the user is not an admin and FCS is enabled 2018-10-05 07:30:42 -07:00
snipe
c21524f240 Fixed NaN when no asset tag is provided 2018-10-05 05:42:28 -07:00
snipe
ecb8204c3c Associate serials with multiple asset creation 2018-10-05 05:30:13 -07:00
snipe
476b58632b Handle array of asset tags
TODO: figure out how to display validation errors more sanely
2018-10-05 04:34:47 -07:00
snipe
d4a97d0431 Increase max fields in multi-asset creation 2018-10-05 04:18:06 -07:00
snipe
ade9a0c995 Removed server-side validation right now
Getting an unexpected keyword ‘export’ error. I’ll come back to this.
2018-10-05 03:47:58 -07:00
snipe
7e33051c7a Remove console logging 2018-10-05 03:44:30 -07:00
snipe
4a448ba5f9 Increment tag based on first 2018-10-05 03:43:40 -07:00
snipe
8e90ed00d8 Added alt tags to logo 2018-10-05 03:43:16 -07:00
snipe
81d8c1cc52 Fixed remove-asset-tag javascript on asset edit, added server side validation support 2018-10-05 02:51:14 -07:00
snipe
4920dced6e Enabled toggleDisabled on form validator 2018-10-05 01:12:14 -07:00
snipe
4a4fc38c43 Style updates 2018-10-05 00:57:18 -07:00
snipe
907d1d0f61 Validate if name is required 2018-10-05 00:46:27 -07:00
snipe
6f71abd0e0 Fixed improper html nesting 2018-10-05 00:45:58 -07:00
snipe
c1b0b8dee2 Move validator to main layout 2018-10-05 00:45:45 -07:00
snipe
a6449fa16e Added jquery-form-validator 2018-10-04 23:50:57 -07:00
snipe
4cc1351bdd More JS tweaks (WIP) 2018-10-04 23:37:52 -07:00
snipe
701beeac2a Merge branch 'develop' into features/create_multiple_asset_tags_on_asset_create 2018-10-04 22:08:18 -07:00
snipe
6489081cd6 Pass variable to edit-form to determine whether we should have a top submit button
This is just so very short forms don’t look too silly
2018-10-04 21:19:25 -07:00
snipe
408f9978e9 More help text updates 2018-10-04 21:14:45 -07:00
snipe
4a7f61b554 Tenporarily replacing the blue@2x.png for icheck 2018-10-04 21:00:13 -07:00
snipe
db765e4a0b Reformatted help popover 2018-10-04 20:51:50 -07:00
snipe
54d916fd05 Pulled “more info” popover header into translated string 2018-10-04 20:41:09 -07:00
snipe
8d680d071b Create help translation file 2018-10-04 20:37:49 -07:00
snipe
252341fd5c Pulled help icon text into its own blade 2018-10-04 20:35:07 -07:00
snipe
c8210131b4 Updated assets 2018-10-04 20:24:59 -07:00
snipe
3843764d15 Added save button at top of form as well 2018-10-04 20:24:53 -07:00
snipe
accafbf1eb Added basic JS to edit blade 2018-10-04 19:28:56 -07:00
snipe
ef9817e12d Updated to latest rollbar 2018-10-04 18:24:41 -07:00
snipe
b5211b2dd5 Fixed #6291 - send-welcome argument in cli importer 2018-10-04 04:44:12 -07:00
snipe
0a72751b37 Fixed issue where admin users could disable activation when editing their own profile 2018-10-04 02:23:12 -07:00
Wes Hulette
3c59452e33 Fixed Tooltips and Rounded corners from previous cleanup (#6285)
* Fixed missing oauth tables during setup.

* Fixed tooltip and square boxes
2018-10-03 13:17:08 -07:00
snipe
84848fabd7 Fixed #6284 - missing checkout information on Status Labels API assets endpoint 2018-10-03 10:30:24 -07:00
Wes Hulette
4a88e155c4 Fixed: #6263 V5 (develop) - Missing oauth tables when using the setup wizard (#6268)
* Fixed missing oauth tables during setup.

* Merged develop changes

Removed PHP_CS file
2018-10-03 10:06:24 -07:00
snipe
66a9421fac Production assets 2018-10-03 01:07:47 -07:00
snipe
be609f4a8f Merge branch 'jwhulette-V5_cleanup_js' into develop 2018-10-03 00:56:49 -07:00
snipe
90b8acdd3b Merge branch 'V5_cleanup_js' of https://github.com/jwhulette/snipe-it into jwhulette-V5_cleanup_js
# Conflicts:
#	public/mix-manifest.json
2018-10-03 00:56:09 -07:00
snipe
c8ad45b11e Port import manager code to develop 2018-10-03 00:52:29 -07:00
snipe
8937edb97e Better validation for manager_id 2018-10-03 00:26:51 -07:00
Djamon Staal
80393d73ae Public function save() missing array. (#6276)
The class was missing as a result that the composer was unable to update and the site returned a 500 error
```
$ composer update
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Nothing to install or update
Package guzzle/guzzle is abandoned, you should avoid using it. Use guzzlehttp/guzzle instead.
Generating optimized autoload files
> Illuminate\Foundation\ComposerScripts::postAutoloadDump
> @php artisan package:discover

In Asset.php line 30:
                                                                               
  Declaration of App\Models\Asset::save($params = Array) should be compatible  
   with Illuminate\Database\Eloquent\Model::save(array $options = Array)       
                                                                               

Script @php artisan package:discover handling the post-autoload-dump event returned with error code 1
```
2018-10-02 04:40:20 -07:00
Wes Hulette
1742867df1 Removed inline signature.css
Added to webpack
2018-10-01 08:20:31 -04:00
Wes Hulette
ce0a40a20c Merge branch 'develop' into JS_Cleanup 2018-10-01 08:07:07 -04:00
snipe
e5e8c068ea Fixed mac address regex 2018-09-29 22:41:17 -07:00
snipe
366c1f81cc Added mac address to seeder 2018-09-29 22:21:32 -07:00
snipe
4975f9100c Added more seeders for better custom field displays on seeding 2018-09-29 22:17:36 -07:00
snipe
a481fa2921 Added accessories images for seeder 2018-09-29 22:17:14 -07:00
snipe
79367642b1 [WIP] Added #5957 - Flysystem support (#6262)
* Added AWS url to example env

* Upgrader - added check for new storage path and attempt to move

* Ignore symlink

* Updated paths for models

* Moved copy methods

* Added AWS_URL support

For some reasin, Flysystem was generating the wrong AWS url (with a region included)

* Switch to Flysystem for image uploads

* Nicer display of image preview

* Updated image preview on edit blades to use Flysystem

* Twiddled some more paths

* Working filesystems config

* Updated Asset Models and Departments to use Flysystem

* Janky workaround for differing S3/local urls/paths

* Try to smartly use S3 as public disk if S3 is configured

* Use public disk Storage options for public files

* Additional transformer edits for Flysystem

* Removed debugging

* Added missing use Storage directive

* Updated seeders to use Flysystem

* Default logo

* Set a default width

We can potentially override this in settings later

* Use Flysystem for logo upload

* Update downloadFile to use Flysystem

* Updated AssetFilesController to use Flysystem

* Updated acceptance signatures to use Flysystem

* Updated signature view to use Flysystem

This isn’t working 100% yet

* Use Flysystem facade for displaying asset image

* Set assets path

Should clean all these up when we’re done here

* Added Rackspace support for Flysystem

* Added Flysystem migrator console command

* Added use Storage directive for categories

* Added user avatars to Flysystem

* Added profile avatar to Flysystem

* Added the option to delete local files with the migrator

* Added a check to prevent people from trying to move from local to local

* Fixed the selectlists for Flysystem

* Fixed the getImageUrl method to reflect Flysystem

* Fixed AWS copy process

* Fixed models path

* More selectlist updates for Flysystem

* Updated example .envs with updated env variable names

* *sigh*

* Updated non-asset getImageUrl() methods to use Flysystem

* Removed S3 hardcoding

* Use Flysystem in email headers

* Fixed typo

* Removed camera support from asset file upload

We’ll find a way to add this in later (and add that support to all of the other image uploads as well)

* Fixed path for categories

* WIP - Switched to standard handleImages for asset upload.

This is currently broken as I refact the handleImages method. Because the assets store/create methods use their own Form Request, the handleImages method doesn’t exist in that Form Request so it wil error now.

* Fixed css URL error

* Updated Debugbar to latest version (#6265)

v3.2 adds support for Laravel 5.7

* Fixed: Missing CSS file in basic.blade.php (#6264)

* Fixed missing CSS file in basic.blade.php

* Added

* Changed stylesheet import for authorize.blade.php

* Updated composer lock

* Added AWS_BUCKET_ROOT as env variable

* Use nicer image preview for logo upload

* Removed AssetRequest form request

* Removed asset form request, moved custom field validation into model

* Added additional help text for logo upload

* Increased the size of the image resize - should make this a setting tho

* Few more formatting tweaks to logo section of branding blade preview

* Use Flysystem for asset/license file uploads

* Use Flysystem for removing images from models that have been deleted

* Enable backups to use Flysystem

This only handles part of the problem. This just makes it so we can ship files to S3 if we want, but does not account for how we backup files that are hosted on S3

* Use Flysystem to download license files

* Updated audits to use Flysystem
2018-09-29 21:33:52 -07:00
Wes Hulette
fc8096f8dc Fixed: Missing CSS file in basic.blade.php (#6264)
* Fixed missing CSS file in basic.blade.php

* Added

* Changed stylesheet import for authorize.blade.php
2018-09-29 14:15:25 -07:00
Wes Hulette
22c57c2862 Updated Debugbar to latest version (#6265)
v3.2 adds support for Laravel 5.7
2018-09-29 14:14:20 -07:00
Wes Hulette
5cb6744c1b Merge remote-tracking branch 'snipe-origin/develop' into develop 2018-09-29 11:30:33 -04:00
snipe
153a711de4 Fixed css URL error 2018-09-28 23:18:16 -07:00
snipe
71f60990db Ignore simlink 2018-09-28 23:18:04 -07:00
snipe
32951bbc90 Make CustomFieldset rules public instead of protected 2018-09-28 15:18:23 -07:00
Wes Hulette
aee15e8af4 Fixed select box rendering issue. (#6260)
Changed order of CSS files for combining
2018-09-28 15:18:15 -07:00
Wes Hulette
3016dcc616 WIP 2018-09-28 17:30:52 -04:00
Wes Hulette
c090a2f0b6 Fixed script imports in setup.blade.php 2018-09-28 17:28:49 -04:00
Wes Hulette
11f128a84f Moved chart.js library into vendor.js 2018-09-28 17:28:49 -04:00
Wes Hulette
991a00b38f Updated pGenerator jQuery Plugin to v1.0.5 2018-09-28 17:27:34 -04:00
Wes Hulette
e80dfc886e Added admin-lte-options file, moved pGenerator to main js file 2018-09-28 17:27:06 -04:00
Wes Hulette
b84eb836f4 Cleaned up JS
Removed unnecessary JS files
Moved JS to app & vendor, so neither file is so large, plus they can be downloaded concurrently.
2018-09-28 17:27:06 -04:00
Wes Hulette
b09afef46f Merge remote-tracking branch 'snipe-it-upstream/develop' into develop 2018-09-28 17:17:48 -04:00
Wes Hulette
ecf77e60df Added: #6246 - CSS Cleanup (#6247)
* Streamlined CSS by using NPM

Removed unnecessary CSS files
Merged CSS files into one file

* Streamlined CSS by using NPM

Removed unnecessary CSS files
Merged CSS files into one file

* Removed override.less

* Moved bootstrap-color-picker css to file

Removed inline calls

* Changed css import on setup.blade.php

* Updated signature-pad.css import

* NPM Prod compile

* Fixed font family loading issue.
2018-09-28 14:09:48 -07:00
snipe
a5abb3e6a6 Fixes #6252 - activated flag not checked when editing active user 2018-09-28 11:19:43 -07:00
Wes Hulette
ea63936947 Merge remote-tracking branch 'snipe-it-upstream/develop' into develop 2018-09-28 08:29:33 -04:00
snipe
68a04c7a23 Fixed #4151 - Undefined index: samaccountname on LDAP import 2018-09-27 16:13:27 -07:00
Wes Hulette
b64924440f Merge remote-tracking branch 'snipe-it-upstream/develop' into develop 2018-09-27 16:39:07 -04:00
snipe
e5d0f74ba7 Fixed #6248 - add free seats to licenses API endpoint 2018-09-27 12:07:13 -07:00
Ivan Nieto
309f102745 Weird syntax in layout.blade.php. Change the use of 'or' operator to the null coalesce operator (#6240) 2018-09-26 22:33:34 -07:00
Wes Hulette
16e56646b8 Fixed #5965: Allow multiple alert email addresses (#6233)
* Fixed #5965: Allow multiple alert email addresses

* Style changes based on PR feedback.
2018-09-26 14:07:41 -07:00
Wes Hulette
82affd5154 Added PHP_CS & PHPMD files (#6234)
Added PHP_CS & PHP mess detector file to help with code standardization.
2018-09-26 12:10:11 -07:00
Ivan Nieto
73e88faa00 Using changes proposed by dmeltzer to eliminate has_licenses function in some tests code (#6218) 2018-09-25 14:01:21 -07:00
snipe
bcf9d2f75c Don’t require statuslabel view to check for deployable status 2018-09-25 13:39:54 -07:00
nix
f85e3edfc7 fixed checking permissions for users with no permissions set (#6229)
When a user has no permissions set (=NULL) in the database (like after an
LDAP import) but is a member of a group with permissions, those group
permissions would not have be applied, effectively denying every access
regardless of group permissions.
2018-09-25 13:24:50 -07:00
snipe
115f718cd9 Fix view if model doesnt have a manufacturer 2018-09-24 19:10:24 -07:00
snipe
9108ff8caa fixed typo 2018-09-24 19:06:12 -07:00
snipe
d5cf0f1fbd Prevent deleting manufactureres via API if they have items/models 2018-09-24 19:04:00 -07:00
Brady Wetherington
c97db3259f Merge pull request #5913 from tilldeeke/refactore-checkout-checkin-notification-sending
Refactor: Decouple checkin/checkout notifications from logging
2018-09-21 18:18:27 -07:00
snipe
4b2093b485 Added counts to location show() API method 2018-09-21 15:51:26 -07:00
snipe
24aaa36532 Applied 3159e7713a to develop 2018-09-19 17:27:34 -07:00
snipe
d84366c6c5 Add empty array to groups if none filled in 2018-09-19 17:24:34 -07:00
Minaev Dmitriy
2604d3c1fd Merge branch 'develop' of https://github.com/snipe/snipe-it into develop 2018-09-14 19:36:01 +03:00
Ivan Nieto
b692f67779 Revision of #5471 (#6148)
* Search functionality in accessories/{accessory} issue #5471:
From the collection of users displayed just filtered the data with the method where() and concat()
for the user can search for first name or last name. The solution is case sensitive.

* A better fix to issue #5471. Now using the established relationship to querying for the users. Also Case-insensitive.

* Fixed previous commit that has magic number in the find method parameter of AccessoriesController.
2018-09-12 22:50:45 -07:00
Juho Taipale
05b03df600 Fix for issue #6165 (#6168)
* Fix problem when using ValidatingTrait

* Checking that email alerts are enabled when trying to send expected check-in alerts (fix for issue #6169)
2018-09-12 22:49:50 -07:00
Till Deeke
e445e201f3 Adds a migration to create checkout acceptances
This creates the checkout acceptances for assets (basically what was previously shown in the „Unaccepted Assets“-report) when migrating the database
2018-09-10 17:37:24 +02:00
Till Deeke
bbd1d6059a Fixes errors in tests 2018-09-10 17:16:07 +02:00
Till Deeke
86f49d34c3 Redirects users from old acceptance screen to new overview 2018-09-10 17:13:16 +02:00
Till Deeke
007e8fbdf9 simplified checkout event handling per @uberbrady’s suggestion
This generalizes the checkout events into the CheckoutableCheckedOut and CheckoutableCheckedIn events.
2018-09-10 16:40:26 +02:00
snipe
e45b4efa1a Better info buttons on audit
TODO: translated strings instead
2018-09-07 18:08:18 -07:00
snipe
10d19be66c Added manager ID to validation 2018-09-07 17:27:31 -07:00
snipe
b903ca05f7 Added manager ID to fillable fields in Location model
This should enable the API to update manager ID
2018-09-07 17:27:19 -07:00
Wes Hulette
1dff71e4df Merge remote-tracking branch 'snipe-it-upstream/develop' into develop 2018-09-07 13:36:12 -04:00
snipe
827295a989 Fixed tooltips 2018-09-07 05:39:56 -07:00
snipe
ff879e2018 Added the ability to update asset location when auditing - per #5854 2018-09-07 05:39:41 -07:00
snipe
e89b33f865 Enable popovers 2018-09-07 05:09:24 -07:00
snipe
181e75adb4 Apply hotfix for fixed category model scope 2018-09-07 03:56:17 -07:00
snipe
827a86b2ef Only send inventory report to users if they have things checked out to them 2018-09-07 03:08:32 -07:00
snipe
451f4c3320 Bumped watson validating package version, laravel to v5.7.2 2018-09-07 03:08:08 -07:00
snipe
77cdb2f409 Added console command to send inventory reports to users 2018-09-07 02:24:41 -07:00
snipe
26fd7f7e79 I have no idea why this was necessary suddenly 2018-09-06 14:28:04 -07:00
snipe
b80b91514d Fixed Laravel 5.7 compatibility issue re: boot() method
This was causing the error: Undefined index: App\Models\CustomField (View: /Users/snipe/Sites/snipe-it/snipe-it/resources/views/hardware/index.blade.php)

and pointed to the Eloquent model library method:

```
protected function initializeTraits()
    {
        foreach (static::$traitInitializers[static::class] as $method) {
            $this->{$method}();
        }
    }
```

Thanks to https://github.com/laravel/framework/issues/25455 for the clue.
2018-09-05 19:27:37 -07:00
snipe
60459d07ce Added email image auto-embed support 2018-09-05 18:57:49 -07:00
snipe
84cc90e427 Added alt text to email headers 2018-09-05 18:57:36 -07:00
snipe
bd40bd5a22 Upgrade to laravel 5.7.0 2018-09-05 14:58:07 -07:00
snipe
0e46b6fd42 Fixed #6152 - typo in upgrade script 2018-09-05 14:58:07 -07:00
Wes Hulette
161271b53a Merge remote-tracking branch 'snipe-it-upstream/develop' into develop 2018-09-04 12:04:53 -04:00
Wes Hulette
a865f79d5e Fixed dashboard tables not showing data (#6143)
Needed data-pagination="true" set
2018-08-29 12:29:47 -07:00
Wes Hulette
e9f6cbc97f Merge remote-tracking branch 'snipe-it-upstream/develop' into develop 2018-08-29 12:45:56 -04:00
Wes Hulette
59559b1966 Merge remote-tracking branch 'snipe-it-upstream/develop' into develop 2018-08-28 16:39:07 -04:00
snipe
a8b5fbde91 Add @inietov as a contributor 2018-08-28 13:31:36 -07:00
Ivan Nieto
0014ef054b Search functionality in accessories/{accessory} issue #5471: (#6070)
From the collection of users displayed just filtered the data with the method where() and concat()
for the user can search for first name or last name. The solution is case sensitive.
2018-08-28 13:25:16 -07:00
snipe
652548957d Add @Seldaek as a contributor 2018-08-28 13:15:21 -07:00
snipe
761ea4e581 Add @liquidhorse as a contributor 2018-08-28 13:15:08 -07:00
snipe
9c24d4300c Add @VELIKII-DIVAN as a contributor 2018-08-28 13:14:55 -07:00
snipe
39ab488d90 Add @patrict as a contributor 2018-08-28 13:14:41 -07:00
snipe
ec67d03a7c Add @jwhulette as a contributor 2018-08-28 13:14:26 -07:00
Wes Hulette
bfb5920677 Added #5956 - Moved bootstrap-tables to npm (#6139)
Created single bootstrap-tables js and css file.
2018-08-28 13:10:27 -07:00
Wes Hulette
0c02ff70f6 Merge pull request #1 from snipe/develop
Develop
2018-08-28 15:47:16 -04:00
patrict
cf2d2ecdfc Depreciation Report: (#6135)
* Added monthly depreciation column
* Right aligned amount column headings
* Added monthly depreciation heading text for en, en-GB & af
2018-08-28 12:40:06 -07:00
Wes Hulette
3831ee9f5a Fixed #5811 - Non US Characters in user export (#6132)
* Added Freebsd as vagrant machine for development

* Ran npm audit fix

Manually added peer depenencies

* Added charset=UTF-8 to content-type

Removed reference to throttle model as is is not longer included.
2018-08-28 12:37:58 -07:00
Dmitriy Minaev
bc8fa31eb2 Add depreciation with half-year convention. Fixed #1237 (#6128)
* Add half-year convention in depreciation for Models/Depreciable.php

* Add a setting for the depreciation method

* Integrate half-year convention inside working output

* fix: add more checks at Depreciable.php

* depreciation value rounding

* Codestyle fix
2018-08-28 12:32:46 -07:00
liquidhorse
678ba228cb Fixed #6079: QR Code unnecessarily squished. (#6080)
* Fixed 2D barcode from being squished unnecessarily when 1D barcode is omitted.
Added one character of whitespace for code readability.
2018-08-28 12:29:50 -07:00
snipe
5b8cbe29e1 Possible fix for #5054 - OpenLDAP (non-AD) LDAP users being deactivated 2018-08-27 14:51:37 -07:00
Minaev Dmitriy
a77b8c2023 Codestyle fix 2018-08-26 18:47:35 +03:00
Minaev Dmitriy
40dd34b5bf depreciation value rounding 2018-08-25 20:18:31 +03:00
Minaev Dmitriy
daba90b346 fix: add more checks at Depreciable.php 2018-08-25 19:17:48 +03:00
Minaev Dmitriy
7b70afa2a1 Integrate half-year convention inside working output 2018-08-24 20:30:22 +03:00
snipe
0b8d70c7ec Fixed #6124 2018-08-23 21:06:04 -07:00
Minaev Dmitriy
8d3b201a49 Add a setting for the depreciation method 2018-08-23 20:49:20 +03:00
Minaev Dmitriy
49ecc08398 Add half-year convention in depreciation for Models/Depreciable.php 2018-08-23 20:29:03 +03:00
snipe
e4f6aefdad Added self-checkout permission option 2018-08-21 23:26:12 -07:00
snipe
771265113e Added cookie serialization for Laravel v5.6.30 2018-08-21 22:40:14 -07:00
snipe
3c23745508 Bumped to laravel 5.6.30
Lower Laravel versions still triggered Roave/SecurityAdvisories :-/
2018-08-21 20:08:34 -07:00
snipe
f6971b8ab2 Fixed #6082 - don’t show expected checkin in email if none given 2018-08-16 14:30:06 -07:00
snipe
aed769c0be Honor active status for forgotten password request forms 2018-08-14 20:05:57 -07:00
snipe
1543cdbc61 Set activated checkbox to 1 by default on new user 2018-08-14 18:17:37 -07:00
snipe
ce45c3af4e Updated password reset language 2018-08-14 18:11:32 -07:00
snipe
25097bce31 Only allow activated users to reset their password 2018-08-14 18:04:27 -07:00
Till Deeke
62195a805a Adding some comments 2018-08-06 14:47:26 +02:00
Till Deeke
8c96e8fd4b Updates asset acceptance report to show unaccepted assets 2018-08-06 14:47:26 +02:00
Till Deeke
1bdf71b584 Handle side effects of accepting/declining
When declining an asset, it gets checked in.
2018-08-06 14:47:26 +02:00
Till Deeke
8648d53d25 Adds checkout acceptances
A checkout acceptance gets generated for every item that needs to be checked out. This resource tracks the user user who can accept the item and their signature
2018-08-06 14:47:26 +02:00
Till Deeke
6b05106dcb Moves license checkout stuff to the license seat
Since we are really checking out a license seat instead of the whole license, we operate the checkin/checkout on the license seat instance.
2018-08-06 14:47:26 +02:00
Till Deeke
43437aac14 Adds acceptable contract to asset 2018-08-06 14:46:10 +02:00
Till Deeke
830a6cf67e Adds accepting/declining to new controller 2018-08-06 14:46:10 +02:00
Till Deeke
39e6b59335 Fixes some typos 2018-08-06 14:46:10 +02:00
Till Deeke
72b43b6526 Updates checkout notifications to use new routes for accepting 2018-08-06 14:46:10 +02:00
Till Deeke
e0423418d2 Moves logging checkin/checkout to separate listener 2018-08-06 14:46:10 +02:00
Till Deeke
e24f292a1a Updates checkout events to not depend on log 2018-08-06 14:46:10 +02:00
Till Deeke
17fc59f989 Adds back the checkin/checkout events after #5916 2018-08-06 14:46:10 +02:00
Till Deeke
775e46288e Cleanup of model attributes 2018-08-06 14:46:10 +02:00
Till Deeke
722f032895 Remove notification sending from loggable trait 2018-08-06 14:46:10 +02:00
Till Deeke
112a532618 Listen for checkout events and send appropriate notifications 2018-08-06 14:46:10 +02:00
Till Deeke
ef76908fce Listen for checkin events and send the appropriate notifications 2018-08-06 14:46:10 +02:00
Till Deeke
4a71542f23 Cleanup checkin notification constructors 2018-08-06 14:46:10 +02:00
Till Deeke
ea64abc607 Adds checkout events 2018-08-06 14:46:10 +02:00
Till Deeke
f0acf47101 Adds checkin events 2018-08-06 14:46:10 +02:00
Till Deeke
92a2a5ccbc Adds listeners for checking/checkout events 2018-08-06 14:46:10 +02:00
Daniel Meltzer
2d0df24ef3 Check for an existing username before getting creative. Fixes #6016 (#6039) 2018-08-03 16:35:13 -07:00
snipe
1a660911e7 Check for minimum PHP version in setup 2018-08-02 21:36:18 -07:00
snipe
84f20b6287 Added php version check to upgrade.php 2018-08-02 20:55:52 -07:00
snipe
134bddf4c7 Fixed #6029 - model number not appearing in checkin/checkout emails 2018-08-02 11:43:11 -07:00
Daniel Meltzer
e368a20427 Use filled instead of has. (#6033)
I think this merged in a weird order and was missed by the global
find/replace.  This fixes bulkassets/bulkusers editing.

At some point we should look at refactoring BulkAssetsController@edit to
only run one DB query, rather than one per item.
2018-08-02 09:54:19 -07:00
Daniel Meltzer
2637ce56a1 Allow importcontroller to return 200 for failed delete. (#6034) 2018-08-02 09:53:54 -07:00
snipe
ffed306ecd Removed old emaol templates (#6026)
Still testing this to make sure it doesn’t break anything else :)
2018-08-01 20:56:32 -07:00
snipe
f5a5d830a5 Better handling for deleting imports where the files may have been moved 2018-08-01 20:49:55 -07:00
snipe
9168979d9e Fixed #6027 - added model to asset maintenances listing 2018-08-01 18:24:52 -07:00
snipe
6f8680efa6 Added external link formatter to BS tables 2018-08-01 18:01:31 -07:00
snipe
3f394f42c7 Partial fix for better UI on deleting files
Still needs Vue stuff
2018-08-01 18:01:16 -07:00
snipe
b2c99c88bb Fixed #6028 - added supplier url to list view 2018-08-01 17:37:58 -07:00
snipe
9a3683ce7c Remove app_locked 2018-08-01 15:36:20 -07:00
snipe
2fa66f4551 Removed duplicate BACKUP_ENV in example env 2018-08-01 15:27:51 -07:00
snipe
a4019c9f63 NIcer UI for activated user + email credentials 2018-08-01 14:18:37 -07:00
snipe
694166862e Added attempted logins admin screen (#6018)
* Added attempted logins admin screen

* Smaller table spacing
2018-08-01 03:51:59 -07:00
snipe
911c2398ef Fixed #6004 - set a default next_audit_date if none provided 2018-08-01 03:04:29 -07:00
snipe
a209a92de8 Fixed #6011 - use correct file created at date 2018-08-01 02:43:08 -07:00
snipe
462878a307 Production assets 2018-08-01 00:27:19 -07:00
snipe
3941437ad4 Limit width of title logo so it doesn’t break with long names 2018-08-01 00:27:14 -07:00
snipe
664cc24481 Fixed PR #6002 2018-08-01 00:26:50 -07:00
snipe
2c38036123 Improvement: Better documentation, small refactors (#6017)
* Better documentation, small refactors

* Small comment fixes
2018-08-01 00:06:41 -07:00
Sam
6ae096a56f These changes will allow submissions during the AJAX process in Select2s. This allows for barcode scanners, magstrip and NFC scanners that enter a carriage return. (#6002) 2018-08-01 00:06:28 -07:00
snipe
436bf152ec Config for new bots 2018-07-31 17:40:32 -07:00
snipe
b1b5eeecba Fixed #6013 - add accessory checkout notes to detail page 2018-07-31 16:00:38 -07:00
snipe
400913631c Use language strings for bulk password reset 2018-07-30 20:37:19 -07:00
snipe
006a3adea0 Added ability to trigger forgotten password emails for users 2018-07-30 20:31:02 -07:00
Earl Ramirez
c2bb3892b7 [WIP] Fix apache default page on ubuntu (#5998)
* Added cron to list of packages

* Updated APP_PATH

* Rename virtual hosts config files
2018-07-30 18:09:37 -07:00
Jason
5c820dd7b8 Added code to snipeit.sh for Raspbian 9.4 install (#5980)
* Added code to snipeit.sh for Raspbian 9.4 install

* More additions to snipeit.sh to install php7.2  on raspian in prep for
version 5

* added public/phpinfo.php to .gitignore

* Deleted phpinfo.php

* removed phpinfo.php from .gitignore
2018-07-27 12:57:39 -07:00
Daniel Meltzer
248fcfa869 Move findLicenseSeatToCheckout back to controller. (#5970)
* Move findLicenseSeatToCheckout back to controller.

After discussion, move findLicenseSeatToCheckout method back to
controller from form request.  Also cleanup one tiny bit more with null
coalesce operator (Yay php 7).

* Revert Earlier change.

$target only exists in the checkoutTo* methods.  Need to log the
checkout individually in each of those.
2018-07-27 12:03:04 -07:00
Daniel Meltzer
b58c77c8b8 Feature: Import users department. (#5987)
Maps to the "Department" header key by default.  Bug: #5382
2018-07-27 12:02:18 -07:00
Daniel Meltzer
94c79fa69a Fixed #5964 - Feature: Group IDs can be passed to User Create. (#5990)
Also added to update, and adjusted api tests to confirm.  Long term it
might be nice to look at support for passing group names instead.

Bug: 5964
2018-07-27 12:01:59 -07:00
Daniel Meltzer
a3811f632d Licence != License (#5993) 2018-07-27 12:01:25 -07:00
snipe
d8f0102204 Merge branch 'features/restore_deleted_cmd' into develop
# Conflicts:
#	config/version.php
#	resources/views/layouts/basic.blade.php
2018-07-27 02:48:13 -07:00
snipe
6b013724aa Uncomment backup 2018-07-26 18:11:51 -07:00
snipe
8774f0cf45 Script to restore deleted users and put their asset assignments back 2018-07-26 18:08:49 -07:00
snipe
8762e158c4 Delete content from login attempts table 2018-07-26 18:08:25 -07:00
Daniel Meltzer
49d95892e3 Port asset history importer to league/csv9 (#5972) 2018-07-26 12:04:21 -07:00
snipe
9618878023 Restrict users asset listing to just assets checked out to users 2018-07-25 21:40:33 -07:00
snipe
b267b34762 Make sure there is a settings value 2018-07-25 19:02:35 -07:00
snipe
a5daee811b Split out custom_css from custom_header color 2018-07-25 19:00:03 -07:00
snipe
1fd0b14b98 Removed ide-helper config 2018-07-25 12:07:50 -07:00
snipe
ce44744dc6 Yoinked ide-helper 2018-07-25 12:07:03 -07:00
snipe
c90dee4cf4 Added barryvdh/laravel-ide-helper 2018-07-25 11:58:00 -07:00
snipe
373885ebd1 Use Storage for file uploads (not model images) 2018-07-25 11:57:49 -07:00
snipe
a9fd9c9e59 Moved gates to individual controller methods to fix “This action is unauthorized” in route:list 2018-07-25 10:45:32 -07:00
snipe
9535c68dfe Fixed base path in local file driver 2018-07-25 10:44:37 -07:00
snipe
63bf71b071 Use Storage methods for asset/license files 2018-07-25 09:48:50 -07:00
snipe
2e92ef7d77 Removed HTML colspan for bootstrap table in files display 2018-07-25 07:40:04 -07:00
snipe
068ae5805b Set base path for storage default on local disk 2018-07-25 07:39:47 -07:00
snipe
054de06522 Added cache variables to S3 2018-07-25 07:29:23 -07:00
snipe
9a99626b9e Added SFTP to filesystem config 2018-07-25 07:27:31 -07:00
snipe
7a9a78ec53 Make Codacy happy by reversing the signature params 2018-07-25 07:14:16 -07:00
snipe
684a892e8b Removed rackspace for now 2018-07-25 06:59:58 -07:00
snipe
91a9e410df Fixed weird whereNULL 2018-07-25 06:46:06 -07:00
snipe
e64e1207cf Reordered PHP versions because anal-retentive 2018-07-25 05:36:54 -07:00
snipe
999c4e781d Update version of PHP for travis 2018-07-25 05:33:28 -07:00
snipe
3df19d267f Fixed Ziggy routes 2018-07-25 03:00:27 -07:00
snipe
501f096a2c Updated spatie backup config file for their latest version 2018-07-25 01:36:30 -07:00
snipe
47ed328f0e Change fire() to handle() for Laravel 5.5 2018-07-25 01:28:44 -07:00
snipe
4cc7ed9ec7 Backup updates 2018-07-25 01:28:30 -07:00
snipe
7af633177a Fixed filledFile back to hasFile 2018-07-24 22:52:49 -07:00
snipe
86c1f11bec Change $request->has to $request->filled unilaterally 2018-07-24 22:51:31 -07:00
snipe
0714ac4248 Update withCounts because Laravel 5.5 :( 2018-07-24 22:40:05 -07:00
snipe
e6dd90e055 Added footer settings to settings reset 2018-07-24 22:21:16 -07:00
snipe
b2968ea6c6 Fixed paths to Aurhorizable/Authenticatable contracts 2018-07-24 21:29:08 -07:00
snipe
d81975e168 Laravel 5.6 requirement for filip/whoops 2018-07-24 21:28:37 -07:00
snipe
24c949c886 Bumped version to v5.0.0-pre 2018-07-24 21:13:02 -07:00
snipe
de84e1bd88 Added hashing config 2018-07-24 21:13:02 -07:00
snipe
60c4fa1d90 Updated trustedproxy w/config 2018-07-24 21:13:02 -07:00
snipe
3d3ed6ab03 Logging updates for 5.6 2018-07-24 21:13:02 -07:00
snipe
14735057a8 New spatie config file 2018-07-24 21:13:02 -07:00
snipe
75b3c66908 Spatie backup lang updates 2018-07-24 21:13:02 -07:00
snipe
52bd7e4dfb Added language file for spatie 2018-07-24 21:13:02 -07:00
snipe
b58314493a Use array for db dump configs 2018-07-24 21:13:02 -07:00
snipe
6ebc653620 Sparie backups config upgrade 2018-07-24 21:13:02 -07:00
snipe
f69e34f6ca Applying @dmeltzer’s changes from afc8ac5e72 2018-07-24 21:13:02 -07:00
snipe
7bb50a61a7 Applying @dmeltzer’s changes from afc8ac5e72 2018-07-24 21:13:02 -07:00
snipe
6b31e2aca9 php7 composer 2018-07-24 21:13:02 -07:00
Antti
a55a9ca4cd Fix: Made migration run original command for mysql (#5915)
* Fix: Made migration run original command for mysql

* Added sqlite_testing migration

* Review suggested fix
2018-07-24 20:57:47 -07:00
snipe
e332442132 Bumped version 2018-07-24 19:45:23 -07:00
Daniel Meltzer
64d649be7f Monster: Cleanup/Refactor http controllers. (#5916)
* Extract a handlesimages trait to centralize logic for parsing/storing images on upload in create/edit methods.

* Use same image upload/layout in accessories as consum+components.

* Monster: Cleanup/Refactor http controllers.

This cleans up docblocks, pulls most non-crudy actions into their own
controllers, and does general cleanup/logic refactoring.  There /should/
be no functional changes, but we all know how should works..

Extract checkin/checkout functions to a separate controller for accessories.

Move controllers to subdirectory.

Cleanup AssetModelsController

Extract component checkin/checkout

Assorted cleanups/doc/formatting in controllers.

Refactor LicenseController.

Refactor UsersController

Update viewassetscontroller.

* Codacy cleanups

* More codacy cleanups.  Extract a LicenseCheckout Form request as well.

* A bit more refactor/cleaning of the license checkout method.

* Review Related Cleanups

* Fix most of the item_not_found translations.  In many cases, the
string being generated did not even use the id parameter.  Where it
does, pass it as id instead of as a different value.

* Remove some old $data arrays from when we manually sent emails from
the controllers.  This has been superseeded by the notification system
(yay!)

* Bugfix: Only log the checkin of an accessory if the checkin completes sucessfully.
2018-07-24 19:35:26 -07:00
3312 changed files with 121487 additions and 200831 deletions

View File

@@ -135,7 +135,8 @@
"avatar_url": "https://avatars0.githubusercontent.com/u/10137?v=3",
"profile": "https://github.com/ghost",
"contributions": [
"translation"
"translation",
"code"
]
},
{
@@ -1651,6 +1652,186 @@
"code"
]
},
{
"login": "jwhulette",
"name": "Wes Hulette",
"avatar_url": "https://avatars1.githubusercontent.com/u/4930051?v=4",
"profile": "http://macfoo.wordpress.com/",
"contributions": [
"code"
]
},
{
"login": "patrict",
"name": "patrict",
"avatar_url": "https://avatars0.githubusercontent.com/u/8134591?v=4",
"profile": "https://github.com/patrict",
"contributions": [
"code"
]
},
{
"login": "VELIKII-DIVAN",
"name": "Dmitriy Minaev",
"avatar_url": "https://avatars3.githubusercontent.com/u/2611616?v=4",
"profile": "https://github.com/VELIKII-DIVAN",
"contributions": [
"code"
]
},
{
"login": "liquidhorse",
"name": "liquidhorse",
"avatar_url": "https://avatars0.githubusercontent.com/u/5132245?v=4",
"profile": "https://github.com/liquidhorse",
"contributions": [
"code"
]
},
{
"login": "Seldaek",
"name": "Jordi Boggiano",
"avatar_url": "https://avatars1.githubusercontent.com/u/183678?v=4",
"profile": "https://seld.be/",
"contributions": [
"code"
]
},
{
"login": "inietov",
"name": "Ivan Nieto",
"avatar_url": "https://avatars0.githubusercontent.com/u/653557?v=4",
"profile": "https://github.com/inietov",
"contributions": [
"code"
]
},
{
"login": "benrubson",
"name": "Ben RUBSON",
"avatar_url": "https://avatars2.githubusercontent.com/u/6764151?v=4",
"profile": "https://github.com/benrubson",
"contributions": [
"code"
]
},
{
"login": "NMathar",
"name": "NMathar",
"avatar_url": "https://avatars2.githubusercontent.com/u/8554558?v=4",
"profile": "https://github.com/NMathar",
"contributions": [
"code"
]
},
{
"login": "smb",
"name": "Steffen",
"avatar_url": "https://avatars1.githubusercontent.com/u/139566?v=4",
"profile": "https://github.com/smb",
"contributions": [
"code"
]
},
{
"login": "Sxderp",
"name": "Sxderp",
"avatar_url": "https://avatars0.githubusercontent.com/u/6609453?v=4",
"profile": "https://github.com/Sxderp",
"contributions": [
"code"
]
},
{
"login": "fanta8897",
"name": "fanta8897",
"avatar_url": "https://avatars1.githubusercontent.com/u/4807843?v=4",
"profile": "https://github.com/fanta8897",
"contributions": [
"code"
]
},
{
"login": "andreybolonin",
"name": "Andrey Bolonin",
"avatar_url": "https://avatars2.githubusercontent.com/u/2576509?v=4",
"profile": "https://andreybolonin.com/phpconsulting/",
"contributions": [
"code"
]
},
{
"login": "shinayoshi",
"name": "shinayoshi",
"avatar_url": "https://avatars3.githubusercontent.com/u/2173307?v=4",
"profile": "http://www.shinayoshi.net/",
"contributions": [
"code"
]
},
{
"login": "reuser",
"name": "Hubert",
"avatar_url": "https://avatars3.githubusercontent.com/u/2130159?v=4",
"profile": "https://github.com/reuser",
"contributions": [
"code"
]
},
{
"login": "KeenRivals",
"name": "KeenRivals",
"avatar_url": "https://avatars0.githubusercontent.com/u/6865789?v=4",
"profile": "https://brashear.me",
"contributions": [
"code"
]
},
{
"login": "omyno",
"name": "omyno",
"avatar_url": "https://avatars3.githubusercontent.com/u/2902513?v=4",
"profile": "https://github.com/omyno",
"contributions": [
"code"
]
},
{
"login": "jackka",
"name": "Evgeny",
"avatar_url": "https://avatars1.githubusercontent.com/u/6271335?v=4",
"profile": "https://github.com/jackka",
"contributions": [
"code"
]
},
{
"login": "colin-campbell",
"name": "Colin Campbell",
"avatar_url": "https://avatars2.githubusercontent.com/u/1169963?v=4",
"profile": "https://digitalist.se",
"contributions": [
"code"
]
},
{
"login": "lubo",
"name": "Ľubomír Kučera",
"avatar_url": "https://avatars3.githubusercontent.com/u/2872098?v=4",
"profile": "https://github.com/lubo",
"contributions": [
"code"
]
},
{
"login": "Mezzle",
"name": "Martin Meredith",
"avatar_url": "https://avatars3.githubusercontent.com/u/570639?v=4",
"profile": "https://www.sourceguru.net",
"contributions": [
"code"
]
},
{
"login": "timothyfarmer",
"name": "Tim Farmer",
@@ -1659,6 +1840,526 @@
"contributions": [
"code"
]
},
{
"login": "mskrip",
"name": "Marián Skrip",
"avatar_url": "https://avatars0.githubusercontent.com/u/17459600?v=4",
"profile": "https://github.com/mskrip",
"contributions": [
"code"
]
},
{
"login": "Godmartinz",
"name": "Godfrey Martinez",
"avatar_url": "https://avatars2.githubusercontent.com/u/47435081?v=4",
"profile": "https://github.com/Godmartinz",
"contributions": [
"code"
]
},
{
"login": "bigtreeEdo",
"name": "bigtreeEdo",
"avatar_url": "https://avatars1.githubusercontent.com/u/2075128?v=4",
"profile": "https://github.com/bigtreeEdo",
"contributions": [
"code"
]
},
{
"login": "ColinMcNeil",
"name": "Colin McNeil",
"avatar_url": "https://avatars0.githubusercontent.com/u/5000430?v=4",
"profile": "https://colinmcneil.me/",
"contributions": [
"code"
]
},
{
"login": "JoKneeMo",
"name": "JoKneeMo",
"avatar_url": "https://avatars0.githubusercontent.com/u/421625?v=4",
"profile": "https://github.com/JoKneeMo",
"contributions": [
"code"
]
},
{
"login": "joshi-redbridge",
"name": "Joshi",
"avatar_url": "https://avatars0.githubusercontent.com/u/54849013?v=4",
"profile": "http://www.redbridge.se",
"contributions": [
"code"
]
},
{
"login": "anthonypburns",
"name": "Anthony Burns",
"avatar_url": "https://avatars2.githubusercontent.com/u/15731458?v=4",
"profile": "https://github.com/anthonypburns",
"contributions": [
"code"
]
},
{
"login": "johnson-yi",
"name": "johnson-yi",
"avatar_url": "https://avatars1.githubusercontent.com/u/63399474?v=4",
"profile": "https://github.com/johnson-yi",
"contributions": [
"code"
]
},
{
"login": "sanjay900",
"name": "Sanjay Govind",
"avatar_url": "https://avatars1.githubusercontent.com/u/1862720?v=4",
"profile": "https://tangentmc.net",
"contributions": [
"code"
]
},
{
"login": "PeterUpfold",
"name": "Peter Upfold",
"avatar_url": "https://avatars0.githubusercontent.com/u/1255375?v=4",
"profile": "https://peter.upfold.org.uk/",
"contributions": [
"code"
]
},
{
"login": "jbiel",
"name": "Jared Biel",
"avatar_url": "https://avatars2.githubusercontent.com/u/961717?v=4",
"profile": "https://github.com/jbiel",
"contributions": [
"code"
]
},
{
"login": "dampfklon",
"name": "Dampfklon",
"avatar_url": "https://avatars1.githubusercontent.com/u/1733625?v=4",
"profile": "https://github.com/dampfklon",
"contributions": [
"code"
]
},
{
"login": "chamilton-ccn",
"name": "Charles Hamilton",
"avatar_url": "https://avatars2.githubusercontent.com/u/52973156?v=4",
"profile": "https://communityclosing.com",
"contributions": [
"code"
]
},
{
"login": "giannello",
"name": "Giuseppe Iannello",
"avatar_url": "https://avatars.githubusercontent.com/u/551789?v=4",
"profile": "https://github.com/giannello",
"contributions": [
"code"
]
},
{
"login": "PeterDaveHello",
"name": "Peter Dave Hello",
"avatar_url": "https://avatars.githubusercontent.com/u/3691490?v=4",
"profile": "https://www.peterdavehello.org/",
"contributions": [
"code"
]
},
{
"login": "sigmoidal",
"name": "sigmoidal",
"avatar_url": "https://avatars.githubusercontent.com/u/6106332?v=4",
"profile": "https://github.com/sigmoidal",
"contributions": [
"code"
]
},
{
"login": "phenixdotnet",
"name": "Vincent Lainé",
"avatar_url": "https://avatars.githubusercontent.com/u/2082554?v=4",
"profile": "https://github.com/phenixdotnet",
"contributions": [
"code"
]
},
{
"login": "derlucas",
"name": "Lucas Pleß",
"avatar_url": "https://avatars.githubusercontent.com/u/1943040?v=4",
"profile": "http://www.lucas-pless.com",
"contributions": [
"code"
]
},
{
"login": "iansltx",
"name": "Ian Littman",
"avatar_url": "https://avatars.githubusercontent.com/u/472804?v=4",
"profile": "http://twitter.com/iansltx",
"contributions": [
"code"
]
},
{
"login": "PauloLuna",
"name": "João Paulo",
"avatar_url": "https://avatars.githubusercontent.com/u/3519029?v=4",
"profile": "https://github.com/PauloLuna",
"contributions": [
"code"
]
},
{
"login": "ThoBur",
"name": "ThoBur",
"avatar_url": "https://avatars.githubusercontent.com/u/70443365?v=4",
"profile": "https://github.com/ThoBur",
"contributions": [
"code"
]
},
{
"login": "alek13",
"name": "Alexander Chibrikin",
"avatar_url": "https://avatars.githubusercontent.com/u/1972329?v=4",
"profile": "http://phpprofi.ru/",
"contributions": [
"code"
]
},
{
"login": "winstan",
"name": "Anthony Winstanley",
"avatar_url": "https://avatars.githubusercontent.com/u/438332?v=4",
"profile": "https://github.com/winstan",
"contributions": [
"code"
]
},
{
"login": "fashberg",
"name": "Folke",
"avatar_url": "https://avatars.githubusercontent.com/u/3075214?v=4",
"profile": "https://github.com/fashberg",
"contributions": [
"code"
]
},
{
"login": "benwa",
"name": "Bennett Blodinger",
"avatar_url": "https://avatars.githubusercontent.com/u/1351571?v=4",
"profile": "https://github.com/benwa",
"contributions": [
"code"
]
},
{
"login": "ncareau",
"name": "NMC",
"avatar_url": "https://avatars.githubusercontent.com/u/2974631?v=4",
"profile": "https://nmc.dev",
"contributions": [
"code"
]
},
{
"login": "andres-baller",
"name": "andres-baller",
"avatar_url": "https://avatars.githubusercontent.com/u/52182449?v=4",
"profile": "https://github.com/andres-baller",
"contributions": [
"code"
]
},
{
"login": "sean-borg",
"name": "sean-borg",
"avatar_url": "https://avatars.githubusercontent.com/u/67109348?v=4",
"profile": "https://github.com/sean-borg",
"contributions": [
"code"
]
},
{
"login": "EDVLeer",
"name": "EDVLeer",
"avatar_url": "https://avatars.githubusercontent.com/u/32170051?v=4",
"profile": "https://github.com/EDVLeer",
"contributions": [
"code"
]
},
{
"login": "Kurokat",
"name": "Kurokat",
"avatar_url": "https://avatars.githubusercontent.com/u/23075196?v=4",
"profile": "https://github.com/Kurokat",
"contributions": [
"code"
]
},
{
"login": "koelle25",
"name": "Kevin Köllmann",
"avatar_url": "https://avatars.githubusercontent.com/u/915514?v=4",
"profile": "https://www.kevinkoellmann.de",
"contributions": [
"code"
]
},
{
"login": "sw-mreyes",
"name": "sw-mreyes",
"avatar_url": "https://avatars.githubusercontent.com/u/49025941?v=4",
"profile": "https://github.com/sw-mreyes",
"contributions": [
"code"
]
},
{
"login": "joelpittet",
"name": "Joel Pittet",
"avatar_url": "https://avatars.githubusercontent.com/u/70129?v=4",
"profile": "https://pittet.ca",
"contributions": [
"code"
]
},
{
"login": "elyscape",
"name": "Eli Young",
"avatar_url": "https://avatars.githubusercontent.com/u/792695?v=4",
"profile": "https://elyscape.com",
"contributions": [
"code"
]
},
{
"login": "raelldottin",
"name": "Raell Dottin",
"avatar_url": "https://avatars.githubusercontent.com/u/317015?v=4",
"profile": "https://github.com/raelldottin",
"contributions": [
"code"
]
},
{
"login": "misilot",
"name": "Tom Misilo",
"avatar_url": "https://avatars.githubusercontent.com/u/1446856?v=4",
"profile": "https://github.com/misilot",
"contributions": [
"code"
]
},
{
"login": "JuustoMestari",
"name": "David Davenne",
"avatar_url": "https://avatars.githubusercontent.com/u/4496300?v=4",
"profile": "http://david.davenne.be",
"contributions": [
"code"
]
},
{
"login": "ocelotsloth",
"name": "Mark Stenglein",
"avatar_url": "https://avatars.githubusercontent.com/u/9255772?v=4",
"profile": "https://markstenglein.com",
"contributions": [
"code"
]
},
{
"login": "ajsy",
"name": "ajsy",
"avatar_url": "https://avatars.githubusercontent.com/u/35658596?v=4",
"profile": "https://github.com/ajsy",
"contributions": [
"code"
]
},
{
"login": "t3easy",
"name": "Jan Kiesewetter",
"avatar_url": "https://avatars.githubusercontent.com/u/3628035?v=4",
"profile": "https://github.com/t3easy",
"contributions": [
"code"
]
},
{
"login": "Tetrachloromethane250",
"name": "Tetrachloromethane250",
"avatar_url": "https://avatars.githubusercontent.com/u/79449630?v=4",
"profile": "https://github.com/Tetrachloromethane250",
"contributions": [
"code"
]
},
{
"login": "kajes",
"name": "Lars Kajes",
"avatar_url": "https://avatars.githubusercontent.com/u/22004482?v=4",
"profile": "https://www.kajes.se/",
"contributions": [
"code"
]
},
{
"login": "Joly0",
"name": "Joly0",
"avatar_url": "https://avatars.githubusercontent.com/u/13993216?v=4",
"profile": "https://github.com/Joly0",
"contributions": [
"code"
]
},
{
"login": "limeless",
"name": "theburger",
"avatar_url": "https://avatars.githubusercontent.com/u/1501022?v=4",
"profile": "https://github.com/limeless",
"contributions": [
"code"
]
},
{
"login": "deivishome",
"name": "David Valin Alonso",
"avatar_url": "https://avatars.githubusercontent.com/u/36065681?v=4",
"profile": "https://github.com/deivishome",
"contributions": [
"code"
]
},
{
"login": "andreaci",
"name": "andreaci",
"avatar_url": "https://avatars.githubusercontent.com/u/8290389?v=4",
"profile": "https://github.com/andreaci",
"contributions": [
"code"
]
},
{
"login": "Jelle-S",
"name": "Jelle Sebreghts",
"avatar_url": "https://avatars.githubusercontent.com/u/1828542?v=4",
"profile": "http://www.jellesebreghts.be",
"contributions": [
"code"
]
},
{
"login": "Skywalker-11",
"name": "Michael Pietsch",
"avatar_url": "https://avatars.githubusercontent.com/u/11180862?v=4",
"profile": "https://github.com/Skywalker-11",
"contributions": []
},
{
"login": "sh1hab",
"name": "Masudul Haque Shihab",
"avatar_url": "https://avatars.githubusercontent.com/u/22068886?v=4",
"profile": "https://github.com/sh1hab",
"contributions": [
"code"
]
},
{
"login": "zybersup",
"name": "Supapong Areeprasertkul",
"avatar_url": "https://avatars.githubusercontent.com/u/16099942?v=4",
"profile": "http://www.freedomdive.com/",
"contributions": [
"code"
]
},
{
"login": "psarossy",
"name": "Peter Sarossy",
"avatar_url": "https://avatars.githubusercontent.com/u/207358?v=4",
"profile": "https://github.com/psarossy",
"contributions": [
"code"
]
},
{
"login": "nepella",
"name": "Renee Margaret McConahy",
"avatar_url": "https://avatars.githubusercontent.com/u/11823649?v=4",
"profile": "https://github.com/nepella",
"contributions": [
"code"
]
},
{
"login": "JohnnyPicnic",
"name": "JohnnyPicnic",
"avatar_url": "https://avatars.githubusercontent.com/u/5553884?v=4",
"profile": "https://github.com/JohnnyPicnic",
"contributions": [
"code"
]
},
{
"login": "markbrule",
"name": "markbrule",
"avatar_url": "https://avatars.githubusercontent.com/u/8799594?v=4",
"profile": "https://github.com/markbrule",
"contributions": [
"code"
]
},
{
"login": "mikecmpbll",
"name": "Mike Campbell",
"avatar_url": "https://avatars.githubusercontent.com/u/1962801?v=4",
"profile": "https://github.com/mikecmpbll",
"contributions": [
"code"
]
},
{
"login": "tbrconnect",
"name": "tbrconnect",
"avatar_url": "https://avatars.githubusercontent.com/u/11973217?v=4",
"profile": "https://github.com/tbrconnect",
"contributions": [
"code"
]
},
{
"login": "kcoyo",
"name": "kcoyo",
"avatar_url": "https://avatars.githubusercontent.com/u/12447225?v=4",
"profile": "https://github.com/kcoyo",
"contributions": [
"code"
]
},
{
"login": "travismiller",
"name": "Travis Miller",
"avatar_url": "https://avatars.githubusercontent.com/u/494017?v=4",
"profile": "https://travismiller.com/",
"contributions": [
"code"
]
}
]
}

View File

@@ -1,5 +1,13 @@
.git
.github
.gitattributes
.gitignore
.dockerignore
app/storage/logs/*
app/storage/views/*
vendor/*
storage/framework/cache/*
node_modules
.vagrant
.idea

157
.env.docker Normal file
View File

@@ -0,0 +1,157 @@
# --------------------------------------------
# REQUIRED: DB SETUP
# --------------------------------------------
MYSQL_DATABASE=snipeit
MYSQL_USER=snipeit
MYSQL_PASSWORD=changeme1234
MYSQL_ROOT_PASSWORD=changeme1234
# --------------------------------------------
# REQUIRED: BASIC APP SETTINGS
# --------------------------------------------
APP_ENV=develop
APP_DEBUG=false
# please regenerate the APP_KEY value by calling `docker-compose run --rm snipeit bash` and then `php artisan key:generate --show` and then copy paste the value here
APP_KEY=base64:3ilviXqB9u6DX1NRcyWGJ+sjySF+H18CPDGb3+IVwMQ=
APP_URL=http://localhost:8000
APP_TIMEZONE='UTC'
APP_LOCALE=en
MAX_RESULTS=500
# --------------------------------------------
# REQUIRED: UPLOADED FILE STORAGE SETTINGS
# --------------------------------------------
PRIVATE_FILESYSTEM_DISK=local
PUBLIC_FILESYSTEM_DISK=local_public
# --------------------------------------------
# REQUIRED: DATABASE SETTINGS
# --------------------------------------------
DB_CONNECTION=mysql
DB_HOST=mariadb
DB_DATABASE=snipeit
DB_USERNAME=snipeit
DB_PASSWORD=changeme1234
DB_PREFIX=null
DB_DUMP_PATH='/usr/bin'
DB_CHARSET=utf8mb4
DB_COLLATION=utf8mb4_unicode_ci
# --------------------------------------------
# OPTIONAL: SSL DATABASE SETTINGS
# --------------------------------------------
DB_SSL=false
DB_SSL_IS_PAAS=false
DB_SSL_KEY_PATH=null
DB_SSL_CERT_PATH=null
DB_SSL_CA_PATH=null
DB_SSL_CIPHER=null
# --------------------------------------------
# REQUIRED: OUTGOING MAIL SERVER SETTINGS
# --------------------------------------------
MAIL_DRIVER=smtp
MAIL_HOST=mailhog
MAIL_PORT=1025
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null
MAIL_FROM_ADDR=you@example.com
MAIL_FROM_NAME='Snipe-IT'
MAIL_REPLYTO_ADDR=you@example.com
MAIL_REPLYTO_NAME='Snipe-IT'
MAIL_AUTO_EMBED_METHOD='attachment'
# --------------------------------------------
# REQUIRED: IMAGE LIBRARY
# This should be gd or imagick
# --------------------------------------------
IMAGE_LIB=gd
# --------------------------------------------
# OPTIONAL: BACKUP SETTINGS
# --------------------------------------------
MAIL_BACKUP_NOTIFICATION_DRIVER=null
MAIL_BACKUP_NOTIFICATION_ADDRESS=null
BACKUP_ENV=true
# --------------------------------------------
# OPTIONAL: SESSION SETTINGS
# --------------------------------------------
SESSION_LIFETIME=12000
EXPIRE_ON_CLOSE=false
ENCRYPT=false
COOKIE_NAME=snipeit_session
COOKIE_DOMAIN=null
SECURE_COOKIES=false
API_TOKEN_EXPIRATION_YEARS=40
# --------------------------------------------
# OPTIONAL: SECURITY HEADER SETTINGS
# --------------------------------------------
APP_TRUSTED_PROXIES=192.168.1.1,10.0.0.1
ALLOW_IFRAMING=false
REFERRER_POLICY=same-origin
ENABLE_CSP=false
CORS_ALLOWED_ORIGINS=null
ENABLE_HSTS=false
# --------------------------------------------
# OPTIONAL: CACHE SETTINGS
# --------------------------------------------
CACHE_DRIVER=file
SESSION_DRIVER=file
QUEUE_DRIVER=sync
CACHE_PREFIX=snipeit
# --------------------------------------------
# OPTIONAL: REDIS SETTINGS
# --------------------------------------------
REDIS_HOST=redis
REDIS_PASSWORD=null
REDIS_PORT=6379
# --------------------------------------------
# OPTIONAL: MEMCACHED SETTINGS
# --------------------------------------------
MEMCACHED_HOST=null
MEMCACHED_PORT=null
# --------------------------------------------
# OPTIONAL: PUBLIC S3 Settings
# --------------------------------------------
PUBLIC_AWS_SECRET_ACCESS_KEY=null
PUBLIC_AWS_ACCESS_KEY_ID=null
PUBLIC_AWS_DEFAULT_REGION=null
PUBLIC_AWS_BUCKET=null
PUBLIC_AWS_URL=null
PUBLIC_AWS_BUCKET_ROOT=null
# --------------------------------------------
# OPTIONAL: PRIVATE S3 Settings
# --------------------------------------------
PRIVATE_AWS_ACCESS_KEY_ID=null
PRIVATE_AWS_SECRET_ACCESS_KEY=null
PRIVATE_AWS_DEFAULT_REGION=null
PRIVATE_AWS_BUCKET=null
PRIVATE_AWS_URL=null
PRIVATE_AWS_BUCKET_ROOT=null
# --------------------------------------------
# OPTIONAL: LOGIN THROTTLING
# --------------------------------------------
LOGIN_MAX_ATTEMPTS=5
LOGIN_LOCKOUT_DURATION=60
RESET_PASSWORD_LINK_EXPIRES=900
# --------------------------------------------
# OPTIONAL: MISC
# --------------------------------------------
APP_LOG=stderr
APP_LOG_MAX_FILES=10
APP_LOCKED=false
APP_CIPHER=AES-256-CBC
GOOGLE_MAPS_API=
LDAP_MEM_LIM=500M
LDAP_TIME_LIM=600

View File

@@ -7,6 +7,13 @@ APP_KEY=ChangeMe
APP_URL=null
APP_TIMEZONE='UTC'
APP_LOCALE=en
MAX_RESULTS=500
# --------------------------------------------
# REQUIRED: UPLOADED FILE STORAGE SETTINGS
# --------------------------------------------
PRIVATE_FILESYSTEM_DISK=local
PUBLIC_FILESYSTEM_DISK=local_public
# --------------------------------------------
# REQUIRED: DATABASE SETTINGS
@@ -25,6 +32,7 @@ DB_COLLATION=utf8mb4_unicode_ci
# OPTIONAL: SSL DATABASE SETTINGS
# --------------------------------------------
DB_SSL=false
DB_SSL_IS_PAAS=false
DB_SSL_KEY_PATH=null
DB_SSL_CERT_PATH=null
DB_SSL_CA_PATH=null
@@ -43,6 +51,7 @@ MAIL_FROM_ADDR=you@example.com
MAIL_FROM_NAME='Snipe-IT'
MAIL_REPLYTO_ADDR=you@example.com
MAIL_REPLYTO_NAME='Snipe-IT'
MAIL_AUTO_EMBED_METHOD='attachment'
# --------------------------------------------
# REQUIRED: IMAGE LIBRARY
@@ -50,6 +59,15 @@ MAIL_REPLYTO_NAME='Snipe-IT'
# --------------------------------------------
IMAGE_LIB=gd
# --------------------------------------------
# OPTIONAL: BACKUP SETTINGS
# --------------------------------------------
MAIL_BACKUP_NOTIFICATION_DRIVER=null
MAIL_BACKUP_NOTIFICATION_ADDRESS=null
BACKUP_ENV=true
# --------------------------------------------
# OPTIONAL: SESSION SETTINGS
# --------------------------------------------
@@ -59,12 +77,17 @@ ENCRYPT=false
COOKIE_NAME=snipeit_session
COOKIE_DOMAIN=null
SECURE_COOKIES=false
API_TOKEN_EXPIRATION_YEARS=15
# --------------------------------------------
# OPTIONAL: SECURITY HEADER SETTINGS
# --------------------------------------------
APP_TRUSTED_PROXIES=192.168.1.1,10.0.0.1
ALLOW_IFRAMING=false
REFERRER_POLICY=same-origin
ENABLE_CSP=false
CORS_ALLOWED_ORIGINS=null
ENABLE_HSTS=false
# --------------------------------------------
# OPTIONAL: CACHE SETTINGS
@@ -88,18 +111,31 @@ MEMCACHED_HOST=null
MEMCACHED_PORT=null
# --------------------------------------------
# OPTIONAL: AWS S3 SETTINGS
# OPTIONAL: PUBLIC S3 Settings
# --------------------------------------------
AWS_SECRET=null
AWS_KEY=null
AWS_REGION=null
AWS_BUCKET=null
PUBLIC_AWS_SECRET_ACCESS_KEY=null
PUBLIC_AWS_ACCESS_KEY_ID=null
PUBLIC_AWS_DEFAULT_REGION=null
PUBLIC_AWS_BUCKET=null
PUBLIC_AWS_URL=null
PUBLIC_AWS_BUCKET_ROOT=null
# --------------------------------------------
# OPTIONAL: PRIVATE S3 Settings
# --------------------------------------------
PRIVATE_AWS_ACCESS_KEY_ID=null
PRIVATE_AWS_SECRET_ACCESS_KEY=null
PRIVATE_AWS_DEFAULT_REGION=null
PRIVATE_AWS_BUCKET=null
PRIVATE_AWS_URL=null
PRIVATE_AWS_BUCKET_ROOT=null
# --------------------------------------------
# OPTIONAL: LOGIN THROTTLING
# --------------------------------------------
LOGIN_MAX_ATTEMPTS=5
LOGIN_LOCKOUT_DURATION=60
RESET_PASSWORD_LINK_EXPIRES=900
# --------------------------------------------
# OPTIONAL: MISC
@@ -107,9 +143,12 @@ LOGIN_LOCKOUT_DURATION=60
APP_LOG=single
APP_LOG_MAX_FILES=10
APP_LOCKED=false
FILESYSTEM_DISK=local
APP_TRUSTED_PROXIES=192.168.1.1,10.0.0.1
ALLOW_IFRAMING=false
APP_CIPHER=AES-256-CBC
APP_FORCE_TLS=false
GOOGLE_MAPS_API=
BACKUP_ENV=true
LDAP_MEM_LIM=500M
LDAP_TIME_LIM=600
IMPORT_TIME_LIMIT=600
IMPORT_MEMORY_LIMIT=500M
REPORT_TIME_LIMIT=12000

View File

@@ -40,10 +40,12 @@ IMAGE_LIB=gd
# --------------------------------------------
# OPTIONAL: AWS S3 SETTINGS
# --------------------------------------------
AWS_SECRET=null
AWS_KEY=null
AWS_REGION=null
AWS_SECRET_ACCESS_KEY=null
AWS_ACCESS_KEY_ID=null
AWS_DEFAULT_REGION=null
AWS_BUCKET=null
AWS_BUCKET_ROOT=null
AWS_URL=null
# --------------------------------------------

View File

@@ -2,7 +2,7 @@
# REQUIRED: BASIC APP SETTINGS
# --------------------------------------------
APP_ENV=testing-ci
APP_DEBUG=true
APP_DEBUG=false
APP_KEY=ChangeMe
APP_URL=http://localhost:8000
APP_TIMEZONE='US/Pacific'
@@ -40,10 +40,12 @@ IMAGE_LIB=gd
# --------------------------------------------
# OPTIONAL: AWS S3 SETTINGS
# --------------------------------------------
AWS_SECRET=null
AWS_KEY=null
AWS_REGION=null
AWS_SECRET_ACCESS_KEY=null
AWS_ACCESS_KEY_ID=null
AWS_DEFAULT_REGION=null
AWS_BUCKET=null
AWS_BUCKET_ROOT=null
AWS_URL=null
# --------------------------------------------

4
.gitattributes vendored
View File

@@ -1 +1,3 @@
* text=auto
* text=auto
public/js/** binary
public/css/** binary

View File

@@ -48,6 +48,7 @@ If applicable, add screenshots to help explain your problem.
- Any errors that appear in your browser's error console.
- Confirm whether the error is reproducible on the demo: https://snipeitapp.com/demo.
- Include any additional information you can find in `storage/logs` and your webserver's logs.
- Include the output from `php -m` (this should display what modules you have enabled.)
**Additional context**
- Is this a fresh install or an upgrade?

4
.github/autolabeler.yml vendored Normal file
View File

@@ -0,0 +1,4 @@
frontend: ["*.js", "*.css", "*.vue", "*.scss", "*.less", "*.blade.*"]
backend: ["/app", "*.php"]
legal: ["LICENSE*", "NOTICES*"]
config: .github

33
.github/config.yml vendored Normal file
View File

@@ -0,0 +1,33 @@
# Configuration for new-issue-welcome - https://github.com/behaviorbot/new-issue-welcome
# Comment to be posted to on first time issues
newIssueWelcomeComment: |
👋 Thanks for opening your first issue here! If you're reporting a 🐞 bug, please make sure you include steps to reproduce it. We get a lot of issues on this repo, so please be patient and we will get back to you as soon as we can.
# Configuration for new-pr-welcome - https://github.com/behaviorbot/new-pr-welcome
# Comment to be posted to on PRs from first time contributors in your repository
newPRWelcomeComment: |
💖 Thanks for this pull request! 💖
We use [semantic commit messages](https://snipe-it.readme.io/docs/contributing-overview#section-pull-request-guidelines) to streamline the release process and easily generate changelogs between versions. Before your pull request can be merged, you should **update your pull request title** to start with a semantic prefix if it doesn't have one already.
Examples of commit messages with semantic prefixes:
- `Fixed #<issue number>: don't overwrite prevent_default if default wasn't prevented`
- `Added #<issue number>: add checkout functionality to assets`
- `Improved Asset Checkout: use new notification method for checkout`
Things that will help get your PR across the finish line:
- Document any user-facing changes you've made.
- Include tests when adding/changing behavior.
- Include screenshots and animated GIFs whenever possible.
We get a lot of pull requests on this repo, so please be patient and we will get back to you as soon as we can.
# Configuration for first-pr-merge - https://github.com/behaviorbot/first-pr-merge
# Comment to be posted to on pull requests merged by a first time user
firstPRMergeComment: >
Congrats on merging your first pull request! 🎉🎉🎉

40
.github/pull_request_template.md vendored Normal file
View File

@@ -0,0 +1,40 @@
# Description
Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context, providing screenshots where practical. List any dependencies that are required for this change.
Fixes # (issue)
## Type of change
Please delete options that are not relevant.
- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
- [ ] This change requires a documentation update
# How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration
- [ ] Test A
- [ ] Test B
**Test Configuration**:
* PHP version:
* MySQL version
* Webserver version
* OS version
# Checklist:
- [ ] I have read the Contributing documentation available here: https://snipe-it.readme.io/docs/contributing-overview
- [ ] I have formatted this PR according to the project guidelines: https://snipe-it.readme.io/docs/contributing-overview#pull-request-guidelines
- [ ] My code follows the style guidelines of this project
- [ ] I have performed a self-review of my own code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation
- [ ] My changes generate no new warnings
- [ ] I have added tests that prove my fix is effective or that my feature works
- [ ] New and existing unit tests pass locally with my changes

7
.github/weekly-digest.yml vendored Normal file
View File

@@ -0,0 +1,7 @@
# Configuration for weekly-digest - https://github.com/apps/weekly-digest
publishDay: sun
canPublishIssues: true
canPublishPullRequests: true
canPublishContributors: true
canPublishStargazers: true
canPublishCommits: true

49
.github/workflows/codacy-analysis.yml vendored Normal file
View File

@@ -0,0 +1,49 @@
# This workflow checks out code, performs a Codacy security scan
# and integrates the results with the
# GitHub Advanced Security code scanning feature. For more information on
# the Codacy security scan action usage and parameters, see
# https://github.com/codacy/codacy-analysis-cli-action.
# For more information on Codacy Analysis CLI in general, see
# https://github.com/codacy/codacy-analysis-cli.
name: Codacy Security Scan
on:
push:
branches: [ master ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ master ]
schedule:
- cron: '36 23 * * 3'
jobs:
codacy-security-scan:
name: Codacy Security Scan
runs-on: ubuntu-latest
steps:
# Checkout the repository to the GitHub Actions runner
- name: Checkout code
uses: actions/checkout@v2
# Execute Codacy Analysis CLI and generate a SARIF output with the security issues identified during the analysis
- name: Run Codacy Analysis CLI
uses: codacy/codacy-analysis-cli-action@1.1.0
with:
# Check https://github.com/codacy/codacy-analysis-cli#project-token to get your project token from your Codacy repository
# You can also omit the token and run the tools that support default configurations
project-token: ${{ secrets.CODACY_PROJECT_TOKEN }}
verbose: true
output: results.sarif
format: sarif
# Adjust severity of non-security issues
gh-code-scanning-compat: true
# Force 0 exit code to allow SARIF file generation
# This will handover control about PR rejection to the GitHub side
max-allowed-issues: 2147483647
# Upload the SARIF file generated in the previous step
- name: Upload SARIF results file
uses: github/codeql-action/upload-sarif@v1
with:
sarif_file: results.sarif

14
.gitignore vendored
View File

@@ -48,6 +48,18 @@ tests/_support/_generated/*
/npm-debug.log
/storage/oauth-private.key
/storage/oauth-public.key
logs/*
*.cache
.vagrant
*.log
*.retry
\.php_cs\.dist
phpmd\.xml
/public/storage
_ide_helper.php
.phpstorm.meta.php
_ide_helper_models.php
/.phplint-cache

View File

@@ -5,7 +5,15 @@
# Make sure .env files not not browseable if in a sub-directory.
<FilesMatch "\.env$">
Deny from all
# Apache 2.2
<IfModule !authz_core_module>
Deny from all
</IfModule>
# Apache 2.4+
<IfModule authz_core_module>
Require all denied
</IfModule>
</FilesMatch>
</IfModule>

1
.nvmrc Normal file
View File

@@ -0,0 +1 @@
v10.15.1

View File

@@ -1,82 +0,0 @@
addons:
code_climate:
repo_token:
secure: "C/bUAEpwfZB82dkzI2Nxx3PW5w/BzbKkSyCkp6YjT046jD2/QKvz6ngCFlt3tAWV11TXWFI6D8DzkMmdWOrQl3SGlPZXRD8QOvCiz0HiGMDvlxjAaPaQecGaQZdx/H4m6xTUXRNUVaYmxlMgkkFCWhAp+HZDs0iyOEVamp0Jszg="
hosts:
- localhost
sudo: false
# see http://about.travis-ci.org/docs/user/languages/php/ for more hints
language: php
services:
- mysql
# list any PHP version you want to test against
php:
- 7.1.2
- 7.2
- 7.3
matrix:
allow_failures:
- php: 7.3
# execute any number of scripts before the test run, custom env's are available as variables
before_script:
- phpenv config-add .github/travis-memory.ini
- phantomjs --webdriver=4444 &
- sleep 4
- mysql -e 'CREATE DATABASE snipeit_unit;'
- mysql -e 'CREATE USER "travis'@'localhost";'
- mysql -e 'GRANT ALL PRIVILEGES ON * . * TO "travis'@'localhost";'
- mysql -e 'FLUSH PRIVILEGES;'
- composer self-update
- composer install -n --prefer-source
- chmod -R 777 storage
- php artisan migrate --env=testing-ci --database=mysql --force
- ./vendor/bin/codecept build
- php artisan --env=testing-ci key:generate
- php artisan --env=testing-ci snipeit:travisci-install
- php artisan --env=testing-ci db:seed --database=mysql --force
- php artisan --env=testing-ci snipeit:create-admin --first_name=Alison --last_name=Foobar --email=me@example.com --username=snipe --password=password
- php artisan --env=testing-ci passport:install
- php artisan serve --env=testing-ci --port=8000 --host=localhost &
- sleep 5
- pip install --user codecov
- sleep 5
# omitting "script:" will default to phpunit
# use the $DB env variable to determine the phpunit.xml to use
# script: ./vendor/bin/codecept run --env testing-ci
script:
- ./vendor/bin/codecept run unit
# - ./vendor/bin/codecept run acceptance --env=testing-ci
- ./vendor/bin/codecept run functional --env=functional-travis -g func1
- ./vendor/bin/codecept run functional --env=functional-travis -g func2
- ./vendor/bin/codecept run api --env=functional-travis
after_script:
- vendor/bin/test-reporter
after_success:
- codecov
after_failure:
- cat tests/_output/*.fail.html
- curl http://localhost:8000/login
- cat storage/logs/laravel.log
# configure notifications (email, IRC, campfire etc)
notifications:
email: false
slack:
secure: vv9we1RxB9RsrMbomSdq6D7vz/okobw87pEkgIZjB+hj1QpQ2by90gsPsOa+NgsJEFaEP7e4KlT6SH8kK+zhbmuKaUd3d1//XdcancE22LZXi6tkiB5yuR/Jhhb1LLDqyGJTB4D92hMnnCPiUjpxNA3r437ttNeYRdYIEEP3drA=
webhooks:
urls:
- https://webhooks.gitter.im/e/5e136eb0c1965f3918d0
on_success: change # options: [always|never|change] default: always
on_failure: change # options: [always|never|change] default: always
on_start: false # default: false

View File

@@ -1,36 +1,62 @@
FROM ubuntu:xenial
LABEL maintainer="uberbrady, hinchk"
FROM ubuntu:bionic
LABEL maintainer Brady Wetherington <uberbrady@gmail.com>
RUN apt-get update && apt-get install -y software-properties-common
RUN LC_ALL=C.UTF-8 add-apt-repository -y ppa:ondrej/php
RUN apt-get update && apt-get install -y \
# No need to add `apt-get clean` here, reference:
# - https://github.com/snipe/snipe-it/pull/9201
# - https://docs.docker.com/develop/develop-images/dockerfile_best-practices/#apt-get
RUN export DEBIAN_FRONTEND=noninteractive; \
export DEBCONF_NONINTERACTIVE_SEEN=true; \
echo 'tzdata tzdata/Areas select Etc' | debconf-set-selections; \
echo 'tzdata tzdata/Zones/Etc select UTC' | debconf-set-selections; \
apt-get update -qqy \
&& apt-get install -qqy --no-install-recommends \
apt-utils \
apache2 \
apache2-bin \
libapache2-mod-php7.1 \
php7.1-curl \
php7.1-ldap \
php7.1-mysql \
php7.1-mcrypt \
php7.1-gd \
php7.1-xml \
php7.1-mbstring \
php7.1-zip \
php7.1-bcmath \
libapache2-mod-php7.2 \
php7.2-curl \
php7.2-ldap \
php7.2-mysql \
php7.2-gd \
php7.2-xml \
php7.2-mbstring \
php7.2-zip \
php7.2-bcmath \
patch \
curl \
wget \
vim \
git \
cron \
mysql-client \
supervisor \
&& apt-get clean \
cron \
gcc \
make \
autoconf \
libc-dev \
pkg-config \
libmcrypt-dev \
php7.2-dev \
ca-certificates \
unzip \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
RUN curl -L -O https://github.com/pear/pearweb_phars/raw/master/go-pear.phar
RUN php go-pear.phar
RUN pecl install mcrypt-1.0.2
RUN bash -c "echo extension=/usr/lib/php/20170718/mcrypt.so > /etc/php/7.2/mods-available/mcrypt.ini"
RUN phpenmod mcrypt
RUN phpenmod gd
RUN phpenmod bcmath
RUN sed -i 's/variables_order = .*/variables_order = "EGPCS"/' /etc/php/7.1/apache2/php.ini
RUN sed -i 's/variables_order = .*/variables_order = "EGPCS"/' /etc/php/7.1/cli/php.ini
RUN sed -i 's/variables_order = .*/variables_order = "EGPCS"/' /etc/php/7.2/apache2/php.ini
RUN sed -i 's/variables_order = .*/variables_order = "EGPCS"/' /etc/php/7.2/cli/php.ini
RUN useradd -m --uid 1000 --gid 50 docker
@@ -41,11 +67,11 @@ COPY docker/000-default.conf /etc/apache2/sites-enabled/000-default.conf
#SSL
RUN mkdir -p /var/lib/snipeit/ssl
COPY docker/001-default-ssl.conf /etc/apache2/sites-enabled/001-default-ssl.conf
#COPY docker/001-default-ssl.conf /etc/apache2/sites-available/001-default-ssl.conf
#COPY docker/001-default-ssl.conf /etc/apache2/sites-enabled/001-default-ssl.conf
COPY docker/001-default-ssl.conf /etc/apache2/sites-available/001-default-ssl.conf
RUN a2enmod ssl
#RUN a2ensite 001-default-ssl.conf
RUN a2ensite 001-default-ssl.conf
COPY . /var/www/html
@@ -68,20 +94,21 @@ RUN \
rm -r "/var/www/html/storage/private_uploads" && ln -fs "/var/lib/snipeit/data/private_uploads" "/var/www/html/storage/private_uploads" \
&& rm -rf "/var/www/html/public/uploads" && ln -fs "/var/lib/snipeit/data/uploads" "/var/www/html/public/uploads" \
&& rm -r "/var/www/html/storage/app/backups" && ln -fs "/var/lib/snipeit/dumps" "/var/www/html/storage/app/backups" \
&& mkdir "/var/lib/snipeit/keys" && ln -fs "/var/lib/snipeit/keys/oauth-private.key" "/var/www/html/storage/oauth-private.key" \
&& mkdir -p "/var/lib/snipeit/keys" && ln -fs "/var/lib/snipeit/keys/oauth-private.key" "/var/www/html/storage/oauth-private.key" \
&& ln -fs "/var/lib/snipeit/keys/oauth-public.key" "/var/www/html/storage/oauth-public.key" \
&& chown docker "/var/lib/snipeit/keys/" \
&& chown -h docker "/var/www/html/storage/" \
&& chmod +x /var/www/html/artisan \
&& echo "Finished setting up application in /var/www/html"
############## DEPENDENCIES via COMPOSER ###################
#global install of composer
RUN cd /tmp;curl -sS https://getcomposer.org/installer | php;mv /tmp/composer.phar /usr/local/bin/composer
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
# Get dependencies
USER docker
RUN cd /var/www/html;composer install && rm -rf /home/docker/.composer/cache
RUN composer install --no-dev --working-dir=/var/www/html
USER root
############### APPLICATION INSTALL/INIT #################

83
Dockerfile.alpine Normal file
View File

@@ -0,0 +1,83 @@
FROM alpine:3.13
# Apache + PHP
RUN apk add --no-cache \
apache2 \
php7 \
php7-common \
php7-apache2 \
php7-curl \
php7-ldap \
php7-mysqli \
php7-gd \
php7-xml \
php7-mbstring \
php7-zip \
php7-ctype \
php7-tokenizer \
php7-pdo_mysql \
php7-openssl \
php7-bcmath \
php7-phar \
php7-json \
php7-iconv \
php7-fileinfo \
php7-simplexml \
php7-session \
php7-dom \
php7-xmlwriter \
curl \
wget \
vim \
git \
mysql-client \
tini
# Where apache's PID lives
RUN mkdir -p /run/apache2 && chown apache:apache /run/apache2
RUN sed -i 's/variables_order = .*/variables_order = "EGPCS"/' /etc/php7/php.ini
COPY docker/000-default-2.4.conf /etc/apache2/conf.d/default.conf
# Enable mod_rewrite
RUN sed -i '/LoadModule rewrite_module/s/^#//g' /etc/apache2/httpd.conf
COPY . /var/www/html
WORKDIR /var/www/html
COPY docker/docker.env /var/www/html/.env
RUN chown -R apache:apache /var/www/html
RUN \
rm -r "/var/www/html/storage/private_uploads" \
&& mkdir -p "/var/lib/snipeit/data/private_uploads" && ln -fs "/var/lib/snipeit/data/private_uploads" "/var/www/html/storage/private_uploads" \
&& rm -rf "/var/www/html/public/uploads" \
&& mkdir -p "/var/lib/snipeit/data/uploads" && ln -fs "/var/lib/snipeit/data/uploads" "/var/www/html/public/uploads" \
&& mkdir -p "/var/lib/snipeit/dumps" && rm -r "/var/www/html/storage/app/backups" && ln -fs "/var/lib/snipeit/dumps" "/var/www/html/storage/app/backups" \
&& mkdir -p "/var/lib/snipeit/keys" && ln -fs "/var/lib/snipeit/keys/oauth-private.key" "/var/www/html/storage/oauth-private.key" \
&& ln -fs "/var/lib/snipeit/keys/oauth-public.key" "/var/www/html/storage/oauth-public.key" \
&& chown -hR apache "/var/www/html/storage/" \
&& chown -R apache "/var/lib/snipeit"
# Install composer
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
RUN mkdir -p /var/www/.composer && chown apache /var/www/.composer
# Install dependencies
USER apache
RUN COMPOSER_CACHE_DIR=/dev/null composer install --no-dev --working-dir=/var/www/html
USER root
VOLUME ["/var/lib/snipeit"]
# Entrypoints
COPY docker/entrypoint_alpine.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
ENTRYPOINT ["/sbin/tini", "--"]
CMD ["/entrypoint.sh"]
EXPOSE 80

102
Dockerfile.fpm-alpine Normal file
View File

@@ -0,0 +1,102 @@
ARG ENVIRONMENT=production
ARG SNIPEIT_RELEASE=5.1.3
ARG PHP_VERSION=7.4.16
ARG PHP_ALPINE_VERSION=3.13
ARG COMPOSER_VERSION=2.0.11
# Cannot use arguments with 'COPY --from' workaround
# https://github.com/moby/moby/issues/34482#issuecomment-454716952
FROM composer:${COMPOSER_VERSION} AS composer
# Final stage
FROM php:${PHP_VERSION}-fpm-alpine${PHP_ALPINE_VERSION} AS source
LABEL maintainer="Mateus Villar <mromeravillar@gmail.com>"
ARG PACKAGES="\
mysql-client \
"
ARG DEV_PACKAGES="\
git \
"
ARG ENVIRONMENT
ENV ENVIRONMENT ${ENVIRONMENT}
ARG SNIPEIT_RELEASE
ENV SNIPEIT_RELEASE ${SNIPEIT_RELEASE}
# Cribbed from wordpress-fpm-alpine image
# set recommended PHP.ini settings
# see https://secure.php.net/manual/en/opcache.installation.php
RUN set -eux; \
docker-php-ext-enable opcache; \
{ \
echo 'opcache.memory_consumption=128'; \
echo 'opcache.interned_strings_buffer=8'; \
echo 'opcache.max_accelerated_files=4000'; \
echo 'opcache.revalidate_freq=2'; \
echo 'opcache.fast_shutdown=1'; \
} > /usr/local/etc/php/conf.d/opcache-recommended.ini
# https://wordpress.org/support/article/editing-wp-config-php/#configure-error-logging
RUN { \
# https://www.php.net/manual/en/errorfunc.constants.php
# https://github.com/docker-library/wordpress/issues/420#issuecomment-517839670
echo 'error_reporting = E_ERROR | E_WARNING | E_PARSE | E_CORE_ERROR | E_CORE_WARNING | E_COMPILE_ERROR | E_COMPILE_WARNING | E_RECOVERABLE_ERROR'; \
echo 'display_errors = Off'; \
echo 'display_startup_errors = Off'; \
echo 'log_errors = On'; \
echo 'error_log = /dev/stderr'; \
echo 'log_errors_max_len = 1024'; \
echo 'ignore_repeated_errors = On'; \
echo 'ignore_repeated_source = Off'; \
echo 'html_errors = Off'; \
} > /usr/local/etc/php/conf.d/error-logging.ini
# Install php extensions inside docker containers easily
# https://github.com/mlocati/docker-php-extension-installer
COPY --from=mlocati/php-extension-installer:1.2.19 /usr/bin/install-php-extensions /usr/local/bin/
RUN set -eux; \
install-php-extensions \
bcmath \
gd \
ldap \
mysqli \
pdo_mysql \
zip; \
rm -f /usr/local/bin/install-php-extensions; \
# Install prerequisites packages
apk add --no-cache \
${PACKAGES};
COPY --from=composer /usr/bin/composer /usr/local/bin
ARG COMPOSER_ALLOW_SUPERUSER=1
RUN set -eux; \
# Download and extract snipeit tarball
curl -o snipeit.tar.gz -fL "https://github.com/snipe/snipe-it/archive/v$SNIPEIT_RELEASE.tar.gz"; \
tar -xzf snipeit.tar.gz --strip-components=1 -C /var/www/html/; \
rm snipeit.tar.gz; \
# Install composer php dependencies
if [ "$ENVIRONMENT" = "production" ]; then \
echo "production enviroment detected!"; \
composer update \
--no-cache \
--no-dev \
--optimize-autoloader \
--working-dir=/var/www/html; \
else \
echo "development enviroment detected!"; \
apk add --no-cache \
${DEV_PACKAGES}; \
composer update \
--no-cache \
--prefer-source \
--optimize-autoloader \
--working-dir=/var/www/html; \
fi; \
rm -f /usr/local/bin/composer; \
chown -R www-data:www-data /var/www/html;
VOLUME [ "/var/lib/snipeit" ]
COPY --chown=www-data:www-data docker/docker-secrets.env /var/www/html/.env
COPY --chmod=655 docker/docker-entrypoint.sh /usr/local/bin/docker-snipeit-entrypoint
ENTRYPOINT [ "/usr/local/bin/docker-snipeit-entrypoint" ]
CMD [ "/usr/local/bin/docker-php-entrypoint", "php-fpm" ]

View File

@@ -1,12 +1,11 @@
[![Build Status](https://travis-ci.org/snipe/snipe-it.svg?branch=master)](https://travis-ci.org/snipe/snipe-it) [![Crowdin](https://d322cqt584bo4o.cloudfront.net/snipe-it/localized.svg)](https://crowdin.com/project/snipe-it) [![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/snipe/snipe-it?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) [![Docker Pulls](https://img.shields.io/docker/pulls/snipe/snipe-it.svg)](https://hub.docker.com/r/snipe/snipe-it/) [![Twitter Follow](https://img.shields.io/twitter/follow/snipeitapp.svg?style=social)](https://twitter.com/snipeitapp) [![Codacy Badge](https://api.codacy.com/project/badge/Grade/553ce52037fc43ea99149785afcfe641)](https://www.codacy.com/app/snipe/snipe-it?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=snipe/snipe-it&amp;utm_campaign=Badge_Grade)
[![All Contributors](https://img.shields.io/badge/all_contributors-181-orange.svg?style=flat-square)](#contributors) [![Open Source Helpers](https://www.codetriage.com/snipe/snipe-it/badges/users.svg)](https://www.codetriage.com/snipe/snipe-it)
![Build Status](https://app.chipperci.com/projects/0e5f8979-31eb-4ee6-9abf-050b76ab0383/status/master) [![Crowdin](https://d322cqt584bo4o.cloudfront.net/snipe-it/localized.svg)](https://crowdin.com/project/snipe-it) [![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/snipe/snipe-it?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) [![Docker Pulls](https://img.shields.io/docker/pulls/snipe/snipe-it.svg)](https://hub.docker.com/r/snipe/snipe-it/) [![Twitter Follow](https://img.shields.io/twitter/follow/snipeitapp.svg?style=social)](https://twitter.com/snipeitapp) [![Codacy Badge](https://api.codacy.com/project/badge/Grade/553ce52037fc43ea99149785afcfe641)](https://www.codacy.com/app/snipe/snipe-it?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=snipe/snipe-it&amp;utm_campaign=Badge_Grade)
[![All Contributors](https://img.shields.io/badge/all_contributors-259-orange.svg?style=flat-square)](#contributors)
## Snipe-IT - Open Source Asset Management System
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 5.5](http://laravel.com).
It is built on [Laravel 6](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/).)
@@ -61,11 +60,23 @@ Since the release of the JSON REST API, several third-party developers have been
- [jamf2snipe](https://github.com/ParadoxGuitarist/jamf2snipe) by [@ParadoxGuitarist](https://github.com/ParadoxGuitarist) - Python script to sync assets between a JAMFPro instance and a Snipe-IT instance
- [Marksman](https://github.com/Scope-IT/marksman) - A Windows agent for Snipe-IT
- [Snipe-IT plugin for Jira Service Desk (beta)](https://marketplace.atlassian.com/apps/1220379/snipe-it-for-jira-service-desk-beta?hosting=cloud&tab=overview) - for the upcoming Snipe-IT v5 only
- [Python 3 CSV importer](https://github.com/gastamper/snipeit-csvimporter) - allows importing assets into Snipe-IT based on Item Name rather than Asset Tag.
- [Snipe-IT Kubernetes Helm Chart](https://github.com/t3n/helm-charts/tree/master/snipeit) - For more information, [click here](https://hub.helm.sh/charts/t3n/snipeit).
- [Snipe-IT Bulk Edit](https://github.com/bricelabelle/snipe-it-bulkedit) - Google Script files to use Google Sheets as a bulk checkout/checkin/edit tool for Snipe-it.
As these were created by third-parties, Snipe-IT cannot provide support for these project, and you should contact the developers directly if you need assistance. Additionally, Snipe-IT makes no guarantees as to the reliability, accuracy or maintainability of these libraries. Use at your own risk. :)
-----
### Contributing
Please see the documentation on [contributing and developing for Snipe-IT](https://snipe-it.readme.io/docs/contributing-overview).
Please note that this project is released with a [Contributor Code of Conduct](CODE_OF_CONDUCT.md). By participating in this project you agree to abide by its terms.
-----
### Security
To report a security vulnerability, please email security@snipeitapp.com instead of using the issue tracker.
@@ -79,7 +90,7 @@ Thanks goes to all of these wonderful people ([emoji key](https://github.com/ken
<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
| [<img src="https://avatars3.githubusercontent.com/u/197404?v=3" width="110px;"/><br /><sub>snipe</sub>](http://www.snipe.net)<br />[💻](https://github.com/snipe/snipe-it/commits?author=snipe "Code") [🚇](#infra-snipe "Infrastructure (Hosting, Build-Tools, etc)") [📖](https://github.com/snipe/snipe-it/commits?author=snipe "Documentation") [⚠️](https://github.com/snipe/snipe-it/commits?author=snipe "Tests") [🐛](https://github.com/snipe/snipe-it/issues?q=author%3Asnipe "Bug reports") [🎨](#design-snipe "Design") [👀](#review-snipe "Reviewed Pull Requests") | [<img src="https://avatars0.githubusercontent.com/u/36335?v=3" width="110px;"/><br /><sub>Brady Wetherington</sub>](http://www.uberbrady.com)<br />[💻](https://github.com/snipe/snipe-it/commits?author=uberbrady "Code") [📖](https://github.com/snipe/snipe-it/commits?author=uberbrady "Documentation") [🚇](#infra-uberbrady "Infrastructure (Hosting, Build-Tools, etc)") [👀](#review-uberbrady "Reviewed Pull Requests") | [<img src="https://avatars0.githubusercontent.com/u/3803132?v=3" width="110px;"/><br /><sub>Daniel Meltzer</sub>](https://github.com/dmeltzer)<br />[💻](https://github.com/snipe/snipe-it/commits?author=dmeltzer "Code") [⚠️](https://github.com/snipe/snipe-it/commits?author=dmeltzer "Tests") [📖](https://github.com/snipe/snipe-it/commits?author=dmeltzer "Documentation") | [<img src="https://avatars0.githubusercontent.com/u/1609106?v=3" width="110px;"/><br /><sub>Michael T</sub>](http://www.tuckertechonline.com)<br />[💻](https://github.com/snipe/snipe-it/commits?author=mtucker6784 "Code") | [<img src="https://avatars2.githubusercontent.com/u/3274937?v=3" width="110px;"/><br /><sub>madd15</sub>](https://github.com/madd15)<br />[📖](https://github.com/snipe/snipe-it/commits?author=madd15 "Documentation") [💬](#question-madd15 "Answering Questions") | [<img src="https://avatars2.githubusercontent.com/u/894126?v=3" width="110px;"/><br /><sub>Vincent Sposato</sub>](https://github.com/vsposato)<br />[💻](https://github.com/snipe/snipe-it/commits?author=vsposato "Code") | [<img src="https://avatars0.githubusercontent.com/u/1639757?v=3" width="110px;"/><br /><sub>Andrea Bergamasco</sub>](https://github.com/vjandrea)<br />[💻](https://github.com/snipe/snipe-it/commits?author=vjandrea "Code") |
| :---: | :---: | :---: | :---: | :---: | :---: | :---: |
| [<img src="https://avatars0.githubusercontent.com/u/10640152?v=3" width="110px;"/><br /><sub>Karol</sub>](https://github.com/kpawelski)<br />[🌍](#translation-kpawelski "Translation") [💻](https://github.com/snipe/snipe-it/commits?author=kpawelski "Code") | [<img src="https://avatars3.githubusercontent.com/u/600106?v=3" width="110px;"/><br /><sub>morph027</sub>](http://blog.morph027.de/)<br />[💻](https://github.com/snipe/snipe-it/commits?author=morph027 "Code") | [<img src="https://avatars3.githubusercontent.com/u/22935755?v=3" width="110px;"/><br /><sub>fvleminckx</sub>](https://github.com/fvleminckx)<br />[🚇](#infra-fvleminckx "Infrastructure (Hosting, Build-Tools, etc)") | [<img src="https://avatars2.githubusercontent.com/u/15633547?v=3" width="110px;"/><br /><sub>itsupportcmsukorg</sub>](https://github.com/itsupportcmsukorg)<br />[💻](https://github.com/snipe/snipe-it/commits?author=itsupportcmsukorg "Code") [🐛](https://github.com/snipe/snipe-it/issues?q=author%3Aitsupportcmsukorg "Bug reports") | [<img src="https://avatars3.githubusercontent.com/u/12373799?v=3" width="110px;"/><br /><sub>Frank</sub>](https://override.io)<br />[💻](https://github.com/snipe/snipe-it/commits?author=base-zero "Code") | [<img src="https://avatars0.githubusercontent.com/u/10137?v=3" width="110px;"/><br /><sub>Deleted user</sub>](https://github.com/ghost)<br />[🌍](#translation-ghost "Translation") | [<img src="https://avatars1.githubusercontent.com/u/10802313?v=3" width="110px;"/><br /><sub>tiagom62</sub>](https://github.com/tiagom62)<br />[💻](https://github.com/snipe/snipe-it/commits?author=tiagom62 "Code") [🚇](#infra-tiagom62 "Infrastructure (Hosting, Build-Tools, etc)") |
| [<img src="https://avatars0.githubusercontent.com/u/10640152?v=3" width="110px;"/><br /><sub>Karol</sub>](https://github.com/kpawelski)<br />[🌍](#translation-kpawelski "Translation") [💻](https://github.com/snipe/snipe-it/commits?author=kpawelski "Code") | [<img src="https://avatars3.githubusercontent.com/u/600106?v=3" width="110px;"/><br /><sub>morph027</sub>](http://blog.morph027.de/)<br />[💻](https://github.com/snipe/snipe-it/commits?author=morph027 "Code") | [<img src="https://avatars3.githubusercontent.com/u/22935755?v=3" width="110px;"/><br /><sub>fvleminckx</sub>](https://github.com/fvleminckx)<br />[🚇](#infra-fvleminckx "Infrastructure (Hosting, Build-Tools, etc)") | [<img src="https://avatars2.githubusercontent.com/u/15633547?v=3" width="110px;"/><br /><sub>itsupportcmsukorg</sub>](https://github.com/itsupportcmsukorg)<br />[💻](https://github.com/snipe/snipe-it/commits?author=itsupportcmsukorg "Code") [🐛](https://github.com/snipe/snipe-it/issues?q=author%3Aitsupportcmsukorg "Bug reports") | [<img src="https://avatars3.githubusercontent.com/u/12373799?v=3" width="110px;"/><br /><sub>Frank</sub>](https://override.io)<br />[💻](https://github.com/snipe/snipe-it/commits?author=base-zero "Code") | [<img src="https://avatars0.githubusercontent.com/u/10137?v=3" width="110px;"/><br /><sub>Deleted user</sub>](https://github.com/ghost)<br />[🌍](#translation-ghost "Translation") [💻](https://github.com/snipe/snipe-it/commits?author=ghost "Code") | [<img src="https://avatars1.githubusercontent.com/u/10802313?v=3" width="110px;"/><br /><sub>tiagom62</sub>](https://github.com/tiagom62)<br />[💻](https://github.com/snipe/snipe-it/commits?author=tiagom62 "Code") [🚇](#infra-tiagom62 "Infrastructure (Hosting, Build-Tools, etc)") |
| [<img src="https://avatars3.githubusercontent.com/u/2389047?v=3" width="110px;"/><br /><sub>Ryan Stafford</sub>](https://github.com/rystaf)<br />[💻](https://github.com/snipe/snipe-it/commits?author=rystaf "Code") | [<img src="https://avatars2.githubusercontent.com/u/10345935?v=3" width="110px;"/><br /><sub>Eammon Hanlon</sub>](https://github.com/ehanlon)<br />[💻](https://github.com/snipe/snipe-it/commits?author=ehanlon "Code") | [<img src="https://avatars0.githubusercontent.com/u/441924?v=3" width="110px;"/><br /><sub>zjean</sub>](https://github.com/zjean)<br />[💻](https://github.com/snipe/snipe-it/commits?author=zjean "Code") | [<img src="https://avatars0.githubusercontent.com/u/12660103?v=3" width="110px;"/><br /><sub>Matthias Frei</sub>](http://www.frei.media)<br />[💻](https://github.com/snipe/snipe-it/commits?author=FREImedia "Code") | [<img src="https://avatars0.githubusercontent.com/u/3767518?v=3" width="110px;"/><br /><sub>opsydev</sub>](https://github.com/opsydev)<br />[💻](https://github.com/snipe/snipe-it/commits?author=opsydev "Code") | [<img src="https://avatars1.githubusercontent.com/u/82290?v=3" width="110px;"/><br /><sub>Daniel Dreier</sub>](http://www.ddreier.com)<br />[💻](https://github.com/snipe/snipe-it/commits?author=ddreier "Code") | [<img src="https://avatars0.githubusercontent.com/u/23448?v=3" width="110px;"/><br /><sub>Nikolai Prokoschenko</sub>](http://rassie.org)<br />[💻](https://github.com/snipe/snipe-it/commits?author=rassie "Code") |
| [<img src="https://avatars0.githubusercontent.com/u/13452757?v=3" width="110px;"/><br /><sub>Drew</sub>](https://github.com/YetAnotherCodeMonkey)<br />[💻](https://github.com/snipe/snipe-it/commits?author=YetAnotherCodeMonkey "Code") | [<img src="https://avatars0.githubusercontent.com/u/1342320?v=3" width="110px;"/><br /><sub>Walter</sub>](https://github.com/merid14)<br />[💻](https://github.com/snipe/snipe-it/commits?author=merid14 "Code") | [<img src="https://avatars3.githubusercontent.com/u/11254614?v=3" width="110px;"/><br /><sub>Petr Baloun</sub>](https://github.com/balous)<br />[💻](https://github.com/snipe/snipe-it/commits?author=balous "Code") | [<img src="https://avatars0.githubusercontent.com/u/6117660?v=3" width="110px;"/><br /><sub>reidblomquist</sub>](https://github.com/reidblomquist)<br />[📖](https://github.com/snipe/snipe-it/commits?author=reidblomquist "Documentation") | [<img src="https://avatars0.githubusercontent.com/u/539914?v=3" width="110px;"/><br /><sub>Mathieu Kooiman</sub>](https://github.com/mathieuk)<br />[💻](https://github.com/snipe/snipe-it/commits?author=mathieuk "Code") | [<img src="https://avatars3.githubusercontent.com/u/6606421?v=3" width="110px;"/><br /><sub>csayre</sub>](https://github.com/csayre)<br />[📖](https://github.com/snipe/snipe-it/commits?author=csayre "Documentation") | [<img src="https://avatars1.githubusercontent.com/u/768488?v=3" width="110px;"/><br /><sub>Adam Dunson</sub>](https://github.com/adamdunson)<br />[💻](https://github.com/snipe/snipe-it/commits?author=adamdunson "Code") |
| [<img src="https://avatars0.githubusercontent.com/u/5547470?v=3" width="110px;"/><br /><sub>Hereward</sub>](https://github.com/thehereward)<br />[💻](https://github.com/snipe/snipe-it/commits?author=thehereward "Code") | [<img src="https://avatars0.githubusercontent.com/u/5802977?v=3" width="110px;"/><br /><sub>swoopdk</sub>](https://github.com/swoopdk)<br />[💻](https://github.com/snipe/snipe-it/commits?author=swoopdk "Code") | [<img src="https://avatars1.githubusercontent.com/u/3470403?v=3" width="110px;"/><br /><sub>Abdullah Alansari</sub>](https://linkedin.com/in/ahimta)<br />[💻](https://github.com/snipe/snipe-it/commits?author=Ahimta "Code") | [<img src="https://avatars0.githubusercontent.com/u/796443?v=3" width="110px;"/><br /><sub>Micael Rodrigues</sub>](https://github.com/MicaelRodrigues)<br />[💻](https://github.com/snipe/snipe-it/commits?author=MicaelRodrigues "Code") | [<img src="https://avatars0.githubusercontent.com/u/614564?v=3" width="110px;"/><br /><sub>Patrick Gallagher</sub>](http://macadmincorner.com)<br />[📖](https://github.com/snipe/snipe-it/commits?author=patgmac "Documentation") | [<img src="https://avatars3.githubusercontent.com/u/7165922?v=3" width="110px;"/><br /><sub>Miliamber</sub>](https://github.com/Miliamber)<br />[💻](https://github.com/snipe/snipe-it/commits?author=Miliamber "Code") | [<img src="https://avatars3.githubusercontent.com/u/861766?v=3" width="110px;"/><br /><sub>hawk554</sub>](https://github.com/hawk554)<br />[💻](https://github.com/snipe/snipe-it/commits?author=hawk554 "Code") |
@@ -103,16 +114,19 @@ Thanks goes to all of these wonderful people ([emoji key](https://github.com/ken
| [<img src="https://avatars2.githubusercontent.com/u/982885?v=4" width="110px;"/><br /><sub>Martin Stub</sub>](http://martinstub.dk)<br />[🌍](#translation-stubben "Translation") | [<img src="https://avatars2.githubusercontent.com/u/28959963?v=4" width="110px;"/><br /><sub>Meyer Flavio</sub>](https://github.com/meyerf99)<br />[🌍](#translation-meyerf99 "Translation") | [<img src="https://avatars3.githubusercontent.com/u/796443?v=4" width="110px;"/><br /><sub>Micael Rodrigues</sub>](https://github.com/MicaelRodrigues)<br />[🌍](#translation-MicaelRodrigues "Translation") | [<img src="https://avatars0.githubusercontent.com/u/10481331?v=4" width="110px;"/><br /><sub>Mikael Rasmussen</sub>](http://rubixy.com/)<br />[🌍](#translation-mikaelssen "Translation") | [<img src="https://avatars1.githubusercontent.com/u/1544552?v=4" width="110px;"/><br /><sub>IxFail</sub>](https://github.com/IxFail)<br />[🌍](#translation-IxFail "Translation") | [<img src="https://avatars3.githubusercontent.com/u/18483118?v=4" width="110px;"/><br /><sub>Mohammed Fota</sub>](http://www.mohammedfota.com)<br />[🌍](#translation-MohammedFota "Translation") | [<img src="https://avatars0.githubusercontent.com/u/227080?v=4" width="110px;"/><br /><sub>Moayad Alserihi</sub>](https://github.com/omego)<br />[🌍](#translation-omego "Translation") |
| [<img src="https://avatars0.githubusercontent.com/u/1680266?v=4" width="110px;"/><br /><sub>saymd</sub>](https://github.com/saymd)<br />[🌍](#translation-saymd "Translation") | [<img src="https://avatars0.githubusercontent.com/u/1826808?v=4" width="110px;"/><br /><sub>Patrik Larsson</sub>](https://nordsken.se)<br />[🌍](#translation-pooot "Translation") | [<img src="https://avatars1.githubusercontent.com/u/20584746?v=4" width="110px;"/><br /><sub>drcryo</sub>](https://github.com/drcryo)<br />[🌍](#translation-drcryo "Translation") | [<img src="https://avatars1.githubusercontent.com/u/19408004?v=4" width="110px;"/><br /><sub>pawel1615</sub>](https://github.com/pawel1615)<br />[🌍](#translation-pawel1615 "Translation") | [<img src="https://avatars2.githubusercontent.com/u/23340468?v=4" width="110px;"/><br /><sub>bodrovics</sub>](https://github.com/bodrovics)<br />[🌍](#translation-bodrovics "Translation") | [<img src="https://avatars0.githubusercontent.com/u/3257654?v=4" width="110px;"/><br /><sub>priatna</sub>](https://github.com/priatna)<br />[🌍](#translation-priatna "Translation") | [<img src="https://avatars1.githubusercontent.com/u/5358374?v=4" width="110px;"/><br /><sub>Fan Jiang</sub>](https://amayume.net)<br />[🌍](#translation-ProfFan "Translation") |
| [<img src="https://avatars1.githubusercontent.com/u/22555451?v=4" width="110px;"/><br /><sub>ragnarcx</sub>](https://github.com/ragnarcx)<br />[🌍](#translation-ragnarcx "Translation") | [<img src="https://avatars2.githubusercontent.com/u/18654582?v=4" width="110px;"/><br /><sub>Rein van Haaren</sub>](http://www.reinvanhaaren.nl/)<br />[🌍](#translation-reinvanhaaren "Translation") | [<img src="https://avatars1.githubusercontent.com/u/386672?v=4" width="110px;"/><br /><sub>Teguh Dwicaksana</sub>](http://dheche.songolimo.net)<br />[🌍](#translation-dheche "Translation") | [<img src="https://avatars2.githubusercontent.com/u/2572552?v=4" width="110px;"/><br /><sub>fraccie</sub>](https://github.com/FRaccie)<br />[🌍](#translation-FRaccie "Translation") | [<img src="https://avatars0.githubusercontent.com/u/35182720?v=4" width="110px;"/><br /><sub>vinzruzell</sub>](https://github.com/vinzruzell)<br />[🌍](#translation-vinzruzell "Translation") | [<img src="https://avatars1.githubusercontent.com/u/7883603?v=4" width="110px;"/><br /><sub>Kevin Austin</sub>](http://kevinaustin.com)<br />[🌍](#translation-vipsystem "Translation") | [<img src="https://avatars3.githubusercontent.com/u/3861828?v=4" width="110px;"/><br /><sub>Wira Sandy</sub>](http://azuraweb.xyz)<br />[🌍](#translation-wira-sandy "Translation") |
| [<img src="https://avatars2.githubusercontent.com/u/8663789?v=4" width="110px;"/><br /><sub>Илья</sub>](https://github.com/GrayHoax)<br />[🌍](#translation-GrayHoax "Translation") | [<img src="https://avatars3.githubusercontent.com/u/30119111?v=4" width="110px;"/><br /><sub>GodUseVPN</sub>](https://github.com/godusevpn)<br />[🌍](#translation-godusevpn "Translation") | [<img src="https://avatars1.githubusercontent.com/u/745576?v=4" width="110px;"/><br /><sub>周周</sub>](https://github.com/EngrZhou)<br />[🌍](#translation-EngrZhou "Translation") | [<img src="https://avatars3.githubusercontent.com/u/1631095?v=4" width="110px;"/><br /><sub>Sam</sub>](https://github.com/takuy)<br />[💻](https://github.com/snipe/snipe-it/commits?author=takuy "Code") | [<img src="https://avatars1.githubusercontent.com/u/264022?v=4" width="110px;"/><br /><sub>Azerothian</sub>](https://www.illisian.com.au)<br />[💻](https://github.com/snipe/snipe-it/commits?author=Azerothian "Code") | [<img src="https://avatars1.githubusercontent.com/u/7632599?v=4" width="110px;"/><br /><sub>Tim Farmer</sub>](https://github.com/timothyfarmer)<br />[💻](https://github.com/snipe/snipe-it/commits?author=timothyfarmer "Code") |
| [<img src="https://avatars2.githubusercontent.com/u/8663789?v=4" width="110px;"/><br /><sub>Илья</sub>](https://github.com/GrayHoax)<br />[🌍](#translation-GrayHoax "Translation") | [<img src="https://avatars3.githubusercontent.com/u/30119111?v=4" width="110px;"/><br /><sub>GodUseVPN</sub>](https://github.com/godusevpn)<br />[🌍](#translation-godusevpn "Translation") | [<img src="https://avatars1.githubusercontent.com/u/745576?v=4" width="110px;"/><br /><sub>周周</sub>](https://github.com/EngrZhou)<br />[🌍](#translation-EngrZhou "Translation") | [<img src="https://avatars3.githubusercontent.com/u/1631095?v=4" width="110px;"/><br /><sub>Sam</sub>](https://github.com/takuy)<br />[💻](https://github.com/snipe/snipe-it/commits?author=takuy "Code") | [<img src="https://avatars1.githubusercontent.com/u/264022?v=4" width="110px;"/><br /><sub>Azerothian</sub>](https://www.illisian.com.au)<br />[💻](https://github.com/snipe/snipe-it/commits?author=Azerothian "Code") | [<img src="https://avatars1.githubusercontent.com/u/4930051?v=4" width="110px;"/><br /><sub>Wes Hulette</sub>](http://macfoo.wordpress.com/)<br />[💻](https://github.com/snipe/snipe-it/commits?author=jwhulette "Code") | [<img src="https://avatars0.githubusercontent.com/u/8134591?v=4" width="110px;"/><br /><sub>patrict</sub>](https://github.com/patrict)<br />[💻](https://github.com/snipe/snipe-it/commits?author=patrict "Code") |
| [<img src="https://avatars3.githubusercontent.com/u/2611616?v=4" width="110px;"/><br /><sub>Dmitriy Minaev</sub>](https://github.com/VELIKII-DIVAN)<br />[💻](https://github.com/snipe/snipe-it/commits?author=VELIKII-DIVAN "Code") | [<img src="https://avatars0.githubusercontent.com/u/5132245?v=4" width="110px;"/><br /><sub>liquidhorse</sub>](https://github.com/liquidhorse)<br />[💻](https://github.com/snipe/snipe-it/commits?author=liquidhorse "Code") | [<img src="https://avatars1.githubusercontent.com/u/183678?v=4" width="110px;"/><br /><sub>Jordi Boggiano</sub>](https://seld.be/)<br />[💻](https://github.com/snipe/snipe-it/commits?author=Seldaek "Code") | [<img src="https://avatars0.githubusercontent.com/u/653557?v=4" width="110px;"/><br /><sub>Ivan Nieto</sub>](https://github.com/inietov)<br />[💻](https://github.com/snipe/snipe-it/commits?author=inietov "Code") | [<img src="https://avatars2.githubusercontent.com/u/6764151?v=4" width="110px;"/><br /><sub>Ben RUBSON</sub>](https://github.com/benrubson)<br />[💻](https://github.com/snipe/snipe-it/commits?author=benrubson "Code") | [<img src="https://avatars2.githubusercontent.com/u/8554558?v=4" width="110px;"/><br /><sub>NMathar</sub>](https://github.com/NMathar)<br />[💻](https://github.com/snipe/snipe-it/commits?author=NMathar "Code") | [<img src="https://avatars1.githubusercontent.com/u/139566?v=4" width="110px;"/><br /><sub>Steffen</sub>](https://github.com/smb)<br />[💻](https://github.com/snipe/snipe-it/commits?author=smb "Code") |
| [<img src="https://avatars0.githubusercontent.com/u/6609453?v=4" width="110px;"/><br /><sub>Sxderp</sub>](https://github.com/Sxderp)<br />[💻](https://github.com/snipe/snipe-it/commits?author=Sxderp "Code") | [<img src="https://avatars1.githubusercontent.com/u/4807843?v=4" width="110px;"/><br /><sub>fanta8897</sub>](https://github.com/fanta8897)<br />[💻](https://github.com/snipe/snipe-it/commits?author=fanta8897 "Code") | [<img src="https://avatars2.githubusercontent.com/u/2576509?v=4" width="110px;"/><br /><sub>Andrey Bolonin</sub>](https://andreybolonin.com/phpconsulting/)<br />[💻](https://github.com/snipe/snipe-it/commits?author=andreybolonin "Code") | [<img src="https://avatars3.githubusercontent.com/u/2173307?v=4" width="110px;"/><br /><sub>shinayoshi</sub>](http://www.shinayoshi.net/)<br />[💻](https://github.com/snipe/snipe-it/commits?author=shinayoshi "Code") | [<img src="https://avatars3.githubusercontent.com/u/2130159?v=4" width="110px;"/><br /><sub>Hubert</sub>](https://github.com/reuser)<br />[💻](https://github.com/snipe/snipe-it/commits?author=reuser "Code") | [<img src="https://avatars0.githubusercontent.com/u/6865789?v=4" width="110px;"/><br /><sub>KeenRivals</sub>](https://brashear.me)<br />[💻](https://github.com/snipe/snipe-it/commits?author=KeenRivals "Code") | [<img src="https://avatars3.githubusercontent.com/u/2902513?v=4" width="110px;"/><br /><sub>omyno</sub>](https://github.com/omyno)<br />[💻](https://github.com/snipe/snipe-it/commits?author=omyno "Code") |
| [<img src="https://avatars1.githubusercontent.com/u/6271335?v=4" width="110px;"/><br /><sub>Evgeny</sub>](https://github.com/jackka)<br />[💻](https://github.com/snipe/snipe-it/commits?author=jackka "Code") | [<img src="https://avatars2.githubusercontent.com/u/1169963?v=4" width="110px;"/><br /><sub>Colin Campbell</sub>](https://digitalist.se)<br />[💻](https://github.com/snipe/snipe-it/commits?author=colin-campbell "Code") | [<img src="https://avatars3.githubusercontent.com/u/2872098?v=4" width="110px;"/><br /><sub>Ľubomír Kučera</sub>](https://github.com/lubo)<br />[💻](https://github.com/snipe/snipe-it/commits?author=lubo "Code") | [<img src="https://avatars3.githubusercontent.com/u/570639?v=4" width="110px;"/><br /><sub>Martin Meredith</sub>](https://www.sourceguru.net)<br />[💻](https://github.com/snipe/snipe-it/commits?author=Mezzle "Code") | [<img src="https://avatars1.githubusercontent.com/u/7632599?v=4" width="110px;"/><br /><sub>Tim Farmer</sub>](https://github.com/timothyfarmer)<br />[💻](https://github.com/snipe/snipe-it/commits?author=timothyfarmer "Code") | [<img src="https://avatars0.githubusercontent.com/u/17459600?v=4" width="110px;"/><br /><sub>Marián Skrip</sub>](https://github.com/mskrip)<br />[💻](https://github.com/snipe/snipe-it/commits?author=mskrip "Code") | [<img src="https://avatars2.githubusercontent.com/u/47435081?v=4" width="110px;"/><br /><sub>Godfrey Martinez</sub>](https://github.com/Godmartinz)<br />[💻](https://github.com/snipe/snipe-it/commits?author=Godmartinz "Code") |
| [<img src="https://avatars1.githubusercontent.com/u/2075128?v=4" width="110px;"/><br /><sub>bigtreeEdo</sub>](https://github.com/bigtreeEdo)<br />[💻](https://github.com/snipe/snipe-it/commits?author=bigtreeEdo "Code") | [<img src="https://avatars0.githubusercontent.com/u/5000430?v=4" width="110px;"/><br /><sub>Colin McNeil</sub>](https://colinmcneil.me/)<br />[💻](https://github.com/snipe/snipe-it/commits?author=ColinMcNeil "Code") | [<img src="https://avatars0.githubusercontent.com/u/421625?v=4" width="110px;"/><br /><sub>JoKneeMo</sub>](https://github.com/JoKneeMo)<br />[💻](https://github.com/snipe/snipe-it/commits?author=JoKneeMo "Code") | [<img src="https://avatars0.githubusercontent.com/u/54849013?v=4" width="110px;"/><br /><sub>Joshi</sub>](http://www.redbridge.se)<br />[💻](https://github.com/snipe/snipe-it/commits?author=joshi-redbridge "Code") | [<img src="https://avatars2.githubusercontent.com/u/15731458?v=4" width="110px;"/><br /><sub>Anthony Burns</sub>](https://github.com/anthonypburns)<br />[💻](https://github.com/snipe/snipe-it/commits?author=anthonypburns "Code") | [<img src="https://avatars1.githubusercontent.com/u/63399474?v=4" width="110px;"/><br /><sub>johnson-yi</sub>](https://github.com/johnson-yi)<br />[💻](https://github.com/snipe/snipe-it/commits?author=johnson-yi "Code") | [<img src="https://avatars1.githubusercontent.com/u/1862720?v=4" width="110px;"/><br /><sub>Sanjay Govind</sub>](https://tangentmc.net)<br />[💻](https://github.com/snipe/snipe-it/commits?author=sanjay900 "Code") |
| [<img src="https://avatars0.githubusercontent.com/u/1255375?v=4" width="110px;"/><br /><sub>Peter Upfold</sub>](https://peter.upfold.org.uk/)<br />[💻](https://github.com/snipe/snipe-it/commits?author=PeterUpfold "Code") | [<img src="https://avatars2.githubusercontent.com/u/961717?v=4" width="110px;"/><br /><sub>Jared Biel</sub>](https://github.com/jbiel)<br />[💻](https://github.com/snipe/snipe-it/commits?author=jbiel "Code") | [<img src="https://avatars1.githubusercontent.com/u/1733625?v=4" width="110px;"/><br /><sub>Dampfklon</sub>](https://github.com/dampfklon)<br />[💻](https://github.com/snipe/snipe-it/commits?author=dampfklon "Code") | [<img src="https://avatars2.githubusercontent.com/u/52973156?v=4" width="110px;"/><br /><sub>Charles Hamilton</sub>](https://communityclosing.com)<br />[💻](https://github.com/snipe/snipe-it/commits?author=chamilton-ccn "Code") | [<img src="https://avatars.githubusercontent.com/u/551789?v=4" width="110px;"/><br /><sub>Giuseppe Iannello</sub>](https://github.com/giannello)<br />[💻](https://github.com/snipe/snipe-it/commits?author=giannello "Code") | [<img src="https://avatars.githubusercontent.com/u/3691490?v=4" width="110px;"/><br /><sub>Peter Dave Hello</sub>](https://www.peterdavehello.org/)<br />[💻](https://github.com/snipe/snipe-it/commits?author=PeterDaveHello "Code") | [<img src="https://avatars.githubusercontent.com/u/6106332?v=4" width="110px;"/><br /><sub>sigmoidal</sub>](https://github.com/sigmoidal)<br />[💻](https://github.com/snipe/snipe-it/commits?author=sigmoidal "Code") |
| [<img src="https://avatars.githubusercontent.com/u/2082554?v=4" width="110px;"/><br /><sub>Vincent Lainé</sub>](https://github.com/phenixdotnet)<br />[💻](https://github.com/snipe/snipe-it/commits?author=phenixdotnet "Code") | [<img src="https://avatars.githubusercontent.com/u/1943040?v=4" width="110px;"/><br /><sub>Lucas Pleß</sub>](http://www.lucas-pless.com)<br />[💻](https://github.com/snipe/snipe-it/commits?author=derlucas "Code") | [<img src="https://avatars.githubusercontent.com/u/472804?v=4" width="110px;"/><br /><sub>Ian Littman</sub>](http://twitter.com/iansltx)<br />[💻](https://github.com/snipe/snipe-it/commits?author=iansltx "Code") | [<img src="https://avatars.githubusercontent.com/u/3519029?v=4" width="110px;"/><br /><sub>João Paulo</sub>](https://github.com/PauloLuna)<br />[💻](https://github.com/snipe/snipe-it/commits?author=PauloLuna "Code") | [<img src="https://avatars.githubusercontent.com/u/70443365?v=4" width="110px;"/><br /><sub>ThoBur</sub>](https://github.com/ThoBur)<br />[💻](https://github.com/snipe/snipe-it/commits?author=ThoBur "Code") | [<img src="https://avatars.githubusercontent.com/u/1972329?v=4" width="110px;"/><br /><sub>Alexander Chibrikin</sub>](http://phpprofi.ru/)<br />[💻](https://github.com/snipe/snipe-it/commits?author=alek13 "Code") | [<img src="https://avatars.githubusercontent.com/u/438332?v=4" width="110px;"/><br /><sub>Anthony Winstanley</sub>](https://github.com/winstan)<br />[💻](https://github.com/snipe/snipe-it/commits?author=winstan "Code") |
| [<img src="https://avatars.githubusercontent.com/u/3075214?v=4" width="110px;"/><br /><sub>Folke</sub>](https://github.com/fashberg)<br />[💻](https://github.com/snipe/snipe-it/commits?author=fashberg "Code") | [<img src="https://avatars.githubusercontent.com/u/1351571?v=4" width="110px;"/><br /><sub>Bennett Blodinger</sub>](https://github.com/benwa)<br />[💻](https://github.com/snipe/snipe-it/commits?author=benwa "Code") | [<img src="https://avatars.githubusercontent.com/u/2974631?v=4" width="110px;"/><br /><sub>NMC</sub>](https://nmc.dev)<br />[💻](https://github.com/snipe/snipe-it/commits?author=ncareau "Code") | [<img src="https://avatars.githubusercontent.com/u/52182449?v=4" width="110px;"/><br /><sub>andres-baller</sub>](https://github.com/andres-baller)<br />[💻](https://github.com/snipe/snipe-it/commits?author=andres-baller "Code") | [<img src="https://avatars.githubusercontent.com/u/67109348?v=4" width="110px;"/><br /><sub>sean-borg</sub>](https://github.com/sean-borg)<br />[💻](https://github.com/snipe/snipe-it/commits?author=sean-borg "Code") | [<img src="https://avatars.githubusercontent.com/u/32170051?v=4" width="110px;"/><br /><sub>EDVLeer</sub>](https://github.com/EDVLeer)<br />[💻](https://github.com/snipe/snipe-it/commits?author=EDVLeer "Code") | [<img src="https://avatars.githubusercontent.com/u/23075196?v=4" width="110px;"/><br /><sub>Kurokat</sub>](https://github.com/Kurokat)<br />[💻](https://github.com/snipe/snipe-it/commits?author=Kurokat "Code") |
| [<img src="https://avatars.githubusercontent.com/u/915514?v=4" width="110px;"/><br /><sub>Kevin Köllmann</sub>](https://www.kevinkoellmann.de)<br />[💻](https://github.com/snipe/snipe-it/commits?author=koelle25 "Code") | [<img src="https://avatars.githubusercontent.com/u/49025941?v=4" width="110px;"/><br /><sub>sw-mreyes</sub>](https://github.com/sw-mreyes)<br />[💻](https://github.com/snipe/snipe-it/commits?author=sw-mreyes "Code") | [<img src="https://avatars.githubusercontent.com/u/70129?v=4" width="110px;"/><br /><sub>Joel Pittet</sub>](https://pittet.ca)<br />[💻](https://github.com/snipe/snipe-it/commits?author=joelpittet "Code") | [<img src="https://avatars.githubusercontent.com/u/792695?v=4" width="110px;"/><br /><sub>Eli Young</sub>](https://elyscape.com)<br />[💻](https://github.com/snipe/snipe-it/commits?author=elyscape "Code") | [<img src="https://avatars.githubusercontent.com/u/317015?v=4" width="110px;"/><br /><sub>Raell Dottin</sub>](https://github.com/raelldottin)<br />[💻](https://github.com/snipe/snipe-it/commits?author=raelldottin "Code") | [<img src="https://avatars.githubusercontent.com/u/1446856?v=4" width="110px;"/><br /><sub>Tom Misilo</sub>](https://github.com/misilot)<br />[💻](https://github.com/snipe/snipe-it/commits?author=misilot "Code") | [<img src="https://avatars.githubusercontent.com/u/4496300?v=4" width="110px;"/><br /><sub>David Davenne</sub>](http://david.davenne.be)<br />[💻](https://github.com/snipe/snipe-it/commits?author=JuustoMestari "Code") |
| [<img src="https://avatars.githubusercontent.com/u/9255772?v=4" width="110px;"/><br /><sub>Mark Stenglein</sub>](https://markstenglein.com)<br />[💻](https://github.com/snipe/snipe-it/commits?author=ocelotsloth "Code") | [<img src="https://avatars.githubusercontent.com/u/35658596?v=4" width="110px;"/><br /><sub>ajsy</sub>](https://github.com/ajsy)<br />[💻](https://github.com/snipe/snipe-it/commits?author=ajsy "Code") | [<img src="https://avatars.githubusercontent.com/u/3628035?v=4" width="110px;"/><br /><sub>Jan Kiesewetter</sub>](https://github.com/t3easy)<br />[💻](https://github.com/snipe/snipe-it/commits?author=t3easy "Code") | [<img src="https://avatars.githubusercontent.com/u/79449630?v=4" width="110px;"/><br /><sub>Tetrachloromethane250</sub>](https://github.com/Tetrachloromethane250)<br />[💻](https://github.com/snipe/snipe-it/commits?author=Tetrachloromethane250 "Code") | [<img src="https://avatars.githubusercontent.com/u/22004482?v=4" width="110px;"/><br /><sub>Lars Kajes</sub>](https://www.kajes.se/)<br />[💻](https://github.com/snipe/snipe-it/commits?author=kajes "Code") | [<img src="https://avatars.githubusercontent.com/u/13993216?v=4" width="110px;"/><br /><sub>Joly0</sub>](https://github.com/Joly0)<br />[💻](https://github.com/snipe/snipe-it/commits?author=Joly0 "Code") | [<img src="https://avatars.githubusercontent.com/u/1501022?v=4" width="110px;"/><br /><sub>theburger</sub>](https://github.com/limeless)<br />[💻](https://github.com/snipe/snipe-it/commits?author=limeless "Code") |
| [<img src="https://avatars.githubusercontent.com/u/36065681?v=4" width="110px;"/><br /><sub>David Valin Alonso</sub>](https://github.com/deivishome)<br />[💻](https://github.com/snipe/snipe-it/commits?author=deivishome "Code") | [<img src="https://avatars.githubusercontent.com/u/8290389?v=4" width="110px;"/><br /><sub>andreaci</sub>](https://github.com/andreaci)<br />[💻](https://github.com/snipe/snipe-it/commits?author=andreaci "Code") | [<img src="https://avatars.githubusercontent.com/u/1828542?v=4" width="110px;"/><br /><sub>Jelle Sebreghts</sub>](http://www.jellesebreghts.be)<br />[💻](https://github.com/snipe/snipe-it/commits?author=Jelle-S "Code") | [<img src="https://avatars.githubusercontent.com/u/11180862?v=4" width="110px;"/><br /><sub>Michael Pietsch</sub>](https://github.com/Skywalker-11)<br /> | [<img src="https://avatars.githubusercontent.com/u/22068886?v=4" width="110px;"/><br /><sub>Masudul Haque Shihab</sub>](https://github.com/sh1hab)<br />[💻](https://github.com/snipe/snipe-it/commits?author=sh1hab "Code") | [<img src="https://avatars.githubusercontent.com/u/16099942?v=4" width="110px;"/><br /><sub>Supapong Areeprasertkul</sub>](http://www.freedomdive.com/)<br />[💻](https://github.com/snipe/snipe-it/commits?author=zybersup "Code") | [<img src="https://avatars.githubusercontent.com/u/207358?v=4" width="110px;"/><br /><sub>Peter Sarossy</sub>](https://github.com/psarossy)<br />[💻](https://github.com/snipe/snipe-it/commits?author=psarossy "Code") |
| [<img src="https://avatars.githubusercontent.com/u/11823649?v=4" width="110px;"/><br /><sub>Renee Margaret McConahy</sub>](https://github.com/nepella)<br />[💻](https://github.com/snipe/snipe-it/commits?author=nepella "Code") | [<img src="https://avatars.githubusercontent.com/u/5553884?v=4" width="110px;"/><br /><sub>JohnnyPicnic</sub>](https://github.com/JohnnyPicnic)<br />[💻](https://github.com/snipe/snipe-it/commits?author=JohnnyPicnic "Code") | [<img src="https://avatars.githubusercontent.com/u/8799594?v=4" width="110px;"/><br /><sub>markbrule</sub>](https://github.com/markbrule)<br />[💻](https://github.com/snipe/snipe-it/commits?author=markbrule "Code") | [<img src="https://avatars.githubusercontent.com/u/1962801?v=4" width="110px;"/><br /><sub>Mike Campbell</sub>](https://github.com/mikecmpbll)<br />[💻](https://github.com/snipe/snipe-it/commits?author=mikecmpbll "Code") | [<img src="https://avatars.githubusercontent.com/u/11973217?v=4" width="110px;"/><br /><sub>tbrconnect</sub>](https://github.com/tbrconnect)<br />[💻](https://github.com/snipe/snipe-it/commits?author=tbrconnect "Code") | [<img src="https://avatars.githubusercontent.com/u/12447225?v=4" width="110px;"/><br /><sub>kcoyo</sub>](https://github.com/kcoyo)<br />[💻](https://github.com/snipe/snipe-it/commits?author=kcoyo "Code") | [<img src="https://avatars.githubusercontent.com/u/494017?v=4" width="110px;"/><br /><sub>Travis Miller</sub>](https://travismiller.com/)<br />[💻](https://github.com/snipe/snipe-it/commits?author=travismiller "Code") |
<!-- ALL-CONTRIBUTORS-LIST:END -->
This project follows the [all-contributors](https://github.com/kentcdodds/all-contributors) specification. Contributions of any kind welcome!
-----
### Contributing
Please see the documentation on [contributing and developing for Snipe-IT](https://snipe-it.readme.io/docs/contributing-overview).
Please note that this project is released with a [Contributor Code of Conduct](CODE_OF_CONDUCT.md). By participating in this project you agree to abide by its terms.

27
SECURITY.md Normal file
View File

@@ -0,0 +1,27 @@
# Security Policy
We take security issues very seriously, and will always attempt to address any
vulnerabilities as quickly as possible.
## Supported Versions
We try to make a reasonable effort to support older versions of Snipe-IT,
however there are times when library dependencies and/or PHP/MySQL dependencies
make it impossible to backport security fixes on older versions.
| Version | Supported |
| ------- | ------------------ |
| 5.1.x | :white_check_mark: |
| 5.0.x | :x: |
| 4.0.x | :white_check_mark: |
| < 4.0 | :x: |
## Reporting a Vulnerability
Security vulnerabilities should be sent to security@snipeitapp.com. You can typically expect a
response within two business days, and we typically have fixes out in under a week from the initial disclosure.
This obviously varies based on the severity of the security issue and the difficulty in remediation,
but those have historically been the timelines we worm around.
For a full breakdown of our security policies, please see https://snipeitapp.com/security.

45
Vagrantfile vendored
View File

@@ -8,25 +8,34 @@ Vagrant.configure("2") do |config|
config.vm.define "bionic" do |bionic|
bionic.vm.box = "ubuntu/bionic64"
bionic.vm.hostname = 'bionic'
bionic.vm.network "public_network", bridge: NETWORK_BRIDGE
bionic.vm.provision :shell, :inline => "wget #{SNIPEIT_SH_URL}"
bionic.vm.provision :shell, :inline => "chmod 755 snipeit.sh"
bionic.vm.network "forwarded_port", guest: 80, host: 8080
bionic.vm.synced_folder ".", "/vagrant", :owner => 'www-data',
:group => 'vagrant', :mount_options => ['dmode=775', 'fmode=775']
bionic.vm.provision "ansible_local" do |ansible|
ansible.playbook = "ansible/ubuntu/vagrant_playbook.yml"
end
end
config.vm.define "xenial" do |xenial|
xenial.vm.box = "ubuntu/xenial64"
xenial.vm.hostname = 'xenial'
xenial.vm.network "public_network", bridge: NETWORK_BRIDGE
xenial.vm.provision :shell, :inline => "wget #{SNIPEIT_SH_URL}"
xenial.vm.provision :shell, :inline => "chmod 755 snipeit.sh"
xenial.vm.network "forwarded_port", guest: 80, host: 8080
xenial.vm.synced_folder ".", "/vagrant", :owner => 'www-data',
:group => 'vagrant', :mount_options => ['dmode=775', 'fmode=775']
xenial.vm.provision "ansible_local" do |ansible|
ansible.playbook = "ansible/ubuntu/vagrant_playbook.yml"
end
end
config.vm.define "trusty" do |trusty|
trusty.vm.box = "ubuntu/trusty32"
trusty.vm.hostname = 'trusty'
trusty.vm.network "public_network", bridge: NETWORK_BRIDGE
trusty.vm.provision :shell, :inline => "wget #{SNIPEIT_SH_URL}"
trusty.vm.provision :shell, :inline => "chmod 755 snipeit.sh"
trusty.vm.network "forwarded_port", guest: 80, host: 8080
trusty.vm.synced_folder ".", "/vagrant", :owner => 'www-data',
:group => 'vagrant', :mount_options => ['dmode=775', 'fmode=775']
trusty.vm.provision "ansible_local" do |ansible|
ansible.playbook = "ansible/ubuntu/vagrant_playbook.yml"
end
end
config.vm.define "centos7" do |centos7|
@@ -81,4 +90,22 @@ Vagrant.configure("2") do |config|
fedora26.vm.provision :shell, :inline => "wget #{SNIPEIT_SH_URL}"
fedora26.vm.provision :shell, :inline => "chmod 755 snipeit.sh"
end
config.vm.define "freebsd" do |freebsd|
freebsd.vm.box = "freebsd/FreeBSD-11.2-RELEASE"
freebsd.vm.hostname = 'freebsd12'
freebsd.vm.network "forwarded_port", guest: 80, host: 8080
freebsd.vm.network "forwarded_port", guest:3306, host:3306 # mysql
freebsd.vm.network "private_network", type: "dhcp"
freebsd.ssh.shell = "sh"
freebsd.vm.base_mac = "080027D14C66"
freebsd.vm.synced_folder ".", "/vagrant", :nfs => true, id: "vagrant-root",
:mount_options => ['rw', 'vers=3', 'tcp', 'actimeo=2']
freebsd.vm.provision "shell", inline: <<-SHELL
pkg install -y python27;
SHELL
freebsd.vm.provision "ansible" do |ansible|
ansible.playbook = "ansible/freebsd/vagrant_playbook.yml"
end
end
end

View File

@@ -0,0 +1,260 @@
---
- name: Set up local server
hosts: all
remote_user: vagrant
become_user: root
become_method: sudo
vars:
- ansible_python_interpreter: /usr/local/bin/python2.7
gather_facts: no
# Tasks
tasks:
#
# Update the PKG database
#
- name: Upgrade PKG database
raw: sudo pkg upgrade -y
#
# Mount the shared folders
#
- name: Update Vagrant Shared Folders
command: "{{ item }}"
with_items:
- sysrc rpc_lockd_enable=YES
- sysrc rpc_statd_enable=YES
become: true
#
# Install required utilities
#
- name: Install Utilities
pkgng:
name: "{{ item }}"
state: present
with_items:
- openssl
- node
- npm
- git
- nano
- wget
- bash
become: true
#
# Install php and php dependancies
#
- name: Install PHP dependancies
pkgng:
name: "{{ item }}"
state: present
with_items:
- php72
- php72-zip
- php72-zlib
- php72-extensions
- php72-mbstring
- php72-openssl
# - php72-mysqli
- php72-curl
- php72-soap
- php72-pdo_mysql
# - php72-pdo_pgsql
- php72-ldap
- php72-curl
- php72-fileinfo
- php72-bcmath
- php72-gd
become: true
#
# Create a php.ini file
#
- name: PHP INI check
stat:
path: /usr/local/etc/php.ini
register: php_ini_exits
- name: Create PHP ini
command: cp /usr/local/etc/php.ini-development /usr/local/etc/php.ini
become: true
when: not php_ini_exits.stat.exists
- name: Enable PHP-FPM auto-start
command: sysrc php_fpm_enable=YES
become: true
- name: Start PHP-FPM service
service:
name: php-fpm
state: started
become: true
#
# Install the lastest version of composer
#
- name: Composer check
stat:
path: /usr/local/bin/composer
register: composer_exits
- name: Install Composer
shell: |
EXPECTED_SIGNATURE=$(wget -q -O - https://composer.github.io/installer.sig)
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
ACTUAL_SIGNATURE=$(php -r "echo hash_file('SHA384', 'composer-setup.php');")
if [ "$EXPECTED_SIGNATURE" != "$ACTUAL_SIGNATURE" ]
then
>&2 echo 'ERROR: Invalid installer signature'
rm composer-setup.php
exit 1
fi
php composer-setup.php --quiet
RESULT=$?
rm composer-setup.php
mv composer.phar /usr/local/bin/composer
exit $RESULT
when: not composer_exits.stat.exists
become: true
#
# Install MySQL Server
- name: Install MySQL 5.7
pkgng:
name: mysql57-server
state: present
become: true
register: sql_server
- name: Start MySQL server
service:
name: mysql-server
state: started
become: true
- name: MySQL 5.7 auto-start
command: sysrc mysql_enable=YES
become: true
when: sql_server.changed == true
- name: Get MySQL root password
command: tail -1 /root/.mysql_secret
register: myql_root_pwd
become: true
when: sql_server.changed == true
- name: Change MySQL root password
command: mysqladmin -u root -p'{{myql_root_pwd.stdout}}' password vagrant
when: sql_server.changed == true
- name: Enable remote mysql
replace:
path: /usr/local/etc/mysql/my.cnf
regexp: "127.0.0.1"
replace: "0.0.0.0"
become: true
when: sql_server.changed == true
- name: Grant user vagrant privelages
shell: mysql -u root -pvagrant -e "GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'vagrant' WITH GRANT OPTION; FLUSH PRIVILEGES;"
become: true
when: sql_server.changed == true
ignore_errors: true
- name: Restart MySQL server
service:
name: mysql-server
state: restarted
become: true
#
# Install Apache Web Server
#
- name: Install Apache 2.4
pkgng:
name: apache24
state: present
become: true
register: apache24_server
- name: Apache 2.4 auto-start
command: sysrc apache24_enable=YES
become: true
when: apache24_server.changed == true
- name: Enable Apache modules
replace:
path: /usr/local/etc/apache24/httpd.conf
regexp: "#{{ item }}"
replace: "{{ item }}"
become: true
with_items:
- LoadModule rewrite_module libexec/apache24/mod_rewrite.so
- LoadModule vhost_alias_module libexec/apache24/mod_vhost_alias.so
- LoadModule deflate_module libexec/apache24/mod_deflate.so
- LoadModule expires_module libexec/apache24/mod_expires.so
- LoadModule mpm_worker_module libexec/apache24/mod_mpm_worker.so
- LoadModule proxy_fcgi_module libexec/apache24/mod_proxy_fcgi.so
- LoadModule proxy_module libexec/apache24/mod_proxy.so
- Include etc/apache24/extra/httpd-vhosts.conf
when: apache24_server.changed == true
- name: Disable Apache modules
replace:
path: /usr/local/etc/apache24/httpd.conf
regexp: "{{ item }}"
replace: "#{{ item }}"
become: true
with_items:
- LoadModule mpm_prefork_module libexec/apache24/mod_mpm_prefork.so
when: apache24_server.changed == true
- name: Backup vhosts
command: cp /usr/local/etc/apache24/extra/httpd-vhosts.conf /usr/local/etc/apache24/extra/httpd-vhosts.conf.bak
become: true
when: apache24_server.changed == true
- name: Truncate vhosts
command: truncate -s 0 /usr/local/etc/apache24/extra/httpd-vhosts.conf
become: true
when: apache24_server.changed == true
- name: Set up vhost
blockinfile:
path: "/usr/local/etc/apache24/extra/httpd-vhosts.conf"
block: |
<VirtualHost *>
DocumentRoot /usr/local/www/apache24/data/public
ServerName vagrant.app
ProxyPassMatch ^/(.*\.php(/.*)?)$ fcgi://127.0.0.1:9000/usr/local/www/apache24/data/public/$1
DirectoryIndex /index.php index.php
<Directory /usr/local/www/apache24/data/public>
Options -Indexes +FollowSymLinks
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
become: true
when: apache24_server.changed == true
- name: Map apache dir to local folder
shell: |
if ! [ -L /var/www ]; then
rm -rf /usr/local/www/apache24/data;
ln -fs /vagrant /usr/local/www/apache24/data;
fi
become: true
when: apache24_server.changed == true
- name: Start Apache 2.4 server
service:
name: apache24
state: started
become: true

View File

@@ -0,0 +1,10 @@
<VirtualHost *:80>
<Directory {{ app_path }}/public>
Allow From All
AllowOverride All
Options -Indexes
</Directory>
DocumentRoot {{ app_path }}/public
ServerName {{ fqdn }}
</VirtualHost>

View File

@@ -0,0 +1,226 @@
---
- name: Set up local server
hosts: all
remote_user: vagrant
become_user: root
become_method: sudo
vars:
app_path: "/var/www/snipeit"
fqdn: "localhost"
tasks:
- name: Update and upgrade existing apt packages
become: true
apt:
upgrade: yes
update_cache: yes
- name: Install Utilities
become: true
apt:
name: "{{ packages }}"
state: present
vars:
packages:
- nano
- vim
- name: Installing Apache httpd, PHP, MariaDB and other requirements.
become: true
apt:
name: "{{ packages }}"
state: present
vars:
packages:
- mariadb-client
- php
- php-curl
- php-mysql
- php-gd
- php-ldap
- php-zip
- php-mbstring
- php-xml
- php-bcmath
- curl
- git
- unzip
- python-pymysql
#
# Install the lastest version of composer
#
- name: Composer check
stat:
path: /usr/local/bin/composer
register: composer_exits
- name: Install Composer
shell: |
EXPECTED_SIGNATURE=$(wget -q -O - https://composer.github.io/installer.sig)
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
ACTUAL_SIGNATURE=$(php -r "echo hash_file('SHA384', 'composer-setup.php');")
if [ "$EXPECTED_SIGNATURE" != "$ACTUAL_SIGNATURE" ]
then
>&2 echo 'ERROR: Invalid installer signature'
rm composer-setup.php
exit 1
fi
php composer-setup.php --quiet
RESULT=$?
rm composer-setup.php
mv composer.phar /usr/local/bin/composer
exit $RESULT
when: not composer_exits.stat.exists
args:
creates: /usr/local/bin/composer
become: true
#
# Install and Configure MariaDB
#
- name: Install MariaDB
become: true
apt:
name: mariadb-server
state: present
register: sql_server
- name: Start and Enable MySQL server
become: true
systemd:
state: started
enabled: yes
name: mariadb
- name: Create Vagrant mysql password
become: true
mysql_user:
name: vagrant
password: vagrant
login_unix_socket: /var/run/mysqld/mysqld.sock
priv: "*.*:ALL"
state: present
- name: Enable remote mysql
replace:
path: /etc/mysql/mariadb.conf.d/50-server.cnf
regexp: "127.0.0.1"
replace: "0.0.0.0"
become: true
notify:
- restart mysql
- name: Create snipeit database
become: true
mysql_db:
name: snipeit
state: present
login_unix_socket: /var/run/mysqld/mysqld.sock
#
# Install Apache Web Server
#
- name: Install Apache 2.4
apt:
name: "{{ packages }}"
state: present
vars:
packages:
- apache2
- libapache2-mod-php
become: true
register: apache2_server
- name: Start and Enable Apache2 Server
become: true
systemd:
name: apache2
state: started
enabled: yes
#- name: Disable Apache modules
# become: true
# apache2_module:
# state: absent
# name: "{{ item }}"
# with_items:
# #- mpm_prefork
# notify:
# - restart apache2
- name: Enable Apache modules
become: true
apache2_module:
state: present
name: "{{ item }}"
with_items:
- rewrite
- vhost_alias
- deflate
- expires
- proxy_fcgi
- proxy
notify:
- restart apache2
- name: Install Apache VirtualHost File
become: true
template:
src: apachevirtualhost.conf.j2
dest: "/etc/apache2/sites-available/snipeit.conf"
- name: Enable VirtualHost
become: true
command: a2ensite snipeit
args:
creates: /etc/apache2/sites-enabled/snipeit.conf
notify:
- restart apache2
- name: Map apache dir to local folder
become: true
file:
src: /vagrant
dest: "{{ app_path }}"
state: link
notify:
- restart apache2
#
# Install dependencies from composer
#
- name: Install dependencies from composer
composer:
command: install
working_dir: "{{ app_path }}"
notify:
- restart apache2
#
# Configure .env file
#
- name: Copy .env file
copy:
src: "{{ app_path }}/.env.example"
dest: "{{ app_path }}/.env"
- name: Configure .env file
lineinfile:
path: "{{ app_path }}/.env"
regexp: "{{ item.regexp }}"
line: "{{ item.line }}"
with_items:
- { regexp: '^DB_HOST=', line: 'DB_HOST=127.0.0.1'}
- { regexp: '^DB_DATABASE=', line: 'DB_DATABASE=snipeit' }
- { regexp: '^DB_USERNAME=', line: 'DB_USERNAME=vagrant' }
- { regexp: '^DB_PASSWORD=', line: 'DB_PASSWORD=vagrant' }
- { regexp: '^APP_URL=', line: "APP_URL=http://{{ fqdn }}" }
- { regexp: '^APP_ENV=', line: "APP_ENV=development" }
- { regexp: '^APP_DEBUG=', line: "APP_ENV=true" }
- name: Generate application key
shell: "php {{ app_path }}/artisan key:generate --force"
- name: Artisan Migrate
shell: "php {{ app_path }}/artisan migrate --force"
#
# Create Cron Job
#
- name: Create scheduler cron job
become: true
cron:
name: "Snipe-IT Artisan Scheduler"
job: "/usr/bin/php {{ app_path }}/artisan schedule:run"
handlers:
- name: restart apache2
become: true
systemd:
name: apache2
state: restarted
- name: restart mysql
become: true
systemd:
name: mysql
state: restarted

View File

@@ -0,0 +1,95 @@
<?php
namespace App\Console\Commands;
use App\Models\LicenseSeat;
use Illuminate\Console\Command;
use App\Models\User;
use App\Models\License;
use Illuminate\Database\Eloquent\Model;
class CheckinLicensesFromAllUsers extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'snipeit:checkin-from-all {--license_id=} {--notify}';
/**
* The console command description.
*
* @var string
*/
protected $description = 'Checks in licenses from all users';
/**
* Create a new command instance.
*
* @return void
*/
public function __construct()
{
parent::__construct();
}
/**
* Execute the console command.
*
* @return mixed
*/
public function handle()
{
$license_id = $this->option('license_id');
$notify = $this->option('notify');
if (!$license_id) {
$this->error('ERROR: License ID is required.');
return false;
}
if (!$license = License::where('id','=',$license_id)->first()) {
$this->error('Invalid license ID');
return false;
}
$this->info('Checking in ALL seats for '.$license->name);
$licenseSeats = LicenseSeat::where('license_id', '=', $license_id)
->whereNotNull('assigned_to')
->with('user')
->get();
$this->info(' There are ' .$licenseSeats->count(). ' seats checked out: ');
if (!$notify) {
$this->info('No mail will be sent.');
}
foreach ($licenseSeats as $seat) {
$this->info($seat->user->username .' has a license seat for '.$license->name);
$seat->assigned_to = null;
if ($seat->save()) {
// Override the email address so we don't notify on checkin
if (!$notify) {
$seat->user->email = null;
}
// Log the checkin
$seat->logCheckin($seat->user, 'Checked in via cli tool');
}
}
}
}

View File

@@ -0,0 +1,112 @@
<?php
namespace App\Console\Commands;
use App\Models\LicenseSeat;
use Illuminate\Console\Command;
use App\Models\User;
use App\Models\License;
use Illuminate\Database\Eloquent\Model;
class CheckoutLicenseToAllUsers extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'snipeit:checkout-to-all {--license_id=} {--notify}';
/**
* The console command description.
*
* @var string
*/
protected $description = 'Command description';
/**
* Create a new command instance.
*
* @return void
*/
public function __construct()
{
parent::__construct();
}
/**
* Execute the console command.
*
* @return mixed
*/
public function handle()
{
$license_id = $this->option('license_id');
$notify = $this->option('notify');
if (!$license_id) {
$this->error('ERROR: License ID is required.');
return false;
}
if (!$license = License::where('id','=',$license_id)->with('assignedusers')->first()) {
$this->error('Invalid license ID');
return false;
}
$users = User::whereNull('deleted_at')->with('licenses')->get();
if ($users->count() > $license->getAvailSeatsCountAttribute()) {
$this->info('You do not have enough free seats to complete this task, so we will check out as many as we can. ');
}
$this->info('Checking out '.$users->count().' of '.$license->getAvailSeatsCountAttribute().' seats for '.$license->name);
if (!$notify) {
$this->info('No mail will be sent.');
}
foreach ($users as $user) {
// Check to make sure this user doesn't already have this license checked out
// to them
if ($user->licenses->where('id', '=', $license_id)->count()) {
$this->info($user->username .' already has this license checked out to them. Skipping... ');
continue;
}
// If the license is valid, check that there is an available seat
if ($license->availCount()->count() < 1) {
$this->error('ERROR: No available seats');
return false;
}
$this->info($license->availCount()->count().' seats left');
// Get the seat ID
$licenseSeat = $license->freeSeat();
// Update the seat with checkout info,
$licenseSeat->assigned_to = $user->id;
if ($licenseSeat->save()) {
// Temporarily null the user's email address so we don't send mail if we're not supposed to
if (!$notify) {
$user->email = null;
}
// Log the checkout
$licenseSeat->logCheckout('Checked out via cli tool', $user);
$this->info('License '.$license_id.' seat '.$licenseSeat->id.' checked out to '.$user->username);
}
}
}
}

View File

@@ -76,10 +76,4 @@ class CreateAdmin extends Command
}
// protected function getArguments()
// {
// return array(
// array('username', InputArgument::REQUIRED, 'Username'),
// );
// }
}

View File

@@ -2,8 +2,8 @@
namespace App\Console\Commands;
use Illuminate\Console\Command;
use App\Models\Setting;
use Illuminate\Console\Command;
class DisableLDAP extends Command
{
@@ -41,7 +41,7 @@ class DisableLDAP extends Command
if ($this->confirm("\n****************************************************\nThis will disable LDAP support. You will not be able \nto login with an account that does not exist \nlocally in the Snipe-IT local database. \n****************************************************\n\nDo you wish to continue? [y|N]")) {
$setting = Setting::first();
$setting = Setting::getSettings();
$setting->ldap_enabled = 0;
if ($setting->save()) {
$this->info('LDAP has been set to disabled.');

View File

@@ -71,7 +71,7 @@ class FixDoubleEscape extends Command
foreach($classname::where("$field",'LIKE','%&%')->get() as $row) {
$this->info('Updating '.$field.' for '.$classname);
$row->{$field} = html_entity_decode($row->{$field});
$row->{$field} = html_entity_decode($row->{$field},ENT_QUOTES);
$row->save();
$count[$classname][$field]++;

View File

@@ -0,0 +1,105 @@
<?php
namespace App\Console\Commands;
use App\Models\Actionlog;
use App\Models\Asset;
use Illuminate\Console\Command;
class FixMismatchedAssetsAndLogs extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'snipeit:fix-assets-and-logs {--dryrun : Run the sync process but don\'t update the database}';
/**
* The console command description.
*
* @var string
*/
protected $description = 'This script attempts to check the log table and check that the assets.assigned_to matches the last checkout.';
/**
* Is dry-run?
*
* @var bool
*/
private $dryrun = false;
/**
* Create a new command instance.
*
* @return void
*/
public function __construct()
{
parent::__construct();
}
/**
* Execute the console command.
*
* @return mixed
*/
public function handle()
{
if ($this->option('dryrun')) {
$this->dryrun = true;
}
if ($this->dryrun) {
$this->info('This is a DRY RUN - no changes will be saved.' );
}
$mismatch_count = 0;
$assets = Asset::whereNotNull('assigned_to')
->where('assigned_type', '=', 'App\\Models\\User')
->orderBy('id', 'ASC')->get();
foreach ($assets as $asset) {
// get the last checkout of the asset
if ($checkout_log = Actionlog::where('target_type', '=', 'App\\Models\\User')
->where('action_type', '=', 'checkout')
->where('item_id', '=', $asset->id)
->orderBy('created_at', 'DESC')
->first()) {
// Now check for a subsequent checkin log - we want to ignore those
if (!$checkin_log = Actionlog::where('target_type', '=', 'App\\Models\\User')
->where('action_type', '=', 'checkin from')
->where('item_id', '=', $asset->id)
->whereDate('created_at', '>', $checkout_log->created_at)
->orderBy('created_at', 'DESC')
->first()) {
//print_r($asset);
if ($checkout_log->target_id != $asset->assigned_to) {
$this->error('Log ID: '.$checkout_log->id.' -- Asset ID '. $checkout_log->item_id.' SHOULD BE checked out to User '.$checkout_log->target_id.' but its assigned_to is '.$asset->assigned_to );
if (!$this->dryrun) {
$asset->assigned_to = $checkout_log->target_id;
if ($asset->save()) {
$this->info('Asset record updated.');
} else {
$this->error('Error updating asset: '.$asset->getErrors());
}
}
$mismatch_count++;
}
} else {
//$this->info('Asset ID '.$asset->id.': There is a checkin '.$checkin_log->created_at.' after this checkout '.$checkout_log->created_at);
}
}
}
$this->info($mismatch_count.' mismatched assets.');
}
}

View File

@@ -48,60 +48,92 @@ class ImportLocations extends Command
$filename = $this->argument('filename');
$csv = Reader::createFromPath(storage_path('private_uploads/imports/').$filename, 'r');
$this->info('Attempting to process: '.storage_path('private_uploads/imports/').$filename);
$csv->setOffset(1); //because we don't want to insert the header
$csv->setHeaderOffset(0); //because we don't want to insert the header
$results = $csv->getRecords();
// Import parent location names first if they don't exist
foreach ($results as $parent_index => $parent_row) {
$parent_name = trim($parent_row['Parent Name']);
// First create any parents if they don't exist
if ($parent_name!='') {
if (array_key_exists('Parent Name', $parent_row)) {
$parent_name = trim($parent_row['Parent Name']);
if (array_key_exists('Name', $parent_row)) {
$this->info('- Parent: ' . $parent_name . ' in row as: ' . trim($parent_row['Parent Name']));
}
// Save parent location name
// This creates a sort of name-stub that we'll update later on in this script
$parent_location = Location::firstOrCreate(array('name' => $parent_name));
$this->info('Parent for '.$parent_row['Name'].' is '.$parent_name.'. Attempting to save '.$parent_name.'.');
if (array_key_exists('Name', $parent_row)) {
$this->info('Parent for ' . $parent_row['Name'] . ' is ' . $parent_name . '. Attempting to save ' . $parent_name . '.');
}
// Check if the record was updated or created.
// This is mostly for clearer debugging.
if ($parent_location->exists) {
$this->info('- Parent location '.$parent_name.' already exists.');
$this->info('- Parent location '.$parent_name.' already exists.');
} else {
$this->info('- Parent location '.$parent_name.' was created.');
}
} else {
$this->info('- No parent location for '.$parent_row['Name'].' provided.');
$this->info('- No Parent Name provided, so no parent location will be created.');
}
}
$this->info('----- Parents Created.... backfilling additional details... --------');
// Loop through ALL records and add/update them if there are additional fields
// besides name
foreach ($results as $index => $row) {
if (array_key_exists('Parent Name', $row)) {
$parent_name = trim($row['Parent Name']);
} else {
$parent_name = null;
}
// Set the location attributes to save
$location = Location::firstOrNew(array('name' => trim($row['Name'])));
$location->name = trim($row['Name']);
$location->currency = trim($row['Currency']);
$location->address = trim($row['Address 1']);
$location->address2 = trim($row['Address 2']);
$location->city = trim($row['City']);
$location->state = trim($row['State']);
$location->zip = trim($row['Zip']);
$location->country = trim($row['Country']);
$location->ldap_ou = trim($row['OU']);
if (array_key_exists('Name', $row)) {
$location = Location::firstOrCreate(array('name' => trim($row['Name'])));
$location->name = trim($row['Name']);
$this->info('Checking location: '.$location->name);
} else {
$this->error('Location name is required and is missing from at least one row in this dataset. Check your CSV for extra trailing rows and try again.');
return false;
}
if (array_key_exists('Currency', $row)) {
$location->currency = trim($row['Currency']);
}
if (array_key_exists('Address 1', $row)) {
$location->address = trim($row['Address 1']);
}
if (array_key_exists('Address 2', $row)) {
$location->address2 = trim($row['Address 2']);
}
if (array_key_exists('City', $row)) {
$location->city = trim($row['City']);
}
if (array_key_exists('State', $row)) {
$location->state = trim($row['State']);
}
if (array_key_exists('Zip', $row)) {
$location->zip = trim($row['Zip']);
}
if (array_key_exists('Country', $row)) {
$location->country = trim($row['Country']);
}
if (array_key_exists('OU', $row)) {
$location->ldap_ou = trim($row['OU']);
}
$this->info('Checking location: '.$location->name);
// If a parent name nis provided, we created it earlier in the script,
// If a parent name is provided, we created it earlier in the script,
// so let's grab that ID
if ($parent_name) {
$this->info('-- Searching for Parent Name: '.$parent_name);
$parent = Location::where('name', '=', $parent_name)->first();
$location->parent_id = $parent->id;
$this->info('Parent ID: '.$parent->id);
$this->info('Parent: '.$parent_name.' - ID: '.$parent->id);
}
// Make sure the more advanced (non-name) fields pass validation

View File

@@ -2,6 +2,7 @@
namespace App\Console\Commands;
use App\Models\Department;
use Illuminate\Console\Command;
use App\Models\Setting;
use App\Models\Ldap;
@@ -42,9 +43,8 @@ class LdapSync extends Command
*/
public function handle()
{
ini_set('max_execution_time', 600); //600 seconds = 10 minutes
ini_set('memory_limit', '500M');
ini_set('max_execution_time', env('LDAP_TIME_LIM', 600)); //600 seconds = 10 minutes
ini_set('memory_limit', env('LDAP_MEM_LIM', '500M'));
$ldap_result_username = Setting::getSettings()->ldap_username_field;
$ldap_result_last_name = Setting::getSettings()->ldap_lname_field;
$ldap_result_first_name = Setting::getSettings()->ldap_fname_field;
@@ -52,6 +52,10 @@ class LdapSync extends Command
$ldap_result_active_flag = Setting::getSettings()->ldap_active_flag_field;
$ldap_result_emp_num = Setting::getSettings()->ldap_emp_num;
$ldap_result_email = Setting::getSettings()->ldap_email;
$ldap_result_phone = Setting::getSettings()->ldap_phone_field;
$ldap_result_jobtitle = Setting::getSettings()->ldap_jobtitle;
$ldap_result_country = Setting::getSettings()->ldap_country;
$ldap_result_dept = Setting::getSettings()->ldap_dept;
try {
$ldapconn = Ldap::connectToLdap();
@@ -85,7 +89,7 @@ class LdapSync extends Command
}
/* Determine which location to assign users to by default. */
$location = NULL;
$location = NULL; // FIXME - this would be better called "$default_location", which is more explicit about its purpose
if ($this->option('location')!='') {
$location = Location::where('name', '=', $this->option('location'))->first();
@@ -107,8 +111,8 @@ class LdapSync extends Command
$ldap_ou_locations = Location::where('ldap_ou', '!=', '')->get()->toArray();
$ldap_ou_lengths = array();
foreach ($ldap_ou_locations as $location) {
$ldap_ou_lengths[] = strlen($location["ldap_ou"]);
foreach ($ldap_ou_locations as $ou_loc) {
$ldap_ou_lengths[] = strlen($ou_loc["ldap_ou"]);
}
array_multisort($ldap_ou_lengths, SORT_ASC, $ldap_ou_locations);
@@ -125,7 +129,16 @@ class LdapSync extends Command
// Grab subsets based on location-specific DNs, and overwrite location for these users.
foreach ($ldap_ou_locations as $ldap_loc) {
$location_users = Ldap::findLdapUsers($ldap_loc["ldap_ou"]);
try {
$location_users = Ldap::findLdapUsers($ldap_loc["ldap_ou"]);
} catch (\Exception $e) { // FIXME: this is stolen from line 77 or so above
if ($this->option('json_summary')) {
$json_summary = [ "error" => true, "error_message" => trans('admin/users/message.error.ldap_could_not_search')." Location: ".$ldap_loc['name']." (ID: ".$ldap_loc['id'].") cannot connect to \"".$ldap_loc["ldap_ou"]."\" - ".$e->getMessage(), "summary" => [] ];
$this->info(json_encode($json_summary));
}
LOG::info($e);
return [];
}
$usernames = array();
for ($i = 0; $i < $location_users["count"]; $i++) {
@@ -167,6 +180,16 @@ class LdapSync extends Command
$item["email"] = isset($results[$i][$ldap_result_email][0]) ? $results[$i][$ldap_result_email][0] : "" ;
$item["ldap_location_override"] = isset($results[$i]["ldap_location_override"]) ? $results[$i]["ldap_location_override"]:"";
$item["location_id"] = isset($results[$i]["location_id"]) ? $results[$i]["location_id"]:"";
$item["telephone"] = isset($results[$i][$ldap_result_phone][0]) ? $results[$i][$ldap_result_phone][0] : "";
$item["jobtitle"] = isset($results[$i][$ldap_result_jobtitle][0]) ? $results[$i][$ldap_result_jobtitle][0] : "";
$item["country"] = isset($results[$i][$ldap_result_country][0]) ? $results[$i][$ldap_result_country][0] : "";
$item["department"] = isset($results[$i][$ldap_result_dept][0]) ? $results[$i][$ldap_result_dept][0] : "";
$department = Department::firstOrCreate([
'name' => $item["department"],
]);
$user = User::where('username', $item["username"])->first();
if ($user) {
@@ -185,11 +208,40 @@ class LdapSync extends Command
$user->username = $item["username"];
$user->email = $item["email"];
$user->employee_num = e($item["employee_number"]);
$user->phone = $item["telephone"];
$user->jobtitle = $item["jobtitle"];
$user->country = $item["country"];
$user->department_id = $department->id;
// Sync activated state for Active Directory.
if ( array_key_exists('useraccountcontrol', $results[$i]) ) {
/* The following is _probably_ the correct logic, but we can't use it because
some users may have been dependent upon the previous behavior, and this
could cause additional access to be available to users they don't want
to allow to log in.
$useraccountcontrol = $results[$i]['useraccountcontrol'][0];
if(
// based on MS docs at: https://support.microsoft.com/en-us/help/305144/how-to-use-useraccountcontrol-to-manipulate-user-account-properties
($useraccountcontrol & 0x200) && // is a NORMAL_ACCOUNT
!($useraccountcontrol & 0x02) && // *and* _not_ ACCOUNTDISABLE
!($useraccountcontrol & 0x10) // *and* _not_ LOCKOUT
) {
$user->activated = 1;
} else {
$user->activated = 0;
} */
$enabled_accounts = [
'512', '544', '66048', '66080', '262656', '262688', '328192', '328224'
'512', // 0x200 NORMAL_ACCOUNT
'544', // 0x220 NORMAL_ACCOUNT, PASSWD_NOTREQD
'66048', // 0x10200 NORMAL_ACCOUNT, DONT_EXPIRE_PASSWORD
'66080', // 0x10220 NORMAL_ACCOUNT, PASSWD_NOTREQD, DONT_EXPIRE_PASSWORD
'262656', // 0x40200 NORMAL_ACCOUNT, SMARTCARD_REQUIRED
'262688', // 0x40220 NORMAL_ACCOUNT, PASSWD_NOTREQD, SMARTCARD_REQUIRED
'328192', // 0x50200 NORMAL_ACCOUNT, SMARTCARD_REQUIRED, DONT_EXPIRE_PASSWORD
'328224', // 0x50220 NORMAL_ACCOUNT, PASSWD_NOT_REQD, SMARTCARD_REQUIRED, DONT_EXPIRE_PASSWORD
'4260352',// 0x410200 NORMAL_ACCOUNT, DONT_EXPIRE_PASSWORD, DONT_REQ_PREAUTH
'1049088',// 0x100200 NORMAL_ACCOUNT, NOT_DELEGATED
];
$user->activated = ( in_array($results[$i]['useraccountcontrol'][0], $enabled_accounts) ) ? 1 : 0;
}
@@ -240,7 +292,7 @@ class LdapSync extends Command
}
}
} else if ($this->option('json_summary')) {
$json_summary = [ "error" => false, "error_message" => "", "summary" => $summary ];
$json_summary = [ "error" => false, "error_message" => "", "summary" => $summary ]; // hardcoding the error to false and the error_message to blank seems a bit weird
$this->info(json_encode($json_summary));
} else {
return $summary;

View File

@@ -0,0 +1,399 @@
<?php
declare(strict_types=1);
namespace App\Console\Commands;
use Log;
use Exception;
use App\Models\User;
use App\Services\LdapAd;
use App\Models\Location;
use Illuminate\Console\Command;
use Adldap\Models\User as AdldapUser;
/**
* LDAP / AD sync command.
*
* @author Wes Hulette <jwhulette@gmail.com>
*
* @since 5.0.0
*/
class LdapSyncNg extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'snipeit:ldap-sync-ng
{--location= : A location name }
{--location_id= : A location id}
{--base_dn= : A diffrent base DN to use }
{--summary : Print summary }
{--json_summary : Print summary in json format }
{--dryrun : Run the sync process but don\'t update the database}';
/**
* The console command description.
*
* @var string
*/
protected $description = 'Command line LDAP/AD sync';
/**
* An LdapAd instance.
*
* @var \App\Models\LdapAd
*/
private $ldap;
/**
* LDAP settings collection.
*
* @var \Illuminate\Support\Collection
*/
private $settings = null;
/**
* A default location collection.
*
* @var \Illuminate\Support\Collection
*/
private $defaultLocation = null;
/**
* Mapped locations collection.
*
* @var \Illuminate\Support\Collection
*/
private $mappedLocations = null;
/**
* The summary collection.
*
* @var \Illuminate\Support\Collection
*/
private $summary;
/**
* Is dry-run?
*
* @var bool
*/
private $dryrun = false;
/**
* Show users to be imported.
*
* @var array
*/
private $userlist = [];
/**
* Create a new command instance.
*/
public function __construct(LdapAd $ldap)
{
parent::__construct();
$this->ldap = $ldap;
$this->settings = $this->ldap->ldapSettings;
$this->summary = collect();
}
/**
* Execute the console command.
*
* @return mixed
*/
public function handle()
{
$dispatcher = \Adldap\Adldap::getEventDispatcher();
// Listen for all model events.
$dispatcher->listen('Adldap\Models\Events\*', function ($eventName, array $data) {
echo $eventName; // Returns 'Adldap\Models\Events\Updating'
var_dump($data); // Returns [0] => (object) Adldap\Models\Events\Updating;
\Log::debug("Event: ".$eventName." data - ".print_r($data, true));
});
$dispatcher->listen('Adldap\Auth\Events\*', function ($eventName, array $data) {
echo $eventName; // Returns 'Adldap\Models\Events\Updating'
var_dump($data); // Returns [0] => (object) Adldap\Models\Events\Updating;
\Log::debug("Event: ".$eventName." data - ".print_r($data, true));
});
ini_set('max_execution_time', env('LDAP_TIME_LIM', "600")); //600 seconds = 10 minutes
ini_set('memory_limit', '500M');
$old_error_reporting = error_reporting(); // grab old error_reporting .ini setting, for later re-enablement
error_reporting($old_error_reporting & ~E_DEPRECATED); // disable deprecation warnings, for LDAP in PHP 7.4 (and greater)
if ($this->option('dryrun')) {
$this->dryrun = true;
}
$this->checkIfLdapIsEnabled();
$this->checkLdapConnection();
$this->setBaseDn();
$this->getUserDefaultLocation();
/*
* Use the default location if set, this is needed for the LDAP users sync page
*/
if (!$this->option('base_dn') && null == $this->defaultLocation) {
$this->getMappedLocations();
}
$this->processLdapUsers();
// Print table of users
if ($this->dryrun) {
$this->info('The following users will be synced!');
$headers = ['First Name', 'Last Name', 'Username', 'Email', 'Employee #', 'Location Id', 'Status'];
$this->table($headers, $this->summary->toArray());
}
error_reporting($old_error_reporting); // re-enable deprecation warnings.
return $this->getSummary();
}
/**
* Generate the LDAP sync summary.
*
* @author Wes Hulette <jwhulette@gmail.com>
*
* @since 5.0.0
*
* @return string
*/
private function getSummary(): string
{
if ($this->option('summary') && null === $this->dryrun) {
$this->summary->each(function ($item) {
$this->info('USER: '.$item['note']);
if ('ERROR' === $item['status']) {
$this->error('ERROR: '.$item['note']);
}
});
} elseif ($this->option('json_summary')) {
$json_summary = [
'error' => false,
'error_message' => '',
'summary' => $this->summary->toArray(),
];
$this->info(json_encode($json_summary));
}
return '';
}
/**
* Create a new user or update an existing user.
*
* @author Wes Hulette <jwhulette@gmail.com>
*
* @since 5.0.0
*
* @param \Adldap\Models\User $snipeUser
*/
private function updateCreateUser(AdldapUser $snipeUser): void
{
$user = $this->ldap->processUser($snipeUser, $this->defaultLocation, $this->mappedLocations);
$summary = [
'firstname' => $user->first_name,
'lastname' => $user->last_name,
'username' => $user->username,
'employee_number' => $user->employee_num,
'email' => $user->email,
'location_id' => $user->location_id,
];
// Only update the database if is not a dry run
if (!$this->dryrun) {
if ($user->isDirty()) { //if nothing on the user changed, don't bother trying to save anything nor put anything in the summary
if ($user->save()) {
$summary['note'] = ($user->wasRecentlyCreated ? 'CREATED' : 'UPDATED');
$summary['status'] = 'SUCCESS';
} else {
$errors = '';
foreach ($user->getErrors()->getMessages() as $error) {
$errors .= implode(", ",$error);
}
$summary['note'] = $snipeUser->getDN().' was not imported. REASON: '.$errors;
$summary['status'] = 'ERROR';
}
} else {
$summary = null;
}
}
// $summary['note'] = ($user->getOriginal('username') ? 'UPDATED' : 'CREATED'); // this seems, kinda, like, superfluous, relative to the $summary['note'] thing above, yeah?
if($summary) { //if the $user wasn't dirty, $summary was set to null so that we will skip the following push()
$this->summary->push($summary);
}
}
/**
* Process the users to update / create.
*
* @author Wes Hulette <jwhulette@gmail.com>
*
* @since 5.0.0
*
*/
private function processLdapUsers(): void
{
try {
\Log::debug("CAL:LING GET LDAP SUSERS");
$ldapUsers = $this->ldap->getLdapUsers();
\Log::debug("END CALLING GET LDAP USERS");
} catch (Exception $e) {
$this->outputError($e);
exit($e->getMessage());
}
if (0 == $ldapUsers->count()) {
$msg = 'ERROR: No users found!';
Log::error($msg);
if ($this->dryrun) {
$this->error($msg);
}
exit($msg);
}
// Process each individual users
foreach ($ldapUsers->getResults() as $user) { // AdLdap2's paginate() method is weird, it gets *everything* and ->getResults() returns *everything*
$this->updateCreateUser($user);
}
}
/**
* Get the mapped locations if a base_dn is provided.
*
* @author Wes Hulette <jwhulette@gmail.com>
*
* @since 5.0.0
*/
private function getMappedLocations()
{
$ldapOuLocation = Location::where('ldap_ou', '!=', '')->select(['id', 'ldap_ou'])->get();
$locations = $ldapOuLocation->sortBy(function ($ou, $key) {
return strlen($ou->ldap_ou);
});
if ($locations->count() > 0) {
$msg = 'Some locations have special OUs set. Locations will be automatically set for users in those OUs.';
LOG::debug($msg);
if ($this->dryrun) {
$this->info($msg);
}
$this->mappedLocations = $locations->pluck('ldap_ou', 'id'); // TODO: this seems ok-ish, but the key-> value is going location_id -> OU name, and the primary action here is the opposite of that - going from OU's to location ID's.
}
}
/**
* Set the base dn if supplied.
*
* @author Wes Hulette <jwhulette@gmail.com>
*
* @since 5.0.0
*/
private function setBaseDn(): void
{
if ($this->option('base_dn')) {
$this->ldap->baseDn = $this->option('base_dn');
$msg = sprintf('Importing users from specified base DN: "%s"', $this->ldap->baseDn);
LOG::debug($msg);
if ($this->dryrun) {
$this->info($msg);
}
}
}
/**
* Get a default location id for imported users.
*
* @author Wes Hulette <jwhulette@gmail.com>
*
* @since 5.0.0
*/
private function getUserDefaultLocation(): void
{
$location = $this->option('location_id') ?? $this->option('location');
if ($location) {
$userLocation = Location::where('name', '=', $location)
->orWhere('id', '=', intval($location))
->select(['name', 'id'])
->first();
if ($userLocation) {
$msg = 'Importing users with default location: '.$userLocation->name.' ('.$userLocation->id.')';
LOG::debug($msg);
if ($this->dryrun) {
$this->info($msg);
}
$this->defaultLocation = collect([
$userLocation->id => $userLocation->name,
]);
} else {
$msg = 'The supplied location is invalid!';
LOG::error($msg);
if ($this->dryrun) {
$this->error($msg);
}
exit(0);
}
}
}
/**
* Check if LDAP intergration is enabled.
*
* @author Wes Hulette <jwhulette@gmail.com>
*
* @since 5.0.0
*/
private function checkIfLdapIsEnabled(): void
{
if (false === $this->settings['ldap_enabled']) {
$msg = 'LDAP intergration is not enabled. Exiting sync process.';
$this->info($msg);
Log::info($msg);
exit(0);
}
}
/**
* Check to make sure we can access the server.
*
* @author Wes Hulette <jwhulette@gmail.com>
*
* @since 5.0.0
*/
private function checkLdapConnection(): void
{
try {
$this->ldap->testLdapAdUserConnection();
$this->ldap->testLdapAdBindConnection();
} catch (Exception $e) {
$this->outputError($e);
exit(0);
}
}
/**
* Output the json summary to the screen if enabled.
*
* @param Exception $error
*/
private function outputError($error): void
{
if ($this->option('json_summary')) {
$json_summary = [
'error' => true,
'error_message' => $error->getMessage(),
'summary' => [],
];
$this->info(json_encode($json_summary));
}
$this->error($error->getMessage());
LOG::error($error);
}
}

View File

@@ -0,0 +1,112 @@
<?php
namespace App\Console\Commands;
use Illuminate\Console\Command;
use App\Models\User;
use Carbon\Carbon;
class MergeUsersByUsername extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'snipeit:merge-users';
/**
* The console command description.
*
* @var string
*/
protected $description = 'This command allows you to merge the history of users. It looks for users without an email address as their username and merges them into the version that does have an email username.';
/**
* Create a new command instance.
*
* @return void
*/
public function __construct()
{
parent::__construct();
}
/**
* Execute the console command.
*
* @return mixed
*/
public function handle()
{
// Get the list of users who have an email address as their username
$users = User::where('username', 'LIKE', '%@%')->whereNull('deleted_at')->get();
foreach ($users as $user) {
$parts = explode("@", $user->username);
$bad_users = User::where('username', '=', $parts[0])->whereNull('deleted_at')->with('assets', 'manager', 'userlog', 'licenses', 'consumables', 'accessories', 'managedLocations')->get();
foreach ($bad_users as $bad_user) {
$this->info($bad_user->username.' ('.$bad_user->id.') will be merged into '.$user->username.' ('.$user->id.') ');
// Walk the list of assets
foreach ($bad_user->assets as $asset) {
$this->info( 'Updating asset '.$asset->asset_tag.' '.$asset->id.' to user '.$user->id);
$asset->assigned_to = $user->id;
if (!$asset->save()) {
$this->error( 'Could not update assigned_to field on asset '.$asset->asset_tag.' '.$asset->id.' to user '.$user->id);
$this->error( 'Error saving: '.$asset->getErrors());
}
}
// Walk the list of licenses
foreach ($bad_user->licenses as $license) {
$this->info( 'Updating license '.$license->name.' '.$license->id.' to user '.$user->id);
$bad_user->licenses()->updateExistingPivot($license->id, ['assigned_to' => $user->id]);
}
// Walk the list of consumables
foreach ($bad_user->consumables as $consumable) {
$this->info( 'Updating consumable '.$consumable->id.' to user '.$user->id);
$bad_user->consumables()->updateExistingPivot($consumable->id, ['assigned_to' => $user->id]);
}
// Walk the list of accessories
foreach ($bad_user->accessories as $accessory) {
$this->info( 'Updating accessory '.$accessory->id.' to user '.$user->id);
$bad_user->accessories()->updateExistingPivot($accessory->id, ['assigned_to' => $user->id]);
}
// Walk the list of logs
foreach ($bad_user->userlog as $log) {
$this->info( 'Updating action log record '.$log->id.' to user '.$user->id);
$log->target_id = $user->id;
$log->save();
}
// Update any manager IDs
$this->info( 'Updating managed user records to user '.$user->id);
User::where('manager_id', '=', $bad_user->id)->update(['manager_id' => $user->id]);
// Update location manager IDs
foreach ($bad_user->managedLocations as $managedLocation) {
$this->info( 'Updating managed location record '.$managedLocation->name.' to manager '.$user->id);
$managedLocation->manager_id = $user->id;
$managedLocation->save();
}
// Mark the user as deleted
$this->info( 'Marking the user as deleted');
$bad_user->deleted_at = Carbon::now()->timestamp;
$bad_user->save();
}
}
}
}

View File

@@ -0,0 +1,183 @@
<?php
namespace App\Console\Commands;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\Storage;
class MoveUploadsToNewDisk extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'snipeit:move-uploads {delete_local?}';
/**
* The console command description.
*
* @var string
*/
protected $description = 'This will move your locally uploaded files to whatever your current disk is.';
/**
* Create a new command instance.
*
* @return void
*/
public function __construct()
{
parent::__construct();
}
/**
* Execute the console command.
*
* @return mixed
*/
public function handle()
{
if (config('filesystems.default')=='local') {
$this->error('Your current disk is set to local so we cannot proceed.');
$this->warn("Please configure your .env settings for S3. \nChange your PUBLIC_FILESYSTEM_DISK value to 's3_public' and your PRIVATE_FILESYSTEM_DISK to s3_private.");
return false;
}
$delete_local = $this->argument('delete_local');
$public_uploads['accessories'] = glob('public/accessories'."/*.*");
$public_uploads['assets'] = glob('public/assets'."/*.*");
$public_uploads['avatars'] = glob('public/avatars'."/*.*");
$public_uploads['categories'] = glob('public/categories'."/*.*");
$public_uploads['companies'] = glob('public/companies'."/*.*");
$public_uploads['components'] = glob('public/components'."/*.*");
$public_uploads['consumables'] = glob('public/consumables'."/*.*");
$public_uploads['departments'] = glob('public/departments'."/*.*");
$public_uploads['locations'] = glob('public/locations'."/*.*");
$public_uploads['manufacturers'] = glob('public/manufacturers'."/*.*");
$public_uploads['suppliers'] = glob('public/suppliers'."/*.*");
$public_uploads['assetmodels'] = glob('public/models'."/*.*");
// iterate files
foreach($public_uploads as $public_type => $public_upload)
{
$type_count = 0;
$this->info("- There are ".count($public_upload).' PUBLIC '.$public_type.' files.');
for ($i = 0; $i < count($public_upload); $i++) {
$type_count++;
$filename = basename($public_upload[$i]);
try {
Storage::disk('public')->put('uploads/'.public_type.'/'.$filename, file_get_contents($public_upload[$i]));
$new_url = Storage::disk('public')->url('uploads/'.$public_type.'/'.$filename, $filename);
$this->info($type_count.'. PUBLIC: '.$filename.' was copied to '.$new_url);
} catch (\Exception $e) {
\Log::debug($e);
$this->error($e);
}
}
}
$logos = glob("public/uploads/setting*.*");
$this->info("- There are ".count($logos).' files that might be logos.');
$type_count = 0;
foreach ($logos as $logo) {
$this->info($logo);
$type_count++;
$filename = basename($logo);
Storage::disk('public')->put('uploads/'.$filename, file_get_contents($logo));
$this->info($type_count.'. LOGO: '.$filename.' was copied to '.env('PUBLIC_AWS_URL').'/uploads/'.$filename);
}
$private_uploads['assets'] = glob('storage/private_uploads/assets'."/*.*");
$private_uploads['signatures'] = glob('storage/private_uploads/signatures'."/*.*");
$private_uploads['audits'] = glob('storage/private_uploads/audits'."/*.*");
$private_uploads['assetmodels'] = glob('storage/private_uploads/assetmodels'."/*.*");
$private_uploads['imports'] = glob('storage/private_uploads/imports'."/*.*");
$private_uploads['licenses'] = glob('storage/private_uploads/licenses'."/*.*");
$private_uploads['users'] = glob('storage/private_uploads/users'."/*.*");
$private_uploads['backups'] = glob('storage/private_uploads/users'."/*.*");
foreach($private_uploads as $private_type => $private_upload)
{
$this->info("- There are ".count($private_upload).' PRIVATE '.$private_type.' files.');
$type_count = 0;
for ($x = 0; $x < count($private_upload); $x++) {
$type_count++;
$filename = basename($private_upload[$x]);
try {
Storage::put($private_type.'/'.$filename, file_get_contents($private_upload[$i]));
$new_url = Storage::url($private_type.'/'.$filename, $filename);
$this->info($type_count.'. PRIVATE: '.$filename.' was copied to '.$new_url);
} catch (\Exception $e) {
\Log::debug($e);
$this->error($e);
}
}
}
if ($delete_local=='true') {
$public_delete_count = 0;
$private_delete_count = 0;
$this->info("\n\n");
$this->error('!!!!!!!!!!!!!!!!!!!!!!!!!!!!! WARNING!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!');
$this->warn("\nTHIS WILL DELETE ALL OF YOUR LOCAL UPLOADED FILES. \n\nThis cannot be undone, so you should take a backup of your system before you proceed.\n");
$this->error('!!!!!!!!!!!!!!!!!!!!!!!!!!!!! WARNING!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!');
if ($this->confirm("Do you wish to continue?")) {
foreach($public_uploads as $public_type => $public_upload) {
for ($i = 0; $i < count($public_upload); $i++) {
$filename = $public_upload[$i];
try {
unlink($filename);
$public_delete_count++;
} catch (\Exception $e) {
\Log::debug($e);
$this->error($e);
}
}
}
foreach($private_uploads as $private_type => $private_upload)
{
for ($i = 0; $i < count($private_upload); $i++) {
$filename = $private_upload[$i];
try {
unlink($filename);
$private_delete_count++;
} catch (\Exception $e) {
\Log::debug($e);
$this->error($e);
}
}
}
$this->info($public_delete_count." PUBLIC local files and ".$private_delete_count." PRIVATE local files were deleted from your filesystem.");
}
}
}
}

View File

@@ -1,34 +1,12 @@
<?php
namespace App\Console\Commands;
use App\Helpers\Helper;
use App\Importer\AccessoryImporter;
use App\Importer\AssetImporter;
use App\Importer\ConsumableImporter;
use App\Importer\Importer;
use App\Models\Accessory;
use App\Models\Asset;
use App\Models\AssetModel;
use App\Models\Category;
use App\Models\Company;
use App\Models\Consumable;
use App\Models\CustomField;
use App\Models\Location;
use App\Models\Manufacturer;
use App\Models\Setting;
use App\Models\Statuslabel;
use App\Models\Supplier;
use App\Models\User;
use DB;
use Illuminate\Console\Command;
use Illuminate\Database\Eloquent\Model;
use League\Csv\Reader;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputOption;
use ForceUTF8\Encoding;
ini_set('max_execution_time', 600); //600 seconds = 10 minutes
ini_set('memory_limit', '500M');
ini_set('max_execution_time', env('IMPORT_TIME_LIMIT', 600)); //600 seconds = 10 minutes
ini_set('memory_limit', env('IMPORT_MEMORY_LIMIT', '500M'));
/**
* Class ObjectImportCommand
@@ -77,8 +55,10 @@ class ObjectImportCommand extends Command
->setShouldNotify($this->option('send-welcome'))
->setUsernameFormat($this->option('username_format'));
$logFile = $this->option('logfile');
\Log::useFiles($logFile);
// This $logFile/useFiles() bit is currently broken, so commenting it out for now
// $logFile = $this->option('logfile');
// \Log::useFiles($logFile);
$this->comment('======= Importing Items from '.$filename.' =========');
$importer->import();

View File

@@ -83,11 +83,20 @@ class PaveIt extends Command
DB::statement('delete from asset_uploads');
DB::statement('delete from action_logs');
DB::statement('delete from checkout_requests');
DB::statement('delete from checkout_acceptances');
DB::statement('delete from consumables_users');
DB::statement('delete from custom_field_custom_fieldset');
DB::statement('delete from custom_fields');
DB::statement('delete from custom_fieldsets');
DB::statement('delete from components_assets');
DB::statement('delete from kits');
DB::statement('delete from kits_accessories');
DB::statement('delete from kits_consumables');
DB::statement('delete from kits_licenses');
DB::statement('delete from kits_models');
DB::statement('delete from login_attempts');
DB::statement('delete from models_custom_fields');
DB::statement('delete from permission_groups');
DB::statement('delete from password_resets');
DB::statement('delete from requested_assets');
DB::statement('delete from requests');
@@ -104,7 +113,10 @@ class PaveIt extends Command
\DB::statement('drop table IF EXISTS assets');
\DB::statement('drop table IF EXISTS categories');
\DB::statement('drop table IF EXISTS checkout_requests');
\DB::statement('drop table IF EXISTS checkout_acceptances');
\DB::statement('drop table IF EXISTS companies');
\DB::statement('drop table IF EXISTS components');
\DB::statement('drop table IF EXISTS components_assets');
\DB::statement('drop table IF EXISTS consumables_users');
\DB::statement('drop table IF EXISTS consumables');
\DB::statement('drop table IF EXISTS custom_field_custom_fieldset');
@@ -114,11 +126,17 @@ class PaveIt extends Command
\DB::statement('drop table IF EXISTS departments');
\DB::statement('drop table IF EXISTS groups');
\DB::statement('drop table IF EXISTS history');
\DB::statement('drop table IF EXISTS components');
\DB::statement('drop table IF EXISTS components_assets');
\DB::statement('drop table IF EXISTS kits');
\DB::statement('drop table IF EXISTS kits_accessories');
\DB::statement('drop table IF EXISTS kits_consumables');
\DB::statement('drop table IF EXISTS kits_licenses');
\DB::statement('drop table IF EXISTS kits_models');
\DB::statement('drop table IF EXISTS models_custom_fields');
\DB::statement('drop table IF EXISTS permission_groups');
\DB::statement('drop table IF EXISTS license_seats');
\DB::statement('drop table IF EXISTS licenses');
\DB::statement('drop table IF EXISTS locations');
\DB::statement('drop table IF EXISTS login_attempts');
\DB::statement('drop table IF EXISTS manufacturers');
\DB::statement('drop table IF EXISTS models');
\DB::statement('drop table IF EXISTS migrations');

View File

@@ -2,22 +2,19 @@
namespace App\Console\Commands;
use App\Models\Accessory;
use App\Models\Asset;
use App\Models\AssetModel;
use App\Models\Category;
use App\Models\Component;
use App\Models\Consumable;
use App\Models\License;
use App\Models\Location;
use App\Models\Manufacturer;
use App\Models\Statuslabel;
use App\Models\Supplier;
use App\Models\User;
use Illuminate\Console\Command;
use DB;
use \App\Models\Asset;
use \App\Models\AssetModel;
use \App\Models\Location;
use \App\Models\Company;
use \App\Models\License;
use \App\Models\Accessory;
use \App\Models\Component;
use \App\Models\Consumable;
use \App\Models\Category;
use \App\Models\User;
use \App\Models\Supplier;
use \App\Models\Manufacturer;
use \App\Models\Depreciation;
use \App\Models\Statuslabel;
class Purge extends Command
{
@@ -33,7 +30,7 @@ class Purge extends Command
*
* @var string
*/
protected $description = 'Purge all soft-deleted deleted records in the database. This will rewrite history for items that have been edited, or checked in or out. It will also reqrite history for users associated with deleted items.';
protected $description = 'Purge all soft-deleted deleted records in the database. This will rewrite history for items that have been edited, or checked in or out. It will also rewrite history for users associated with deleted items.';
/**
* Create a new command instance.

View File

@@ -0,0 +1,44 @@
<?php
namespace App\Console\Commands;
use Illuminate\Console\Command;
class PurgeLoginAttempts extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'snipeit:purge-logins';
/**
* The console command description.
*
* @var string
*/
protected $description = 'Clears the login_attempts table';
/**
* Create a new command instance.
*
* @return void
*/
public function __construct()
{
parent::__construct();
}
/**
* Execute the console command.
*
* @return mixed
*/
public function handle()
{
if ($this->confirm("\n****************************************************\nTHIS WILL DELETE ALL OF THE YOUR LOGIN ATTEMPT RECORDS. \nThere is NO undo! \n****************************************************\n\nDo you wish to continue? No backsies! [y|N]")) {
\DB::statement('delete from login_attempts');
}
}
}

View File

@@ -0,0 +1,126 @@
<?php
namespace App\Console\Commands;
use App\Models\CustomField;
use Illuminate\Console\Command;
class ReEncodeCustomFieldNames extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'snipeit:regenerate-fieldnames';
/**
* The console command description.
*
* @var string
*/
protected $description = 'This utility will regenerate the column names for custom fields. It should typically only be needed when a PHP upgrade changed the behavior of the unicode conversion between versions.';
/**
* Create a new command instance.
*
* @return void
*/
public function __construct()
{
parent::__construct();
}
/**
* All three of these things must match for the custom fields system to work as expected:
*
* - what the system thinks the output of $field->convertUnicodeDbSlug() is
* - the actual db_column name in the customfields table
* - the physical column name that was created on the assets table
*
* For some people who upgraded their version of PHP, the unicode converter now behaves
* differently in than it did when their custom fields were first created, specifically as it
* relates to handling slashes, ampersands, etc. This can result in the field names no longer
* matching up, as an older version of the PHP extension simply dropped slashes, etc, while the
* newer version of the PHP extension will convert them to underscores.
*
* @return mixed
*/
public function handle()
{
if ($this->confirm('This will regenerate all of the custom field database fieldnames in your database. THIS WILL CHANGE YOUR SCHEMA AND SHOULD NOT BE DONE WITHOUT MAKING A BACKUP FIRST. Do you wish to continue?'))
{
/** Get all of the custom fields */
$fields = CustomField::get();
$asset_columns = \DB::getSchemaBuilder()->getColumnListing('assets');
$custom_field_columns = array();
/** Loop through the columns on the assets table */
foreach ($asset_columns as $asset_column) {
/** Add ones that start with _snipeit_ to an array for handling */
if (strpos($asset_column, '_snipeit_') === 0) {
/**
* Get the ID of the custom field based on the fieldname.
* For example, in _snipeit_mac_address_1, we grab the 1 because we know
* that's the ID of the custom field that created the column.
* Then use that ID as the array key for use comparing the actual assets field name
* and the db_column value from the custom fields table.
*/
$last_part = substr(strrchr($asset_column, "_snipeit_"), 1);
$custom_field_columns[$last_part] = $asset_column;
}
}
foreach ($fields as $field) {
$this->info($field->name .' ('.$field->id.') column should be '. $field->convertUnicodeDbSlug().'');
/** The assets table has the column it should have, all is well */
if (\Schema::hasColumn('assets', $field->convertUnicodeDbSlug()))
{
$this->info('-- ✓ This field exists - all good');
/**
* There is a mismatch between the fieldname on the assets table and
* what $field->convertUnicodeDbSlug() is *now* expecting.
*/
} else {
$this->warn('-- X Field mismatch: updating... ');
/** Make sure the custom_field_columns array has the ID */
if (array_key_exists($field->id, $custom_field_columns)) {
/**
* Update the asset schema to the corrected fieldname that will be recognized by the
* system elsewhere that we use $field->convertUnicodeDbSlug()
*/
\Schema::table('assets', function($table) use ($custom_field_columns, $field) {
$table->renameColumn($custom_field_columns[$field->id], $field->convertUnicodeDbSlug());
});
$this->warn('-- ✓ Field updated from '.$custom_field_columns[$field->id].' to '.$field->convertUnicodeDbSlug());
} else {
$this->warn('-- X WARNING: There is no field on the assets table ending in '.$field->id.'. This may require more in-depth investigation and may mean the schema was altered manually.');
}
}
/** Update the db_column property in the custom fields table, just in case it doesn't match the other
* things.
*/
$field->db_column = $field->convertUnicodeDbSlug();
$field->save();
}
}
}
}

View File

@@ -2,11 +2,11 @@
namespace App\Console\Commands;
use App\Models\CustomField;
use Illuminate\Console\Command;
use App\LegacyEncrypter\McryptEncrypter;
use App\Models\Setting;
use App\Models\Asset;
use App\Models\CustomField;
use App\Models\Setting;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\Storage;
class RecryptFromMcrypt extends Command

View File

@@ -2,11 +2,10 @@
namespace App\Console\Commands;
use Illuminate\Console\Command;
use App\Models\Asset;
use App\Models\Setting;
use DB;
use Artisan;
use Illuminate\Console\Command;
class RegenerateAssetTags extends Command
{

View File

@@ -3,9 +3,9 @@
namespace App\Console\Commands;
use Illuminate\Console\Command;
use App\Models\Setting;
use App\Models\User;
use Illuminate\Console\Command;
class ResetDemoSettings extends Command
{
@@ -51,9 +51,9 @@ class ResetDemoSettings extends Command
$settings->header_color = null;
$settings->barcode_type = 'QRCODE';
$settings->default_currency = 'USD';
$settings->brand = 3;
$settings->brand = 2;
$settings->ldap_enabled = 0;
$settings->full_multiple_companies_support = 1;
$settings->full_multiple_companies_support = 0;
$settings->alt_barcode = 'C128';
$settings->skin = '';
$settings->email_domain = 'snipeitapp.com';
@@ -64,7 +64,16 @@ class ResetDemoSettings extends Command
$settings->thumbnail_max_h = '30';
$settings->locale = 'en';
$settings->version_footer = 'on';
$settings->support_footer = 'on';
$settings->support_footer = null;
$settings->saml_enabled = '0';
$settings->saml_sp_x509cert = null;
$settings->saml_idp_metadata = null;
$settings->saml_attr_mapping_username = null;
$settings->saml_forcelogin = '0';
$settings->saml_slo = null;
$settings->saml_custom_settings = null;
$settings->save();
if ($user = User::where('username', '=', 'admin')->first()) {
@@ -72,7 +81,9 @@ class ResetDemoSettings extends Command
$user->save();
}
\Storage::disk('local_public')->put('snipe-logo.png', file_get_contents(public_path('img/demo/snipe-logo.png')));
\Storage::disk('local_public')->put('snipe-logo-lg.png', file_get_contents(public_path('img/demo/snipe-logo-lg.png')));
}
}

View File

@@ -2,16 +2,13 @@
namespace App\Console\Commands;
use Illuminate\Console\Command;
use App\Models\User;
use App\Models\Actionlog;
use App\Models\Asset;
use App\Models\Consumable;
use App\Models\Accessory;
use App\Models\LicenseSeat;
use App\Models\License;
use DB;
use App\Models\User;
use Artisan;
use DB;
use Illuminate\Console\Command;
class RestoreDeletedUsers extends Command
{

View File

@@ -0,0 +1,292 @@
<?php
namespace App\Console\Commands;
use Illuminate\Console\Command;
use ZipArchive;
class RestoreFromBackup extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'snipeit:restore
{--force : Skip the danger prompt; assuming you hit "y"}
{filename : The zip file to be migrated}
{--no-progress : Don\'t show a progress bar}';
/**
* The console command description.
*
* @var string
*/
protected $description = 'Restore from a previously created backup';
/**
* Create a new command instance.
*
* @return void
*/
public function __construct()
{
parent::__construct();
}
/**
* Execute the console command.
*
* @return mixed
*/
public function handle()
{
$dir = getcwd();
print "Current working directory is: $dir\n";
//
$filename = $this->argument('filename');
if (!$filename) {
return $this->error("Missing required filename");
}
if (!$this->option('force') && !$this->confirm('Are you sure you wish to restore from the given backup file? This can lead to MASSIVE DATA LOSS!')) {
return $this->error("Data loss not confirmed");
}
if (config('database.default') != 'mysql') {
return $this->error("DB_CONNECTION must be MySQL in order to perform a restore. Detected: ".config('database.default'));
}
$za = new ZipArchive();
$errcode = $za->open($filename, ZipArchive::RDONLY);
if ($errcode !== true) {
$errors = [
ZipArchive::ER_EXISTS => "File already exists.",
ZipArchive::ER_INCONS => "Zip archive inconsistent.",
ZipArchive::ER_INVAL => "Invalid argument.",
ZipArchive::ER_MEMORY => "Malloc failure.",
ZipArchive::ER_NOENT => "No such file.",
ZipArchive::ER_NOZIP => "Not a zip archive.",
ZipArchive::ER_OPEN => "Can't open file.",
ZipArchive::ER_READ => "Read error.",
ZipArchive::ER_SEEK => "Seek error."
];
return $this->error("Could not access file: ".$filename." - ".array_key_exists($errcode,$errors) ? $errors[$errcode] : " Unknown reason: $errcode");
}
$private_dirs = [
'storage/private_uploads/assets', // these are asset _files_, not the pictures.
'storage/private_uploads/audits',
'storage/private_uploads/imports',
'storage/private_uploads/assetmodels',
'storage/private_uploads/users',
'storage/private_uploads/licenses',
'storage/private_uploads/signatures'
];
$private_files = [
'storage/oauth-private.key',
'storage/oauth-public.key'
];
$public_dirs = [
'public/uploads/companies',
'public/uploads/components',
'public/uploads/categories',
'public/uploads/manufacturers',
//'public/uploads/barcodes', // we don't want this, let the barcodes be regenerated
'public/uploads/consumables',
'public/uploads/departments',
'public/uploads/avatars',
'public/uploads/suppliers',
'public/uploads/assets', // these are asset _pictures_, not asset files
'public/uploads/locations',
'public/uploads/accessories',
'public/uploads/models',
'public/uploads/categories',
'public/uploads/avatars',
'public/uploads/manufacturers'
];
$public_files = [
'public/uploads/logo.*',
'public/uploads/setting-email_logo*',
'public/uploads/setting-label_logo*',
'public/uploads/setting-logo*',
'public/uploads/favicon.*',
'public/uploads/favicon-uploaded.*'
];
$all_files = $private_dirs + $public_dirs;
$sqlfiles = [];
$sqlfile_indices = [];
$interesting_files = [];
$boring_files = [];
for ($i=0; $i<$za->numFiles;$i++) {
$stat_results = $za->statIndex($i);
// echo "index: $i\n";
// print_r($stat_results);
$raw_path = $stat_results['name'];
if(strpos($raw_path,'\\')!==false) { //found a backslash, swap it to forward-slash
$raw_path = strtr($raw_path,'\\','/');
//print "Translating file: ".$stat_results['name']." to: ".$raw_path."\n";
}
// skip macOS resource fork files (?!?!?!)
if(strpos($raw_path,"__MACOSX")!==false && strpos($raw_path,"._") !== false) {
//print "SKIPPING macOS Resource fork file: $raw_path\n";
$boring_files[] = $raw_path;
continue;
}
if(@pathinfo($raw_path)['extension'] == "sql") {
print "Found a sql file!\n";
$sqlfiles[] = $raw_path;
$sqlfile_indices[] = $i;
continue;
}
foreach(array_merge($private_dirs,$public_dirs) as $dir) {
$last_pos = strrpos($raw_path,$dir.'/');
if($last_pos !== false ) {
//print("INTERESTING - last_pos is $last_pos when searching $raw_path for $dir - last_pos+strlen(\$dir) is: ".($last_pos+strlen($dir))." and strlen(\$rawpath) is: ".strlen($raw_path)."\n");
//print("We would copy $raw_path to $dir.\n"); //FIXME append to a path?
$interesting_files[$raw_path] = ['dest' =>$dir, 'index' => $i];
continue 2;
if($last_pos + strlen($dir) +1 == strlen($raw_path)) {
// we don't care about that; we just want files with the appropriate prefix
//print("FOUND THE EXACT DIRECTORY: $dir AT: $raw_path!!!\n");
}
}
}
$good_extensions = ["png","gif","jpg","svg","jpeg","doc","docx","pdf","txt",
"zip","rar","xls","xlsx","lic","xml","rtf", "webp","key","ico"];
foreach(array_merge($private_files, $public_files) as $file) {
$has_wildcard = (strpos($file,"*") !== false);
if($has_wildcard) {
$file = substr($file,0,-1); //trim last character (which should be the wildcard)
}
$last_pos = strrpos($raw_path,$file); // no trailing slash!
if($last_pos !== false ) {
$extension = strtolower(pathinfo($raw_path, PATHINFO_EXTENSION));
if(!in_array($extension, $good_extensions)) {
$this->warn("Potentially unsafe file ".$raw_path." is being skipped");
$boring_files[] = $raw_path;
continue 2;
}
//print("INTERESTING - last_pos is $last_pos when searching $raw_path for $file - last_pos+strlen(\$file) is: ".($last_pos+strlen($file))." and strlen(\$rawpath) is: ".strlen($raw_path)."\n");
//no wildcards found in $file, process 'normally'
if($last_pos + strlen($file) == strlen($raw_path) || $has_wildcard) { //again, no trailing slash. or this is a wildcard and we just take it.
// print("FOUND THE EXACT FILE: $file AT: $raw_path!!!\n"); //we *do* care about this, though.
$interesting_files[$raw_path] = ['dest' => dirname($file),'index' => $i];
continue 2;
}
}
}
$boring_files[] = $raw_path; //if we've gotten to here and haven't continue'ed our way into the next iteration, we don't want this file
} // end of pre-processing the ZIP file for-loop
// print_r($interesting_files);exit(-1);
if( count($sqlfiles) != 1) {
return $this->error("There should be exactly *one* sql backup file found, found: ".( count($sqlfiles) == 0 ? "None" : implode(", ",$sqlfiles)));
}
if( strpos($sqlfiles[0], "db-dumps") === false ) {
//return $this->error("SQL backup file is missing 'db-dumps' component of full pathname: ".$sqlfiles[0]);
//older Snipe-IT installs don't have the db-dumps subdirectory component
}
//how to invoke the restore?
$pipes = [];
$env_vars = getenv();
$env_vars['MYSQL_PWD'] = config("database.connections.mysql.password");
$proc_results = proc_open("mysql -h ".escapeshellarg(config('database.connections.mysql.host'))." -u ".escapeshellarg(config('database.connections.mysql.username'))." ".escapeshellarg(config('database.connections.mysql.database')), // yanked -p since we pass via ENV
[0 => ['pipe','r'],1 => ['pipe','w'],2 => ['pipe','w']],
$pipes,
null,
$env_vars); // this is not super-duper awesome-secure, but definitely more secure than showing it on the CLI, or dropping temporary files with passwords in them.
if($proc_results === false) {
return $this->error("Unable to invoke mysql via CLI");
}
// $this->info("Stdout says? ".fgets($pipes[1])); //FIXME: I think we might need to set non-blocking mode to use this properly?
// $this->info("Stderr says? ".fgets($pipes[2])); //FIXME: ditto, same.
// should we read stdout?
// fwrite($pipes[0],config("database.connections.mysql.password")."\n"); //this doesn't work :(
//$sql_contents = fopen($sqlfiles[0], "r"); //NOPE! This isn't a real file yet, silly-billy!
$sql_stat = $za->statIndex($sqlfile_indices[0]);
//$this->info("SQL Stat is: ".print_r($sql_stat,true));
$sql_contents = $za->getStream($sql_stat['name']);
if ($sql_contents === false) {
$stdout = fgets($pipes[1]);
$this->info($stdout);
$stderr = fgets($pipes[2]);
$this->info($stderr);
return false;
}
while(($buffer = fgets($sql_contents)) !== false ) {
//$this->info("Buffer is: '$buffer'");
$bytes_written = fwrite($pipes[0],$buffer);
if($bytes_written === false) {
$stdout = fgets($pipes[1]);
$this->info($stdout);
$stderr = fgets($pipes[2]);
$this->info($stderr);
return false;
}
}
fclose($pipes[0]);
fclose($sql_contents);
fclose($pipes[1]);
fclose($pipes[2]);
//wait, have to do fclose() on all pipes first?
$close_results = proc_close($proc_results);
if($close_results != 0) {
return $this->error("There may have been a problem with the database import: Error number ".$close_results);
}
//and now copy the files over too (right?)
//FIXME - we don't prune the filesystem space yet!!!!
if($this->option('no-progress')) {
$bar = null;
} else {
$bar = $this->output->createProgressBar(count($interesting_files));
}
foreach($interesting_files AS $pretty_file_name => $file_details) {
$ugly_file_name = $za->statIndex($file_details['index'])['name'];
$fp = $za->getStream($ugly_file_name);
//$this->info("Weird problem, here are file details? ".print_r($file_details,true));
$migrated_file = fopen($file_details['dest']."/".basename($pretty_file_name),"w");
while(($buffer = fgets($fp))!== false) {
fwrite($migrated_file,$buffer);
}
fclose($migrated_file);
fclose($fp);
//$this->info("Wrote $ugly_file_name to $pretty_file_name");
if($bar) {
$bar->advance();
}
}
if($bar) {
$bar->finish();
$this->line("");
} else {
$this->info(count($interesting_files)." files were succesfully transferred");
}
foreach($boring_files as $boring_file) {
$this->warn($boring_file." was skipped.");
}
}
}

View File

@@ -0,0 +1,135 @@
<?php
namespace App\Console\Commands;
use Illuminate\Console\Command;
use Artisan;
use App\Models\CustomField;
use App\Models\Asset;
use App\Models\Setting;
use \Illuminate\Encryption\Encrypter;
class RotateAppKey extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'snipeit:rotate-key';
/**
* The console command description.
*
* @var string
*/
protected $description = 'Command description';
/**
* Create a new command instance.
*
* @return void
*/
public function __construct()
{
parent::__construct();
}
/**
* Execute the console command.
*
* @return mixed
*/
public function handle()
{
if ($this->confirm("\n****************************************************\nTHIS WILL MODIFY YOUR APP_KEY AND DE-CRYPT YOUR ENCRYPTED CUSTOM FIELDS AND \nRE-ENCRYPT THEM WITH A NEWLY GENERATED KEY. \n\nThere is NO undo. \n\nMake SURE you have a database backup and a backup of your .env generated BEFORE running this command. \n\nIf you do not save the newly generated APP_KEY to your .env in this process, \nyour encrypted data will no longer be decryptable. \n\nAre you SURE you wish to continue, and have confirmed you have a database backup and an .env backup? ")) {
// Get the existing app_key and ciphers
// We put them in a variable since we clear the cache partway through here.
$old_app_key = config('app.key');
$cipher = config('app.cipher');
// Generate a new one
Artisan::call('key:generate', ['--show' => true]);
$new_app_key = Artisan::output();
// Clear the config cache
Artisan::call('config:clear');
$this->warn('Your app cipher is: '.$cipher);
$this->warn('Your old APP_KEY is: '.$old_app_key);
$this->warn('Your new APP_KEY is: '.$new_app_key);
// Write the new app key to the .env file
$this->writeNewEnvironmentFileWith($new_app_key);
// Manually create an old encrypter instance using the old app key
// and also create a new encrypter instance so we can re-crypt the field
// using the newly generated app key
$oldEncrypter = new Encrypter(base64_decode(substr($old_app_key, 7)), $cipher);
$newEncrypter = new Encrypter(base64_decode(substr($new_app_key, 7)), $cipher);
$fields = CustomField::where('field_encrypted', '1')->get();
foreach ($fields as $field) {
$assets = Asset::whereNotNull($field->db_column)->get();
foreach ($assets as $asset) {
$asset->{$field->db_column} = $oldEncrypter->decrypt($asset->{$field->db_column});
$this->line('DECRYPTED: '. $field->db_column);
$asset->{$field->db_column} = $newEncrypter->encrypt($asset->{$field->db_column});
$this->line('ENCRYPTED: '.$field->db_column);
$asset->save();
}
}
// Handle the LDAP password if one is provided
$setting = Setting::first();
if ($setting->ldap_pword!='') {
$setting->ldap_pword = $oldEncrypter->decrypt($setting->ldap_pword);
$setting->ldap_pword = $newEncrypter->encrypt($setting->ldap_pword);
$setting->save();
$this->warn('LDAP password has been re-encrypted.');
}
} else {
$this->info('This operation has been canceled. No changes have been made.');
}
}
/**
* Write a new environment file with the given key.
*
* @param string $key
* @return void
*/
protected function writeNewEnvironmentFileWith($key)
{
file_put_contents($this->laravel->environmentFilePath(), preg_replace(
$this->keyReplacementPattern(),
'APP_KEY='.$key,
file_get_contents($this->laravel->environmentFilePath())
));
}
/**
* Get a regex pattern that will match env APP_KEY with any random key.
*
* @return string
*/
protected function keyReplacementPattern()
{
$escaped = preg_quote('='.$this->laravel['config']['app.key'], '/');
return "/^APP_KEY{$escaped}/m";
}
}

View File

@@ -0,0 +1,60 @@
<?php
namespace App\Console\Commands;
use App\Models\User;
use App\Notifications\CurrentInventory;
use Illuminate\Console\Command;
class SendCurrentInventoryToUsers extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'snipeit:user-inventory';
/**
* The console command description.
*
* @var string
*/
protected $description = 'This will send users a report of all of the items currently checked out to them.';
/**
* Create a new command instance.
*
* @return void
*/
public function __construct()
{
parent::__construct();
}
/**
* Execute the console command.
*
* @return mixed
*/
public function handle()
{
$users = User::whereNull('deleted_at')->whereNotNull('email')->with('assets', 'accessories', 'licenses')->get();
$count = 0;
foreach ($users as $user) {
if (($user->assets->count() > 0) || ($user->accessories->count() > 0) || ($user->licenses->count() > 0))
{
$count++;
$user->notify((new CurrentInventory($user)));
}
}
$this->info($count.' users notified.');
}
}

View File

@@ -2,17 +2,16 @@
namespace App\Console\Commands;
use App\Models\Asset;
use App\Models\Setting;
use Illuminate\Console\Command;
use App\Notifications\ExpectedCheckinNotification;
use App\Notifications\ExpectedCheckinAdminNotification;
use App\Notifications\ExpectedCheckinNotification;
use Carbon\Carbon;
use Illuminate\Console\Command;
use App\Models\Recipients\AlertRecipient;
class SendExpectedCheckinAlerts extends Command
{
/**
* The console command name.
*
@@ -29,8 +28,6 @@ class SendExpectedCheckinAlerts extends Command
/**
* Create a new command instance.
*
* @return void
*/
public function __construct()
{
@@ -44,15 +41,15 @@ class SendExpectedCheckinAlerts extends Command
*/
public function handle()
{
$settings = Setting::getSettings();
$settings = Setting::getSettings();
$whenNotify = Carbon::now()->addDays(7);
$assets = Asset::with('assignedTo')->whereNotNull('assigned_to')->whereNotNull('expected_checkin')->where('expected_checkin', '<=', $whenNotify)->get();
$assets = Asset::with('assignedTo')->whereNotNull('assigned_to')->whereNotNull('expected_checkin')->where('expected_checkin', '<=', $whenNotify)->get();
$this->info($whenNotify.' is deadline');
$this->info($assets->count().' assets');
$this->info($whenNotify . ' is deadline');
$this->info($assets->count() . ' assets');
foreach ($assets as $asset) {
if ($asset->assigned && $asset->checkedOutToUser()) {
if ($asset->assigned && $asset->checkedOutToUser()) {
$asset->assigned->notify((new ExpectedCheckinNotification($asset)));
}
}
@@ -60,14 +57,9 @@ class SendExpectedCheckinAlerts extends Command
if (($assets) && ($assets->count() > 0) && ($settings->alert_email != '')) {
// Send a rollup to the admin, if settings dictate
$recipients = collect(explode(',', $settings->alert_email))->map(function ($item, $key) {
return new \App\Models\Recipients\AlertRecipient($item);
return new AlertRecipient($item);
});
\Notification::send($recipients, new ExpectedCheckinAdminNotification($assets));
}
}
}

View File

@@ -4,16 +4,14 @@ namespace App\Console\Commands;
use App\Models\Asset;
use App\Models\License;
use App\Models\Recipients\AlertRecipient;
use App\Models\Setting;
use DB;
use App\Notifications\ExpiringLicenseNotification;
use App\Notifications\ExpiringAssetsNotification;
use App\Notifications\ExpiringLicenseNotification;
use Illuminate\Console\Command;
class SendExpirationAlerts extends Command
{
/**
* The console command name.
*
@@ -30,8 +28,6 @@ class SendExpirationAlerts extends Command
/**
* Create a new command instance.
*
* @return void
*/
public function __construct()
{
@@ -45,48 +41,35 @@ class SendExpirationAlerts extends Command
*/
public function handle()
{
$settings = Setting::getSettings();
$settings = Setting::getSettings();
$threshold = $settings->alert_interval;
if (($settings->alert_email != '') && ($settings->alerts_enabled == 1)) {
// Send a rollup to the admin, if settings dictate
$recipients = collect(explode(',', $settings->alert_email))->map(function ($item, $key) {
return new \App\Models\Recipients\AlertRecipient($item);
return new AlertRecipient($item);
});
// Expiring Assets
$assets = Asset::getExpiringWarrantee(Setting::getSettings()->alert_interval);
$assets = Asset::getExpiringWarrantee($threshold);
if ($assets->count() > 0) {
$this->info(trans_choice('mail.assets_warrantee_alert', $assets->count(),
['count' => $assets->count(), 'threshold' => $threshold]));
$this->info(trans_choice('mail.assets_warrantee_alert', $assets->count(), ['count' => $assets->count(), 'threshold' => $threshold]));
\Notification::send($recipients, new ExpiringAssetsNotification($assets, $threshold));
}
// Expiring licenses
$licenses = License::getExpiringLicenses($threshold);
if ($licenses->count() > 0) {
$this->info(trans_choice('mail.license_expiring_alert', $licenses->count(), ['count' => $licenses->count(), 'threshold' => $threshold]));
\Notification::send($recipients, new ExpiringLicenseNotification($licenses, $threshold));
}
} else {
if ($settings->alert_email=='') {
if ($settings->alert_email == '') {
$this->error('Could not send email. No alert email configured in settings');
} elseif ($settings->alerts_enabled!=1) {
} elseif (1 != $settings->alerts_enabled) {
$this->info('Alerts are disabled in the settings. No mail will be sent');
}
}
}
}

View File

@@ -2,13 +2,12 @@
namespace App\Console\Commands;
use App\Models\Setting;
use DB;
use Mail;
use App\Helpers\Helper;
use App\Models\Recipients\AlertRecipient;
use App\Models\Setting;
use App\Notifications\InventoryAlert;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\Notification;
class SendInventoryAlerts extends Command
{
@@ -28,8 +27,6 @@ class SendInventoryAlerts extends Command
/**
* Create a new command instance.
*
* @return void
*/
public function __construct()
{
@@ -45,29 +42,24 @@ class SendInventoryAlerts extends Command
{
$settings = Setting::getSettings();
if (($settings->alert_email!='') && ($settings->alerts_enabled==1)) {
if (($settings->alert_email != '') && ($settings->alerts_enabled == 1)) {
$items = Helper::checkLowInventory();
// Send a rollup to the admin, if settings dictate
if (($items) && (count($items) > 0)) {
$this->info(trans_choice('mail.low_inventory_alert', count($items)));
// Send a rollup to the admin, if settings dictate
$recipients = collect(explode(',', $settings->alert_email))->map(function ($item, $key) {
return new \App\Models\Recipients\AlertRecipient($item);
return new AlertRecipient($item);
});
\Notification::send($recipients, new InventoryAlert($items, $settings->alert_threshold));
}
} else {
if (Setting::getSettings()->alert_email=='') {
if ($settings->alert_email == '') {
$this->error('Could not send email. No alert email configured in settings');
} elseif (Setting::getSettings()->alerts_enabled!=1) {
} elseif (1 != $settings->alerts_enabled) {
$this->info('Alerts are disabled in the settings. No mail will be sent');
}
}
}
}

View File

@@ -2,8 +2,8 @@
namespace App\Console\Commands;
use Illuminate\Console\Command;
use App\Models\Asset;
use Illuminate\Console\Command;
class SyncAssetCounters extends Command
{

View File

@@ -2,10 +2,8 @@
namespace App\Console\Commands;
use App\Models\CustomField;
use Illuminate\Console\Command;
use App\Models\Asset;
use Illuminate\Support\Facades\Storage;
use Illuminate\Console\Command;
class SyncAssetLocations extends Command
{

View File

@@ -2,39 +2,14 @@
namespace App\Console;
use App\Console\Commands\ImportLocations;
use App\Console\Commands\ReEncodeCustomFieldNames;
use App\Console\Commands\RestoreDeletedUsers;
use Illuminate\Console\Scheduling\Schedule;
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
class Kernel extends ConsoleKernel
{
/**
* The Artisan commands provided by your application.
*
* @var array
*/
protected $commands = [
Commands\PaveIt::class,
Commands\CreateAdmin::class,
Commands\SendExpirationAlerts::class,
Commands\SendInventoryAlerts::class,
Commands\SendExpectedCheckinAlerts::class,
Commands\ObjectImportCommand::class,
Commands\Version::class,
Commands\SystemBackup::class,
Commands\DisableLDAP::class,
Commands\Purge::class,
Commands\LdapSync::class,
Commands\FixDoubleEscape::class,
Commands\RecryptFromMcrypt::class,
Commands\ResetDemoSettings::class,
Commands\SyncAssetLocations::class,
Commands\RegenerateAssetTags::class,
Commands\SyncAssetCounters::class,
Commands\RestoreDeletedUsers::class,
Commands\SendUpcomingAuditReport::class,
Commands\ImportLocations::class,
];
/**
* Define the application's command schedule.
@@ -44,7 +19,6 @@ class Kernel extends ConsoleKernel
*/
protected function schedule(Schedule $schedule)
{
$schedule->command('snipeit:inventory-alerts')->daily();
$schedule->command('snipeit:expiring-alerts')->daily();
$schedule->command('snipeit:expected-checkin')->daily();
@@ -53,6 +27,10 @@ class Kernel extends ConsoleKernel
$schedule->command('snipeit:upcoming-audits')->daily();
}
/**
* This method is required by Laravel to handle any console routes
* that are defined in routes/console.php.
*/
protected function commands()
{
require base_path('routes/console.php');

View File

@@ -0,0 +1,23 @@
<?php
namespace App\Events;
use App\Models\CheckoutAcceptance;
use App\Models\Contracts\Acceptable;
use Illuminate\Foundation\Events\Dispatchable;
use Illuminate\Queue\SerializesModels;
class CheckoutAccepted
{
use Dispatchable, SerializesModels;
/**
* Create a new event instance.
*
* @return void
*/
public function __construct(CheckoutAcceptance $acceptance)
{
$this->acceptance = $acceptance;
}
}

View File

@@ -0,0 +1,23 @@
<?php
namespace App\Events;
use App\Models\CheckoutAcceptance;
use App\Models\Contracts\Acceptable;
use Illuminate\Foundation\Events\Dispatchable;
use Illuminate\Queue\SerializesModels;
class CheckoutDeclined
{
use Dispatchable, SerializesModels;
/**
* Create a new event instance.
*
* @return void
*/
public function __construct(CheckoutAcceptance $acceptance)
{
$this->acceptance = $acceptance;
}
}

View File

@@ -0,0 +1,32 @@
<?php
namespace App\Events;
use App\Models\User;
use Illuminate\Foundation\Events\Dispatchable;
use Illuminate\Queue\SerializesModels;
class CheckoutableCheckedIn
{
use Dispatchable, SerializesModels;
public $checkoutable;
public $checkedOutTo;
public $checkedInBy;
public $note;
public $action_date; // Date setted in the hardware.checkin view at the checkin_at input, for the action log
/**
* Create a new event instance.
*
* @return void
*/
public function __construct($checkoutable, $checkedOutTo, User $checkedInBy, $note, $action_date = null)
{
$this->checkoutable = $checkoutable;
$this->checkedOutTo = $checkedOutTo;
$this->checkedInBy = $checkedInBy;
$this->note = $note;
$this->action_date = $action_date ?? date('Y-m-d');
}
}

View File

@@ -0,0 +1,30 @@
<?php
namespace App\Events;
use App\Models\User;
use Illuminate\Foundation\Events\Dispatchable;
use Illuminate\Queue\SerializesModels;
class CheckoutableCheckedOut
{
use Dispatchable, SerializesModels;
public $checkoutable;
public $checkedOutTo;
public $checkedOutBy;
public $note;
/**
* Create a new event instance.
*
* @return void
*/
public function __construct($checkoutable, $checkedOutTo, User $checkedOutBy, $note)
{
$this->checkoutable = $checkoutable;
$this->checkedOutTo = $checkedOutTo;
$this->checkedOutBy = $checkedOutBy;
$this->note = $note;
}
}

View File

@@ -3,6 +3,7 @@
namespace App\Exceptions;
use Exception;
class CheckoutNotAllowed extends Exception
{

View File

@@ -9,6 +9,7 @@ use App\Helpers\Helper;
use Illuminate\Validation\ValidationException;
use Log;
class Handler extends ExceptionHandler
{
/**
@@ -24,6 +25,7 @@ class Handler extends ExceptionHandler
\Illuminate\Session\TokenMismatchException::class,
\Illuminate\Validation\ValidationException::class,
\Intervention\Image\Exception\NotSupportedException::class,
\League\OAuth2\Server\Exception\OAuthServerException::class,
];
/**
@@ -37,7 +39,7 @@ class Handler extends ExceptionHandler
public function report(Exception $exception)
{
if ($this->shouldReport($exception)) {
Log::error($exception);
\Log::error($exception);
return parent::report($exception);
}
}
@@ -67,10 +69,6 @@ class Handler extends ExceptionHandler
return response()->json(Helper::formatStandardApiResponse('error', null, $className . ' not found'), 200);
}
if ($e instanceof \Illuminate\Validation\ValidationException) {
return response()->json(Helper::formatStandardApiResponse('error', null, $e->response['messages'], 400));
}
if ($this->isHttpException($e)) {
$statusCode = $e->getStatusCode();
@@ -85,11 +83,6 @@ class Handler extends ExceptionHandler
}
}
// Try to parse 500 Errors in a bit nicer way when debug is enabled.
if (config('app.debug')) {
return response()->json(Helper::formatStandardApiResponse('error', null, "An Error has occured! " . $e->getMessage()), 500);
}
}
@@ -113,7 +106,7 @@ class Handler extends ExceptionHandler
protected function unauthenticated($request, AuthenticationException $exception)
{
if ($request->expectsJson()) {
return response()->json(['error' => 'Unauthorized.'], 401);
return response()->json(['error' => 'Unauthorized or unauthenticated.'], 401);
}
return redirect()->guest('login');
@@ -128,6 +121,6 @@ class Handler extends ExceptionHandler
*/
protected function invalidJson($request, ValidationException $exception)
{
return response()->json($exception->errors(), $exception->status);
return response()->json(Helper::formatStandardApiResponse('error', null, $exception->errors(), 400));
}
}

View File

@@ -1,25 +1,16 @@
<?php
namespace App\Helpers;
use DB;
use App\Models\Statuslabel;
use App\Models\Location;
use App\Models\Department;
use App\Models\AssetModel;
use App\Models\Company;
use App\Models\User;
use App\Models\Manufacturer;
use App\Models\Supplier;
use App\Models\Category;
use App\Models\Depreciation;
use App\Models\CustomFieldset;
use App\Models\CustomField;
use App\Models\Component;
use App\Models\Accessory;
use App\Models\Component;
use App\Models\Consumable;
use App\Models\Asset;
use App\Models\CustomField;
use App\Models\CustomFieldset;
use App\Models\Depreciation;
use App\Models\Setting;
use App\Models\Statuslabel;
use Crypt;
use Image;
use Illuminate\Contracts\Encryption\DecryptException;
class Helper
@@ -64,27 +55,313 @@ class Helper
/**
* Static colors for pie charts.
* This is inelegant, and could be refactored later.
*
* @author [A. Gianotto] [<snipe@snipe.net>]
* @since [v3.3]
* @return Array
*/
public static function chartColors()
public static function defaultChartColors($index = 0)
{
$colors = [
'#f56954',
'#00a65a',
'#f39c12',
'#00c0ef',
'#3c8dbc',
'#d2d6de',
'#3c8dbc',
'#3c8dbc',
'#3c8dbc',
"#008941",
"#FF4A46",
"#006FA6",
"#A30059",
"#1CE6FF",
"#FFDBE5",
"#7A4900",
"#0000A6",
"#63FFAC",
"#B79762",
"#004D43",
"#8FB0FF",
"#997D87",
"#5A0007",
"#809693",
"#FEFFE6",
"#1B4400",
"#4FC601",
"#3B5DFF",
"#4A3B53",
"#FF2F80",
"#61615A",
"#BA0900",
"#6B7900",
"#00C2A0",
"#FFAA92",
"#FF90C9",
"#B903AA",
"#D16100",
"#DDEFFF",
"#000035",
"#7B4F4B",
"#A1C299",
"#300018",
"#0AA6D8",
"#013349",
"#00846F",
"#372101",
"#FFB500",
"#C2FFED",
"#A079BF",
"#CC0744",
"#C0B9B2",
"#C2FF99",
"#001E09",
"#00489C",
"#6F0062",
"#0CBD66",
"#EEC3FF",
"#456D75",
"#B77B68",
"#7A87A1",
"#788D66",
"#885578",
"#FAD09F",
"#FF8A9A",
"#D157A0",
"#BEC459",
"#456648",
"#0086ED",
"#886F4C",
"#34362D",
"#B4A8BD",
"#00A6AA",
"#452C2C",
"#636375",
"#A3C8C9",
"#FF913F",
"#938A81",
"#575329",
"#00FECF",
"#B05B6F",
"#8CD0FF",
"#3B9700",
"#04F757",
"#C8A1A1",
"#1E6E00",
"#7900D7",
"#A77500",
"#6367A9",
"#A05837",
"#6B002C",
"#772600",
"#D790FF",
"#9B9700",
"#549E79",
"#FFF69F",
"#201625",
"#72418F",
"#BC23FF",
"#99ADC0",
"#3A2465",
"#922329",
"#5B4534",
"#FDE8DC",
"#404E55",
"#0089A3",
"#CB7E98",
"#A4E804",
"#324E72",
"#6A3A4C",
"#83AB58",
"#001C1E",
"#D1F7CE",
"#004B28",
"#C8D0F6",
"#A3A489",
"#806C66",
"#222800",
"#BF5650",
"#E83000",
"#66796D",
"#DA007C",
"#FF1A59",
"#8ADBB4",
"#1E0200",
"#5B4E51",
"#C895C5",
"#320033",
"#FF6832",
"#66E1D3",
"#CFCDAC",
"#D0AC94",
"#7ED379",
"#012C58",
"#7A7BFF",
"#D68E01",
"#353339",
"#78AFA1",
"#FEB2C6",
"#75797C",
"#837393",
"#943A4D",
"#B5F4FF",
"#D2DCD5",
"#9556BD",
"#6A714A",
"#001325",
"#02525F",
"#0AA3F7",
"#E98176",
"#DBD5DD",
"#5EBCD1",
"#3D4F44",
"#7E6405",
"#02684E",
"#962B75",
"#8D8546",
"#9695C5",
"#E773CE",
"#D86A78",
"#3E89BE",
"#CA834E",
"#518A87",
"#5B113C",
"#55813B",
"#E704C4",
"#00005F",
"#A97399",
"#4B8160",
"#59738A",
"#FF5DA7",
"#F7C9BF",
"#643127",
"#513A01",
"#6B94AA",
"#51A058",
"#A45B02",
"#1D1702",
"#E20027",
"#E7AB63",
"#4C6001",
"#9C6966",
"#64547B",
"#97979E",
"#006A66",
"#391406",
"#F4D749",
"#0045D2",
"#006C31",
"#DDB6D0",
"#7C6571",
"#9FB2A4",
"#00D891",
"#15A08A",
"#BC65E9",
"#FFFFFE",
"#C6DC99",
"#203B3C",
"#671190",
"#6B3A64",
"#F5E1FF",
"#FFA0F2",
"#CCAA35",
"#374527",
"#8BB400",
"#797868",
"#C6005A",
"#3B000A",
"#C86240",
"#29607C",
"#402334",
"#7D5A44",
"#CCB87C",
"#B88183",
"#AA5199",
"#B5D6C3",
"#A38469",
"#9F94F0",
"#A74571",
"#B894A6",
"#71BB8C",
"#00B433",
"#789EC9",
"#6D80BA",
"#953F00",
"#5EFF03",
"#E4FFFC",
"#1BE177",
"#BCB1E5",
"#76912F",
"#003109",
"#0060CD",
"#D20096",
"#895563",
"#29201D",
"#5B3213",
"#A76F42",
"#89412E",
"#1A3A2A",
"#494B5A",
"#A88C85",
"#F4ABAA",
"#A3F3AB",
"#00C6C8",
"#EA8B66",
"#958A9F",
"#BDC9D2",
"#9FA064",
"#BE4700",
"#658188",
"#83A485",
"#453C23",
"#47675D",
"#3A3F00",
"#061203",
"#DFFB71",
"#868E7E",
"#98D058",
"#6C8F7D",
"#D7BFC2",
"#3C3E6E",
"#D83D66",
"#2F5D9B",
"#6C5E46",
"#D25B88",
"#5B656C",
"#00B57F",
"#545C46",
"#866097",
"#365D25",
"#252F99",
"#00CCFF",
"#674E60",
"#FC009C",
"#92896B",
];
return $colors;
return $colors[$index];
}
/**
* Increases or decreases the brightness of a color by a percentage of the current brightness.
*
* @param string $hexCode Supported formats: `#FFF`, `#FFFFFF`, `FFF`, `FFFFFF`
* @param float $adjustPercent A number between -1 and 1. E.g. 0.3 = 30% lighter; -0.4 = 40% darker.
*
* @return string
*/
public static function adjustBrightness($hexCode, $adjustPercent) {
$hexCode = ltrim($hexCode, '#');
if (strlen($hexCode) == 3) {
$hexCode = $hexCode[0] . $hexCode[0] . $hexCode[1] . $hexCode[1] . $hexCode[2] . $hexCode[2];
}
$hexCode = array_map('hexdec', str_split($hexCode, 2));
foreach ($hexCode as & $color) {
$adjustableLimit = $adjustPercent < 0 ? $color : 255 - $color;
$adjustAmount = ceil($adjustableLimit * $adjustPercent);
$color = str_pad(dechex($color + $adjustAmount), 2, '0', STR_PAD_LEFT);
}
return '#' . implode($hexCode);
}
@@ -151,6 +428,26 @@ class Helper
return $statuslabel_list;
}
/**
* Get the list of deployable status labels in an array to make a dropdown menu
*
* @todo This should probably be a selectlist, same as the other endpoints
* and we should probably add to the API controllers to make sure that
* the status_id submitted is actually really deployable.
*
* @author [A. Gianotto] [<snipe@snipe.net>]
* @since [v5.1.0]
* @return Array
*/
public static function deployableStatusLabelList()
{
$statuslabel_list = Statuslabel::where('deployable', '=', '1')->orderBy('default_label', 'desc')
->orderBy('name','asc')
->orderBy('deployable','desc')
->pluck('name', 'id')->toArray();
return $statuslabel_list;
}
/**
* Get the list of status label types in an array to make a dropdown menu
*
@@ -225,8 +522,9 @@ class Helper
*/
public static function predefined_formats()
{
$keys = array_keys(CustomField::$PredefinedFormats);
$keys = array_keys(CustomField::PREDEFINED_FORMATS);
$stuff = array_combine($keys, $keys);
return $stuff;
}
@@ -476,10 +774,9 @@ class Helper
/**
* Gracefully handle decrypting the legacy data (encrypted via mcrypt) and use the new
* decryption method instead.
* Gracefully handle decrypting encrypted fields (custom fields, etc).
*
* This is not currently used, but will be.
* @todo allow this to handle more than just strings (arrays, etc)
*
* @author A. Gianotto
* @since 3.6
@@ -614,38 +911,32 @@ class Helper
$extension = substr(strrchr($filename,'.'),1);
if ($extension) {
switch ($extension) {
case 'jpg':
case 'jpeg':
case 'gif':
case 'png':
return "fa fa-file-image-o";
break;
case 'doc':
case 'docx':
return "fa fa-file-word-o";
break;
case 'xls':
case 'xlsx':
return "fa fa-file-excel-o";
break;
case 'zip':
case 'rar':
return "fa fa-file-archive-o";
break;
case 'pdf':
return "fa fa-file-pdf-o";
break;
case 'txt':
return "fa fa-file-text-o";
break;
case 'lic':
return "fa fa-floppy-o";
break;
default:
return "fa fa-file-o";
}
$allowedExtensionMap = [
// Images
'jpg' => 'fa fa-file-image-o',
'jpeg' => 'fa fa-file-image-o',
'gif' => 'fa fa-file-image-o',
'png' => 'fa fa-file-image-o',
// word
'doc' => 'fa fa-file-word-o',
'docx' => 'fa fa-file-word-o',
// Excel
'xls' => 'fa fa-file-excel-o',
'xlsx' => 'fa fa-file-excel-o',
// archive
'zip' => 'fa fa-file-archive-o',
'rar' => 'fa fa-file-archive-o',
//Text
'txt' => 'fa fa-file-text-o',
'rtf' => 'fa fa-file-text-o',
'xml' => 'fa fa-file-text-o',
// Misc
'pdf' => 'fa fa-file-pdf-o',
'lic' => 'fa fa-file-floppy-o',
];
if ($extension && array_key_exists($extension, $allowedExtensionMap)) {
return $allowedExtensionMap[$extension];
}
return "fa fa-file-o";
}
@@ -669,7 +960,80 @@ class Helper
return false;
}
/**
* Generate a random encrypted password.
*
* @author Wes Hulette <jwhulette@gmail.com>
*
* @since 5.0.0
*
* @return string
*/
public static function generateEncyrptedPassword(): string
{
return bcrypt(Helper::generateUnencryptedPassword());
}
/**
* Get a random unencrypted password.
*
* @author Steffen Buehl <sb@sbuehl.com>
*
* @since 5.0.0
*
* @return string
*/
public static function generateUnencryptedPassword(): string
{
$chars = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
$password = '';
for ( $i = 0; $i < 20; $i++ ) {
$password .= substr( $chars, random_int( 0, strlen( $chars ) - 1 ), 1 );
}
return $password;
}
/**
* Process base64 encoded image data and save it on supplied path
*
* @param string $image_data base64 encoded image data with mime type
* @param string $save_path path to a folder where the image should be saved
* @return string path to uploaded image or false if something went wrong
*/
public static function processUploadedImage(String $image_data, String $save_path) {
if ($image_data == null || $save_path == null) {
return false;
}
// After modification, the image is prefixed by mime info like the following:
// data:image/jpeg;base64,; This causes the image library to be unhappy, so we need to remove it.
$header = explode(';', $image_data, 2)[0];
// Grab the image type from the header while we're at it.
$extension = substr($header, strpos($header, '/')+1);
// Start reading the image after the first comma, postceding the base64.
$image = substr($image_data, strpos($image_data, ',')+1);
$file_name = str_random(25).".".$extension;
$directory= public_path($save_path);
// Check if the uploads directory exists. If not, try to create it.
if (!file_exists($directory)) {
mkdir($directory, 0755, true);
}
$path = public_path($save_path.$file_name);
try {
Image::make($image)->resize(500, 500, function ($constraint) {
$constraint->aspectRatio();
$constraint->upsize();
})->save($path);
} catch (\Exception $e) {
return false;
}
return $file_name;
}
}

View File

@@ -0,0 +1,23 @@
<?php
namespace App\Helpers;
use Illuminate\Support\Facades\Storage;
class StorageHelper
{
static function downloader($filename, $disk = 'default') {
if($disk == 'default') {
$disk = config('filesystems.default');
}
switch(config("filesystems.disks.$disk.driver")) {
case 'local':
return response()->download(Storage::disk($disk)->path($filename)); //works for PRIVATE or public?!
case 's3':
return redirect()->away(Storage::disk($disk)->temporaryUrl($filename, now()->addMinutes(5))); //works for private or public, I guess?
default:
return Storage::disk($disk)->download($filename);
}
}
}

View File

@@ -0,0 +1,207 @@
<?php
namespace App\Http\Controllers\Accessories;
use App\Helpers\Helper;
use App\Http\Controllers\Controller;
use App\Http\Requests\ImageUploadRequest;
use App\Models\Accessory;
use App\Models\Company;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Storage;
use Redirect;
/** This controller handles all actions related to Accessories for
* the Snipe-IT Asset Management application.
*
* @version v1.0
*/
class AccessoriesController extends Controller
{
/**
* Returns a view that invokes the ajax tables which actually contains
* the content for the accessories listing, which is generated in getDatatable.
*
* @author [A. Gianotto] [<snipe@snipe.net>]
* @see AccessoriesController::getDatatable() method that generates the JSON response
* @since [v1.0]
* @return View
* @throws \Illuminate\Auth\Access\AuthorizationException
*/
public function index()
{
$this->authorize('index', Accessory::class);
return view('accessories/index');
}
/**
* Returns a view with a form to create a new Accessory.
*
* @author [A. Gianotto] [<snipe@snipe.net>]
* @return View
* @throws \Illuminate\Auth\Access\AuthorizationException
*/
public function create()
{
$this->authorize('create', Accessory::class);
$category_type = 'accessory';
return view('accessories/edit')->with('category_type', $category_type)
->with('item', new Accessory);
}
/**
* Validate and save new Accessory from form post
*
* @author [A. Gianotto] [<snipe@snipe.net>]
* @param ImageUploadRequest $request
* @return Redirect
* @throws \Illuminate\Auth\Access\AuthorizationException
*/
public function store(ImageUploadRequest $request)
{
$this->authorize(Accessory::class);
// create a new model instance
$accessory = new Accessory();
// Update the accessory data
$accessory->name = request('name');
$accessory->category_id = request('category_id');
$accessory->location_id = request('location_id');
$accessory->min_amt = request('min_amt');
$accessory->company_id = Company::getIdForCurrentUser(request('company_id'));
$accessory->order_number = request('order_number');
$accessory->manufacturer_id = request('manufacturer_id');
$accessory->model_number = request('model_number');
$accessory->purchase_date = request('purchase_date');
$accessory->purchase_cost = Helper::ParseFloat(request('purchase_cost'));
$accessory->qty = request('qty');
$accessory->user_id = Auth::user()->id;
$accessory->supplier_id = request('supplier_id');
$accessory = $request->handleImages($accessory);
// Was the accessory created?
if ($accessory->save()) {
// Redirect to the new accessory page
return redirect()->route('accessories.index')->with('success', trans('admin/accessories/message.create.success'));
}
return redirect()->back()->withInput()->withErrors($accessory->getErrors());
}
/**
* Return view for the Accessory update form, prepopulated with existing data
*
* @author [A. Gianotto] [<snipe@snipe.net>]
* @param int $accessoryId
* @return View
* @throws \Illuminate\Auth\Access\AuthorizationException
*/
public function edit($accessoryId = null)
{
if ($item = Accessory::find($accessoryId)) {
$this->authorize($item);
return view('accessories/edit', compact('item'))->with('category_type', 'accessory');
}
return redirect()->route('accessories.index')->with('error', trans('admin/accessories/message.does_not_exist'));
}
/**
* Save edited Accessory from form post
*
* @author [A. Gianotto] [<snipe@snipe.net>]
* @param ImageUploadRequest $request
* @param int $accessoryId
* @return Redirect
* @throws \Illuminate\Auth\Access\AuthorizationException
*/
public function update(ImageUploadRequest $request, $accessoryId = null)
{
if (is_null($accessory = Accessory::find($accessoryId))) {
return redirect()->route('accessories.index')->with('error', trans('admin/accessories/message.does_not_exist'));
}
$this->authorize($accessory);
// Update the accessory data
$accessory->name = request('name');
$accessory->location_id = request('location_id');
$accessory->min_amt = request('min_amt');
$accessory->category_id = request('category_id');
$accessory->company_id = Company::getIdForCurrentUser(request('company_id'));
$accessory->manufacturer_id = request('manufacturer_id');
$accessory->order_number = request('order_number');
$accessory->model_number = request('model_number');
$accessory->purchase_date = request('purchase_date');
$accessory->purchase_cost = request('purchase_cost');
$accessory->qty = request('qty');
$accessory->supplier_id = request('supplier_id');
$accessory = $request->handleImages($accessory);
// Was the accessory updated?
if ($accessory->save()) {
return redirect()->route('accessories.index')->with('success', trans('admin/accessories/message.update.success'));
}
return redirect()->back()->withInput()->withErrors($accessory->getErrors());
}
/**
* Delete the given accessory.
*
* @author [A. Gianotto] [<snipe@snipe.net>]
* @param int $accessoryId
* @return Redirect
* @throws \Illuminate\Auth\Access\AuthorizationException
*/
public function destroy($accessoryId)
{
if (is_null($accessory = Accessory::find($accessoryId))) {
return redirect()->route('accessories.index')->with('error', trans('admin/accessories/message.not_found'));
}
$this->authorize($accessory);
if ($accessory->hasUsers() > 0) {
return redirect()->route('accessories.index')->with('error', trans('admin/accessories/message.assoc_users', array('count'=> $accessory->hasUsers())));
}
if ($accessory->image) {
try {
Storage::disk('public')->delete('accessories'.'/'.$accessory->image);
} catch (\Exception $e) {
\Log::debug($e);
}
}
$accessory->delete();
return redirect()->route('accessories.index')->with('success', trans('admin/accessories/message.delete.success'));
}
/**
* Returns a view that invokes the ajax table which contains
* the content for the accessory detail view, which is generated in getDataView.
*
* @author [A. Gianotto] [<snipe@snipe.net>]
* @param int $accessoryID
* @see AccessoriesController::getDataView() method that generates the JSON response
* @since [v1.0]
* @return View
* @throws \Illuminate\Auth\Access\AuthorizationException
*/
public function show($accessoryID = null)
{
$accessory = Accessory::find($accessoryID);
$this->authorize('view', $accessory);
if (isset($accessory->id)) {
return view('accessories/view', compact('accessory'));
}
return redirect()->route('accessories.index')->with('error', trans('admin/accessories/message.does_not_exist', ['id' => $accessoryID]));
}
}

View File

@@ -0,0 +1,78 @@
<?php
namespace App\Http\Controllers\Accessories;
use App\Events\CheckoutableCheckedIn;
use App\Http\Controllers\Controller;
use App\Models\Accessory;
use App\Models\User;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\DB;
class AccessoryCheckinController extends Controller
{
/**
* Check the accessory back into inventory
*
* @author [A. Gianotto] [<snipe@snipe.net>]
* @param Request $request
* @param integer $accessoryUserId
* @param string $backto
* @return View
* @internal param int $accessoryId
* @throws \Illuminate\Auth\Access\AuthorizationException
*/
public function create($accessoryUserId = null, $backto = null)
{
// Check if the accessory exists
if (is_null($accessory_user = DB::table('accessories_users')->find($accessoryUserId))) {
// Redirect to the accessory management page with error
return redirect()->route('accessories.index')->with('error', trans('admin/accessories/message.not_found'));
}
$accessory = Accessory::find($accessory_user->accessory_id);
$this->authorize('checkin', $accessory);
return view('accessories/checkin', compact('accessory'))->with('backto', $backto);
}
/**
* Check in the item so that it can be checked out again to someone else
*
* @uses Accessory::checkin_email() to determine if an email can and should be sent
* @author [A. Gianotto] [<snipe@snipe.net>]
* @param null $accessoryUserId
* @param string $backto
* @return Redirect
* @throws \Illuminate\Auth\Access\AuthorizationException
* @internal param int $accessoryId
*/
public function store(Request $request, $accessoryUserId = null, $backto = null)
{
// Check if the accessory exists
if (is_null($accessory_user = DB::table('accessories_users')->find($accessoryUserId))) {
// Redirect to the accessory management page with error
return redirect()->route('accessories.index')->with('error', trans('admin/accessories/message.does_not_exist'));
}
$accessory = Accessory::find($accessory_user->accessory_id);
$this->authorize('checkin', $accessory);
$checkin_at = date('Y-m-d');
if($request->filled('checkin_at')){
$checkin_at = $request->input('checkin_at');
}
// Was the accessory updated?
if (DB::table('accessories_users')->where('id', '=', $accessory_user->id)->delete()) {
$return_to = e($accessory_user->assigned_to);
event(new CheckoutableCheckedIn($accessory, User::find($return_to), Auth::user(), $request->input('note'), $checkin_at));
return redirect()->route("accessories.show", $accessory->id)->with('success', trans('admin/accessories/message.checkin.success'));
}
// Redirect to the accessory management page with error
return redirect()->route('accessories.index')->with('error', trans('admin/accessories/message.checkin.error'));
}
}

View File

@@ -0,0 +1,89 @@
<?php
namespace App\Http\Controllers\Accessories;
use App\Events\CheckoutableCheckedOut;
use App\Http\Controllers\Controller;
use App\Models\Accessory;
use App\Models\User;
use Carbon\Carbon;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Input;
class AccessoryCheckoutController extends Controller
{
/**
* Return the form to checkout an Accessory to a user.
*
* @author [A. Gianotto] [<snipe@snipe.net>]
* @param int $accessoryId
* @return View
* @throws \Illuminate\Auth\Access\AuthorizationException
*/
public function create($accessoryId)
{
// Check if the accessory exists
if (is_null($accessory = Accessory::find($accessoryId))) {
// Redirect to the accessory management page with error
return redirect()->route('accessories.index')->with('error', trans('admin/accessories/message.not_found'));
}
if ($accessory->category) {
$this->authorize('checkout', $accessory);
// Get the dropdown of users and then pass it to the checkout view
return view('accessories/checkout', compact('accessory'));
}
return redirect()->back()->with('error', 'The category type for this accessory is not valid. Edit the accessory and select a valid accessory category.');
}
/**
* Save the Accessory checkout information.
*
* If Slack is enabled and/or asset acceptance is enabled, it will also
* trigger a Slack message and send an email.
*
* @author [A. Gianotto] [<snipe@snipe.net>]
* @param Request $request
* @param int $accessoryId
* @return Redirect
* @throws \Illuminate\Auth\Access\AuthorizationException
*/
public function store(Request $request, $accessoryId)
{
// Check if the accessory exists
if (is_null($accessory = Accessory::find($accessoryId))) {
// Redirect to the accessory management page with error
return redirect()->route('accessories.index')->with('error', trans('admin/accessories/message.user_not_found'));
}
$this->authorize('checkout', $accessory);
if (!$user = User::find($request->input('assigned_to'))) {
return redirect()->route('checkout/accessory', $accessory->id)->with('error', trans('admin/accessories/message.checkout.user_does_not_exist'));
}
// Update the accessory data
$accessory->assigned_to = e($request->input('assigned_to'));
$accessory->users()->attach($accessory->id, [
'accessory_id' => $accessory->id,
'created_at' => Carbon::now(),
'user_id' => Auth::id(),
'assigned_to' => $request->get('assigned_to'),
'note' => $request->input('note')
]);
DB::table('accessories_users')->where('assigned_to', '=', $accessory->assigned_to)->where('accessory_id', '=', $accessory->id)->first();
event(new CheckoutableCheckedOut($accessory, $user, Auth::user(), $request->input('note')));
// Redirect to the new accessory page
return redirect()->route('accessories.index')->with('success', trans('admin/accessories/message.checkout.success'));
}
}

View File

@@ -1,400 +0,0 @@
<?php
namespace App\Http\Controllers;
use App\Helpers\Helper;
use App\Models\Accessory;
use App\Models\Company;
use App\Models\User;
use Auth;
use Carbon\Carbon;
use Config;
use DB;
use Gate;
use Input;
use Lang;
use Redirect;
use Illuminate\Http\Request;
use Slack;
use Str;
use View;
use Image;
use App\Http\Requests\ImageUploadRequest;
/** This controller handles all actions related to Accessories for
* the Snipe-IT Asset Management application.
*
* @version v1.0
*/
class AccessoriesController extends Controller
{
/**
* Returns a view that invokes the ajax tables which actually contains
* the content for the accessories listing, which is generated in getDatatable.
*
* @author [A. Gianotto] [<snipe@snipe.net>]
* @see AccessoriesController::getDatatable() method that generates the JSON response
* @since [v1.0]
* @return View
*/
public function index(Request $request)
{
$this->authorize('index', Accessory::class);
return view('accessories/index');
}
/**
* Returns a view with a form to create a new Accessory.
*
* @author [A. Gianotto] [<snipe@snipe.net>]
* @return View
*/
public function create(Request $request)
{
$this->authorize('create', Accessory::class);
$category_type = 'accessory';
return view('accessories/edit')->with('category_type', $category_type)
->with('item', new Accessory);
}
/**
* Validate and save new Accessory from form post
*
* @author [A. Gianotto] [<snipe@snipe.net>]
* @return Redirect
*/
public function store(ImageUploadRequest $request)
{
$this->authorize(Accessory::class);
// create a new model instance
$accessory = new Accessory();
// Update the accessory data
$accessory->name = request('name');
$accessory->category_id = request('category_id');
$accessory->location_id = request('location_id');
$accessory->min_amt = request('min_amt');
$accessory->company_id = Company::getIdForCurrentUser(request('company_id'));
$accessory->order_number = request('order_number');
$accessory->manufacturer_id = request('manufacturer_id');
$accessory->model_number = request('model_number');
$accessory->purchase_date = request('purchase_date');
$accessory->purchase_cost = Helper::ParseFloat(request('purchase_cost'));
$accessory->qty = request('qty');
$accessory->user_id = Auth::user()->id;
$accessory->supplier_id = request('supplier_id');
if ($request->hasFile('image')) {
if (!config('app.lock_passwords')) {
$image = $request->file('image');
$ext = $image->getClientOriginalExtension();
$file_name = "accessory-".str_random(18).'.'.$ext;
$path = public_path('/uploads/accessories');
if ($image->getClientOriginalExtension()!='svg') {
Image::make($image->getRealPath())->resize(null, 800, function ($constraint) {
$constraint->aspectRatio();
$constraint->upsize();
})->save($path.'/'.$file_name);
} else {
$image->move($path, $file_name);
}
$accessory->image = $file_name;
}
}
// Was the accessory created?
if ($accessory->save()) {
// Redirect to the new accessory page
return redirect()->route('accessories.index')->with('success', trans('admin/accessories/message.create.success'));
}
return redirect()->back()->withInput()->withErrors($accessory->getErrors());
}
/**
* Return view for the Accessory update form, prepopulated with existing data
*
* @author [A. Gianotto] [<snipe@snipe.net>]
* @param int $accessoryId
* @return View
*/
public function edit(Request $request, $accessoryId = null)
{
if ($item = Accessory::find($accessoryId)) {
$this->authorize($item);
$category_type = 'accessory';
return view('accessories/edit', compact('item'))->with('category_type', $category_type);
}
return redirect()->route('accessories.index')->with('error', trans('admin/accessories/message.does_not_exist'));
}
/**
* Save edited Accessory from form post
*
* @author [A. Gianotto] [<snipe@snipe.net>]
* @param int $accessoryId
* @return Redirect
*/
public function update(ImageUploadRequest $request, $accessoryId = null)
{
if (is_null($accessory = Accessory::find($accessoryId))) {
return redirect()->route('accessories.index')->with('error', trans('admin/accessories/message.does_not_exist'));
}
$this->authorize($accessory);
// Update the accessory data
$accessory->name = request('name');
$accessory->location_id = request('location_id');
$accessory->min_amt = request('min_amt');
$accessory->category_id = request('category_id');
$accessory->company_id = Company::getIdForCurrentUser(request('company_id'));
$accessory->manufacturer_id = request('manufacturer_id');
$accessory->order_number = request('order_number');
$accessory->model_number = request('model_number');
$accessory->purchase_date = request('purchase_date');
$accessory->purchase_cost = request('purchase_cost');
$accessory->qty = request('qty');
$accessory->supplier_id = request('supplier_id');
if ($request->hasFile('image')) {
if (!config('app.lock_passwords')) {
$image = $request->file('image');
$ext = $image->getClientOriginalExtension();
$file_name = "accessory-".str_random(18).'.'.$ext;
$path = public_path('/uploads/accessories');
if ($image->getClientOriginalExtension()!='svg') {
Image::make($image->getRealPath())->resize(null, 800, function ($constraint) {
$constraint->aspectRatio();
$constraint->upsize();
})->save($path.'/'.$file_name);
} else {
$image->move($path, $file_name);
}
if (($accessory->image) && (file_exists($path.'/'.$accessory->image))) {
unlink($path.'/'.$accessory->image);
}
$accessory->image = $file_name;
}
}
// Was the accessory updated?
if ($accessory->save()) {
return redirect()->route('accessories.index')->with('success', trans('admin/accessories/message.update.success'));
}
return redirect()->back()->withInput()->withErrors($accessory->getErrors());
}
/**
* Delete the given accessory.
*
* @author [A. Gianotto] [<snipe@snipe.net>]
* @param int $accessoryId
* @return Redirect
*/
public function destroy(Request $request, $accessoryId)
{
if (is_null($accessory = Accessory::find($accessoryId))) {
return redirect()->route('accessories.index')->with('error', trans('admin/accessories/message.not_found'));
}
$this->authorize($accessory);
if ($accessory->hasUsers() > 0) {
return redirect()->route('accessories.index')->with('error', trans('admin/accessories/message.assoc_users', array('count'=> $accessory->hasUsers())));
}
$accessory->delete();
return redirect()->route('accessories.index')->with('success', trans('admin/accessories/message.delete.success'));
}
/**
* Returns a view that invokes the ajax table which contains
* the content for the accessory detail view, which is generated in getDataView.
*
* @author [A. Gianotto] [<snipe@snipe.net>]
* @param int $accessoryID
* @see AccessoriesController::getDataView() method that generates the JSON response
* @since [v1.0]
* @return View
*/
public function show(Request $request, $accessoryID = null)
{
$accessory = Accessory::find($accessoryID);
$this->authorize('view', $accessory);
if (isset($accessory->id)) {
return view('accessories/view', compact('accessory'));
}
return redirect()->route('accessories.index')->with('error', trans('admin/accessories/message.does_not_exist', compact('id')));
}
/**
* Return the form to checkout an Accessory to a user.
*
* @author [A. Gianotto] [<snipe@snipe.net>]
* @param int $accessoryId
* @return View
*/
public function getCheckout(Request $request, $accessoryId)
{
// Check if the accessory exists
if (is_null($accessory = Accessory::find($accessoryId))) {
// Redirect to the accessory management page with error
return redirect()->route('accessories.index')->with('error', trans('admin/accessories/message.not_found'));
}
if ($accessory->category) {
$this->authorize('checkout', $accessory);
// Get the dropdown of users and then pass it to the checkout view
return view('accessories/checkout', compact('accessory'));
}
return redirect()->back()->with('error', 'The category type for this accessory is not valid. Edit the accessory and select a valid accessory category.');
}
/**
* Save the Accessory checkout information.
*
* If Slack is enabled and/or asset acceptance is enabled, it will also
* trigger a Slack message and send an email.
*
* @author [A. Gianotto] [<snipe@snipe.net>]
* @param int $accessoryId
* @return Redirect
*/
public function postCheckout(Request $request, $accessoryId)
{
// Check if the accessory exists
if (is_null($accessory = Accessory::find($accessoryId))) {
// Redirect to the accessory management page with error
return redirect()->route('accessories.index')->with('error', trans('admin/accessories/message.user_not_found'));
}
$this->authorize('checkout', $accessory);
if (!$user = User::find(Input::get('assigned_to'))) {
return redirect()->route('checkout/accessory', $accessory->id)->with('error', trans('admin/accessories/message.checkout.user_does_not_exist'));
}
// Update the accessory data
$accessory->assigned_to = e(Input::get('assigned_to'));
$accessory->users()->attach($accessory->id, [
'accessory_id' => $accessory->id,
'created_at' => Carbon::now(),
'user_id' => Auth::id(),
'assigned_to' => $request->get('assigned_to')
]);
$logaction = $accessory->logCheckout(e(Input::get('note')), $user);
DB::table('accessories_users')->where('assigned_to', '=', $accessory->assigned_to)->where('accessory_id', '=', $accessory->id)->first();
$data['log_id'] = $logaction->id;
$data['eula'] = $accessory->getEula();
$data['first_name'] = $user->first_name;
$data['item_name'] = $accessory->name;
$data['checkout_date'] = $logaction->created_at;
$data['item_tag'] = '';
$data['expected_checkin'] = '';
$data['note'] = $logaction->note;
$data['require_acceptance'] = $accessory->requireAcceptance();
// Redirect to the new accessory page
return redirect()->route('accessories.index')->with('success', trans('admin/accessories/message.checkout.success'));
}
/**
* Check the accessory back into inventory
*
* @author [A. Gianotto] [<snipe@snipe.net>]
* @param Request $request
* @param integer $accessoryUserId
* @param string $backto
* @return View
* @internal param int $accessoryId
*/
public function getCheckin(Request $request, $accessoryUserId = null, $backto = null)
{
// Check if the accessory exists
if (is_null($accessory_user = DB::table('accessories_users')->find($accessoryUserId))) {
// Redirect to the accessory management page with error
return redirect()->route('accessories.index')->with('error', trans('admin/accessories/message.not_found'));
}
$accessory = Accessory::find($accessory_user->accessory_id);
$this->authorize('checkin', $accessory);
return view('accessories/checkin', compact('accessory'))->with('backto', $backto);
}
/**
* Check in the item so that it can be checked out again to someone else
*
* @uses Accessory::checkin_email() to determine if an email can and should be sent
* @author [A. Gianotto] [<snipe@snipe.net>]
* @param Request $request
* @param integer $accessoryUserId
* @param string $backto
* @return Redirect
* @internal param int $accessoryId
*/
public function postCheckin(Request $request, $accessoryUserId = null, $backto = null)
{
// Check if the accessory exists
if (is_null($accessory_user = DB::table('accessories_users')->find($accessoryUserId))) {
// Redirect to the accessory management page with error
return redirect()->route('accessories.index')->with('error', trans('admin/accessories/message.does_not_exist'));
}
$accessory = Accessory::find($accessory_user->accessory_id);
$this->authorize('checkin', $accessory);
$return_to = e($accessory_user->assigned_to);
$logaction = $accessory->logCheckin(User::find($return_to), e(Input::get('note')));
// Was the accessory updated?
if (DB::table('accessories_users')->where('id', '=', $accessory_user->id)->delete()) {
if (!is_null($accessory_user->assigned_to)) {
$user = User::find($accessory_user->assigned_to);
}
$data['log_id'] = $logaction->id;
$data['first_name'] = e($user->first_name);
$data['last_name'] = e($user->last_name);
$data['item_name'] = e($accessory->name);
$data['checkin_date'] = e($logaction->created_at);
$data['item_tag'] = '';
$data['note'] = e($logaction->note);
if ($backto=='user') {
return redirect()->route("users.show", $return_to)->with('success', trans('admin/accessories/message.checkin.success'));
}
return redirect()->route("accessories.show", $accessory->id)->with('success', trans('admin/accessories/message.checkin.success'));
}
// Redirect to the accessory management page with error
return redirect()->route('accessories.index')->with('error', trans('admin/accessories/message.checkin.error'));
}
}

View File

@@ -0,0 +1,127 @@
<?php
namespace App\Http\Controllers\Account;
use App\Events\CheckoutAccepted;
use App\Events\CheckoutDeclined;
use App\Events\ItemAccepted;
use App\Events\ItemDeclined;
use App\Http\Controllers\Controller;
use App\Models\CheckoutAcceptance;
use App\Models\Company;
use App\Models\Contracts\Acceptable;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Storage;
use Illuminate\Support\Str;
class AcceptanceController extends Controller {
/**
* Show a listing of pending checkout acceptances for the current user
*
* @return View
*/
public function index() {
$acceptances = CheckoutAcceptance::forUser(Auth::user())->pending()->get();
return view('account/accept.index', compact('acceptances'));
}
/**
* Shows a form to either accept or decline the checkout acceptance
*
* @param int $id
* @return mixed
*/
public function create($id) {
$acceptance = CheckoutAcceptance::find($id);
if (is_null($acceptance)) {
return redirect()->route('account.accept')->with('error', trans('admin/hardware/message.does_not_exist'));
}
if (! $acceptance->isPending()) {
return redirect()->route('account.accept')->with('error', trans('admin/users/message.error.asset_already_accepted'));
}
if (! $acceptance->isCheckedOutTo(Auth::user())) {
return redirect()->route('account.accept')->with('error', trans('admin/users/message.error.incorrect_user_accepted'));
}
if (!Company::isCurrentUserHasAccess($acceptance->checkoutable)) {
return redirect()->route('account.accept')->with('error', trans('general.insufficient_permissions'));
}
return view('account/accept.create', compact('acceptance'));
}
/**
* Stores the accept/decline of the checkout acceptance
*
* @param Request $request
* @param int $id
* @return Redirect
*/
public function store(Request $request, $id) {
$acceptance = CheckoutAcceptance::find($id);
if (is_null($acceptance)) {
return redirect()->route('account.accept')->with('error', trans('admin/hardware/message.does_not_exist'));
}
if (! $acceptance->isPending()) {
return redirect()->route('account.accept')->with('error', trans('admin/users/message.error.asset_already_accepted'));
}
if (! $acceptance->isCheckedOutTo(Auth::user())) {
return redirect()->route('account.accept')->with('error', trans('admin/users/message.error.incorrect_user_accepted'));
}
if (!Company::isCurrentUserHasAccess($acceptance->checkoutable)) {
return redirect()->route('account.accept')->with('error', trans('general.insufficient_permissions'));
}
if (!$request->filled('asset_acceptance')) {
return redirect()->back()->with('error', trans('admin/users/message.error.accept_or_decline'));
}
/**
* Get the signature and save it
*/
if (!Storage::exists('private_uploads/signatures')) Storage::makeDirectory('private_uploads/signatures', 775);
$sig_filename = '';
if ($request->filled('signature_output')) {
$sig_filename = "siglog-" .Str::uuid() . '-'.date('Y-m-d-his').".png";
$data_uri = e($request->input('signature_output'));
$encoded_image = explode(",", $data_uri);
$decoded_image = base64_decode($encoded_image[1]);
Storage::put('private_uploads/signatures/'.$sig_filename, (string)$decoded_image);
}
if ($request->input('asset_acceptance') == 'accepted') {
$acceptance->accept($sig_filename);
event(new CheckoutAccepted($acceptance));
$return_msg = trans('admin/users/message.accepted');
} else {
$acceptance->decline($sig_filename);
event(new CheckoutDeclined($acceptance));
$return_msg = trans('admin/users/message.declined');
}
return redirect()->to('account/accept')->with('success', $return_msg);
}
}

View File

@@ -2,13 +2,17 @@
namespace App\Http\Controllers\Api;
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
use App\Helpers\Helper;
use App\Models\Accessory;
use App\Http\Controllers\Controller;
use App\Http\Transformers\AccessoriesTransformer;
use App\Http\Transformers\SelectlistTransformer;
use App\Models\Accessory;
use App\Models\Company;
use App\Models\User;
use Carbon\Carbon;
use Auth;
use DB;
use Illuminate\Http\Request;
class AccessoriesController extends Controller
{
@@ -46,8 +50,14 @@ class AccessoriesController extends Controller
$accessories->where('supplier_id','=',$request->input('supplier_id'));
}
$offset = (($accessories) && (request('offset') > $accessories->count())) ? 0 : request('offset', 0);
$limit = $request->input('limit', 50);
// Set the offset to the API call's offset, unless the offset is higher than the actual count of items in which
// case we override with the actual count, so we should return 0 items.
$offset = (($accessories) && ($request->get('offset') > $accessories->count())) ? $accessories->count() : $request->get('offset', 0);
// Check to make sure the limit is not higher than the max allowed
((config('app.max_results') >= $request->input('limit')) && ($request->filled('limit'))) ? $limit = $request->input('limit') : $limit = config('app.max_results');
$order = $request->input('order') === 'asc' ? 'asc' : 'desc';
$sort = in_array($request->input('sort'), $allowed_columns) ? $request->input('sort') : 'created_at';
@@ -132,18 +142,36 @@ class AccessoriesController extends Controller
* @param int $id
* @return \Illuminate\Http\Response
*/
public function checkedout($id)
public function checkedout($id, Request $request)
{
$this->authorize('view', Accessory::class);
$accessory = Accessory::findOrFail($id);
$accessory = Accessory::with('lastCheckout')->findOrFail($id);
if (!Company::isCurrentUserHasAccess($accessory)) {
return ['total' => 0, 'rows' => []];
}
$offset = request('offset', 0);
$limit = request('limit', 50);
$accessory_users = $accessory->users;
$total = $accessory_users->count();
return (new AccessoriesTransformer)->transformCheckedoutAccessory($accessory_users, $total);
if($total < $offset){
$offset = 0;
}
$accessory_users = $accessory->users()->skip($offset)->take($limit)->get();
if ($request->filled('search')) {
$accessory_users = $accessory->users()
->where('first_name', 'like', '%'.$request->input('search').'%')
->orWhere('last_name', 'like', '%'.$request->input('search').'%')
->get();
$total = $accessory_users->count();
}
return (new AccessoriesTransformer)->transformCheckedoutAccessory($accessory, $accessory_users, $total);
}
@@ -158,7 +186,7 @@ class AccessoriesController extends Controller
*/
public function update(Request $request, $id)
{
$this->authorize('edit', Accessory::class);
$this->authorize('update', Accessory::class);
$accessory = Accessory::findOrFail($id);
$accessory->fill($request->all());
@@ -191,4 +219,122 @@ class AccessoriesController extends Controller
return response()->json(Helper::formatStandardApiResponse('success', null, trans('admin/accessories/message.delete.success')));
}
/**
* Save the Accessory checkout information.
*
* If Slack is enabled and/or asset acceptance is enabled, it will also
* trigger a Slack message and send an email.
*
* @author [A. Gianotto] [<snipe@snipe.net>]
* @param int $accessoryId
* @return Redirect
*/
public function checkout(Request $request, $accessoryId)
{
// Check if the accessory exists
if (is_null($accessory = Accessory::find($accessoryId))) {
return response()->json(Helper::formatStandardApiResponse('error', null, trans('admin/accessories/message.does_not_exist')));
}
$this->authorize('checkout', $accessory);
if ($accessory->numRemaining() > 0) {
if (!$user = User::find($request->input('assigned_to'))) {
return response()->json(Helper::formatStandardApiResponse('error', null, trans('admin/accessories/message.checkout.user_does_not_exist')));
}
// Update the accessory data
$accessory->assigned_to = $request->input('assigned_to');
$accessory->users()->attach($accessory->id, [
'accessory_id' => $accessory->id,
'created_at' => Carbon::now(),
'user_id' => Auth::id(),
'assigned_to' => $request->get('assigned_to'),
'note' => $request->get('note')
]);
$accessory->logCheckout($request->input('note'), $user);
return response()->json(Helper::formatStandardApiResponse('success', null, trans('admin/accessories/message.checkout.success')));
}
return response()->json(Helper::formatStandardApiResponse('error', null, 'No accessories remaining'));
}
/**
* Check in the item so that it can be checked out again to someone else
*
* @uses Accessory::checkin_email() to determine if an email can and should be sent
* @author [A. Gianotto] [<snipe@snipe.net>]
* @param Request $request
* @param integer $accessoryUserId
* @param string $backto
* @return Redirect
* @internal param int $accessoryId
*/
public function checkin(Request $request, $accessoryUserId = null)
{
if (is_null($accessory_user = DB::table('accessories_users')->find($accessoryUserId))) {
return response()->json(Helper::formatStandardApiResponse('error', null, trans('admin/accessories/message.does_not_exist')));
}
$accessory = Accessory::find($accessory_user->accessory_id);
$this->authorize('checkin', $accessory);
$logaction = $accessory->logCheckin(User::find($accessory_user->user_id), $request->input('note'));
// Was the accessory updated?
if (DB::table('accessories_users')->where('id', '=', $accessory_user->id)->delete()) {
if (!is_null($accessory_user->assigned_to)) {
$user = User::find($accessory_user->assigned_to);
}
$data['log_id'] = $logaction->id;
$data['first_name'] = $user->first_name;
$data['last_name'] = $user->last_name;
$data['item_name'] = $accessory->name;
$data['checkin_date'] = $logaction->created_at;
$data['item_tag'] = '';
$data['note'] = $logaction->note;
return response()->json(Helper::formatStandardApiResponse('success', null, trans('admin/accessories/message.checkin.success')));
}
return response()->json(Helper::formatStandardApiResponse('error', null, trans('admin/accessories/message.checkin.error')));
}
/**
* Gets a paginated collection for the select2 menus
*
* @see \App\Http\Transformers\SelectlistTransformer
*
*/
public function selectlist(Request $request)
{
$accessories = Accessory::select([
'accessories.id',
'accessories.name'
]);
if ($request->filled('search')) {
$accessories = $accessories->where('accessories.name', 'LIKE', '%'.$request->get('search').'%');
}
$accessories = $accessories->orderBy('name', 'ASC')->paginate(50);
return (new SelectlistTransformer)->transformSelectlist($accessories);
}
}

View File

@@ -9,7 +9,6 @@ use App\Models\AssetMaintenance;
use App\Models\Company;
use Auth;
use Carbon\Carbon;
use Gate;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Input;
@@ -34,18 +33,23 @@ class AssetMaintenancesController extends Controller
*/
public function index(Request $request)
{
$maintenances = AssetMaintenance::with('asset', 'supplier', 'asset.company', 'admin');
$maintenances = AssetMaintenance::with('asset', 'asset.model','asset.location', 'supplier', 'asset.company', 'admin');
if (Input::has('search')) {
$maintenances = $maintenances->TextSearch(e($request->input('search')));
if ($request->filled('search')) {
$maintenances = $maintenances->TextSearch($request->input('search'));
}
if ($request->filled('asset_id')) {
$maintenances->where('asset_id', '=', $request->input('asset_id'));
}
$offset = (($maintenances) && (request('offset') > $maintenances->count())) ? 0 : request('offset', 0);
$limit = request('limit', 50);
// Set the offset to the API call's offset, unless the offset is higher than the actual count of items in which
// case we override with the actual count, so we should return 0 items.
$offset = (($maintenances) && ($request->get('offset') > $maintenances->count())) ? $maintenances->count() : $request->get('offset', 0);
// Check to make sure the limit is not higher than the max allowed
((config('app.max_results') >= $request->input('limit')) && ($request->filled('limit'))) ? $limit = $request->input('limit') : $limit = config('app.max_results');
$allowed_columns = [
'id',
@@ -60,8 +64,8 @@ class AssetMaintenancesController extends Controller
'asset_name',
'user_id'
];
$order = Input::get('order') === 'asc' ? 'asc' : 'desc';
$sort = in_array(Input::get('sort'), $allowed_columns) ? e($request->input('sort')) : 'created_at';
$order = $request->input('order') === 'asc' ? 'asc' : 'desc';
$sort = in_array($request->input('sort'), $allowed_columns) ? e($request->input('sort')) : 'created_at';
switch ($sort) {
case 'user_id':

View File

@@ -1,15 +1,15 @@
<?php
namespace App\Http\Controllers\Api;
use App\Models\AssetModel;
use App\Models\Asset;
use App\Http\Controllers\Controller;
use App\Helpers\Helper;
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
use App\Http\Transformers\AssetModelsTransformer;
use App\Http\Transformers\AssetsTransformer;
use App\Http\Transformers\SelectlistTransformer;
use App\Models\Asset;
use App\Models\AssetModel;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Storage;
/**
* This class controls all actions related to asset models for
@@ -30,7 +30,20 @@ class AssetModelsController extends Controller
public function index(Request $request)
{
$this->authorize('view', AssetModel::class);
$allowed_columns = ['id','image','name','model_number','eol','notes','created_at','manufacturer','assets_count'];
$allowed_columns =
[
'id',
'image',
'name',
'model_number',
'eol',
'notes',
'created_at',
'manufacturer',
'requestable',
'assets_count',
'category'
];
$assetmodels = AssetModel::select([
'models.id',
@@ -38,6 +51,7 @@ class AssetModelsController extends Controller
'models.name',
'model_number',
'eol',
'requestable',
'models.notes',
'models.created_at',
'category_id',
@@ -60,8 +74,13 @@ class AssetModelsController extends Controller
$assetmodels->TextSearch($request->input('search'));
}
$offset = (($assetmodels) && (request('offset') > $assetmodels->count())) ? 0 : request('offset', 0);
$limit = $request->input('limit', 50);
// Set the offset to the API call's offset, unless the offset is higher than the actual count of items in which
// case we override with the actual count, so we should return 0 items.
$offset = (($assetmodels) && ($request->get('offset') > $assetmodels->count())) ? $assetmodels->count() : $request->get('offset', 0);
// Check to make sure the limit is not higher than the max allowed
((config('app.max_results') >= $request->input('limit')) && ($request->filled('limit'))) ? $limit = $request->input('limit') : $limit = config('app.max_results');
$order = $request->input('order') === 'asc' ? 'asc' : 'desc';
$sort = in_array($request->input('sort'), $allowed_columns) ? $request->input('sort') : 'models.created_at';
@@ -69,13 +88,14 @@ class AssetModelsController extends Controller
case 'manufacturer':
$assetmodels->OrderManufacturer($order);
break;
case 'category':
$assetmodels->OrderCategory($order);
break;
default:
$assetmodels->orderBy($sort, $order);
break;
}
$total = $assetmodels->count();
$assetmodels = $assetmodels->skip($offset)->take($limit)->get();
return (new AssetModelsTransformer)->transformAssetModels($assetmodels, $total);
@@ -148,7 +168,19 @@ class AssetModelsController extends Controller
$this->authorize('update', AssetModel::class);
$assetmodel = AssetModel::findOrFail($id);
$assetmodel->fill($request->all());
$assetmodel->fieldset_id = $request->get("custom_fieldset_id");
/**
* Allow custom_fieldset_id to override and populate fieldset_id.
* This is stupid, but required for legacy API support.
*
* I have no idea why we manually overrode that field name
* in previous versions. I assume there was a good reason for
* it, but I'll be damned if I can think of one. - snipe
*/
if ($request->filled('custom_fieldset_id')) {
$assetmodel->fieldset_id = $request->get("custom_fieldset_id");
}
if ($assetmodel->save()) {
return response()->json(Helper::formatStandardApiResponse('success', $assetmodel, trans('admin/models/message.update.success')));
@@ -177,7 +209,7 @@ class AssetModelsController extends Controller
if ($assetmodel->image) {
try {
unlink(public_path().'/uploads/models/'.$assetmodel->image);
Storage::disk('public')->delete('assetmodels/'.$assetmodel->image);
} catch (\Exception $e) {
\Log::info($e);
}
@@ -221,20 +253,20 @@ class AssetModelsController extends Controller
$assetmodel->use_text = '';
if ($settings->modellistCheckedValue('category')) {
$assetmodel->use_text .= (($assetmodel->category) ? e($assetmodel->category->name).' - ' : '');
$assetmodel->use_text .= (($assetmodel->category) ? $assetmodel->category->name.' - ' : '');
}
if ($settings->modellistCheckedValue('manufacturer')) {
$assetmodel->use_text .= (($assetmodel->manufacturer) ? e($assetmodel->manufacturer->name).' ' : '');
$assetmodel->use_text .= (($assetmodel->manufacturer) ? $assetmodel->manufacturer->name.' ' : '');
}
$assetmodel->use_text .= e($assetmodel->name);
$assetmodel->use_text .= $assetmodel->name;
if (($settings->modellistCheckedValue('model_number')) && ($assetmodel->model_number!='')) {
$assetmodel->use_text .= ' (#'.e($assetmodel->model_number).')';
$assetmodel->use_text .= ' (#'.$assetmodel->model_number.')';
}
$assetmodel->use_image = ($settings->modellistCheckedValue('image') && ($assetmodel->image)) ? url('/').'/uploads/models/'.$assetmodel->image : null;
$assetmodel->use_image = ($settings->modellistCheckedValue('image') && ($assetmodel->image)) ? Storage::disk('public')->url('models/'.e($assetmodel->image)) : null;
}
return (new SelectlistTransformer)->transformSelectlist($assetmodels);

View File

@@ -1,37 +1,31 @@
<?php
namespace App\Http\Controllers\Api;
use Illuminate\Support\Facades\Gate;
use App\Helpers\Helper;
use App\Http\Controllers\Controller;
use App\Http\Requests\AssetRequest;
use App\Http\Requests\AssetCheckoutRequest;
use App\Http\Transformers\AssetsTransformer;
use App\Http\Transformers\LicensesTransformer;
use App\Http\Transformers\SelectlistTransformer;
use App\Models\Asset;
use App\Models\AssetModel;
use App\Models\Company;
use App\Models\CustomField;
use App\Models\License;
use App\Models\Location;
use App\Models\Setting;
use App\Models\User;
use Artisan;
use Auth;
use Carbon\Carbon;
use Config;
use DB;
use Gate;
use Illuminate\Http\Request;
use Input;
use Lang;
use Log;
use Mail;
use Paginator;
use Response;
use Slack;
use Str;
use TCPDF;
use Validator;
use View;
use App\Http\Transformers\SelectlistTransformer;
/**
@@ -121,6 +115,10 @@ class AssetsController extends Controller
$assets->where('assets.location_id', '=', $request->input('location_id'));
}
if ($request->filled('rtd_location_id')) {
$assets->where('assets.rtd_location_id', '=', $request->input('rtd_location_id'));
}
if ($request->filled('supplier_id')) {
$assets->where('assets.supplier_id', '=', $request->input('supplier_id'));
}
@@ -144,8 +142,14 @@ class AssetsController extends Controller
$request->filled('order_number') ? $assets = $assets->where('assets.order_number', '=', e($request->get('order_number'))) : '';
$offset = (($assets) && (request('offset') > $assets->count())) ? 0 : request('offset', 0);
$limit = $request->input('limit', 50);
// Set the offset to the API call's offset, unless the offset is higher than the actual count of items in which
// case we override with the actual count, so we should return 0 items.
$offset = (($assets) && ($request->get('offset') > $assets->count())) ? $assets->count() : $request->get('offset', 0);
// Check to make sure the limit is not higher than the max allowed
((config('app.max_results') >= $request->input('limit')) && ($request->filled('limit'))) ? $limit = $request->input('limit') : $limit = config('app.max_results');
$order = $request->input('order') === 'asc' ? 'asc' : 'desc';
// This is used by the audit reporting routes
@@ -170,7 +174,7 @@ class AssetsController extends Controller
// I am sad. :(
switch ($request->input('status')) {
case 'Deleted':
$assets->withTrashed()->Deleted();
$assets->onlyTrashed();
break;
case 'Pending':
$assets->join('status_labels AS status_alias',function ($join) {
@@ -288,6 +292,7 @@ class AssetsController extends Controller
$total = $assets->count();
$assets = $assets->skip($offset)->take($limit)->get();
// dd($assets);
return (new AssetsTransformer)->transformAssets($assets, $total);
}
@@ -302,7 +307,7 @@ class AssetsController extends Controller
*/
public function showByTag($tag)
{
if ($asset = Asset::with('assetstatus')->with('assignedTo')->withTrashed()->where('asset_tag',$tag)->first()) {
if ($asset = Asset::with('assetstatus')->with('assignedTo')->where('asset_tag',$tag)->first()) {
$this->authorize('view', $asset);
return (new AssetsTransformer)->transformAsset($asset);
}
@@ -323,8 +328,7 @@ class AssetsController extends Controller
$this->authorize('index', Asset::class);
if ($assets = Asset::with('assetstatus')->with('assignedTo')
->withTrashed()->where('serial',$serial)->get()) {
return (new AssetsTransformer)->transformAssets($assets, $assets->count());
return (new AssetsTransformer)->transformAssets($assets, $assets->count());
}
return response()->json(Helper::formatStandardApiResponse('error', null, 'Asset not found'), 200);
@@ -341,13 +345,22 @@ class AssetsController extends Controller
*/
public function show($id)
{
if ($asset = Asset::with('assetstatus')->with('assignedTo')->withTrashed()->withCount('checkins as checkins_count', 'checkouts as checkouts_count', 'userRequests as userRequests_count')->findOrFail($id)) {
if ($asset = Asset::with('assetstatus')->with('assignedTo')->withTrashed()
->withCount('checkins as checkins_count', 'checkouts as checkouts_count', 'userRequests as user_requests_count')->findOrFail($id)) {
$this->authorize('view', $asset);
return (new AssetsTransformer)->transformAsset($asset);
}
}
public function licenses($id)
{
$this->authorize('view', Asset::class);
$this->authorize('view', License::class);
$asset = Asset::where('id', $id)->withTrashed()->first();
$licenses = $asset->licenses()->get();
return (new LicensesTransformer())->transformLicenses($licenses, $licenses->count());
}
/**
@@ -369,7 +382,7 @@ class AssetsController extends Controller
'assets.assigned_to',
'assets.assigned_type',
'assets.status_id'
])->with('model', 'assetstatus', 'assignedTo')->NotArchived(),'company_id', 'assets');
])->with('model', 'assetstatus', 'assignedTo')->NotArchived(), 'company_id', 'assets');
if ($request->filled('assetStatusType') && $request->input('assetStatusType') === 'RTD') {
$assets = $assets->RTD();
@@ -415,7 +428,7 @@ class AssetsController extends Controller
* @since [v4.0]
* @return JsonResponse
*/
public function store(AssetRequest $request)
public function store(Request $request)
{
$this->authorize('create', Asset::class);
@@ -442,19 +455,59 @@ class AssetsController extends Controller
$asset->supplier_id = $request->get('supplier_id', 0);
$asset->requestable = $request->get('requestable', 0);
$asset->rtd_location_id = $request->get('rtd_location_id', null);
$asset->location_id = $request->get('rtd_location_id', null);
if ($request->has('image_source') && $request->input('image_source') != "") {
$saved_image_path = Helper::processUploadedImage(
$request->input('image_source'), 'uploads/assets/'
);
if (!$saved_image_path) {
return response()->json(Helper::formatStandardApiResponse(
'error',
null,
trans('admin/hardware/message.create.error')
), 200);
}
$asset->image = $saved_image_path;
}
// Update custom fields in the database.
// Validation for these fields is handled through the AssetRequest form request
$model = AssetModel::find($request->get('model_id'));
if (($model) && ($model->fieldset)) {
foreach ($model->fieldset->fields as $field) {
if ($field->field_encrypted=='1') {
if (Gate::allows('admin')) {
$asset->{$field->convertUnicodeDbSlug()} = \Crypt::encrypt($request->input($field->convertUnicodeDbSlug()));
}
} else {
$asset->{$field->convertUnicodeDbSlug()} = $request->input($field->convertUnicodeDbSlug());
// Set the field value based on what was sent in the request
$field_val = $request->input($field->convertUnicodeDbSlug(), null);
// If input value is null, use custom field's default value
if ($field_val == null) {
\Log::debug('Field value for '.$field->convertUnicodeDbSlug().' is null');
$field_val = $field->defaultValue($request->get('model_id'));
\Log::debug('Use the default fieldset value of '.$field->defaultValue($request->get('model_id')));
}
// if the field is set to encrypted, make sure we encrypt the value
if ($field->field_encrypted == '1') {
\Log::debug('This model field is encrypted in this fieldset.');
if (Gate::allows('admin')) {
// If input value is null, use custom field's default value
if (($field_val == null) && ($request->has('model_id')!='')){
$field_val = \Crypt::encrypt($field->defaultValue($request->get('model_id')));
} else {
$field_val = \Crypt::encrypt($request->input($field->convertUnicodeDbSlug()));
}
}
}
$asset->{$field->convertUnicodeDbSlug()} = $field_val;
}
}
@@ -470,6 +523,11 @@ class AssetsController extends Controller
if (isset($target)) {
$asset->checkOut($target, Auth::user(), date('Y-m-d H:i:s'), '', 'Checked out on asset creation', e($request->get('name')));
}
if ($asset->image) {
$asset->image = $asset->getImageUrl();
}
return response()->json(Helper::formatStandardApiResponse('success', $asset, trans('admin/hardware/message.create.success')));
}
@@ -490,15 +548,40 @@ class AssetsController extends Controller
$this->authorize('update', Asset::class);
if ($asset = Asset::find($id)) {
$asset->fill($request->all());
($request->filled('model_id')) ?
$asset->model()->associate(AssetModel::find($request->get('model_id'))) : null;
($request->filled('rtd_location_id')) ?
$asset->location_id = $request->get('rtd_location_id') : '';
($request->filled('company_id')) ?
$asset->company_id = Company::getIdForCurrentUser($request->get('company_id')) : null;
$asset->company_id = Company::getIdForCurrentUser($request->get('company_id')) : '';
($request->filled('rtd_location_id')) ?
$asset->location_id = $request->get('rtd_location_id') : null;
if ($request->filled('image_source')) {
if ($request->input('image_source') == "") {
($request->filled('rtd_location_id')) ?
$asset->location_id = $request->get('rtd_location_id') : null;
$asset->image = null;
} else {
$saved_image_path = Helper::processUploadedImage(
$request->input('image_source'), 'uploads/assets/'
);
if (!$saved_image_path) {
return response()->json(Helper::formatStandardApiResponse(
'error',
null,
trans('admin/hardware/message.update.error')
), 200);
}
$asset->image = $saved_image_path;
}
}
// Update custom fields
if (($model = AssetModel::find($asset->model_id)) && (isset($model->fieldset))) {
@@ -519,9 +602,13 @@ class AssetsController extends Controller
if ($asset->save()) {
if (($request->filled('assigned_user')) && ($target = User::find($request->get('assigned_user')))) {
$location = $target->location_id;
$location = $target->location_id;
} elseif (($request->filled('assigned_asset')) && ($target = Asset::find($request->get('assigned_asset')))) {
$location = $target->location_id;
Asset::where('assigned_type', '\\App\\Models\\Asset')->where('assigned_to', $id)
->update(['location_id' => $target->location_id]);
} elseif (($request->filled('assigned_location')) && ($target = Location::find($request->get('assigned_location')))) {
$location = $target->id;
}
@@ -530,6 +617,10 @@ class AssetsController extends Controller
$asset->checkOut($target, Auth::user(), date('Y-m-d H:i:s'), '', 'Checked out on asset update', e($request->get('name')), $location);
}
if ($asset->image) {
$asset->image = $asset->getImageUrl();
}
return response()->json(Helper::formatStandardApiResponse('success', $asset, trans('admin/hardware/message.update.success')));
}
return response()->json(Helper::formatStandardApiResponse('error', null, $asset->getErrors()), 200);
@@ -605,16 +696,14 @@ class AssetsController extends Controller
$target = Asset::where('id','!=',$asset_id)->find(request('assigned_asset'));
$asset->location_id = $target->rtd_location_id;
// Override with the asset's location_id if it has one
if ($target->location_id!='') {
$asset->location_id = ($target) ? $target->location_id : '';
}
$asset->location_id = (($target) && (isset($target->location_id))) ? $target->location_id : '';
$error_payload['target_id'] = $request->input('assigned_asset');
$error_payload['target_type'] = 'asset';
} elseif (request('checkout_to_type')=='user') {
// Fetch the target and set the asset's new location_id
$target = User::find(request('assigned_user'));
$asset->location_id = ($target) ? $target->location_id : '';
$asset->location_id = (($target) && (isset($target->location_id))) ? $target->location_id : '';
$error_payload['target_id'] = $request->input('assigned_user');
$error_payload['target_type'] = 'user';
}
@@ -633,11 +722,13 @@ class AssetsController extends Controller
$asset_name = request('name', null);
// Set the location ID to the RTD location id if there is one
if ($asset->rtd_location_id!='') {
$asset->location_id = $target->rtd_location_id;
}
// Wait, why are we doing this? This overrides the stuff we set further up, which makes no sense.
// TODO: Follow up here. WTF. Commented out for now.
// if ((isset($target->rtd_location_id)) && ($asset->rtd_location_id!='')) {
// $asset->location_id = $target->rtd_location_id;
// }
@@ -645,7 +736,7 @@ class AssetsController extends Controller
return response()->json(Helper::formatStandardApiResponse('success', ['asset'=> e($asset->asset_tag)], trans('admin/hardware/message.checkout.success')));
}
return response()->json(Helper::formatStandardApiResponse('error', ['asset'=> e($asset->asset_tag)], trans('admin/hardware/message.checkout.error')))->withErrors($asset->getErrors());
return response()->json(Helper::formatStandardApiResponse('error', ['asset'=> e($asset->asset_tag)], trans('admin/hardware/message.checkout.error')));
}
@@ -674,19 +765,23 @@ class AssetsController extends Controller
$asset->assigned_to = null;
$asset->assignedTo()->disassociate($asset);
$asset->accepted = null;
$asset->name = Input::get('name');
if ($request->filled('name')) {
$asset->name = $request->input('name');
}
$asset->location_id = $asset->rtd_location_id;
if ($request->filled('location_id')) {
$asset->location_id = $request->input('location_id');
}
if (Input::has('status_id')) {
$asset->status_id = Input::get('status_id');
if ($request->has('status_id')) {
$asset->status_id = $request->input('status_id');
}
if ($asset->save()) {
$asset->logCheckin($target, e(request('note')));
$asset->logCheckin($target, e($request->input('note')));
return response()->json(Helper::formatStandardApiResponse('success', ['asset'=> e($asset->asset_tag)], trans('admin/hardware/message.checkin.success')));
}
@@ -717,21 +812,35 @@ class AssetsController extends Controller
return response()->json(Helper::formatStandardApiResponse('error', null, $validator->errors()->all()));
}
$settings = Setting::getSettings();
$dt = Carbon::now()->addMonths($settings->audit_interval)->toDateString();
$asset = Asset::where('asset_tag','=', $request->input('asset_tag'))->first();
if ($asset) {
// We don't want to log this as a normal update, so let's bypass that
$asset->unsetEventDispatcher();
$asset->next_audit_date = $request->input('next_audit_date');
$asset->last_audit_date = date('Y-m-d h:i:s');
$asset->next_audit_date = $dt;
if ($request->filled('next_audit_date')) {
$asset->next_audit_date = $request->input('next_audit_date');
}
// Check to see if they checked the box to update the physical location,
// not just note it in the audit notes
if ($request->input('update_location')=='1') {
$asset->location_id = $request->input('location_id');
}
$asset->last_audit_date = date('Y-m-d H:i:s');
if ($asset->save()) {
$log = $asset->logAudit(request('note'),request('location_id'));
return response()->json(Helper::formatStandardApiResponse('success', [
'asset_tag'=> e($asset->asset_tag),
'note'=> e($request->input('note')),
'next_audit_date' => Helper::getFormattedDateObject($log->calcNextAuditDate())
'next_audit_date' => Helper::getFormattedDateObject($asset->next_audit_date)
], trans('admin/hardware/message.audit.success')));
}
}

View File

@@ -2,12 +2,13 @@
namespace App\Http\Controllers\Api;
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
use App\Helpers\Helper;
use App\Models\Category;
use App\Http\Controllers\Controller;
use App\Http\Transformers\CategoriesTransformer;
use App\Http\Transformers\SelectlistTransformer;
use App\Models\Category;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Storage;
class CategoriesController extends Controller
{
@@ -30,8 +31,13 @@ class CategoriesController extends Controller
$categories = $categories->TextSearch($request->input('search'));
}
$offset = (($categories) && (request('offset') > $categories->count())) ? 0 : request('offset', 0);
$limit = $request->input('limit', 50);
// Set the offset to the API call's offset, unless the offset is higher than the actual count of items in which
// case we override with the actual count, so we should return 0 items.
$offset = (($categories) && ($request->get('offset') > $categories->count())) ? $categories->count() : $request->get('offset', 0);
// Check to make sure the limit is not higher than the max allowed
((config('app.max_results') >= $request->input('limit')) && ($request->filled('limit'))) ? $limit = $request->input('limit') : $limit = config('app.max_results');
$order = $request->input('order') === 'asc' ? 'asc' : 'desc';
$sort = in_array($request->input('sort'), $allowed_columns) ? $request->input('sort') : 'assets_count';
$categories->orderBy($sort, $order);
@@ -116,14 +122,10 @@ class CategoriesController extends Controller
$this->authorize('delete', Category::class);
$category = Category::findOrFail($id);
if ($category->has_models() > 0) {
return response()->json(Helper::formatStandardApiResponse('error', null, trans('admin/categories/message.assoc_items', ['asset_type'=>'model'])));
} elseif ($category->accessories()->count() > 0) {
return response()->json(Helper::formatStandardApiResponse('error', null, trans('admin/categories/message.assoc_items', ['asset_type'=>'accessory'])));
} elseif ($category->consumables()->count() > 0) {
return response()->json(Helper::formatStandardApiResponse('error', null, trans('admin/categories/message.assoc_items', ['asset_type'=>'consumable'])));
} elseif ($category->components()->count() > 0) {
return response()->json(Helper::formatStandardApiResponse('error', null, trans('admin/categories/message.assoc_items', ['asset_type'=>'component'])));
if (!$category->isDeletable()) {
return response()->json(
Helper::formatStandardApiResponse('error', null, trans('admin/categories/message.assoc_items', ['asset_type'=>$category->category_type]))
);
}
$category->delete();
return response()->json(Helper::formatStandardApiResponse('success', null, trans('admin/categories/message.delete.success')));
@@ -158,7 +160,7 @@ class CategoriesController extends Controller
// This lets us have more flexibility in special cases like assets, where
// they may not have a ->name value but we want to display something anyway
foreach ($categories as $category) {
$category->use_image = ($category->image) ? url('/').'/uploads/categories/'.$category->image : null;
$category->use_image = ($category->image) ? Storage::disk('public')->url('categories/'.$category->image, $category->image) : null;
}
return (new SelectlistTransformer)->transformSelectlist($categories);

View File

@@ -2,12 +2,13 @@
namespace App\Http\Controllers\Api;
use App\Http\Transformers\CompaniesTransformer;
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
use App\Helpers\Helper;
use App\Models\Company;
use App\Http\Controllers\Controller;
use App\Http\Transformers\CompaniesTransformer;
use App\Http\Transformers\SelectlistTransformer;
use App\Models\Company;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Storage;
class CompaniesController extends Controller
{
@@ -41,8 +42,13 @@ class CompaniesController extends Controller
$companies->TextSearch($request->input('search'));
}
$offset = (($companies) && (request('offset') > $companies->count())) ? 0 : request('offset', 0);
$limit = $request->input('limit', 50);
// Set the offset to the API call's offset, unless the offset is higher than the actual count of items in which
// case we override with the actual count, so we should return 0 items.
$offset = (($companies) && ($request->get('offset') > $companies->count())) ? $companies->count() : $request->get('offset', 0);
// Check to make sure the limit is not higher than the max allowed
((config('app.max_results') >= $request->input('limit')) && ($request->filled('limit'))) ? $limit = $request->input('limit') : $limit = config('app.max_results');
$order = $request->input('order') === 'asc' ? 'asc' : 'desc';
$sort = in_array($request->input('sort'), $allowed_columns) ? $request->input('sort') : 'created_at';
$companies->orderBy($sort, $order);
@@ -127,28 +133,17 @@ class CompaniesController extends Controller
*/
public function destroy($id)
{
$this->authorize('delete', Company::class);
$company = Company::findOrFail($id);
$this->authorize('delete', $company);
$this->authorize('delete', Company::class);
$company = Company::findOrFail($id);
$this->authorize('delete', $company);
try {
$company->delete();
if ( !$company->isDeletable() ) {
return response()
->json(Helper::formatStandardApiResponse('success', null, trans('admin/companies/message.delete.success')));
} catch (\Illuminate\Database\QueryException $exception) {
/*
* NOTE: This happens when there's a foreign key constraint violation
* For example when rows in other tables are referencing this company
*/
if ($exception->getCode() == 23000) {
return response()
->json(Helper::formatStandardApiResponse('error', null, trans('admin/companies/message.assoc_users')));
} else {
throw $exception;
}
}
$company->delete();
return response()
->json(Helper::formatStandardApiResponse('success', null, trans('admin/companies/message.delete.success')));
}
/**
@@ -178,7 +173,7 @@ class CompaniesController extends Controller
// This lets us have more flexibility in special cases like assets, where
// they may not have a ->name value but we want to display something anyway
foreach ($companies as $company) {
$company->use_image = ($company->image) ? url('/').'/uploads/companies/'.$company->image : null;
$company->use_image = ($company->image) ? Storage::disk('public')->url('companies/'.$company->image, $company->image) : null;
}
return (new SelectlistTransformer)->transformSelectlist($companies);

View File

@@ -2,14 +2,12 @@
namespace App\Http\Controllers\Api;
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
use App\Http\Transformers\AssetsTransformer;
use App\Http\Transformers\ComponentsTransformer;
use App\Http\Transformers\ComponentsAssetsTransformer;
use App\Models\Component;
use App\Models\Company;
use App\Helpers\Helper;
use App\Http\Controllers\Controller;
use App\Http\Transformers\ComponentsTransformer;
use App\Models\Company;
use App\Models\Component;
use Illuminate\Http\Request;
class ComponentsController extends Controller
{
@@ -43,8 +41,12 @@ class ComponentsController extends Controller
$components->where('location_id','=',$request->input('location_id'));
}
$offset = (($components) && (request('offset') > $components->count())) ? 0 : request('offset', 0);
$limit = request('limit', 50);
// Set the offset to the API call's offset, unless the offset is higher than the actual count of items in which
// case we override with the actual count, so we should return 0 items.
$offset = (($components) && ($request->get('offset') > $components->count())) ? $components->count() : $request->get('offset', 0);
// Check to make sure the limit is not higher than the max allowed
((config('app.max_results') >= $request->input('limit')) && ($request->filled('limit'))) ? $limit = $request->input('limit') : $limit = config('app.max_results');
$allowed_columns = ['id','name','min_amt','order_number','serial','purchase_date','purchase_cost','company','category','qty','location','image'];
$order = $request->input('order') === 'asc' ? 'asc' : 'desc';

View File

@@ -2,12 +2,14 @@
namespace App\Http\Controllers\Api;
use Illuminate\Http\Request;
use App\Helpers\Helper;
use App\Http\Controllers\Controller;
use App\Http\Transformers\ConsumablesTransformer;
use App\Http\Transformers\SelectlistTransformer;
use App\Models\Company;
use App\Models\Consumable;
use App\Http\Transformers\ConsumablesTransformer;
use App\Helpers\Helper;
use App\Models\User;
use Illuminate\Http\Request;
class ConsumablesController extends Controller
{
@@ -44,8 +46,13 @@ class ConsumablesController extends Controller
}
$offset = (($consumables) && (request('offset') > $consumables->count())) ? 0 : request('offset', 0);
$limit = request('limit', 50);
// Set the offset to the API call's offset, unless the offset is higher than the actual count of items in which
// case we override with the actual count, so we should return 0 items.
$offset = (($consumables) && ($request->get('offset') > $consumables->count())) ? $consumables->count() : $request->get('offset', 0);
// Check to make sure the limit is not higher than the max allowed
((config('app.max_results') >= $request->input('limit')) && ($request->filled('limit'))) ? $limit = $request->input('limit') : $limit = config('app.max_results');
$allowed_columns = ['id','name','order_number','min_amt','purchase_date','purchase_cost','company','category','model_number', 'item_no', 'manufacturer','location','qty','image'];
$order = $request->input('order') === 'asc' ? 'asc' : 'desc';
$sort = in_array($request->input('sort'), $allowed_columns) ? $request->input('sort') : 'created_at';
@@ -152,11 +159,11 @@ class ConsumablesController extends Controller
return response()->json(Helper::formatStandardApiResponse('success', null, trans('admin/consumables/message.delete.success')));
}
/**
/**
* Returns a JSON response containing details on the users associated with this consumable.
*
* @author [A. Gianotto] [<snipe@snipe.net>]
* @see ConsumablesController::getView() method that returns the form.
* @see \App\Http\Controllers\Consumables\ConsumablesController::getView() method that returns the form.
* @since [v1.0]
* @param int $consumableId
* @return array
@@ -165,7 +172,7 @@ class ConsumablesController extends Controller
{
$consumable = Consumable::with(array('consumableAssignments'=>
function ($query) {
$query->orderBy('created_at', 'DESC');
$query->orderBy($query->getModel()->getTable().'.created_at', 'DESC');
},
'consumableAssignments.admin'=> function ($query) {
},
@@ -191,4 +198,79 @@ class ConsumablesController extends Controller
$data = array('total' => $consumableCount, 'rows' => $rows);
return $data;
}
/**
* Checkout a consumable
*
* @author [A. Gutierrez] [<andres@baller.tv>]
* @param int $id
* @since [v4.9.5]
* @return JsonResponse
*/
public function checkout(Request $request, $id)
{
// Check if the consumable exists
if (is_null($consumable = Consumable::find($id))) {
return response()->json(Helper::formatStandardApiResponse('error', null, trans('admin/consumables/message.does_not_exist')));
}
$this->authorize('checkout', $consumable);
if ($consumable->qty > 0) {
// Check if the user exists
$assigned_to = $request->input('assigned_to');
if (is_null($user = User::find($assigned_to))) {
// Return error message
return response()->json(Helper::formatStandardApiResponse('error', null, 'No user found'));
}
// Update the consumable data
$consumable->assigned_to = e($assigned_to);
$consumable->users()->attach($consumable->id, [
'consumable_id' => $consumable->id,
'user_id' => $user->id,
'assigned_to' => $assigned_to
]);
// Log checkout event
$logaction = $consumable->logCheckout(e($request->input('note')), $user);
$data['log_id'] = $logaction->id;
$data['eula'] = $consumable->getEula();
$data['first_name'] = $user->first_name;
$data['item_name'] = $consumable->name;
$data['checkout_date'] = $logaction->created_at;
$data['note'] = $logaction->note;
$data['require_acceptance'] = $consumable->requireAcceptance();
return response()->json(Helper::formatStandardApiResponse('success', null, trans('admin/consumables/message.checkout.success')));
}
return response()->json(Helper::formatStandardApiResponse('error', null, 'No consumables remaining'));
}
/**
* Gets a paginated collection for the select2 menus
*
* @see \App\Http\Transformers\SelectlistTransformer
*
*/
public function selectlist(Request $request)
{
$consumables = Consumable::select([
'consumables.id',
'consumables.name'
]);
if ($request->filled('search')) {
$consumables = $consumables->where('consumables.name', 'LIKE', '%'.$request->get('search').'%');
}
$consumables = $consumables->orderBy('name', 'ASC')->paginate(50);
return (new SelectlistTransformer)->transformSelectlist($consumables);
}
}

View File

@@ -9,7 +9,6 @@ use App\Models\CustomField;
use App\Models\CustomFieldset;
use Illuminate\Http\Request;
use Validator;
use Illuminate\Validation\Rule;
class CustomFieldsController extends Controller
{
@@ -24,7 +23,7 @@ class CustomFieldsController extends Controller
public function index()
{
$this->authorize('index', CustomFields::class);
$this->authorize('index', CustomField::class);
$fields = CustomField::get();
return (new CustomFieldsTransformer)->transformCustomFields($fields, $fields->count());
}
@@ -38,7 +37,7 @@ class CustomFieldsController extends Controller
*/
public function show($id)
{
$this->authorize('show', CustomField::class);
$this->authorize('view', CustomField::class);
if ($field = CustomField::find($id)) {
return (new CustomFieldsTransformer)->transformCustomField($field);
}
@@ -59,9 +58,9 @@ class CustomFieldsController extends Controller
{
$this->authorize('update', CustomField::class);
$field = CustomField::findOrFail($id);
/**
* Updated values for the field,
* Updated values for the field,
* without the "field_encrypted" flag, preventing the change of encryption status
* @var array
*/
@@ -96,7 +95,14 @@ class CustomFieldsController extends Controller
$field = new CustomField;
$data = $request->all();
$validator = Validator::make($data, $field->validationRules());
$regex_format = null;
if (str_contains($data["format"], "regex:")){
$regex_format = $data["format"];
}
$validator = Validator::make($data, $field->validationRules($regex_format));
if ($validator->fails()) {
return response()->json(Helper::formatStandardApiResponse('error', null, $validator->errors()));
}

View File

@@ -1,22 +1,14 @@
<?php
namespace App\Http\Controllers\Api;
use View;
use App\Models\CustomFieldset;
use App\Models\CustomField;
use Input;
use Validator;
use Redirect;
use App\Models\AssetModel;
use Lang;
use Auth;
use Illuminate\Http\Request;
use Log;
use App\Http\Controllers\Controller;
use App\Helpers\Helper;
use App\Http\Transformers\CustomFieldsTransformer;
use App\Http\Controllers\Controller;
use App\Http\Transformers\CustomFieldsetsTransformer;
use App\Http\Requests\AssetRequest;
use App\Http\Transformers\CustomFieldsTransformer;
use App\Models\CustomFieldset;
use Illuminate\Http\Request;
use Redirect;
use View;
/**
* This controller handles all actions related to Custom Asset Fieldsets for
@@ -58,7 +50,7 @@ class CustomFieldsetsController extends Controller
*/
public function show($id)
{
$this->authorize('show', CustomFieldset::class);
$this->authorize('view', CustomFieldset::class);
if ($fieldset = CustomFieldset::find($id)) {
return (new CustomFieldsetsTransformer)->transformCustomFieldset($fieldset);
}

View File

@@ -2,20 +2,21 @@
namespace App\Http\Controllers\Api;
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
use App\Models\Department;
use App\Http\Transformers\DepartmentsTransformer;
use App\Helpers\Helper;
use Auth;
use App\Http\Controllers\Controller;
use App\Http\Transformers\DepartmentsTransformer;
use App\Http\Transformers\SelectlistTransformer;
use App\Models\Department;
use Auth;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Storage;
class DepartmentsController extends Controller
{
/**
* Display a listing of the resource.
*
* @author [A. Gianotto] [<snipe@snipe.net>]
* @author [Godfrey Martinez] [<snipe@snipe.net>]
* @since [v4.0]
* @return \Illuminate\Http\Response
*/
@@ -39,8 +40,13 @@ class DepartmentsController extends Controller
$departments = $departments->TextSearch($request->input('search'));
}
$offset = (($departments) && (request('offset') > $departments->count())) ? 0 : request('offset', 0);
$limit = $request->input('limit', 50);
// Set the offset to the API call's offset, unless the offset is higher than the actual count of items in which
// case we override with the actual count, so we should return 0 items.
$offset = (($departments) && ($request->get('offset') > $departments->count())) ? $departments->count() : $request->get('offset', 0);
// Check to make sure the limit is not higher than the max allowed
((config('app.max_results') >= $request->input('limit')) && ($request->filled('limit'))) ? $limit = $request->input('limit') : $limit = config('app.max_results');
$order = $request->input('order') === 'asc' ? 'asc' : 'desc';
$sort = in_array($request->input('sort'), $allowed_columns) ? $request->input('sort') : 'created_at';
@@ -100,14 +106,36 @@ class DepartmentsController extends Controller
return (new DepartmentsTransformer)->transformDepartment($department);
}
/**
* Update the specified resource in storage.
*
* @author [A. Gianotto] [<snipe@snipe.net>]
* @since [v5.0]
* @param \Illuminate\Http\Request $request
* @param int $id
* @return \Illuminate\Http\Response
*/
public function update(Request $request, $id)
{
$this->authorize('update', Department::class);
$department = Department::findOrFail($id);
$department->fill($request->all());
if ($department->save()) {
return response()->json(Helper::formatStandardApiResponse('success', $department, trans('admin/departments/message.update.success')));
}
return response()->json(Helper::formatStandardApiResponse('error', null, $department->getErrors()));
}
/**
* Validates and deletes selected location.
* Validates and deletes selected department.
*
* @author [A. Gianotto] [<snipe@snipe.net>]
* @param int $locationId
* @since [v1.0]
* @since [v4.0]
* @return \Illuminate\Http\RedirectResponse
*/
public function destroy($id)
@@ -152,7 +180,7 @@ class DepartmentsController extends Controller
// This lets us have more flexibility in special cases like assets, where
// they may not have a ->name value but we want to display something anyway
foreach ($departments as $department) {
$department->use_image = ($department->image) ? url('/').'/uploads/departments/'.$department->image : null;
$department->use_image = ($department->image) ? Storage::disk('public')->url('departments/'.$department->image, $department->image) : null;
}
return (new SelectlistTransformer)->transformSelectlist($departments);

View File

@@ -2,11 +2,11 @@
namespace App\Http\Controllers\Api;
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
use App\Helpers\Helper;
use App\Models\Depreciation;
use App\Http\Controllers\Controller;
use App\Http\Transformers\DepreciationsTransformer;
use App\Models\Depreciation;
use Illuminate\Http\Request;
class DepreciationsController extends Controller
{
@@ -20,7 +20,7 @@ class DepreciationsController extends Controller
public function index(Request $request)
{
$this->authorize('view', Depreciation::class);
$allowed_columns = ['id','name','created_at'];
$allowed_columns = ['id','name','months','created_at'];
$depreciations = Depreciation::select('id','name','months','user_id','created_at','updated_at');
@@ -28,8 +28,13 @@ class DepreciationsController extends Controller
$depreciations = $depreciations->TextSearch($request->input('search'));
}
$offset = (($depreciations) && (request('offset') > $depreciations->count())) ? 0 : request('offset', 0);
$limit = $request->input('limit', 50);
// Set the offset to the API call's offset, unless the offset is higher than the actual count of items in which
// case we override with the actual count, so we should return 0 items.
$offset = (($depreciations) && ($request->get('offset') > $depreciations->count())) ? $depreciations->count() : $request->get('offset', 0);
// Check to make sure the limit is not higher than the max allowed
((config('app.max_results') >= $request->input('limit')) && ($request->filled('limit'))) ? $limit = $request->input('limit') : $limit = config('app.max_results');
$order = $request->input('order') === 'asc' ? 'asc' : 'desc';
$sort = in_array($request->input('sort'), $allowed_columns) ? $request->input('sort') : 'created_at';
$depreciations->orderBy($sort, $order);
@@ -110,10 +115,10 @@ class DepreciationsController extends Controller
public function destroy($id)
{
$this->authorize('delete', Depreciation::class);
$depreciation = Depreciation::findOrFail($id);
$depreciation = Depreciation::withCount('models as models_count')->findOrFail($id);
$this->authorize('delete', $depreciation);
if ($depreciation->has_models() > 0) {
if ($depreciation->models_count > 0) {
return response()->json(Helper::formatStandardApiResponse('error', trans('admin/depreciations/message.assoc_users')));
}

View File

@@ -2,11 +2,11 @@
namespace App\Http\Controllers\Api;
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
use App\Helpers\Helper;
use App\Models\Group;
use App\Http\Controllers\Controller;
use App\Http\Transformers\GroupsTransformer;
use App\Models\Group;
use Illuminate\Http\Request;
class GroupsController extends Controller
{
@@ -28,8 +28,13 @@ class GroupsController extends Controller
$groups = $groups->TextSearch($request->input('search'));
}
$offset = (($groups) && (request('offset') > $groups->count())) ? 0 : request('offset', 0);
$limit = $request->input('limit', 50);
// Set the offset to the API call's offset, unless the offset is higher than the actual count of items in which
// case we override with the actual count, so we should return 0 items.
$offset = (($groups) && ($request->get('offset') > $groups->count())) ? $groups->count() : $request->get('offset', 0);
// Check to make sure the limit is not higher than the max allowed
((config('app.max_results') >= $request->input('limit')) && ($request->filled('limit'))) ? $limit = $request->input('limit') : $limit = config('app.max_results');
$order = $request->input('order') === 'asc' ? 'asc' : 'desc';
$sort = in_array($request->input('sort'), $allowed_columns) ? $request->input('sort') : 'created_at';
$groups->orderBy($sort, $order);

View File

@@ -6,15 +6,15 @@ use App\Helpers\Helper;
use App\Http\Controllers\Controller;
use App\Http\Requests\ItemImportRequest;
use App\Http\Transformers\ImportsTransformer;
use App\Models\Asset;
use App\Models\Company;
use App\Models\Import;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Input;
use Artisan;
use Illuminate\Support\Facades\Request;
use Illuminate\Support\Facades\Session;
use Illuminate\Support\Facades\Storage;
use League\Csv\Reader;
use Symfony\Component\HttpFoundation\File\Exception\FileException;
use Artisan;
use App\Models\Asset;
class ImportController extends Controller
{
@@ -41,7 +41,7 @@ class ImportController extends Controller
{
$this->authorize('import');
if (!config('app.lock_passwords')) {
$files = Input::file('files');
$files = Request::file('files');
$path = config('app.private_uploads').'/imports';
$results = [];
$import = new Import;
@@ -49,10 +49,12 @@ class ImportController extends Controller
if (!in_array($file->getMimeType(), array(
'application/vnd.ms-excel',
'text/csv',
'application/csv',
'text/x-Algol68', // because wtf CSV files?
'text/plain',
'text/comma-separated-values',
'text/tsv'))) {
$results['error']='File type must be CSV';
$results['error']='File type must be CSV. Uploaded file is '.$file->getMimeType();
return response()->json(Helper::formatStandardApiResponse('error', null, $results['error']), 500);
}
@@ -112,14 +114,21 @@ class ImportController extends Controller
/**
* Processes the specified Import.
*
* @param \App\Import $import
* @param int $import_id
* @return \Illuminate\Http\Response
*/
public function process(ItemImportRequest $request, $import_id)
{
$this->authorize('import');
// Run a backup immediately before processing
Artisan::call('backup:run');
if ($request->has('run-backup')) {
\Log::debug('Backup manually requested via importer');
Artisan::call('backup:run');
} else {
\Log::debug('NO BACKUP requested via importer');
}
$errors = $request->import(Import::find($import_id));
$redirectTo = "hardware.index";
switch ($request->get('import-type')) {
@@ -155,19 +164,26 @@ class ImportController extends Controller
/**
* Remove the specified resource from storage.
*
* @param \App\Import $import
* @param int $import_id
* @return \Illuminate\Http\Response
*/
public function destroy($import_id)
{
$this->authorize('import');
$import = Import::find($import_id);
try {
unlink(config('app.private_uploads').'/imports/'.$import->file_path);
$import->delete();
return response()->json(Helper::formatStandardApiResponse('success', null, trans('admin/hardware/message.import.file_delete_success')));
} catch (\Exception $e) {
return response()->json(Helper::formatStandardApiResponse('error', null, trans('admin/hardware/message.import.file_delete_error')), 500);
$this->authorize('create', Asset::class);
if ($import = Import::find($import_id)) {
try {
// Try to delete the file
Storage::delete('imports/'.$import->file_path);
$import->delete();
return response()->json(Helper::formatStandardApiResponse('success', null, trans('admin/hardware/message.import.file_delete_success')));
} catch (\Exception $e) {
// If the file delete didn't work, remove it from the database anyway and return a warning
$import->delete();
return response()->json(Helper::formatStandardApiResponse('warning', null, trans('admin/hardware/message.import.file_not_deleted_warning')));
}
}
}
}

View File

@@ -0,0 +1,141 @@
<?php
namespace App\Http\Controllers\Api;
use App\Helpers\Helper;
use App\Http\Controllers\Controller;
use App\Http\Transformers\LicenseSeatsTransformer;
use App\Models\Asset;
use App\Models\License;
use App\Models\LicenseSeat;
use App\Models\User;
use Auth;
use Illuminate\Http\Request;
class LicenseSeatsController extends Controller
{
/**
* Display a listing of the resource.
*
* @param \Illuminate\Http\Request $request
* @param int $licenseId
* @return \Illuminate\Http\Response
*/
public function index(Request $request, $licenseId)
{
//
if ($license = License::find($licenseId)) {
$this->authorize('view', $license);
$seats = LicenseSeat::with('license', 'user', 'asset', 'user.department')
->where('license_seats.license_id', $licenseId);
$order = $request->input('order') === 'asc' ? 'asc' : 'desc';
if ($request->input('sort')=='department') {
$seats->OrderDepartments($order);
} else {
$seats->orderBy('id', $order);
}
$total = $seats->count();
$offset = (($seats) && (request('offset') > $total)) ? 0 : request('offset', 0);
$limit = request('limit', 50);
$seats = $seats->skip($offset)->take($limit)->get();
if ($seats) {
return (new LicenseSeatsTransformer)->transformLicenseSeats($seats, $total);
}
}
return response()->json(Helper::formatStandardApiResponse('error', null, trans('admin/licenses/message.does_not_exist')), 200);
}
/**
* Display the specified resource.
*
* @param int $licenseId
* @param int $seatId
* @return \Illuminate\Http\Response
*/
public function show($licenseId, $seatId)
{
//
$this->authorize('view', License::class);
// sanity checks:
// 1. does the license seat exist?
if (!$licenseSeat = LicenseSeat::find($seatId)) {
return response()->json(Helper::formatStandardApiResponse('error', null, 'Seat not found'));
}
// 2. does the seat belong to the specified license?
if (!$license = $licenseSeat->license()->first() || $license->id != intval($licenseId)) {
return response()->json(Helper::formatStandardApiResponse('error', null, 'Seat does not belong to the specified license'));
}
return (new LicenseSeatsTransformer)->transformLicenseSeat($licenseSeat);
}
/**
* Update the specified resource in storage.
*
* @param \Illuminate\Http\Request $request
* @param int $licenseId
* @param int $seatId
* @return \Illuminate\Http\Response
*/
public function update(Request $request, $licenseId, $seatId)
{
$this->authorize('checkout', License::class);
// sanity checks:
// 1. does the license seat exist?
if (!$licenseSeat = LicenseSeat::find($seatId)) {
return response()->json(Helper::formatStandardApiResponse('error', null, 'Seat not found'));
}
// 2. does the seat belong to the specified license?
if (!$license = $licenseSeat->license()->first() || $license->id != intval($licenseId)) {
return response()->json(Helper::formatStandardApiResponse('error', null, 'Seat does not belong to the specified license'));
}
$oldUser = $licenseSeat->user()->first();
$oldAsset = $licenseSeat->asset()->first();
// attempt to update the license seat
$licenseSeat->fill($request->all());
$licenseSeat->user_id = Auth::user()->id;
// check if this update is a checkin operation
// 1. are relevant fields touched at all?
$touched = $licenseSeat->isDirty('assigned_to') || $licenseSeat->isDirty('asset_id');
// 2. are they cleared? if yes then this is a checkin operation
$is_checkin = ($touched && $licenseSeat->assigned_to === null && $licenseSeat->asset_id === null);
if (!$touched) {
// nothing to update
return response()->json(Helper::formatStandardApiResponse('success', $licenseSeat, trans('admin/licenses/message.update.success')));
}
if ($licenseSeat->save()) {
// the logging functions expect only one "target". if both asset and user are present in the request,
// we simply let assets take precedence over users...
$changes = $licenseSeat->getChanges();
if (array_key_exists('assigned_to', $changes)) {
$target = $is_checkin ? $oldUser : User::find($changes['assigned_to']);
}
if (array_key_exists('asset_id', $changes)) {
$target = $is_checkin ? $oldAsset : Asset::find($changes['asset_id']);
}
if ($is_checkin) {
$licenseSeat->logCheckin($target, $request->input('note'));
return response()->json(Helper::formatStandardApiResponse('success', $licenseSeat, trans('admin/licenses/message.update.success')));
}
// in this case, relevant fields are touched but it's not a checkin operation. so it must be a checkout operation.
$licenseSeat->logCheckout($request->input('note'), $target);
return response()->json(Helper::formatStandardApiResponse('success', $licenseSeat, trans('admin/licenses/message.update.success')));
}
return Helper::formatStandardApiResponse('error', null, $licenseSeat->getErrors());
}
}

View File

@@ -6,6 +6,7 @@ use App\Helpers\Helper;
use App\Http\Controllers\Controller;
use App\Http\Transformers\LicenseSeatsTransformer;
use App\Http\Transformers\LicensesTransformer;
use App\Http\Transformers\SelectlistTransformer;
use App\Models\Company;
use App\Models\License;
use App\Models\LicenseSeat;
@@ -82,8 +83,13 @@ class LicensesController extends Controller
}
$offset = (($licenses) && (request('offset') > $licenses->count())) ? 0 : request('offset', 0);
$limit = request('limit', 50);
// Set the offset to the API call's offset, unless the offset is higher than the actual count of items in which
// case we override with the actual count, so we should return 0 items.
$offset = (($licenses) && ($request->get('offset') > $licenses->count())) ? $licenses->count() : $request->get('offset', 0);
// Check to make sure the limit is not higher than the max allowed
((config('app.max_results') >= $request->input('limit')) && ($request->filled('limit'))) ? $limit = $request->input('limit') : $limit = config('app.max_results');
$order = $request->input('order') === 'asc' ? 'asc' : 'desc';
@@ -97,11 +103,33 @@ class LicensesController extends Controller
case 'category':
$licenses = $licenses->leftJoin('categories', 'licenses.category_id', '=', 'categories.id')->orderBy('categories.name', $order);
break;
case 'depreciation':
$licenses = $licenses->leftJoin('depreciations', 'licenses.depreciation_id', '=', 'depreciations.id')->orderBy('depreciations.name', $order);
break;
case 'company':
$licenses = $licenses->leftJoin('companies', 'licenses.company_id', '=', 'companies.id')->orderBy('companies.name', $order);
break;
default:
$allowed_columns = ['id','name','purchase_cost','expiration_date','purchase_order','order_number','notes','purchase_date','serial','company','category','license_name','license_email','free_seats_count','seats'];
$allowed_columns =
[
'id',
'name',
'purchase_cost',
'expiration_date',
'purchase_order',
'order_number',
'notes',
'purchase_date',
'serial',
'company',
'category',
'license_name',
'license_email',
'free_seats_count',
'seats',
'termination_date',
'depreciation_id'
];
$sort = in_array($request->input('sort'), $allowed_columns) ? e($request->input('sort')) : 'created_at';
$licenses = $licenses->orderBy($sort, $order);
break;
@@ -150,7 +178,7 @@ class LicensesController extends Controller
public function show($id)
{
$this->authorize('view', License::class);
$license = License::findOrFail($id);
$license = License::withCount('freeSeats')->findOrFail($id);
$license = $license->load('assignedusers', 'licenseSeats.user', 'licenseSeats.asset');
return (new LicensesTransformer)->transformLicense($license);
}
@@ -209,40 +237,28 @@ class LicensesController extends Controller
}
return response()->json(Helper::formatStandardApiResponse('error', null, trans('admin/licenses/message.assoc_users')));
}
/**
* Get license seat listing
* Gets a paginated collection for the select2 menus
*
* @author [A. Gianotto] [<snipe@snipe.net>]
* @since [v1.0]
* @param int $licenseId
* @return \Illuminate\Contracts\View\View
* @see \App\Http\Transformers\SelectlistTransformer
*/
public function seats(Request $request, $licenseId)
public function selectlist(Request $request)
{
if ($license = License::find($licenseId)) {
$this->authorize('view', $license);
$seats = LicenseSeat::where('license_id', $licenseId)->with('license', 'user', 'asset');
$offset = (($seats) && (request('offset') > $seats->count())) ? 0 : request('offset', 0);
$limit = request('limit', 50);
$order = $request->input('order') === 'asc' ? 'asc' : 'desc';
$total = $seats->count();
$seats = $seats->skip($offset)->take($limit)->get();
if ($seats) {
return (new LicenseSeatsTransformer)->transformLicenseSeats($seats, $total);
}
$licenses = License::select([
'licenses.id',
'licenses.name'
]);
if ($request->filled('search')) {
$licenses = $licenses->where('licenses.name', 'LIKE', '%'.$request->get('search').'%');
}
return response()->json(Helper::formatStandardApiResponse('error', null, trans('admin/licenses/message.does_not_exist')), 200);
$licenses = $licenses->orderBy('name', 'ASC')->paginate(50);
return (new SelectlistTransformer)->transformSelectlist($licenses);
}

View File

@@ -8,6 +8,8 @@ use App\Helpers\Helper;
use App\Models\Location;
use App\Http\Transformers\LocationsTransformer;
use App\Http\Transformers\SelectlistTransformer;
use Illuminate\Pagination\LengthAwarePaginator;
use Illuminate\Support\Collection;
class LocationsController extends Controller
{
@@ -22,11 +24,11 @@ class LocationsController extends Controller
{
$this->authorize('view', Location::class);
$allowed_columns = [
'id','name','address','address2','city','state','country','zip','created_at',
'updated_at','manager_id','image',
'assigned_assets_count','users_count','assets_count','currency'];
'id','name','address','address2','city','state','country','zip','created_at',
'updated_at','manager_id','image',
'assigned_assets_count','users_count','assets_count','currency','ldap_ou'];
$locations = Location::with('parent', 'manager', 'childLocations')->select([
$locations = Location::with('parent', 'manager', 'children')->select([
'locations.id',
'locations.name',
'locations.address',
@@ -40,10 +42,11 @@ class LocationsController extends Controller
'locations.created_at',
'locations.updated_at',
'locations.image',
'locations.ldap_ou',
'locations.currency'
])->withCount('assignedAssets as assigned_assets_count')
->withCount('assets as assets_count')
->withCount('users as users_count');
->withCount('assets as assets_count')
->withCount('users as users_count');
if ($request->filled('search')) {
$locations = $locations->TextSearch($request->input('search'));
@@ -51,8 +54,11 @@ class LocationsController extends Controller
$offset = (($locations) && (request('offset') > $locations->count())) ? 0 : request('offset', 0);
$limit = $request->input('limit', 50);
$offset = (($locations) && (request('offset') > $locations->count())) ? $locations->count() : request('offset', 0);
// Check to make sure the limit is not higher than the max allowed
((config('app.max_results') >= $request->input('limit')) && ($request->filled('limit'))) ? $limit = $request->input('limit') : $limit = config('app.max_results');
$order = $request->input('order') === 'asc' ? 'asc' : 'desc';
$sort = in_array($request->input('sort'), $allowed_columns) ? $request->input('sort') : 'created_at';
@@ -106,7 +112,7 @@ class LocationsController extends Controller
public function show($id)
{
$this->authorize('view', Location::class);
$location = Location::with('parent', 'manager', 'childLocations')
$location = Location::with('parent', 'manager', 'children')
->select([
'locations.id',
'locations.name',
@@ -137,15 +143,19 @@ class LocationsController extends Controller
* @since [v4.0]
* @param \Illuminate\Http\Request $request
* @param int $id
* @return \Illuminate\Http\Response
* @return \Illuminate\Http\JsonResponse
*/
public function update(Request $request, $id)
{
$this->authorize('update', Location::class);
$location = Location::findOrFail($id);
$location->fill($request->all());
if ($location->save()) {
if ($location->isValid()) {
$location->save();
return response()->json(
Helper::formatStandardApiResponse(
'success',
@@ -170,6 +180,10 @@ class LocationsController extends Controller
{
$this->authorize('delete', Location::class);
$location = Location::findOrFail($id);
if(!$location->isDeletable()) {
return response()
->json(Helper::formatStandardApiResponse('error', null, trans('admin/companies/message.assoc_users')));
}
$this->authorize('delete', $location);
$location->delete();
return response()->json(Helper::formatStandardApiResponse('success', null, trans('admin/locations/message.delete.success')));
@@ -178,6 +192,27 @@ class LocationsController extends Controller
/**
* Gets a paginated collection for the select2 menus
*
* This is handled slightly differently as of ~4.7.8-pre, as
* we have to do some recursive magic to get the hierarchy to display
* properly when looking at the parent/child relationship in the
* rich menus.
*
* This means we can't use the normal pagination that we use elsewhere
* in our selectlists, since we have to get the full set before we can
* determine which location is parent/child/grandchild, etc.
*
* This also means that hierarchy display gets a little funky when people
* use the Select2 search functionality, but there's not much we can do about
* that right now.
*
* As a result, instead of paginating as part of the query, we have to grab
* the entire data set, and then invoke a paginator manually and pass that
* through to the SelectListTransformer.
*
* Many thanks to @uberbrady for the help getting this working better.
* Recursion still sucks, but I guess he doesn't have to get in the
* sea... this time.
*
* @author [A. Gianotto] [<snipe@snipe.net>]
* @since [v4.0.16]
* @see \App\Http\Transformers\SelectlistTransformer
@@ -189,25 +224,44 @@ class LocationsController extends Controller
$locations = Location::select([
'locations.id',
'locations.name',
'locations.parent_id',
'locations.image',
]);
$page = 1;
if ($request->filled('page')) {
$page = $request->input('page');
}
if ($request->filled('search')) {
$locations = $locations->where('locations.name', 'LIKE', '%'.$request->get('search').'%');
$locations = $locations->where('locations.name', 'LIKE', '%'.$request->input('search').'%');
}
$locations = $locations->orderBy('name', 'ASC')->paginate(50);
$locations = $locations->orderBy('name', 'ASC')->get();
$locations_with_children = [];
// Loop through and set some custom properties for the transformer to use.
// This lets us have more flexibility in special cases like assets, where
// they may not have a ->name value but we want to display something anyway
foreach ($locations as $location) {
$location->use_text = $location->name;
$location->use_image = ($location->image) ? url('/').'/uploads/locations/'.$location->image : null;
if (!array_key_exists($location->parent_id, $locations_with_children)) {
$locations_with_children[$location->parent_id] = [];
}
$locations_with_children[$location->parent_id][] = $location;
}
return (new SelectlistTransformer)->transformSelectlist($locations);
if ($request->filled('search')) {
$locations_formatted = $locations;
} else {
$location_options = Location::indenter($locations_with_children);
$locations_formatted = new Collection($location_options);
}
$paginated_results = new LengthAwarePaginator($locations_formatted->forPage($page, 500), $locations_formatted->count(), 500, $page, []);
//return [];
return (new SelectlistTransformer)->transformSelectlist($paginated_results);
}
}

View File

@@ -2,13 +2,13 @@
namespace App\Http\Controllers\Api;
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
use App\Helpers\Helper;
use App\Models\Manufacturer;
use App\Http\Transformers\DatatablesTransformer;
use App\Http\Controllers\Controller;
use App\Http\Transformers\ManufacturersTransformer;
use App\Http\Transformers\SelectlistTransformer;
use App\Models\Manufacturer;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Storage;
class ManufacturersController extends Controller
{
@@ -37,10 +37,13 @@ class ManufacturersController extends Controller
}
// Set the offset to the API call's offset, unless the offset is higher than the actual count of items in which
// case we override with the actual count, so we should return 0 items.
$offset = (($manufacturers) && ($request->get('offset') > $manufacturers->count())) ? $manufacturers->count() : $request->get('offset', 0);
// Check to make sure the limit is not higher than the max allowed
((config('app.max_results') >= $request->input('limit')) && ($request->filled('limit'))) ? $limit = $request->input('limit') : $limit = config('app.max_results');
$offset = (($manufacturers) && (request('offset') > $manufacturers->count())) ? 0 : request('offset', 0);
$limit = $request->input('limit', 50);
$order = $request->input('order') === 'asc' ? 'asc' : 'desc';
$sort = in_array($request->input('sort'), $allowed_columns) ? $request->input('sort') : 'created_at';
$manufacturers->orderBy($sort, $order);
@@ -120,11 +123,21 @@ class ManufacturersController extends Controller
*/
public function destroy($id)
{
$this->authorize('delete', Manufacturer::class);
$manufacturer = Manufacturer::findOrFail($id);
$this->authorize('delete', $manufacturer);
$manufacturer->delete();
return response()->json(Helper::formatStandardApiResponse('success', null, trans('admin/manufacturers/message.delete.success')));
if ($manufacturer->isDeletable()) {
$manufacturer->delete();
return response()->json(Helper::formatStandardApiResponse('success', null, trans('admin/manufacturers/message.delete.success')));
}
return response()->json(Helper::formatStandardApiResponse('error', null, trans('admin/manufacturers/message.assoc_users')));
}
@@ -156,7 +169,7 @@ class ManufacturersController extends Controller
// they may not have a ->name value but we want to display something anyway
foreach ($manufacturers as $manufacturer) {
$manufacturer->use_text = $manufacturer->name;
$manufacturer->use_image = ($manufacturer->image) ? url('/').'/uploads/manufacturers/'.$manufacturer->image : null;
$manufacturer->use_image = ($manufacturer->image) ? Storage::disk('public')->url('manufacturers/'.$manufacturer->image, $manufacturer->image) : null;
}
return (new SelectlistTransformer)->transformSelectlist($manufacturers);

View File

@@ -0,0 +1,449 @@
<?php
namespace App\Http\Controllers\Api;
use App\Helpers\Helper;
use App\Http\Controllers\Controller;
use App\Http\Transformers\PredefinedKitsTransformer;
use App\Models\PredefinedKit;
use Illuminate\Http\Request;
/**
* @author [D. Minaev.] [<dmitriy.minaev.v@gmail.com>]
*/
class PredefinedKitsController extends Controller
{
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
*/
public function index(Request $request)
{
$this->authorize('view', PredefinedKit::class);
$allowed_columns = ['id', 'name'];
$kits = PredefinedKit::query();
if ($request->filled('search')) {
$kits = $kits->TextSearch($request->input('search'));
}
$offset = $request->input('offset', 0);
$limit = $request->input('limit', 50);
$order = $request->input('order') === 'asc' ? 'asc' : 'desc';
$sort = in_array($request->input('sort'), $allowed_columns) ? $request->input('sort') : 'assets_count';
$kits->orderBy($sort, $order);
$total = $kits->count();
$kits = $kits->skip($offset)->take($limit)->get();
return (new PredefinedKitsTransformer)->transformPredefinedKits($kits, $total);
}
/**
* Store a newly created resource in storage.
*
* @param \Illuminate\Http\Request $request
* @return \Illuminate\Http\Response
*/
public function store(Request $request)
{
$this->authorize('create', PredefinedKit::class);
$kit = new PredefinedKit;
$kit->fill($request->all());
if ($kit->save()) {
return response()->json(Helper::formatStandardApiResponse('success', $kit, trans('admin/kits/general.create_success')));
}
return response()->json(Helper::formatStandardApiResponse('error', null, $kit->getErrors()));
}
/**
* Display the specified resource.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function show($id)
{
$this->authorize('view', PredefinedKit::class);
$kit = PredefinedKit::findOrFail($id);
return (new PredefinedKitsTransformer)->transformPredefinedKit($kit);
}
/**
* Update the specified resource in storage.
*
* @param \Illuminate\Http\Request $request
* @param int $id kit id
* @return \Illuminate\Http\Response
*/
public function update(Request $request, $id)
{
$this->authorize('update', PredefinedKit::class);
$kit = PredefinedKit::findOrFail($id);
$kit->fill($request->all());
if ($kit->save()) {
return response()->json(Helper::formatStandardApiResponse('success', $kit, trans('admin/kits/general.update_success'))); // TODO: trans
}
return response()->json(Helper::formatStandardApiResponse('error', null, $kit->getErrors()));
}
/**
* Remove the specified resource from storage.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function destroy($id)
{
$this->authorize('delete', PredefinedKit::class);
$kit = PredefinedKit::findOrFail($id);
// Delete childs
$kit->models()->detach();
$kit->licenses()->detach();
$kit->consumables()->detach();
$kit->accessories()->detach();
$kit->delete();
return response()->json(Helper::formatStandardApiResponse('success', null, trans('admin/kits/general.delete_success'))); // TODO: trans
}
/**
* Gets a paginated collection for the select2 menus
*
* @see \App\Http\Transformers\SelectlistTransformer
*
*/
public function selectlist(Request $request)
{
$kits = PredefinedKit::select([
'id',
'name'
]);
if ($request->filled('search')) {
$kits = $kits->where('name', 'LIKE', '%'.$request->get('search').'%');
}
$kits = $kits->orderBy('name', 'ASC')->paginate(50);
return (new SelectlistTransformer)->transformSelectlist($kits);
}
/**
* Display the specified resource.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function indexLicenses($kit_id) {
$this->authorize('view', PredefinedKit::class);
$kit = PredefinedKit::findOrFail($kit_id);
$licenses = $kit->licenses;
return (new PredefinedKitsTransformer)->transformElements($licenses, $licenses->count());
}
/**
* Store the specified resource.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function storeLicense(Request $request, $kit_id)
{
$this->authorize('update', PredefinedKit::class);
$kit = PredefinedKit::findOrFail($kit_id);
$quantity = $request->input('quantity', 1);
if( $quantity < 1) {
$quantity = 1;
}
$license_id = $request->get('license');
$relation = $kit->licenses();
if( $relation->find($license_id) ) {
return response()->json(Helper::formatStandardApiResponse('error', null, ['license' => 'License already attached to kit']));
}
$relation->attach( $license_id, ['quantity' => $quantity]);
return response()->json(Helper::formatStandardApiResponse('success', $kit, 'License added successfull')); // TODO: trans
}
/**
* Update the specified resource in storage.
*
* @param \Illuminate\Http\Request $request
* @param int $kit_id
* @return \Illuminate\Http\Response
*/
public function updateLicense(Request $request, $kit_id, $license_id)
{
$this->authorize('update', PredefinedKit::class);
$kit = PredefinedKit::findOrFail($kit_id);
$quantity = $request->input('quantity', 1);
if( $quantity < 1) {
$quantity = 1;
}
$kit->licenses()->syncWithoutDetaching([$license_id => ['quantity' => $quantity]]);
return response()->json(Helper::formatStandardApiResponse('success', $kit, 'License updated')); // TODO: trans
}
/**
* Remove the specified resource from storage.
*
* @param int $kit_id
* @return \Illuminate\Http\Response
*/
public function detachLicense($kit_id, $license_id)
{
$this->authorize('update', PredefinedKit::class);
$kit = PredefinedKit::findOrFail($kit_id);
$kit->licenses()->detach($license_id);
return response()->json(Helper::formatStandardApiResponse('success', $kit, trans('admin/kits/general.delete_success')));
}
/**
* Display the specified resource.
*
* @param int $kit_id
* @return \Illuminate\Http\Response
*/
public function indexModels($kit_id) {
$this->authorize('view', PredefinedKit::class);
$kit = PredefinedKit::findOrFail($kit_id);
$models = $kit->models;
return (new PredefinedKitsTransformer)->transformElements($models, $models->count());
}
/**
* Store the specified resource.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function storeModel(Request $request, $kit_id)
{
$this->authorize('update', PredefinedKit::class);
$kit = PredefinedKit::findOrFail($kit_id);
$model_id = $request->get('model');
$quantity = $request->input('quantity', 1);
if( $quantity < 1) {
$quantity = 1;
}
$relation = $kit->models();
if( $relation->find($model_id) ) {
return response()->json(Helper::formatStandardApiResponse('error', null, ['model' => 'Model already attached to kit']));
}
$relation->attach($model_id, ['quantity' => $quantity]);
return response()->json(Helper::formatStandardApiResponse('success', $kit, 'Model added successfull'));
}
/**
* Update the specified resource in storage.
*
* @param \Illuminate\Http\Request $request
* @param int $kit_id
* @return \Illuminate\Http\Response
*/
public function updateModel(Request $request, $kit_id, $model_id)
{
$this->authorize('update', PredefinedKit::class);
$kit = PredefinedKit::findOrFail($kit_id);
$quantity = $request->input('quantity', 1);
if( $quantity < 1) {
$quantity = 1;
}
$kit->models()->syncWithoutDetaching([$model_id => ['quantity' => $quantity]]);
return response()->json(Helper::formatStandardApiResponse('success', $kit, 'License updated')); // TODO: trans
}
/**
* Remove the specified resource from storage.
*
* @param int $kit_id
* @return \Illuminate\Http\Response
*/
public function detachModel($kit_id, $model_id)
{
$this->authorize('update', PredefinedKit::class);
$kit = PredefinedKit::findOrFail($kit_id);
$kit->models()->detach($model_id);
return response()->json(Helper::formatStandardApiResponse('success', $kit, trans('admin/kits/general.model_removed_success')));
}
/**
* Display the specified resource.
*
* @param int $kit_id
* @return \Illuminate\Http\Response
*/
public function indexConsumables($kit_id) {
$this->authorize('view', PredefinedKit::class);
$kit = PredefinedKit::findOrFail($kit_id);
$consumables = $kit->consumables;
return (new PredefinedKitsTransformer)->transformElements($consumables, $consumables->count());
}
/**
* Store the specified resource.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function storeConsumable(Request $request, $kit_id)
{
$this->authorize('update', PredefinedKit::class);
$kit = PredefinedKit::findOrFail($kit_id);
$quantity = $request->input('quantity', 1);
if( $quantity < 1) {
$quantity = 1;
}
$consumable_id = $request->get('consumable');
$relation = $kit->consumables();
if( $relation->find($consumable_id) ) {
return response()->json(Helper::formatStandardApiResponse('error', null, ['consumable' => 'Consumable already attached to kit']));
}
$relation->attach( $consumable_id, ['quantity' => $quantity]);
return response()->json(Helper::formatStandardApiResponse('success', $kit, 'Consumable added successfull')); // TODO: trans
}
/**
* Update the specified resource in storage.
*
* @param \Illuminate\Http\Request $request
* @param int $kit_id
* @return \Illuminate\Http\Response
*/
public function updateConsumable(Request $request, $kit_id, $consumable_id)
{
$this->authorize('update', PredefinedKit::class);
$kit = PredefinedKit::findOrFail($kit_id);
$quantity = $request->input('quantity', 1);
if( $quantity < 1) {
$quantity = 1;
}
$kit->consumables()->syncWithoutDetaching([$consumable_id => ['quantity' => $quantity]]);
return response()->json(Helper::formatStandardApiResponse('success', $kit, 'Consumable updated')); // TODO: trans
}
/**
* Remove the specified resource from storage.
*
* @param int $kit_id
* @return \Illuminate\Http\Response
*/
public function detachConsumable($kit_id, $consumable_id)
{
$this->authorize('update', PredefinedKit::class);
$kit = PredefinedKit::findOrFail($kit_id);
$kit->consumables()->detach($consumable_id);
return response()->json(Helper::formatStandardApiResponse('success', $kit, 'Delete was successfull')); // TODO: trans
}
/**
* Display the specified resource.
*
* @param int $kit_id
* @return \Illuminate\Http\Response
*/
public function indexAccessories($kit_id) {
$this->authorize('view', PredefinedKit::class);
$kit = PredefinedKit::findOrFail($kit_id);
$accessories = $kit->accessories;
return (new PredefinedKitsTransformer)->transformElements($accessories, $accessories->count());
}
/**
* Store the specified resource.
*
* @param int $kit_id
* @return \Illuminate\Http\Response
*/
public function storeAccessory(Request $request, $kit_id)
{
$this->authorize('update', PredefinedKit::class);
$kit = PredefinedKit::findOrFail($kit_id);
$quantity = $request->input('quantity', 1);
if( $quantity < 1) {
$quantity = 1;
}
$accessory_id = $request->get('accessory');
$relation = $kit->accessories();
if( $relation->find($accessory_id) ) {
return response()->json(Helper::formatStandardApiResponse('error', null, ['accessory' => 'Accessory already attached to kit']));
}
$relation->attach( $accessory_id, ['quantity' => $quantity]);
return response()->json(Helper::formatStandardApiResponse('success', $kit, 'Accessory added successfull')); // TODO: trans
}
/**
* Update the specified resource in storage.
*
* @param \Illuminate\Http\Request $request
* @param int $kit_id
* @return \Illuminate\Http\Response
*/
public function updateAccessory(Request $request, $kit_id, $accessory_id)
{
$this->authorize('update', PredefinedKit::class);
$kit = PredefinedKit::findOrFail($kit_id);
$quantity = $request->input('quantity', 1);
if( $quantity < 1) {
$quantity = 1;
}
$kit->accessories()->syncWithoutDetaching([$accessory_id => ['quantity' => $quantity]]);
return response()->json(Helper::formatStandardApiResponse('success', $kit, 'Accessory updated')); // TODO: trans
}
/**
* Remove the specified resource from storage.
*
* @param int $kit_id
* @return \Illuminate\Http\Response
*/
public function detachAccessory($kit_id, $accessory_id)
{
$this->authorize('update', PredefinedKit::class);
$kit = PredefinedKit::findOrFail($kit_id);
$kit->accessories()->detach($accessory_id);
return response()->json(Helper::formatStandardApiResponse('success', $kit, 'Delete was successfull')); // TODO: trans
}
}

View File

@@ -2,11 +2,10 @@
namespace App\Http\Controllers\Api;
use App\Models\CheckoutRequest;
use App\Http\Controllers\Controller;
use Auth;
use App\Helpers\Helper;
use App\Http\Controllers\Controller;
use App\Models\CheckoutRequest;
use Auth;
class ProfileController extends Controller
{

View File

@@ -2,10 +2,10 @@
namespace App\Http\Controllers\Api;
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
use App\Models\Actionlog;
use App\Http\Transformers\ActionlogsTransformer;
use App\Models\Actionlog;
use Illuminate\Http\Request;
class ReportsController extends Controller
{
@@ -49,6 +49,7 @@ class ReportsController extends Controller
'created_at',
'target_id',
'user_id',
'accept_signature',
'action_type',
'note'
];

View File

@@ -2,50 +2,122 @@
namespace App\Http\Controllers\Api;
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
use App\Models\Ldap;
use Validator;
use App\Http\Transformers\LoginAttemptsTransformer;
use App\Models\Setting;
use Mail;
use App\Notifications\SlackTest;
use Notification;
use App\Notifications\MailTest;
use App\Services\LdapAd;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
use Illuminate\Http\Response;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Log;
use Illuminate\Support\Facades\Notification;
use GuzzleHttp\Client;
use Illuminate\Support\Facades\Storage;
use Illuminate\Support\Facades\Validator;
use App\Models\Ldap; // forward-port of v4 LDAP model for Sync
class SettingsController extends Controller
{
public function ldaptest()
/**
* Test the ldap settings
*
* @author Wes Hulette <jwhulette@gmail.com>
*
* @since 5.0.0
*
* @param App\Models\LdapAd $ldap
*
* @return \Illuminate\Http\JsonResponse
*/
public function ldapAdSettingsTest(LdapAd $ldap): JsonResponse
{
if (Setting::getSettings()->ldap_enabled!='1') {
\Log::debug('LDAP is not enabled cannot test.');
if(!$ldap->init()) {
Log::info('LDAP is not enabled so we cannot test.');
return response()->json(['message' => 'LDAP is not enabled, cannot test.'], 400);
}
\Log::debug('Preparing to test LDAP connection');
// The connect, bind and resulting users message
$message = [];
// This is all kinda fucked right now. The connection test doesn't actually do what you think,
// // and the way we parse the errors
// on the JS side is horrible.
Log::info('Preparing to test LDAP user login');
// Test user can connect to the LDAP server
try {
$connection = Ldap::connectToLdap();
try {
\Log::debug('attempting to bind to LDAP for LDAP test');
Ldap::bindAdminToLdap($connection);
return response()->json(['message' => 'It worked!'], 200);
} catch (\Exception $e) {
\Log::debug('Bind failed');
return response()->json(['message' => $e->getMessage()], 400);
//return response()->json(['message' => $e->getMessage()], 500);
}
} catch (\Exception $e) {
\Log::debug('Connection failed');
return response()->json(['message' => $e->getMessage()], 600);
$ldap->testLdapAdUserConnection();
$message['login'] = [
'message' => 'Successfully connected to LDAP server.'
];
} catch (\Exception $ex) {
\Log::debug('Connection to LDAP server '.Setting::getSettings()->ldap_server.' failed. Please check your LDAP settings and try again. Server Responded with error: ' . $ex->getMessage());
return response()->json(
['message' => 'Connection to LDAP server '.Setting::getSettings()->ldap_server." failed. Verify that the LDAP hostname is entered correctly and that it can be reached from this web server. \n\nServer Responded with error: " . $ex->getMessage()
], 400);
}
Log::info('Preparing to test LDAP bind connection');
// Test user can bind to the LDAP server
try {
Log::info('Testing Bind');
$ldap->testLdapAdBindConnection();
$message['bind'] = [
'message' => 'Successfully bound to LDAP server.'
];
} catch (\Exception $ex) {
Log::info('LDAP Bind failed');
return response()->json(['message' => 'Connection to LDAP successful, but we were unable to Bind the LDAP user '.Setting::getSettings()->ldap_uname.". Verify your that your LDAP Bind username and password are correct. \n\nServer Responded with error: " . $ex->getMessage()
], 400);
}
Log::info('Preparing to get sample user set from LDAP directory');
// Get a sample of 10 users so user can verify the data is correct
$settings = Setting::getSettings();
try {
Log::info('Testing LDAP sync');
error_reporting(E_ALL & ~E_DEPRECATED); // workaround for php7.4, which deprecates ldap_control_paged_result
// $users = $ldap->testUserImportSync(); // from AdLdap2 from v5, disabling and falling back to v4's sync code
$users = collect(Ldap::findLdapUsers())->slice(0, 11)->filter(function ($value, $key) { //choosing ELEVEN because one is going to be the count, which we're about to filter out in the next line
return is_int($key);
})->map(function ($item) use ($settings) {
return (object) [
'username' => $item[$settings['ldap_username_field']][0] ?? null,
'employee_number' => $item[$settings['ldap_emp_num']][0] ?? null,
'lastname' => $item[$settings['ldap_lname_field']][0] ?? null,
'firstname' => $item[$settings['ldap_fname_field']][0] ?? null,
'email' => $item[$settings['ldap_email']][0] ?? null,
];
});
if ($users->count() > 0) {
$message['user_sync'] = [
'users' => $users
];
} else {
$message['user_sync'] = [
'message' => 'Connection to LDAP was successful, however there were no users returned from your query. You should confirm the Base Bind DN above.'
];
return response()->json($message, 400);
}
} catch (\Exception $ex) {
Log::info('LDAP sync failed');
$message['user_sync'] = [
'message' => 'Error getting users from LDAP directory, error: ' . $ex->getMessage()
];
return response()->json($message, 400);
}
return response()->json($message, 200);
}
public function ldaptestlogin(Request $request)
public function ldaptestlogin(Request $request, LdapAd $ldap)
{
if (Setting::getSettings()->ldap_enabled!='1') {
@@ -69,55 +141,54 @@ class SettingsController extends Controller
\Log::debug('Preparing to test LDAP login');
try {
$connection = Ldap::connectToLdap();
try {
Ldap::bindAdminToLdap($connection);
\Log::debug('Attempting to bind to LDAP for LDAP test');
try {
$ldap_user = Ldap::findAndBindUserLdap($request->input('ldaptest_user'), $request->input('ldaptest_password'));
if ($ldap_user) {
\Log::debug('It worked! '. $request->input('ldaptest_user').' successfully binded to LDAP.');
return response()->json(['message' => 'It worked! '. $request->input('ldaptest_user').' successfully binded to LDAP.'], 200);
}
return response()->json(['message' => 'Login Failed. '. $request->input('ldaptest_user').' did not successfully bind to LDAP.'], 400);
DB::beginTransaction(); //this was the easiest way to invoke a full test of an LDAP login without adding new users to the DB (which may not be desired)
} catch (\Exception $e) {
\Log::debug('LDAP login failed');
return response()->json(['message' => $e->getMessage()], 400);
}
// $results = $ldap->ldap->auth()->attempt($request->input('ldaptest_username'), $request->input('ldaptest_password'), true);
// can't do this because that's a protected property.
} catch (\Exception $e) {
\Log::debug('Bind failed');
return response()->json(['message' => $e->getMessage()], 400);
//return response()->json(['message' => $e->getMessage()], 500);
$results = $ldap->ldapLogin($request->input('ldaptest_user'), $request->input('ldaptest_password')); // this would normally create a user on success (if they didn't already exist), but for the transaction
if($results) {
return response()->json(['message' => 'It worked! '. $request->input('ldaptest_user').' successfully binded to LDAP.'], 200);
} else {
return response()->json(['message' => 'Login Failed. '. $request->input('ldaptest_user').' did not successfully bind to LDAP.'], 400);
}
} catch (\Exception $e) {
\Log::debug('Connection failed');
return response()->json(['message' => $e->getMessage()], 500);
return response()->json(['message' => $e->getMessage()], 400);
} finally {
DB::rollBack(); // ALWAYS rollback, whether success or failure
}
}
public function slacktest()
public function slacktest(Request $request)
{
if ($settings = Setting::getSettings()->slack_channel=='') {
\Log::debug('Slack is not enabled. Cannot test.');
return response()->json(['message' => 'Slack is not enabled, cannot test.'], 400);
}
$slack = new Client([
'base_url' => e($request->input('slack_endpoint')),
'defaults' => [
'exceptions' => false
]
]);
\Log::debug('Preparing to test slack connection');
$payload = json_encode(
[
'channel' => e($request->input('slack_channel')),
'text' => trans('general.slack_test_msg'),
'username' => e($request->input('slack_botname')),
'icon_emoji' => ':heart:'
]);
try {
Notification::send($settings = Setting::getSettings(), new SlackTest());
$slack->post($request->input('slack_endpoint'),['body' => $payload]);
return response()->json(['message' => 'Success'], 200);
} catch (\Exception $e) {
\Log::debug('Slack connection failed');
return response()->json(['message' => $e->getMessage()], 400);
return response()->json(['message' => 'Oops! Please check the channel name and webhook endpoint URL. Slack responded with: '.$e->getMessage()], 400);
}
return response()->json(['message' => 'Something went wrong :( '], 400);
}
@@ -135,7 +206,7 @@ class SettingsController extends Controller
try {
Notification::send(Setting::first(), new MailTest());
return response()->json(['message' => 'Mail sent to '.config('mail.reply_to.address')], 200);
} catch (Exception $e) {
} catch (\Exception $e) {
return response()->json(['message' => $e->getMessage()], 500);
}
}
@@ -144,5 +215,74 @@ class SettingsController extends Controller
}
/**
* Delete server-cached barcodes
*
* @author [A. Gianotto] [<snipe@snipe.net>]
* @since [v5.0.0]
* @return Response
*/
public function purgeBarcodes()
{
$file_count = 0;
$files = Storage::disk('public')->files('barcodes');
foreach ($files as $file) { // iterate files
$file_parts = explode(".", $file);
$extension = end($file_parts);
\Log::debug($extension);
// Only generated barcodes would have a .png file extension
if ($extension =='png') {
\Log::debug('Deleting: '.$file);
try {
Storage::disk('public')->delete($file);
\Log::debug('Deleting: '.$file);
$file_count++;
} catch (\Exception $e) {
\Log::debug($e);
}
}
}
return response()->json(['message' => 'Deleted '.$file_count.' barcodes'], 200);
}
/**
* Get a list of login attempts
*
* @author [A. Gianotto] [<snipe@snipe.net>]
* @since [v5.0.0]
* @param \Illuminate\Http\Request $request
* @return array
*/
public function showLoginAttempts(Request $request)
{
$allowed_columns = ['id', 'username', 'remote_ip', 'user_agent','successful','created_at'];
$login_attempts = DB::table('login_attempts');
$order = $request->input('order') === 'asc' ? 'asc' : 'desc';
$sort = in_array($request->get('sort'), $allowed_columns) ? $request->get('sort') : 'created_at';
$total = $login_attempts->count();
$login_attempts->orderBy($sort, $order);
$login_attempt_results = $login_attempts->skip(request('offset', 0))->take(request('limit', 20))->get();
return (new LoginAttemptsTransformer)->transformLoginAttempts($login_attempt_results, $total);
}
}

View File

@@ -2,13 +2,13 @@
namespace App\Http\Controllers\Api;
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
use App\Helpers\Helper;
use App\Models\Statuslabel;
use App\Models\Asset;
use App\Http\Transformers\StatuslabelsTransformer;
use App\Http\Controllers\Controller;
use App\Http\Transformers\AssetsTransformer;
use App\Http\Transformers\StatuslabelsTransformer;
use App\Models\Asset;
use App\Models\Statuslabel;
use Illuminate\Http\Request;
class StatuslabelsController extends Controller
{
@@ -30,8 +30,13 @@ class StatuslabelsController extends Controller
$statuslabels = $statuslabels->TextSearch($request->input('search'));
}
$offset = (($statuslabels) && (request('offset') > $statuslabels->count())) ? 0 : request('offset', 0);
$limit = $request->input('limit', 50);
// Set the offset to the API call's offset, unless the offset is higher than the actual count of items in which
// case we override with the actual count, so we should return 0 items.
$offset = (($statuslabels) && ($request->get('offset') > $statuslabels->count())) ? $statuslabels->count() : $request->get('offset', 0);
// Check to make sure the limit is not higher than the max allowed
((config('app.max_results') >= $request->input('limit')) && ($request->filled('limit'))) ? $limit = $request->input('limit') : $limit = config('app.max_results');
$order = $request->input('order') === 'asc' ? 'asc' : 'desc';
$sort = in_array($request->input('sort'), $allowed_columns) ? $request->input('sort') : 'created_at';
$statuslabels->orderBy($sort, $order);
@@ -162,25 +167,31 @@ class StatuslabelsController extends Controller
{
$this->authorize('view', Statuslabel::class);
$statuslabels = Statuslabel::with('assets')->groupBy('id')->withCount('assets as assets_count')->get();
$statuslabels = Statuslabel::with('assets')
->groupBy('id')
->withCount('assets as assets_count')
->get();
$labels=[];
$points=[];
$colors=[];
$default_color_count = 0;
$colors_array = array();
foreach ($statuslabels as $statuslabel) {
if ($statuslabel->assets_count > 0) {
$labels[]=$statuslabel->name. ' ('.number_format($statuslabel->assets_count).')';
$points[]=$statuslabel->assets_count;
if ($statuslabel->color!='') {
$colors[]=$statuslabel->color;
$colors_array[] = $statuslabel->color;
} else {
$colors_array[] = Helper::defaultChartColors($default_color_count);
$default_color_count++;
}
}
}
$colors_array = array_merge($colors, Helper::chartColors());
$result= [
"labels" => $labels,
"datasets" => [ [
@@ -204,11 +215,11 @@ class StatuslabelsController extends Controller
{
$this->authorize('view', Statuslabel::class);
$this->authorize('index', Asset::class);
$assets = Asset::where('status_id','=',$id);
$assets = Asset::where('status_id','=',$id)->with('assignedTo');
$allowed_columns = [
'id',
'name'
'name',
];
$offset = request('offset', 0);
@@ -238,8 +249,6 @@ class StatuslabelsController extends Controller
*/
public function checkIfDeployable($id) {
$statuslabel = Statuslabel::findOrFail($id);
$this->authorize('view', Asset::class);
if ($statuslabel->getStatuslabelType()=='deployable') {
return '1';
}

View File

@@ -2,13 +2,13 @@
namespace App\Http\Controllers\Api;
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
use App\Helpers\Helper;
use App\Models\Supplier;
use App\Http\Transformers\SuppliersTransformer;
use App\Http\Controllers\Controller;
use App\Http\Transformers\SelectlistTransformer;
use App\Http\Transformers\SuppliersTransformer;
use App\Models\Supplier;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Storage;
class SuppliersController extends Controller
{
@@ -22,7 +22,7 @@ class SuppliersController extends Controller
public function index(Request $request)
{
$this->authorize('view', Supplier::class);
$allowed_columns = ['id','name','address','phone','contact','fax','email','image','assets_count','licenses_count', 'accessories_count'];
$allowed_columns = ['id','name','address','phone','contact','fax','email','image','assets_count','licenses_count', 'accessories_count','url'];
$suppliers = Supplier::select(
array('id','name','address','address2','city','state','country','fax', 'phone','email','contact','created_at','updated_at','deleted_at','image','notes')
@@ -33,8 +33,13 @@ class SuppliersController extends Controller
$suppliers = $suppliers->TextSearch($request->input('search'));
}
$offset = (($suppliers) && (request('offset') > $suppliers->count())) ? 0 : request('offset', 0);
$limit = $request->input('limit', 50);
// Set the offset to the API call's offset, unless the offset is higher than the actual count of items in which
// case we override with the actual count, so we should return 0 items.
$offset = (($suppliers) && ($request->get('offset') > $suppliers->count())) ? $suppliers->count() : $request->get('offset', 0);
// Check to make sure the limit is not higher than the max allowed
((config('app.max_results') >= $request->input('limit')) && ($request->filled('limit'))) ? $limit = $request->input('limit') : $limit = config('app.max_results');
$order = $request->input('order') === 'asc' ? 'asc' : 'desc';
$sort = in_array($request->input('sort'), $allowed_columns) ? $request->input('sort') : 'created_at';
$suppliers->orderBy($sort, $order);
@@ -164,7 +169,7 @@ class SuppliersController extends Controller
// they may not have a ->name value but we want to display something anyway
foreach ($suppliers as $supplier) {
$supplier->use_text = $supplier->name;
$supplier->use_image = ($supplier->image) ? url('/').'/uploads/suppliers/'.$supplier->image : null;
$supplier->use_image = ($supplier->image) ? Storage::disk('public')->url('suppliers/'.$supplier->image, $supplier->image) : null;
}
return (new SelectlistTransformer)->transformSelectlist($suppliers);

View File

@@ -2,17 +2,21 @@
namespace App\Http\Controllers\Api;
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
use App\Http\Transformers\UsersTransformer;
use App\Models\Company;
use App\Models\User;
use App\Helpers\Helper;
use App\Http\Controllers\Controller;
use App\Http\Requests\SaveUserRequest;
use App\Models\Asset;
use App\Http\Transformers\AssetsTransformer;
use App\Http\Transformers\SelectlistTransformer;
use App\Http\Transformers\AccessoriesTransformer;
use App\Http\Transformers\AssetsTransformer;
use App\Http\Transformers\LicensesTransformer;
use App\Http\Transformers\SelectlistTransformer;
use App\Http\Transformers\UsersTransformer;
use App\Models\Asset;
use App\Models\Company;
use App\Models\License;
use App\Models\User;
use Auth;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Storage;
class UsersController extends Controller
{
@@ -45,6 +49,7 @@ class UsersController extends Controller
'users.jobtitle',
'users.last_login',
'users.last_name',
'users.locale',
'users.location_id',
'users.manager_id',
'users.notes',
@@ -56,6 +61,7 @@ class UsersController extends Controller
'users.updated_at',
'users.username',
'users.zip',
'users.ldap_import',
])->with('manager', 'groups', 'userloc', 'company', 'department','assets','licenses','accessories','consumables')
->withCount('assets as assets_count','licenses as licenses_count','accessories as accessories_count','consumables as consumables_count');
@@ -63,7 +69,9 @@ class UsersController extends Controller
if (($request->filled('deleted')) && ($request->input('deleted')=='true')) {
$users = $users->GetDeleted();
$users = $users->onlyTrashed();
} elseif (($request->filled('all')) && ($request->input('all')=='true')) {
$users = $users->withTrashed();
}
if ($request->filled('company_id')) {
@@ -74,6 +82,14 @@ class UsersController extends Controller
$users = $users->where('users.location_id', '=', $request->input('location_id'));
}
if ($request->filled('email')) {
$users = $users->where('users.email', '=', $request->input('email'));
}
if ($request->filled('username')) {
$users = $users->where('users.username', '=', $request->input('username'));
}
if ($request->filled('group_id')) {
$users = $users->ByGroup($request->get('group_id'));
}
@@ -88,7 +104,14 @@ class UsersController extends Controller
$order = $request->input('order') === 'asc' ? 'asc' : 'desc';
$offset = (($users) && (request('offset') > $users->count())) ? 0 : request('offset', 0);
$limit = request('limit', 20);
// Set the offset to the API call's offset, unless the offset is higher than the actual count of items in which
// case we override with the actual count, so we should return 0 items.
$offset = (($users) && ($request->get('offset') > $users->count())) ? $users->count() : $request->get('offset', 0);
// Check to make sure the limit is not higher than the max allowed
((config('app.max_results') >= $request->input('limit')) && ($request->filled('limit'))) ? $limit = $request->input('limit') : $limit = config('app.max_results');
switch ($request->input('sort')) {
case 'manager':
@@ -110,7 +133,7 @@ class UsersController extends Controller
'assets','accessories', 'consumables','licenses','groups','activated','created_at',
'two_factor_enrolled','two_factor_optin','last_login', 'assets_count', 'licenses_count',
'consumables_count', 'accessories_count', 'phone', 'address', 'city', 'state',
'country', 'zip', 'id'
'country', 'zip', 'id', 'ldap_import'
];
$sort = in_array($request->get('sort'), $allowed_columns) ? $request->get('sort') : 'first_name';
@@ -163,16 +186,16 @@ class UsersController extends Controller
foreach ($users as $user) {
$name_str = '';
if ($user->last_name!='') {
$name_str .= e($user->last_name).', ';
$name_str .= $user->last_name.', ';
}
$name_str .= e($user->first_name);
$name_str .= $user->first_name;
if ($user->username!='') {
$name_str .= ' ('.e($user->username).')';
$name_str .= ' ('.$user->username.')';
}
if ($user->employee_num!='') {
$name_str .= ' - #'.e($user->employee_num);
$name_str .= ' - #'.$user->employee_num;
}
$user->use_text = $name_str;
@@ -200,9 +223,21 @@ class UsersController extends Controller
$user = new User;
$user->fill($request->all());
if ($request->has('permissions')) {
$permissions_array = $request->input('permissions');
// Strip out the superuser permission if the API user isn't a superadmin
if (!Auth::user()->isSuperUser()) {
unset($permissions_array['superuser']);
}
$user->permissions = $permissions_array;
}
$tmp_pass = substr(str_shuffle("0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"), 0, 20);
$user->password = bcrypt($request->get('password', $tmp_pass));
if ($user->save()) {
if ($request->filled('groups')) {
$user->groups()->sync($request->input('groups'));
@@ -225,7 +260,7 @@ class UsersController extends Controller
public function show($id)
{
$this->authorize('view', User::class);
$user = User::findOrFail($id);
$user = User::withCount('assets as assets_count','licenses as licenses_count','accessories as accessories_count','consumables as consumables_count')->findOrFail($id);
return (new UsersTransformer)->transformUser($user);
}
@@ -244,6 +279,16 @@ class UsersController extends Controller
$this->authorize('update', User::class);
$user = User::findOrFail($id);
// This is a janky hack to prevent people from changing admin demo user data on the public demo.
// The $ids 1 and 2 are special since they are seeded as superadmins in the demo seeder.
// Thanks, jerks. You are why we can't have nice things. - snipe
if ((($id == 1) || ($id == 2)) && (config('app.lock_passwords'))) {
return response()->json(Helper::formatStandardApiResponse('error', null, 'Permission denied. You cannot update user information via API on the demo.'));
}
$user->fill($request->all());
if ($user->id == $request->input('manager_id')) {
@@ -254,18 +299,44 @@ class UsersController extends Controller
$user->password = bcrypt($request->input('password'));
}
// We need to use has() instead of filled()
// here because we need to overwrite permissions
// if someone needs to null them out
if ($request->has('permissions')) {
$permissions_array = $request->input('permissions');
// Strip out the superuser permission if the API user isn't a superadmin
if (!Auth::user()->isSuperUser()) {
unset($permissions_array['superuser']);
}
$user->permissions = $permissions_array;
}
// Update the location of any assets checked out to this user
Asset::where('assigned_type', User::class)
->where('assigned_to', $user->id)->update(['location_id' => $request->input('location_id', null)]);
if ($user->save()) {
// Sync group memberships:
// This was changed in Snipe-IT v4.6.x to 4.7, since we upgraded to Laravel 5.5
// which changes the behavior of has vs filled.
// The $request->has method will now return true even if the input value is an empty string or null.
// A new $request->filled method has was added that provides the previous behavior of the has method.
// Check if the request has groups passed and has a value
if ($request->filled('groups')) {
$user->groups()->sync($request->input('groups'));
} else {
// The groups field has been passed but it is null, so we should blank it out
} elseif ($request->has('groups')) {
$user->groups()->sync(array());
}
return response()->json(Helper::formatStandardApiResponse('success', (new UsersTransformer)->transformUser($user), trans('admin/users/message.success.update')));
}
@@ -287,11 +358,32 @@ class UsersController extends Controller
$this->authorize('delete', $user);
if ($user->assets()->count() > 0) {
if (($user->assets) && ($user->assets->count() > 0)) {
return response()->json(Helper::formatStandardApiResponse('error', null, trans('admin/users/message.error.delete_has_assets')));
}
if (($user->licenses) && ($user->licenses->count() > 0)) {
return response()->json(Helper::formatStandardApiResponse('error', null, 'This user still has ' . $user->licenses->count() . ' license(s) associated with them and cannot be deleted.'));
}
if (($user->accessories) && ($user->accessories->count() > 0)) {
return response()->json(Helper::formatStandardApiResponse('error', null, 'This user still has ' . $user->accessories->count() . ' accessories associated with them.'));
}
if (($user->managedLocations()) && ($user->managedLocations()->count() > 0)) {
return response()->json(Helper::formatStandardApiResponse('error', null, 'This user still has ' . $user->managedLocations()->count() . ' locations that they manage.'));
}
if ($user->delete()) {
// Remove the user's avatar if they have one
if (Storage::disk('public')->exists('avatars/'.$user->avatar)) {
try {
Storage::disk('public')->delete('avatars/'.$user->avatar);
} catch (\Exception $e) {
\Log::debug($e);
}
}
return response()->json(Helper::formatStandardApiResponse('success', null, trans('admin/users/message.success.delete')));
}
return response()->json(Helper::formatStandardApiResponse('error', null, trans('admin/users/message.error.delete')));
@@ -331,6 +423,25 @@ class UsersController extends Controller
}
/**
* Return JSON containing a list of licenses assigned to a user.
*
* @author [N. Mathar] [<snipe@snipe.net>]
* @since [v5.0]
* @param $userId
* @return string JSON
*/
public function licenses($id)
{
$this->authorize('view', User::class);
$this->authorize('view', License::class);
$user = User::where('id', $id)->withTrashed()->first();
$licenses = $user->licenses()->get();
return (new LicensesTransformer())->transformLicenses($licenses, $licenses->count());
}
/**
* Reset the user's two-factor status
*
* @author [A. Gianotto] [<snipe@snipe.net>]
@@ -368,6 +479,6 @@ class UsersController extends Controller
*/
public function getCurrentUserInfo(Request $request)
{
return response()->json($request->user());
return (new UsersTransformer)->transformUser($request->user());
}
}

View File

@@ -1,26 +1,17 @@
<?php
namespace App\Http\Controllers;
use App\Helpers\Helper;
use App\Models\Asset;
use App\Models\AssetMaintenance;
use Carbon\Carbon;
use App\Models\Company;
use DB;
use Input;
use Lang;
use Log;
use Mail;
use Response;
use Auth;
use Carbon\Carbon;
use Illuminate\Http\Request;
use Slack;
use Str;
use TCPDF;
use Validator;
use View;
use App\Models\Setting;
use App\Models\Asset;
use App\Helpers\Helper;
use Auth;
use Gate;
use Illuminate\Http\Request;
/**
* This controller handles all actions related to Asset Maintenance for
@@ -109,9 +100,9 @@ class AssetMaintenancesController extends Controller
$assetMaintenance = new AssetMaintenance();
$assetMaintenance->supplier_id = $request->input('supplier_id');
$assetMaintenance->is_warranty = $request->input('is_warranty');
$assetMaintenance->cost = e($request->input('cost'));
$assetMaintenance->notes = e($request->input('notes'));
$asset = Asset::find(e($request->input('asset_id')));
$assetMaintenance->cost = $request->input('cost');
$assetMaintenance->notes = $request->input('notes');
$asset = Asset::find($request->input('asset_id'));
if ((!Company::isCurrentUserHasAccess($asset)) && ($asset!=null)) {
return static::getInsufficientPermissionsRedirect();
@@ -165,6 +156,7 @@ class AssetMaintenancesController extends Controller
} elseif (!$assetMaintenance->asset) {
return redirect()->route('maintenances.index')
->with('error', 'The asset associated with this maintenance does not exist.');
} elseif (!Company::isCurrentUserHasAccess($assetMaintenance->asset)) {
return static::getInsufficientPermissionsRedirect();
}

View File

@@ -1,23 +1,15 @@
<?php
namespace App\Http\Controllers;
use App\Models\CustomField;
use Image;
use Input;
use Lang;
use App\Models\AssetModel;
use Redirect;
use Auth;
use DB;
use Str;
use Validator;
use View;
use App\Models\Asset;
use App\Models\Company;
use Config;
use App\Helpers\Helper;
use Illuminate\Http\Request;
use App\Http\Requests\ImageUploadRequest;
use App\Models\AssetModel;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Input;
use Illuminate\Support\Facades\View;
use Redirect;
use Request;
use Storage;
use Symfony\Component\HttpFoundation\JsonResponse;
@@ -31,13 +23,14 @@ use Symfony\Component\HttpFoundation\JsonResponse;
class AssetModelsController extends Controller
{
/**
* Returns a view that invokes the ajax tables which actually contains
* the content for the accessories listing, which is generated in getDatatable.
*
* @author [A. Gianotto] [<snipe@snipe.net>]
* @since [v1.0]
* @return View
*/
* Returns a view that invokes the ajax tables which actually contains
* the content for the accessories listing, which is generated in getDatatable.
*
* @author [A. Gianotto] [<snipe@snipe.net>]
* @since [v1.0]
* @return View
* @throws \Illuminate\Auth\Access\AuthorizationException
*/
public function index()
{
$this->authorize('index', AssetModel::class);
@@ -45,29 +38,31 @@ class AssetModelsController extends Controller
}
/**
* Returns a view containing the asset model creation form.
*
* @author [A. Gianotto] [<snipe@snipe.net>]
* @since [v1.0]
* @return View
*/
* Returns a view containing the asset model creation form.
*
* @author [A. Gianotto] [<snipe@snipe.net>]
* @since [v1.0]
* @return View
* @throws \Illuminate\Auth\Access\AuthorizationException
*/
public function create()
{
$this->authorize('create', AssetModel::class);
$category_type = 'asset';
return view('models/edit')->with('category_type',$category_type)
->with('depreciation_list', Helper::depreciationList())
->with('item', new AssetModel);
return view('models/edit')->with('category_type', 'asset')
->with('depreciation_list', Helper::depreciationList())
->with('item', new AssetModel);
}
/**
* Validate and process the new Asset Model data.
*
* @author [A. Gianotto] [<snipe@snipe.net>]
* @since [v1.0]
* @return Redirect
*/
* Validate and process the new Asset Model data.
*
* @author [A. Gianotto] [<snipe@snipe.net>]
* @since [v1.0]
* @param ImageUploadRequest $request
* @return Redirect
* @throws \Illuminate\Auth\Access\AuthorizationException
*/
public function store(ImageUploadRequest $request)
{
@@ -84,29 +79,13 @@ class AssetModelsController extends Controller
$model->category_id = $request->input('category_id');
$model->notes = $request->input('notes');
$model->user_id = Auth::id();
$model->requestable = Input::has('requestable');
$model->requestable = Request::has('requestable');
if ($request->input('custom_fieldset')!='') {
$model->fieldset_id = e($request->input('custom_fieldset'));
}
if (Input::file('image')) {
$image = Input::file('image');
$file_name = str_slug($image->getClientOriginalName()) . "." . $image->getClientOriginalExtension();
$path = app('models_upload_path');
if ($image->getClientOriginalExtension()!='svg') {
Image::make($image->getRealPath())->resize(800, null, function ($constraint) {
$constraint->aspectRatio();
$constraint->upsize();
})->save($path.'/'.$file_name);
} else {
$image->move($path, $file_name);
}
$model->image = $file_name;
}
$model = $request->handleImages($model);
// Was it created?
if ($model->save()) {
@@ -121,13 +100,14 @@ class AssetModelsController extends Controller
}
/**
* Returns a view containing the asset model edit form.
*
* @author [A. Gianotto] [<snipe@snipe.net>]
* @since [v1.0]
* @param int $modelId
* @return View
*/
* Returns a view containing the asset model edit form.
*
* @author [A. Gianotto] [<snipe@snipe.net>]
* @since [v1.0]
* @param int $modelId
* @return View
* @throws \Illuminate\Auth\Access\AuthorizationException
*/
public function edit($modelId = null)
{
$this->authorize('update', AssetModel::class);
@@ -144,14 +124,16 @@ class AssetModelsController extends Controller
/**
* Validates and processes form data from the edit
* Asset Model form based on the model ID passed.
*
* @author [A. Gianotto] [<snipe@snipe.net>]
* @since [v1.0]
* @param int $modelId
* @return Redirect
*/
* Validates and processes form data from the edit
* Asset Model form based on the model ID passed.
*
* @author [A. Gianotto] [<snipe@snipe.net>]
* @since [v1.0]
* @param ImageUploadRequest $request
* @param int $modelId
* @return Redirect
* @throws \Illuminate\Auth\Access\AuthorizationException
*/
public function update(ImageUploadRequest $request, $modelId = null)
{
$this->authorize('update', AssetModel::class);
@@ -161,6 +143,8 @@ class AssetModelsController extends Controller
return redirect()->route('models.index')->with('error', trans('admin/models/message.does_not_exist'));
}
$model = $request->handleImages($model);
$model->depreciation_id = $request->input('depreciation_id');
$model->eol = $request->input('eol');
$model->name = $request->input('name');
@@ -170,6 +154,8 @@ class AssetModelsController extends Controller
$model->notes = $request->input('notes');
$model->requestable = $request->input('requestable', '0');
$this->removeCustomFieldsDefaultValues($model);
if ($request->input('custom_fieldset')=='') {
@@ -182,37 +168,6 @@ class AssetModelsController extends Controller
}
}
$old_image = $model->image;
// Set the model's image property to null if the image is being deleted
if ($request->input('image_delete') == 1) {
$model->image = null;
}
if ($request->file('image')) {
$image = $request->file('image');
$file_name = $model->id.'-'.str_slug($image->getClientOriginalName()) . "." . $image->getClientOriginalExtension();
if ($image->getClientOriginalExtension()!='svg') {
Image::make($image->getRealPath())->resize(800, null, function ($constraint) {
$constraint->aspectRatio();
$constraint->upsize();
})->save(app('models_upload_path').$file_name);
} else {
$image->move(app('models_upload_path'), $file_name);
}
$model->image = $file_name;
}
if ((($request->file('image')) && (isset($old_image)) && ($old_image!='')) || ($request->input('image_delete') == 1)) {
try {
unlink(app('models_upload_path').$old_image);
} catch (\Exception $e) {
\Log::info($e);
}
}
if ($model->save()) {
return redirect()->route("models.index")->with('success', trans('admin/models/message.update.success'));
@@ -221,14 +176,15 @@ class AssetModelsController extends Controller
}
/**
* Validate and delete the given Asset Model. An Asset Model
* cannot be deleted if there are associated assets.
*
* @author [A. Gianotto] [<snipe@snipe.net>]
* @since [v1.0]
* @param int $modelId
* @return Redirect
*/
* Validate and delete the given Asset Model. An Asset Model
* cannot be deleted if there are associated assets.
*
* @author [A. Gianotto] [<snipe@snipe.net>]
* @since [v1.0]
* @param int $modelId
* @return Redirect
* @throws \Illuminate\Auth\Access\AuthorizationException
*/
public function destroy($modelId)
{
$this->authorize('delete', AssetModel::class);
@@ -244,7 +200,7 @@ class AssetModelsController extends Controller
if ($model->image) {
try {
unlink(public_path().'/uploads/models/'.$model->image);
Storage::disk('public')->delete('models/'.$model->image);
} catch (\Exception $e) {
\Log::info($e);
}
@@ -259,13 +215,14 @@ class AssetModelsController extends Controller
/**
* Restore a given Asset Model (mark as un-deleted)
*
* @author [A. Gianotto] [<snipe@snipe.net>]
* @since [v1.0]
* @param int $modelId
* @return Redirect
*/
* Restore a given Asset Model (mark as un-deleted)
*
* @author [A. Gianotto] [<snipe@snipe.net>]
* @since [v1.0]
* @param int $modelId
* @return Redirect
* @throws \Illuminate\Auth\Access\AuthorizationException
*/
public function getRestore($modelId = null)
{
$this->authorize('create', AssetModel::class);
@@ -273,16 +230,8 @@ class AssetModelsController extends Controller
$model = AssetModel::withTrashed()->find($modelId);
if (isset($model->id)) {
// Restore the model
$model->restore();
// Prepare the success message
$success = trans('admin/models/message.restore.success');
// Redirect back
return redirect()->route('models.index')->with('success', $success);
return redirect()->route('models.index')->with('success', trans('admin/models/message.restore.success'));
}
return redirect()->back()->with('error', trans('admin/models/message.not_found'));
@@ -290,13 +239,14 @@ class AssetModelsController extends Controller
/**
* Get the model information to present to the model view page
*
* @author [A. Gianotto] [<snipe@snipe.net>]
* @since [v1.0]
* @param int $modelId
* @return View
*/
* Get the model information to present to the model view page
*
* @author [A. Gianotto] [<snipe@snipe.net>]
* @since [v1.0]
* @param int $modelId
* @return View
* @throws \Illuminate\Auth\Access\AuthorizationException
*/
public function show($modelId = null)
{
$this->authorize('view', AssetModel::class);
@@ -305,11 +255,8 @@ class AssetModelsController extends Controller
if (isset($model->id)) {
return view('models/view', compact('model'));
}
// Prepare the error message
$error = trans('admin/models/message.does_not_exist', compact('id'));
// Redirect to the user management page
return redirect()->route('models.index')->with('error', $error);
return redirect()->route('models.index')->with('error', trans('admin/models/message.does_not_exist'));
}
/**
@@ -331,12 +278,10 @@ class AssetModelsController extends Controller
$model->id = null;
// Show the page
$view = View::make('models/edit');
$view->with('depreciation_list', Helper::depreciationList());
$view->with('item', $model);
$view->with('clone_model', $model_to_clone);
return $view;
return view('models/edit')
->with('depreciation_list', Helper::depreciationList())
->with('item', $model)
->with('clone_model', $model_to_clone);
}
@@ -350,8 +295,7 @@ class AssetModelsController extends Controller
*/
public function getCustomFields($modelId)
{
$model = AssetModel::find($modelId);
return view("models.custom_fields_form")->with("model", $model);
return view("models.custom_fields_form")->with("model", AssetModel::find($modelId));
}
@@ -367,7 +311,7 @@ class AssetModelsController extends Controller
public function postBulkEdit(Request $request)
{
$models_raw_array = Input::get('ids');
$models_raw_array = $request->input('ids');
// Make sure some IDs have been selected
if ((is_array($models_raw_array)) && (count($models_raw_array) > 0)) {
@@ -416,7 +360,7 @@ class AssetModelsController extends Controller
public function postBulkEditSave(Request $request)
{
$models_raw_array = Input::get('ids');
$models_raw_array = $request->input('ids');
$update_array = array();
@@ -457,7 +401,7 @@ class AssetModelsController extends Controller
*/
public function postBulkDelete(Request $request)
{
$models_raw_array = Input::get('ids');
$models_raw_array = $request->input('ids');
if ((is_array($models_raw_array)) && (count($models_raw_array) > 0)) {

View File

@@ -1,25 +1,29 @@
<?php
namespace App\Http\Controllers;
namespace App\Http\Controllers\Assets;
use App\Events\CheckoutableCheckedIn;
use App\Helpers\Helper;
use App\Http\Controllers\Controller;
use App\Http\Requests\AssetCheckinRequest;
use App\Models\Asset;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Redirect;
use Illuminate\Support\Facades\View;
class AssetCheckinController extends Controller
{
/**
* Returns a view that presents a form to check an asset back into inventory.
*
* @author [A. Gianotto] [<snipe@snipe.net>]
* @param int $assetId
* @param string $backto
* @since [v1.0]
* @return View
*/
* Returns a view that presents a form to check an asset back into inventory.
*
* @author [A. Gianotto] [<snipe@snipe.net>]
* @param int $assetId
* @param string $backto
* @return View
* @throws \Illuminate\Auth\Access\AuthorizationException
* @since [v1.0]
*/
public function create($assetId, $backto = null)
{
// Check if the asset exists
@@ -40,6 +44,7 @@ class AssetCheckinController extends Controller
* @param int $assetId
* @param null $backto
* @return Redirect
* @throws \Illuminate\Auth\Access\AuthorizationException
* @since [v1.0]
*/
public function store(AssetCheckinRequest $request, $assetId = null, $backto = null)
@@ -50,14 +55,14 @@ class AssetCheckinController extends Controller
return redirect()->route('hardware.index')->with('error', trans('admin/hardware/message.does_not_exist'));
}
if (is_null($target = $asset->assignedTo)) {
return redirect()->route('hardware.index')->with('error', trans('admin/hardware/message.checkin.already_checked_in'));
}
$this->authorize('checkin', $asset);
if ($asset->assignedType() == Asset::USER) {
$user = $asset->assignedTo;
}
if (is_null($target = $asset->assignedTo)) {
return redirect()->route('hardware.index')->with('error', trans('admin/hardware/message.checkin.already_checked_in'));
}
$asset->expected_checkin = null;
$asset->last_checkout = null;
@@ -71,34 +76,50 @@ class AssetCheckinController extends Controller
$asset->status_id = e($request->get('status_id'));
}
// This is just meant to correct legacy issues where some user data would have 0
// as a location ID, which isn't valid. Later versions of Snipe-IT have stricter validation
// rules, so it's necessary to fix this for long-time users. It's kinda gross, but will help
// people (and their data) in the long run
if ($asset->rtd_location_id=='0') {
\Log::debug('Manually override the RTD location IDs');
\Log::debug('Original RTD Location ID: '.$asset->rtd_location_id);
$asset->rtd_location_id = '';
\Log::debug('New RTD Location ID: '.$asset->rtd_location_id);
}
if ($asset->location_id=='0') {
\Log::debug('Manually override the location IDs');
\Log::debug('Original Location ID: '.$asset->location_id);
$asset->location_id = '';
\Log::debug('New RTD Location ID: '.$asset->location_id);
}
$asset->location_id = $asset->rtd_location_id;
\Log::debug('After Location ID: '.$asset->location_id);
\Log::debug('After RTD Location ID: '.$asset->rtd_location_id);
if ($request->filled('location_id')) {
\Log::debug('NEW Location ID: '.$request->get('location_id'));
$asset->location_id = e($request->get('location_id'));
}
$checkin_at = date('Y-m-d');
if($request->filled('checkin_at')){
$checkin_at = $request->input('checkin_at');
}
// Was the asset updated?
if ($asset->save()) {
$logaction = $asset->logCheckin($target, e(request('note')));
event(new CheckoutableCheckedIn($asset, $target, Auth::user(), $request->input('note'), $checkin_at));
$data['log_id'] = $logaction->id;
$data['first_name'] = get_class($target) == User::class ? $target->first_name : '';
$data['last_name'] = get_class($target) == User::class ? $target->last_name : '';
$data['item_name'] = $asset->present()->name();
$data['checkin_date'] = $logaction->created_at;
$data['item_tag'] = $asset->asset_tag;
$data['item_serial'] = $asset->serial;
$data['note'] = $logaction->note;
$data['manufacturer_name'] = $asset->model->manufacturer->name;
$data['model_name'] = $asset->model->name;
$data['model_number'] = $asset->model->model_number;
if (($user) && ($backto =='user')) {
if ((isset($user)) && ($backto =='user')) {
return redirect()->route("users.show", $user->id)->with('success', trans('admin/hardware/message.checkin.success'));
}
return redirect()->route("hardware.index")->with('success', trans('admin/hardware/message.checkin.success'));
}
// Redirect to the asset management page with error
return redirect()->route("hardware.index")->with('error', trans('admin/hardware/message.checkin.error'));
return redirect()->route("hardware.index")->with('error', trans('admin/hardware/message.checkin.error').$asset->getErrors());
}
}

View File

@@ -1,15 +1,15 @@
<?php
namespace App\Http\Controllers;
namespace App\Http\Controllers\Assets;
use App\Exceptions\CheckoutNotAllowed;
use App\Helpers\Helper;
use App\Http\Controllers\CheckInOutRequest;
use App\Http\Controllers\Controller;
use App\Http\Requests\AssetCheckoutRequest;
use App\Models\Asset;
use App\Models\Location;
use App\Models\User;
use Illuminate\Database\Eloquent\ModelNotFoundException;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
class AssetCheckoutController extends Controller
@@ -28,18 +28,17 @@ class AssetCheckoutController extends Controller
{
// Check if the asset exists
if (is_null($asset = Asset::find(e($assetId)))) {
// Redirect to the asset management page with error
return redirect()->route('hardware.index')->with('error', trans('admin/hardware/message.does_not_exist'));
}
$this->authorize('checkout', $asset);
if ($asset->availableForCheckout()) {
return view('hardware/checkout', compact('asset'));
return view('hardware/checkout', compact('asset'))
->with('statusLabel_list', Helper::deployableStatusLabelList());
}
return redirect()->route('hardware.index')->with('error', trans('admin/hardware/message.checkout.not_available'));
// Get the dropdown of users and then pass it to the checkout view
}
@@ -65,9 +64,7 @@ class AssetCheckoutController extends Controller
$admin = Auth::user();
$target = $this->determineCheckoutTarget($asset);
if ($asset->is($target)) {
throw new CheckoutNotAllowed('You cannot check an asset out to itself.');
}
$asset = $this->updateAssetLocation($asset, $target);
$checkout_at = date("Y-m-d H:i:s");
@@ -80,12 +77,16 @@ class AssetCheckoutController extends Controller
$expected_checkin = $request->get('expected_checkin');
}
if ($request->filled('status_id')) {
$asset->status_id = $request->get('status_id');
}
if ($asset->checkOut($target, $admin, $checkout_at, $expected_checkin, e($request->get('note')), $request->get('name'))) {
return redirect()->route("hardware.index")->with('success', trans('admin/hardware/message.checkout.success'));
}
// Redirect to the asset management page with error
return redirect()->to("hardware/$assetId/checkout")->with('error', trans('admin/hardware/message.checkout.error'))->withErrors($asset->getErrors());
return redirect()->to("hardware/$assetId/checkout")->with('error', trans('admin/hardware/message.checkout.error').$asset->getErrors());
} catch (ModelNotFoundException $e) {
return redirect()->back()->with('error', trans('admin/hardware/message.checkout.error'))->withErrors($asset->getErrors());
} catch (CheckoutNotAllowed $e) {

View File

@@ -1,13 +1,15 @@
<?php
namespace App\Http\Controllers;
namespace App\Http\Controllers\Assets;
use App\Helpers\Helper;
use App\Http\Controllers\Controller;
use App\Http\Requests\AssetFileRequest;
use App\Models\Actionlog;
use App\Models\Asset;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Response;
use Illuminate\Support\Facades\Storage;
use App\Helpers\StorageHelper;
class AssetFilesController extends Controller
{
@@ -19,6 +21,7 @@ class AssetFilesController extends Controller
* @param int $assetId
* @return Redirect
* @since [v1.0]
* @throws \Illuminate\Auth\Access\AuthorizationException
*/
public function store(AssetFileRequest $request, $assetId = null)
{
@@ -28,15 +31,15 @@ class AssetFilesController extends Controller
$this->authorize('update', $asset);
$destinationPath = config('app.private_uploads').'/assets';
if ($request->hasFile('file')) {
if (!Storage::exists('private_uploads/assets')) Storage::makeDirectory('private_uploads/assets', 775);
foreach ($request->file('file') as $file) {
$extension = $file->getClientOriginalExtension();
$filename = 'hardware-'.$asset->id.'-'.str_random(8);
$filename .= '-'.str_slug(basename($file->getClientOriginalName(), '.'.$extension)).'.'.$extension;
$file->move($destinationPath, $filename);
$asset->logUpload($filename, e($request->get('notes')));
$file_name = 'hardware-'.$asset->id.'-'.str_random(8).'-'.str_slug(basename($file->getClientOriginalName(), '.'.$extension)).'.'.$extension;
Storage::put('private_uploads/assets/'.$file_name, file_get_contents($file));
$asset->logUpload($file_name, e($request->get('notes')));
}
return redirect()->back()->with('success', trans('admin/hardware/message.upload.success'));
}
@@ -45,14 +48,15 @@ class AssetFilesController extends Controller
}
/**
* Check for permissions and display the file.
*
* @author [A. Gianotto] [<snipe@snipe.net>]
* @param int $assetId
* @param int $fileId
* @since [v1.0]
* @return View
*/
* Check for permissions and display the file.
*
* @author [A. Gianotto] [<snipe@snipe.net>]
* @param int $assetId
* @param int $fileId
* @since [v1.0]
* @return View
* @throws \Illuminate\Auth\Access\AuthorizationException
*/
public function show($assetId = null, $fileId = null, $download = true)
{
$asset = Asset::find($assetId);
@@ -65,24 +69,25 @@ class AssetFilesController extends Controller
->header('Content-Type', 'text/plain');
}
$file = $log->get_src('assets');
$file = 'private_uploads/assets/'.$log->filename;
\Log::debug('Checking for '.$file);
if ($log->action_type =='audit') {
$file = $log->get_src('audits');
$file = 'private_uploads/audits/'.$log->filename;
}
if (!file_exists($file)) {
if (!Storage::exists($file)) {
return response('File '.$file.' not found on server', 404)
->header('Content-Type', 'text/plain');
}
if ($download != 'true') {
if ($contents = file_get_contents($file)) {
return Response::make($contents)->header('Content-Type', mime_content_type($file));
if ($contents = file_get_contents(Storage::url($file))) {
return Response::make(Storage::url($file)->header('Content-Type', mime_content_type($file)));
}
return JsonResponse::create(["error" => "Failed validation: "], 500);
}
return Response::download($file);
return StorageHelper::downloader($file);
}
// Prepare the error message
$error = trans('admin/hardware/message.does_not_exist', ['id' => $fileId]);
@@ -92,35 +97,35 @@ class AssetFilesController extends Controller
}
/**
* Delete the associated file
*
* @author [A. Gianotto] [<snipe@snipe.net>]
* @param int $assetId
* @param int $fileId
* @since [v1.0]
* @return View
*/
* Delete the associated file
*
* @author [A. Gianotto] [<snipe@snipe.net>]
* @param int $assetId
* @param int $fileId
* @since [v1.0]
* @return View
* @throws \Illuminate\Auth\Access\AuthorizationException
*/
public function destroy($assetId = null, $fileId = null)
{
$asset = Asset::find($assetId);
$this->authorize('update', $asset);
$destinationPath = config('app.private_uploads').'/imports/assets';
$rel_path = 'private_uploads/assets';
// the asset is valid
if (isset($asset->id)) {
$this->authorize('update', $asset);
$log = Actionlog::find($fileId);
if ($log) {
$full_filename = $destinationPath.'/'.$log->filename;
if (file_exists($full_filename)) {
unlink($destinationPath.'/'.$log->filename);
if (Storage::exists($rel_path.'/'.$log->filename)) {
Storage::delete($rel_path.'/'.$log->filename);
}
$log->delete();
return redirect()->back()->with('success', trans('admin/hardware/message.deletefile.success'));
}
return redirect()->back()->with('error', 'Could not find matching upload log.');
$log->delete();
return redirect()->back()
->with('success', trans('admin/hardware/message.deletefile.success'));
}
// Redirect to the hardware management page

View File

@@ -1,44 +1,35 @@
<?php
namespace App\Http\Controllers;
namespace App\Http\Controllers\Assets;
use App\Helpers\Helper;
use App\Http\Requests\AssetCheckinRequest;
use App\Http\Requests\AssetCheckoutRequest;
use App\Http\Requests\AssetFileRequest;
use App\Http\Requests\AssetRequest;
use App\Http\Requests\ItemImportRequest;
use App\Http\Controllers\Controller;
use App\Http\Requests\ImageUploadRequest;
use App\Models\Actionlog;
use App\Models\Asset;
use App\Models\AssetModel;
use App\Models\CheckoutRequest;
use App\Models\Company;
use App\Models\CustomField;
use App\Models\Import;
use App\Models\Location;
use App\Models\Setting;
use App\Models\User;
use Artisan;
use Auth;
use Carbon\Carbon;
use Config;
use Intervention\Image\Facades\Image;
use DB;
use Gate;
use Illuminate\Http\Request;
use Image;
use Illuminate\Support\Facades\Cache;
use Illuminate\Support\Facades\Storage;
use Input;
use Lang;
use League\Csv\Reader;
use Log;
use Mail;
use League\Csv\Statement;
use Paginator;
use Redirect;
use Response;
use Slack;
use Str;
use Symfony\Component\HttpFoundation\File\Exception\FileException;
use TCPDF;
use Validator;
use View;
use App\Models\CheckoutRequest;
/**
* This class controls all actions related to assets for
@@ -66,16 +57,14 @@ class AssetsController extends Controller
* @author [A. Gianotto] [<snipe@snipe.net>]
* @see AssetController::getDatatable() method that generates the JSON response
* @since [v1.0]
* @param Request $request
* @return View
* @throws \Illuminate\Auth\Access\AuthorizationException
*/
public function index(Request $request)
{
$this->authorize('index', Asset::class);
if ($request->filled('company_id')) {
$company = Company::find($request->input('company_id'));
} else {
$company = null;
}
$company = Company::find($request->input('company_id'));
return view('hardware/index')->with('company', $company);
}
@@ -110,116 +99,121 @@ class AssetsController extends Controller
* @since [v1.0]
* @return Redirect
*/
public function store(AssetRequest $request)
public function store(ImageUploadRequest $request)
{
$this->authorize(Asset::class);
// Handle asset tags - there could be one, or potentially many.
// This is only necessary on create, not update, since bulk editing is handled
// differently
$asset_tags = $request->input('asset_tags');
$asset = new Asset();
$asset->model()->associate(AssetModel::find($request->input('model_id')));
$settings = Setting::getSettings();
$asset->name = $request->input('name');
$asset->serial = $request->input('serial');
$asset->company_id = Company::getIdForCurrentUser($request->input('company_id'));
$asset->model_id = $request->input('model_id');
$asset->order_number = $request->input('order_number');
$asset->notes = $request->input('notes');
$asset->asset_tag = $request->input('asset_tag');
$asset->user_id = Auth::id();
$asset->archived = '0';
$asset->physical = '1';
$asset->depreciate = '0';
$asset->status_id = request('status_id', 0);
$asset->warranty_months = request('warranty_months', null);
$asset->purchase_cost = Helper::ParseFloat($request->get('purchase_cost'));
$asset->purchase_date = request('purchase_date', null);
$asset->assigned_to = request('assigned_to', null);
$asset->supplier_id = request('supplier_id', 0);
$asset->requestable = request('requestable', 0);
$asset->rtd_location_id = request('rtd_location_id', null);
$success = false;
$serials = $request->input('serials');
if ($asset->assigned_to=='') {
$asset->location_id = $request->input('rtd_location_id', null);
}
for ($a = 1; $a <= count($asset_tags); $a++) {
// Create the image (if one was chosen.)
if ($request->filled('image')) {
$image = $request->input('image');
$asset = new Asset();
$asset->model()->associate(AssetModel::find($request->input('model_id')));
$asset->name = $request->input('name');
// After modification, the image is prefixed by mime info like the following:
// data:image/jpeg;base64,; This causes the image library to be unhappy, so we need to remove it.
$header = explode(';', $image, 2)[0];
// Grab the image type from the header while we're at it.
$extension = substr($header, strpos($header, '/')+1);
// Start reading the image after the first comma, postceding the base64.
$image = substr($image, strpos($image, ',')+1);
$file_name = str_random(25).".".$extension;
$directory= public_path('uploads/assets/');
// Check if the uploads directory exists. If not, try to create it.
if (!file_exists($directory)) {
mkdir($directory, 0755, true);
// Check for a corresponding serial
if (($serials) && (array_key_exists($a, $serials))) {
$asset->serial = $serials[$a];
}
$path = public_path('uploads/assets/'.$file_name);
try {
Image::make($image)->resize(800, 800, function ($constraint) {
$constraint->aspectRatio();
$constraint->upsize();
})->save($path);
$asset->image = $file_name;
} catch (\Exception $e) {
\Input::flash();
$messageBag = new \Illuminate\Support\MessageBag();
$messageBag->add('image', $e->getMessage());
\Session()->flash('errors', \Session::get('errors', new \Illuminate\Support\ViewErrorBag)
->put('default', $messageBag));
return response()->json(['image' => $e->getMessage()], 422);
if (($asset_tags) && (array_key_exists($a, $asset_tags))) {
$asset->asset_tag = $asset_tags[$a];
}
}
$asset->company_id = Company::getIdForCurrentUser($request->input('company_id'));
$asset->model_id = $request->input('model_id');
$asset->order_number = $request->input('order_number');
$asset->notes = $request->input('notes');
$asset->user_id = Auth::id();
$asset->archived = '0';
$asset->physical = '1';
$asset->depreciate = '0';
$asset->status_id = request('status_id', 0);
$asset->warranty_months = request('warranty_months', null);
$asset->purchase_cost = Helper::ParseFloat($request->get('purchase_cost'));
$asset->purchase_date = request('purchase_date', null);
$asset->assigned_to = request('assigned_to', null);
$asset->supplier_id = request('supplier_id', 0);
$asset->requestable = request('requestable', 0);
$asset->rtd_location_id = request('rtd_location_id', null);
// Update custom fields in the database.
// Validation for these fields is handled through the AssetRequest form request
$model = AssetModel::find($request->get('model_id'));
if (!empty($settings->audit_interval)) {
$asset->next_audit_date = Carbon::now()->addMonths($settings->audit_interval)->toDateString();
}
if (($model) && ($model->fieldset)) {
foreach ($model->fieldset->fields as $field) {
if ($field->field_encrypted=='1') {
if (Gate::allows('admin')) {
$asset->{$field->convertUnicodeDbSlug()} = \Crypt::encrypt($request->input($field->convertUnicodeDbSlug()));
if ($asset->assigned_to=='') {
$asset->location_id = $request->input('rtd_location_id', null);
}
// Create the image (if one was chosen.)
if ($request->has('image')) {
$asset = $request->handleImages($asset);
}
// Update custom fields in the database.
// Validation for these fields is handled through the AssetRequest form request
$model = AssetModel::find($request->get('model_id'));
if (($model) && ($model->fieldset)) {
foreach ($model->fieldset->fields as $field) {
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()))));
}else{
$asset->{$field->convertUnicodeDbSlug()} = \Crypt::encrypt(e($request->input($field->convertUnicodeDbSlug())));
} }
} else {
if(is_array($request->input($field->convertUnicodeDbSlug()))){
$asset->{$field->convertUnicodeDbSlug()} = implode(', ', $request->input($field->convertUnicodeDbSlug()));
}else{
$asset->{$field->convertUnicodeDbSlug()} = $request->input($field->convertUnicodeDbSlug());
}
}
} else {
$asset->{$field->convertUnicodeDbSlug()} = $request->input($field->convertUnicodeDbSlug());
}
}
// Validate the asset before saving
if ($asset->isValid() && $asset->save()) {
if (request('assigned_user')) {
$target = User::find(request('assigned_user'));
$location = $target->location_id;
} elseif (request('assigned_asset')) {
$target = Asset::find(request('assigned_asset'));
$location = $target->location_id;
} elseif (request('assigned_location')) {
$target = Location::find(request('assigned_location'));
$location = $target->id;
}
if (isset($target)) {
$asset->checkOut($target, Auth::user(), date('Y-m-d H:i:s'), $request->input('expected_checkin', null), 'Checked out on asset creation', e($request->get('name')), $location);
}
$success = true;
}
}
// Was the asset created?
if ($asset->save()) {
if (request('assigned_user')) {
$target = User::find(request('assigned_user'));
$location = $target->location_id;
} elseif (request('assigned_asset')) {
$target = Asset::find(request('assigned_asset'));
$location = $target->location_id;
} elseif (request('assigned_location')) {
$target = Location::find(request('assigned_location'));
$location = $target->id;
}
if (isset($target)) {
$asset->checkOut($target, Auth::user(), date('Y-m-d H:i:s'), '', 'Checked out on asset creation', e($request->get('name')), $location);
}
if ($success) {
// Redirect to the asset listing page
\Session::flash('success', trans('admin/hardware/message.create.success'));
return response()->json(['redirect_url' => route('hardware.index')]);
return redirect()->route('hardware.index')
->with('success', trans('admin/hardware/message.create.success'));
}
\Input::flash();
\Session::flash('errors', $asset->getErrors());
return response()->json(['errors' => $asset->getErrors()], 500);
return redirect()->back()->withInput()->withErrors($asset->getErrors());
}
/**
@@ -297,7 +291,7 @@ class AssetsController extends Controller
* @return Redirect
*/
public function update(AssetRequest $request, $assetId = null)
public function update(ImageUploadRequest $request, $assetId = null)
{
// Check if the asset exists
if (!$asset = Asset::find($assetId)) {
@@ -311,6 +305,7 @@ class AssetsController extends Controller
$asset->purchase_cost = Helper::ParseFloat($request->input('purchase_cost', null));
$asset->purchase_date = $request->input('purchase_date', null);
$asset->supplier_id = $request->input('supplier_id', null);
$asset->expected_checkin = $request->input('expected_checkin', null);
// If the box isn't checked, it's not in the request at all.
$asset->requestable = $request->filled('requestable');
@@ -333,47 +328,18 @@ class AssetsController extends Controller
// Update the asset data
$asset_tag = $request->input('asset_tags');
$serial = $request->input('serials');
$asset->name = $request->input('name');
$asset->serial = $request->input('serial');
$asset->serial = $serial[1];
$asset->company_id = Company::getIdForCurrentUser($request->input('company_id'));
$asset->model_id = $request->input('model_id');
$asset->order_number = $request->input('order_number');
$asset->asset_tag = $request->input('asset_tag');
$asset->asset_tag = $asset_tag[1];
$asset->notes = $request->input('notes');
$asset->physical = '1';
// Update the image
if ($request->filled('image')) {
$image = $request->input('image');
// See postCreate for more explaination of the following.
$header = explode(';', $image, 2)[0];
$extension = substr($header, strpos($header, '/')+1);
$image = substr($image, strpos($image, ',')+1);
$directory= public_path('uploads/assets/');
// Check if the uploads directory exists. If not, try to create it.
if (!file_exists($directory)) {
mkdir($directory, 0755, true);
}
$file_name = str_random(25).".".$extension;
$path = public_path('uploads/assets/'.$file_name);
try {
Image::make($image)->resize(800, 800, function ($constraint) {
$constraint->aspectRatio();
$constraint->upsize();
})->save($path);
$asset->image = $file_name;
} catch (\Exception $e) {
\Input::flash();
$messageBag = new \Illuminate\Support\MessageBag();
$messageBag->add('image', $e->getMessage());
\Session()->flash('errors', \Session::get('errors', new \Illuminate\Support\ViewErrorBag)
->put('default', $messageBag));
return response()->json(['image' => $e->getMessage()], 422);
}
$asset->image = $file_name;
}
$asset = $request->handleImages($asset);
// Update custom fields in the database.
// Validation for these fields is handlded through the AssetRequest form request
@@ -384,23 +350,29 @@ class AssetsController extends Controller
foreach ($model->fieldset->fields as $field) {
if ($field->field_encrypted=='1') {
if (Gate::allows('admin')) {
$asset->{$field->convertUnicodeDbSlug()} = \Crypt::encrypt(e($request->input($field->convertUnicodeDbSlug())));
if(is_array($request->input($field->convertUnicodeDbSlug()))){
$asset->{$field->convertUnicodeDbSlug()} = \Crypt::encrypt(e(implode(', ', $request->input($field->convertUnicodeDbSlug()))));
}else{
$asset->{$field->convertUnicodeDbSlug()} = \Crypt::encrypt(e($request->input($field->convertUnicodeDbSlug())));
}
}
} else {
$asset->{$field->convertUnicodeDbSlug()} = $request->input($field->convertUnicodeDbSlug());
if(is_array($request->input($field->convertUnicodeDbSlug()))){
$asset->{$field->convertUnicodeDbSlug()} = implode(', ', $request->input($field->convertUnicodeDbSlug()));
}else{
$asset->{$field->convertUnicodeDbSlug()} = $request->input($field->convertUnicodeDbSlug());
}
}
}
}
if ($asset->save()) {
// Redirect to the new asset page
\Session::flash('success', trans('admin/hardware/message.update.success'));
return response()->json(['redirect_url' => route("hardware.show", $assetId)]);
return redirect()->route("hardware.show", $assetId)
->with('success', trans('admin/hardware/message.update.success'));
}
\Input::flash();
\Session::flash('errors', $asset->getErrors());
return response()->json(['errors' => $asset->getErrors()], 500);
return redirect()->back()->withInput()->withErrors($asset->getErrors());
}
/**
@@ -425,6 +397,14 @@ class AssetsController extends Controller
->where('id', $asset->id)
->update(array('assigned_to' => null));
if ($asset->image) {
try {
Storage::disk('public')->delete('assets'.'/'.$asset->image);
} catch (\Exception $e) {
\Log::debug($e);
}
}
$asset->delete();
return redirect()->route('hardware.index')->with('success', trans('admin/hardware/message.delete.success'));
@@ -504,17 +484,46 @@ class AssetsController extends Controller
return response()->file($barcode_file, $header);
} else {
// Calculate barcode width in pixel based on label width (inch)
$barcode_width = ($settings->labels_width - $settings->labels_display_sgutter) * 96.000000000001;
$barcode_width = ($settings->labels_width - $settings->labels_display_sgutter) * 200.000000000001;
$barcode = new \Com\Tecnick\Barcode\Barcode();
$barcode_obj = $barcode->getBarcodeObj($settings->alt_barcode,$asset->asset_tag,($barcode_width < 300 ? $barcode_width : 300),50);
try {
$barcode_obj = $barcode->getBarcodeObj($settings->alt_barcode,$asset->asset_tag,($barcode_width < 300 ? $barcode_width : 300),50);
file_put_contents($barcode_file, $barcode_obj->getPngData());
return response($barcode_obj->getPngData())->header('Content-type', 'image/png');
} catch(\Exception $e) {
\Log::debug('The barcode format is invalid.');
return response(file_get_contents(public_path('uploads/barcodes/invalid_barcode.gif')))->header('Content-type', 'image/gif');
}
file_put_contents($barcode_file, $barcode_obj->getPngData());
return response($barcode_obj->getPngData())->header('Content-type', 'image/png');
}
}
}
/**
* Return a label for an individual asset.
*
* @author [L. Swartzendruber] [<logan.swartzendruber@gmail.com>
* @param int $assetId
* @return View
*/
public function getLabel($assetId = null)
{
if (isset($assetId)) {
$asset = Asset::find($assetId);
$this->authorize('view', $asset);
return view('hardware/labels')
->with('assets', Asset::find($asset))
->with('settings', Setting::getSettings())
->with('bulkedit', false)
->with('count', 0);
}
}
/**
* Returns a view that presents a form to clone an asset.
*
@@ -554,7 +563,7 @@ class AssetsController extends Controller
*/
public function getImportHistory()
{
$this->authorize('checkout', Asset::class);
$this->authorize('admin');
return view('hardware/history');
}
@@ -563,29 +572,35 @@ class AssetsController extends Controller
*
* This needs a LOT of love. It's done very inelegantly right now, and there are
* a ton of optimizations that could (and should) be done.
*
*
* Updated to respect checkin dates:
* No checkin column, assume all items are checked in (todays date)
* Checkin date in the past, update history.
* Checkin date in future or empty, check the item out to the user.
*
* @author [A. Gianotto] [<snipe@snipe.net>]
* @since [v3.3]
* @return View
*/
public function postImportHistory(Request $request)
{
if (!$request->hasFile('user_import_csv')) {
return back()->with('error', 'No file provided. Please select a file for import and try again. ');
}
if (!ini_get("auto_detect_line_endings")) {
ini_set("auto_detect_line_endings", '1');
}
$csv = Reader::createFromPath(Input::file('user_import_csv'));
$csv->setNewline("\r\n");
//get the first row, usually the CSV header
//$headers = $csv->fetchOne();
$csv = Reader::createFromPath($request->file('user_import_csv'));
$csv->setHeaderOffset(0);
$header = $csv->getHeader();
$isCheckinHeaderExplicit = in_array("checkin date", (array_map('strtolower', $header)));
$results = $csv->getRecords();
$item = array();
$status = array();
$status['error'] = array();
$status['success'] = array();
foreach ($results as $row) {
if (is_array($row)) {
$row = array_change_key_case($row, CASE_LOWER);
@@ -594,27 +609,34 @@ class AssetsController extends Controller
$item[$asset_tag] = array();
}
$batch_counter = count($item[$asset_tag]);
$item[$asset_tag][$batch_counter]['checkout_date'] = Carbon::parse(Helper::array_smart_fetch($row, "date"))->format('Y-m-d H:i:s');
$item[$asset_tag][$batch_counter]['checkout_date'] = Carbon::parse(Helper::array_smart_fetch($row, "checkout date"))->format('Y-m-d H:i:s');
if ($isCheckinHeaderExplicit){
//checkin date not empty, assume past transaction or future checkin date (expected)
if (!empty(Helper::array_smart_fetch($row, "checkin date"))) {
$item[$asset_tag][$batch_counter]['checkin_date'] = Carbon::parse(Helper::array_smart_fetch($row, "checkin date"))->format('Y-m-d H:i:s');
} else {
$item[$asset_tag][$batch_counter]['checkin_date'] = '';
}
} else {
//checkin header missing, assume data is unavailable and make checkin date explicit (now) so we don't encounter invalid state.
$item[$asset_tag][$batch_counter]['checkin_date'] = Carbon::parse(now())->format('Y-m-d H:i:s');
}
$item[$asset_tag][$batch_counter]['asset_tag'] = Helper::array_smart_fetch($row, "asset tag");
$item[$asset_tag][$batch_counter]['name'] = Helper::array_smart_fetch($row, "name");
$item[$asset_tag][$batch_counter]['email'] = Helper::array_smart_fetch($row, "email");
if ($asset = Asset::where('asset_tag', '=', $asset_tag)->first()) {
$item[$asset_tag][$batch_counter]['asset_id'] = $asset->id;
$base_username = User::generateFormattedNameFromFullName(Setting::getSettings()->username_format, $item[$asset_tag][$batch_counter]['name']);
$user = User::where('username', '=', $base_username['username']);
$user_query = ' on username '.$base_username['username'];
if ($request->input('match_firstnamelastname')=='1') {
$firstnamedotlastname = User::generateFormattedNameFromFullName('firstname.lastname', $item[$asset_tag][$batch_counter]['name']);
$item[$asset_tag][$batch_counter]['username'][] = $firstnamedotlastname['username'];
$user->orWhere('username', '=', $firstnamedotlastname['username']);
$user_query .= ', or on username '.$firstnamedotlastname['username'];
}
if ($request->input('match_flastname')=='1') {
$flastname = User::generateFormattedNameFromFullName('filastname', $item[$asset_tag][$batch_counter]['name']);
$item[$asset_tag][$batch_counter]['username'][] = $flastname['username'];
@@ -628,16 +650,22 @@ class AssetsController extends Controller
$user_query .= ', or on username '.$firstname['username'];
}
if ($request->input('match_email')=='1') {
if ($item[$asset_tag][$batch_counter]['email']=='') {
if ($item[$asset_tag][$batch_counter]['name']=='') {
$item[$asset_tag][$batch_counter]['username'][] = $user_email = User::generateEmailFromFullName($item[$asset_tag][$batch_counter]['name']);
$user->orWhere('username', '=', $user_email);
$user_query .= ', or on username '.$user_email;
}
}
if ($request->input('match_username') == '1'){
// Added #8825: add explicit username lookup
$raw_username = $item[$asset_tag][$batch_counter]['name'];
$user->orWhere('username', '=', $raw_username);
$user_query .= ', or on username ' . $raw_username;
}
// A matching user was found
if ($user = $user->first()) {
$item[$asset_tag][$batch_counter]['checkedout_to'] = $user->id;
//$user is now matched user from db
$item[$asset_tag][$batch_counter]['user_id'] = $user->id;
Actionlog::firstOrCreate(array(
@@ -651,15 +679,43 @@ class AssetsController extends Controller
'action_type' => 'checkout',
));
$asset->assigned_to = $user->id;
$checkin_date = $item[$asset_tag][$batch_counter]['checkin_date'];
if ($isCheckinHeaderExplicit) {
//if checkin date header exists, assume that empty or future date is still checked out
//if checkin is before todays date, assume it's checked in and do not assign user ID, if checkin date is in the future or blank, this is the expected checkin date, items is checked out
if ((strtotime($checkin_date) > strtotime(Carbon::now())) || (empty($checkin_date))
) {
//only do this if item is checked out
$asset->assigned_to = $user->id;
$asset->assigned_type = User::class;
}
}
if (!empty($checkin_date)) {
//only make a checkin there is a valid checkin date or we created one on import.
Actionlog::firstOrCreate(array(
'item_id' =>
$item[$asset_tag][$batch_counter]['asset_id'],
'item_type' => Asset::class,
'user_id' => Auth::user()->id,
'note' => 'Checkin imported by ' . Auth::user()->present()->fullName() . ' from history importer',
'target_id' => null,
'created_at' => $checkin_date,
'action_type' => 'checkin'
));
}
if ($asset->save()) {
$status['success'][]['asset'][$asset_tag]['msg'] = 'Asset successfully matched for '.Helper::array_smart_fetch($row, "name").$user_query.' on '.$item[$asset_tag][$batch_counter]['checkout_date'];
} else {
$status['error'][]['asset'][$asset_tag]['msg'] = 'Asset and user was matched but could not be saved.';
}
} else {
$item[$asset_tag][$batch_counter]['checkedout_to'] = null;
$item[$asset_tag][$batch_counter]['user_id'] = null;
$status['error'][]['user'][Helper::array_smart_fetch($row, "name")]['msg'] = 'User does not exist so no checkin log was created.';
}
} else {
@@ -668,35 +724,14 @@ class AssetsController extends Controller
}
}
}
// Loop through and backfill the checkins
foreach ($item as $key => $asset_batch) {
$total_in_batch = count($asset_batch);
for ($x = 0; $x < $total_in_batch; $x++) {
$next = $x + 1;
// Only do this if a matching user was found
if ((array_key_exists('checkedout_to', $asset_batch[$x])) && ($asset_batch[$x]['checkedout_to']!='')) {
if (($total_in_batch > 1) && ($x < $total_in_batch) && (array_key_exists($next, $asset_batch))) {
$checkin_date = Carbon::parse($asset_batch[$next]['checkout_date'])->subDay(1)->format('Y-m-d H:i:s');
$asset_batch[$x]['real_checkin'] = $checkin_date;
Actionlog::firstOrCreate(array(
'item_id' => $asset_batch[$x]['asset_id'],
'item_type' => Asset::class,
'user_id' => Auth::user()->id,
'note' => 'Checkin imported by ' . Auth::user()->present()->fullName() . ' from history importer',
'target_id' => null,
'created_at' => $checkin_date,
'action_type' => 'checkin'
));
}
}
}
}
return view('hardware/history')->with('status', $status);
}
public function sortByName(array $recordA, array $recordB): int
{
return strcmp($recordB['Full Name'], $recordA['Full Name']);
}
/**
* Retore a deleted asset.
*
@@ -757,7 +792,7 @@ class AssetsController extends Controller
}
public function auditStore(AssetFileRequest $request, $id)
public function auditStore(Request $request, $id)
{
$this->authorize('audit', Asset::class);
@@ -778,26 +813,30 @@ class AssetsController extends Controller
$asset->unsetEventDispatcher();
$asset->next_audit_date = $request->input('next_audit_date');
$asset->last_audit_date = date('Y-m-d h:i:s');
$asset->last_audit_date = date('Y-m-d H:i:s');
// Check to see if they checked the box to update the physical location,
// not just note it in the audit notes
if ($request->input('update_location')=='1') {
\Log::debug('update location in audit');
$asset->location_id = $request->input('location_id');
}
if ($asset->save()) {
$filename = '';
$file_name = '';
// Upload an image, if attached
if ($request->hasFile('image')) {
$file = $request->file('image');
try {
$destinationPath = config('app.private_uploads').'/audits';
$extension = $file->getClientOriginalExtension();
$filename = 'audit-'.$asset->id.'-'.str_slug(basename($file->getClientOriginalName(), '.'.$extension)).'.'.$extension;
$file->move($destinationPath, $filename);
} catch (\Exception $e) {
\Log::info($e);
}
$path = 'private_uploads/audits';
if (!Storage::exists($path)) Storage::makeDirectory($path, 775);
$upload = $image = $request->file('image');
$ext = $image->getClientOriginalExtension();
$file_name = 'audit-'.str_random(18).'.'.$ext;
Storage::putFileAs($path, $upload, $file_name);
}
$asset->logAudit($request->input('note'), $request->input('location_id'), $filename);
$asset->logAudit($request->input('note'), $request->input('location_id'), $file_name);
return redirect()->to("hardware")->with('success', trans('admin/hardware/message.audit.success'));
}
}

Some files were not shown because too many files have changed in this diff Show More