Compare commits

...

27 Commits

Author SHA1 Message Date
snipe 9dca7396f3 Merge branch 'develop' 2017-09-26 11:12:55 -07:00
snipe 4324242475 Bumped version 2017-09-26 11:12:36 -07:00
snipe eca5a05335 Fix forgotten password missing route (???) 2017-09-26 11:08:47 -07:00
snipe aa4d3c3ffb Fix forgotten password missing route (???) 2017-09-26 11:07:47 -07:00
snipe d442feb687 Add @gizzmojr as a contributor 2017-09-25 22:18:25 -07:00
snipe 0a88141b18 Merge branch 'develop' of github.com:snipe/snipe-it into develop 2017-09-25 22:17:38 -07:00
snipe d5e6d82ca1 Bumped version 2017-09-25 22:17:00 -07:00
gizzmojr f2a62857cb Clear audit input field (#4010) 2017-09-25 22:15:29 -07:00
snipe b354ca817d Bumped version 2017-09-25 22:10:06 -07:00
snipe 4b9bfc178d One more try on #4001 2017-09-25 22:05:57 -07:00
snipe abc2f7e789 Bumped build number 2017-09-25 21:57:16 -07:00
snipe 29cc9a0815 Tweaks to upgrade script 2017-09-25 21:50:41 -07:00
snipe f2ee7dcabb Fixes #4001 - license checkout not working 2017-09-25 21:40:43 -07:00
snipe 26203801f6 Fixes #4009 - zip not populating on locations listing page 2017-09-25 20:45:05 -07:00
snipe fbe9539130 Proto upgrade script 2017-09-25 20:30:18 -07:00
snipe 43ec959385 Add @richardhofman6 as a contributor 2017-09-25 16:58:47 -07:00
snipe 9b6276f281 Bumped version 2017-09-25 16:04:23 -07:00
snipe 0715791229 Include oauth keys in backup 2017-09-25 15:45:33 -07:00
snipe 0a0661bf41 Additional fixes for #3995 in atypical blades 2017-09-25 15:41:02 -07:00
snipe 6ee939d29b Allegedly fixes #3995 - subdirectory issues with JS/CSS 2017-09-25 15:39:18 -07:00
snipe c3afbc0e53 Run backups before purging and importing 2017-09-25 15:00:23 -07:00
snipe 38326314ca Merge branch 'develop' 2017-09-25 11:53:33 -07:00
snipe 865950e766 Fixes #4000 - user_id blank 2017-09-25 11:53:10 -07:00
snipe d49b67d033 Fix for assigned user location
Was breaking requestable page
2017-09-25 11:26:04 -07:00
snipe 6b63808e34 Fix for asset location null on user 2017-09-25 11:25:15 -07:00
snipe 34dfcb5add Merge branch 'develop' 2017-09-22 17:23:38 -07:00
snipe 30019a144a Disable login note editing on demo 2017-09-22 17:23:22 -07:00
24 changed files with 202 additions and 38 deletions
+18
View File
@@ -737,6 +737,24 @@
"contributions": [
"code"
]
},
{
"login": "richardhofman6",
"name": "Richard Hofman",
"avatar_url": "https://avatars1.githubusercontent.com/u/6551003?v=4",
"profile": "https://github.com/richardhofman6",
"contributions": [
"code"
]
},
{
"login": "gizzmojr",
"name": "gizzmojr",
"avatar_url": "https://avatars0.githubusercontent.com/u/3697569?v=4",
"profile": "https://github.com/gizzmojr",
"contributions": [
"code"
]
}
]
}
+2 -2
View File
@@ -1,5 +1,5 @@
[![Build Status](https://travis-ci.org/snipe/snipe-it.svg?branch=develop)](https://travis-ci.org/snipe/snipe-it) [![Stories in Ready](https://badge.waffle.io/snipe/snipe-it.png?label=ready+for+dev&title=Ready+for+development)](http://waffle.io/snipe/snipe-it) [![Maintenance](https://img.shields.io/maintenance/yes/2017.svg)]() [![Crowdin](https://d322cqt584bo4o.cloudfront.net/snipe-it/localized.png)](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/snipeyhead.svg?style=social)](https://twitter.com/snipeyhead) [![Zenhub](https://raw.githubusercontent.com/ZenHubIO/support/master/zenhub-badge.png)](https://zenhub.io) [![Codacy Badge](https://api.codacy.com/project/badge/Grade/553ce52037fc43ea99149785afcfe641)](https://www.codacy.com/app/snipe/snipe-it?utm_source=github.com&utm_medium=referral&utm_content=snipe/snipe-it&utm_campaign=Badge_Grade)
[![All Contributors](https://img.shields.io/badge/all_contributors-79-orange.svg?style=flat-square)](#contributors)
[![All Contributors](https://img.shields.io/badge/all_contributors-81-orange.svg?style=flat-square)](#contributors)
## Snipe-IT - Open Source Asset Management System
@@ -67,7 +67,7 @@ Thanks goes to all of these wonderful people ([emoji key](https://github.com/ken
| [<img src="https://avatars0.githubusercontent.com/u/8341172?v=3" width="110px;"/><br /><sub>Jay Richards</sub>](http://www.cordeos.com)<br />[💻](https://github.com/snipe/snipe-it/commits?author=technogenus "Code") | [<img src="https://avatars2.githubusercontent.com/u/7295127?v=3" width="110px;"/><br /><sub>Alexander Innes</sub>](https://necurity.co.uk)<br />[💻](https://github.com/snipe/snipe-it/commits?author=leostat "Code") | [<img src="https://avatars2.githubusercontent.com/u/334485?v=3" width="110px;"/><br /><sub>Danny Garcia</sub>](https://buzzedword.codes)<br />[💻](https://github.com/snipe/snipe-it/commits?author=buzzedword "Code") | [<img src="https://avatars2.githubusercontent.com/u/366855?v=3" width="110px;"/><br /><sub>archpoint</sub>](https://github.com/archpoint)<br />[💻](https://github.com/snipe/snipe-it/commits?author=archpoint "Code") | [<img src="https://avatars1.githubusercontent.com/u/67991?v=3" width="110px;"/><br /><sub>Jake McGraw</sub>](http://www.jakemcgraw.com)<br />[💻](https://github.com/snipe/snipe-it/commits?author=jakemcgraw "Code") | [<img src="https://avatars1.githubusercontent.com/u/1714374?v=3" width="110px;"/><br /><sub>FleischKarussel</sub>](https://github.com/FleischKarussel)<br />[📖](https://github.com/snipe/snipe-it/commits?author=FleischKarussel "Documentation") | [<img src="https://avatars3.githubusercontent.com/u/319644?v=3" width="110px;"/><br /><sub>Dylan Yi</sub>](https://github.com/feeva)<br />[💻](https://github.com/snipe/snipe-it/commits?author=feeva "Code") |
| [<img src="https://avatars2.githubusercontent.com/u/857740?v=3" width="110px;"/><br /><sub>Gil Rutkowski</sub>](http://FlashingCursor.com)<br />[💻](https://github.com/snipe/snipe-it/commits?author=flashingcursor "Code") | [<img src="https://avatars3.githubusercontent.com/u/129360?v=3" width="110px;"/><br /><sub>Desmond Morris</sub>](http://www.desmondmorris.com)<br />[💻](https://github.com/snipe/snipe-it/commits?author=desmondmorris "Code") | [<img src="https://avatars2.githubusercontent.com/u/52936?v=3" width="110px;"/><br /><sub>Nick Peelman</sub>](http://peelman.us)<br />[💻](https://github.com/snipe/snipe-it/commits?author=peelman "Code") | [<img src="https://avatars0.githubusercontent.com/u/53161?v=3" width="110px;"/><br /><sub>Abraham Vegh</sub>](https://abrahamvegh.com)<br />[💻](https://github.com/snipe/snipe-it/commits?author=abrahamvegh "Code") | [<img src="https://avatars0.githubusercontent.com/u/2818680?v=3" width="110px;"/><br /><sub>Mohamed Rashid</sub>](https://github.com/rashivkp)<br />[📖](https://github.com/snipe/snipe-it/commits?author=rashivkp "Documentation") | [<img src="https://avatars3.githubusercontent.com/u/1509456?v=3" width="110px;"/><br /><sub>Kasey</sub>](http://hinchk.github.io)<br />[💻](https://github.com/snipe/snipe-it/commits?author=HinchK "Code") | [<img src="https://avatars2.githubusercontent.com/u/10522541?v=3" width="110px;"/><br /><sub>Brett</sub>](https://github.com/BrettFagerlund)<br />[⚠️](https://github.com/snipe/snipe-it/commits?author=BrettFagerlund "Tests") |
| [<img src="https://avatars2.githubusercontent.com/u/16108587?v=3" width="110px;"/><br /><sub>Jason Spriggs</sub>](http://jasonspriggs.com)<br />[💻](https://github.com/snipe/snipe-it/commits?author=jasonspriggs "Code") | [<img src="https://avatars2.githubusercontent.com/u/1134568?v=3" width="110px;"/><br /><sub>Nate Felton</sub>](http://n8felton.wordpress.com)<br />[💻](https://github.com/snipe/snipe-it/commits?author=n8felton "Code") | [<img src="https://avatars2.githubusercontent.com/u/14036694?v=3" width="110px;"/><br /><sub>Manasses Ferreira</sub>](http://homepages.dcc.ufmg.br/~manassesferreira)<br />[💻](https://github.com/snipe/snipe-it/commits?author=manassesferreira "Code") | [<img src="https://avatars0.githubusercontent.com/u/15913949?v=3" width="110px;"/><br /><sub>Steve</sub>](https://github.com/steveelwood)<br />[⚠️](https://github.com/snipe/snipe-it/commits?author=steveelwood "Tests") | [<img src="https://avatars1.githubusercontent.com/u/3361683?v=3" width="110px;"/><br /><sub>matc</sub>](http://twitter.com/matc)<br />[⚠️](https://github.com/snipe/snipe-it/commits?author=matc "Tests") | [<img src="https://avatars3.githubusercontent.com/u/7405702?v=3" width="110px;"/><br /><sub>Cole R. Davis</sub>](http://www.davisracingteam.com)<br />[⚠️](https://github.com/snipe/snipe-it/commits?author=VanillaNinjaD "Tests") | [<img src="https://avatars2.githubusercontent.com/u/10167681?v=3" width="110px;"/><br /><sub>gibsonjoshua55</sub>](https://github.com/gibsonjoshua55)<br />[💻](https://github.com/snipe/snipe-it/commits?author=gibsonjoshua55 "Code") |
| [<img src="https://avatars2.githubusercontent.com/u/2809241?v=4" width="110px;"/><br /><sub>Robin Temme</sub>](https://github.com/zwerch)<br />[💻](https://github.com/snipe/snipe-it/commits?author=zwerch "Code") | [<img src="https://avatars0.githubusercontent.com/u/6961695?v=4" width="110px;"/><br /><sub>Iman</sub>](https://github.com/imanghafoori1)<br />[💻](https://github.com/snipe/snipe-it/commits?author=imanghafoori1 "Code") |
| [<img src="https://avatars2.githubusercontent.com/u/2809241?v=4" width="110px;"/><br /><sub>Robin Temme</sub>](https://github.com/zwerch)<br />[💻](https://github.com/snipe/snipe-it/commits?author=zwerch "Code") | [<img src="https://avatars0.githubusercontent.com/u/6961695?v=4" width="110px;"/><br /><sub>Iman</sub>](https://github.com/imanghafoori1)<br />[💻](https://github.com/snipe/snipe-it/commits?author=imanghafoori1 "Code") | [<img src="https://avatars1.githubusercontent.com/u/6551003?v=4" width="110px;"/><br /><sub>Richard Hofman</sub>](https://github.com/richardhofman6)<br />[💻](https://github.com/snipe/snipe-it/commits?author=richardhofman6 "Code") | [<img src="https://avatars0.githubusercontent.com/u/3697569?v=4" width="110px;"/><br /><sub>gizzmojr</sub>](https://github.com/gizzmojr)<br />[💻](https://github.com/snipe/snipe-it/commits?author=gizzmojr "Code") |
<!-- ALL-CONTRIBUTORS-LIST:END -->
This project follows the [all-contributors](https://github.com/kentcdodds/all-contributors) specification. Contributions of any kind welcome!
@@ -13,6 +13,7 @@ use Illuminate\Support\Facades\Input;
use Illuminate\Support\Facades\Session;
use League\Csv\Reader;
use Symfony\Component\HttpFoundation\File\Exception\FileException;
use Artisan;
class ImportController extends Controller
{
@@ -94,6 +95,8 @@ class ImportController extends Controller
public function process(ItemImportRequest $request, $import_id)
{
$this->authorize('create', Asset::class);
// Run a backup immediately before processing
Artisan::call('backup:run');
$errors = $request->import(Import::find($import_id));
$redirectTo = "hardware.index";
switch ($request->get('import-type')) {
@@ -82,7 +82,7 @@ class AssetModelsController extends Controller
$model->manufacturer_id = $request->input('manufacturer_id');
$model->category_id = $request->input('category_id');
$model->notes = $request->input('notes');
$model->user_id = Auth::guard('api')->user();
$model->user_id = Auth::id();
$model->requestable = Input::has('requestable');
if ($request->input('custom_fieldset')!='') {
+2 -2
View File
@@ -306,8 +306,8 @@ class LicensesController extends Controller
return redirect()->route('licenses.index')->with('error', trans('admin/licenses/message.asset_does_not_exist'));
}
if (($target->assigned_to!='') && (($target->assigned_to!=$assigned_to)) && ($target!='')) {
return redirect()->route('licenses.index')->with('error', trans('admin/licenses/message.owner_doesnt_match_asset'));
if (($request->has('assigned_to')) && ($request->has('asset_id'))) {
return redirect()->back()->withInput()->with('error', trans('admin/licenses/message.select_asset_or_person'));
}
}
+6 -1
View File
@@ -338,7 +338,10 @@ class SettingsController extends Controller
$setting->email_format = $request->input('email_format');
$setting->username_format = $request->input('username_format');
$setting->require_accept_signature = $request->input('require_accept_signature');
$setting->login_note = $request->input('login_note');
if (config('app.lock_passwords')) {
$setting->login_note = $request->input('login_note');
}
$setting->default_eula_text = $request->input('default_eula_text');
$setting->thumbnail_max_h = $request->input('thumbnail_max_h');
@@ -992,6 +995,8 @@ class SettingsController extends Controller
{
if (!config('app.lock_passwords')) {
if (Input::get('confirm_purge')=='DELETE') {
// Run a backup immediately before processing
Artisan::call('backup:run');
Artisan::call('snipeit:purge', ['--force'=>'true','--no-interaction'=>true]);
$output = Artisan::output();
return view('settings/purge')
@@ -33,8 +33,9 @@ class LicensesTransformer
'depreciation' => ($license->depreciation) ? ['id' => (int) $license->depreciation->id,'name'=> e($license->depreciation->name)] : null,
'notes' => e($license->notes),
'expiration_date' => Helper::getFormattedDateObject($license->expiration_date, 'date'),
'total_seats' => (int) $license->total_seats,
'remaining_qty' => $license->remaincount(),
'total_seats' => (int) $license->seats,
'next_seat' => ($license->freeSeat()) ? (int) $license->freeSeat()->id : null,
'remaining_qty' => (int) $license->remaincount(),
'min_qty' => $license->remaincount(),
'license_name' => e($license->license_name),
'license_email' => e($license->license_email),
@@ -36,9 +36,11 @@ class LocationsTransformer
'address' => e($location->address),
'city' => e($location->city),
'state' => e($location->state),
'country' => e($location->country),
'zip' => e($location->zip),
'assets_checkedout' => $location->assets()->count(),
'assets_default' => $location->assignedassets()->count(),
'country' => e($location->country),
'created_at' => Helper::getFormattedDateObject($location->created_at, 'datetime'),
'updated_at' => Helper::getFormattedDateObject($location->updated_at, 'datetime'),
'parent' => ($location->parent) ? [
+4 -3
View File
@@ -262,11 +262,12 @@ class Asset extends Depreciable
return $this->assignedTo();
}
if ($this->assignedType() == self::USER) {
if (!$this->assignedTo) {
return $this->defaultLoc();
}
return $this->assignedTo->userLoc();
}
if (!$this->assignedTo) {
return $this->defaultLoc();
}
}
return $this->defaultLoc();
}
+5 -2
View File
@@ -332,14 +332,17 @@ class License extends Depreciable
return $this->belongsTo('\App\Models\Supplier', 'supplier_id');
}
/*
* Get the next available free seat - used by
* the API to populate next_seat
*/
public function freeSeat()
{
$seat = LicenseSeat::where('license_id', '=', $this->id)
return $this->licenseseats()
->whereNull('deleted_at')
->whereNull('assigned_to')
->whereNull('asset_id')
->first();
return $seat->id;
}
public static function getExpiringLicenses($days = 60)
+7 -4
View File
@@ -43,20 +43,23 @@ trait Loggable
$log->target_type = get_class($target);
$log->target_id = $target->id;
$class = get_class($target);
if ($class == Location::class) {
$target_class = get_class($target);
// Figure out what the target is
if ($target_class == Location::class) {
// We can checkout to a location
$log->location_id = $target->id;
} else if ($class== Asset::class) {
} elseif ($target_class== Asset::class) {
$log->location_id = $target->rtd_location_id;
} else {
$log->location_id = $target->location_id;
}
$log->note = $note;
$log->logaction('checkout');
$params = [
'item' => $this,
'item' => $log->item,
'target' => $target,
'admin' => $log->user,
'note' => $note,
+1 -1
View File
@@ -94,7 +94,7 @@ class CheckoutNotification extends Notification
'item_tag' => $item->asset_tag,
'note' => $this->params['note'],
'item_serial' => $item->serial,
'require_acceptance' => $item->requireAcceptance(),
'require_acceptance' => method_exists($item, 'requireAcceptance') ? $item->requireAcceptance() : '',
'log_id' => $this->params['log_id'],
];
return (new MailMessage)
+10
View File
@@ -146,6 +146,16 @@ class LicensePresenter extends Presenter
return (string)link_to_route('licenses.show', $this->name, $this->id);
}
/**
* Link to this licenses Name
* @return string
*/
public function fullName()
{
return 'poop';
}
/**
* Link to this licenses serial
* @return string
+2
View File
@@ -22,6 +22,8 @@ return [
base_path('public/uploads'),
base_path('config'),
base_path('storage/private_uploads'),
base_path('storage/oauth-private.key'),
base_path('storage/oauth-public.key'),
],
/*
+3 -3
View File
@@ -1,7 +1,7 @@
<?php
return array (
'app_version' => 'v4.0',
'app_version' => 'v4.0.4',
'build_version' => '1',
'hash_version' => 'g998c4a5',
'full_hash' => 'v4.0-1-g998c4a5',
'hash_version' => 'geca5a05',
'full_hash' => 'v4.0.4-1-geca5a05',
);
@@ -7,6 +7,7 @@ return array(
'asset_does_not_exist' => 'The asset you are trying to associate with this license does not exist.',
'owner_doesnt_match_asset' => 'The asset you are trying to associate with this license is owned by somene other than the person selected in the assigned to dropdown.',
'assoc_users' => 'This license is currently checked out to a user and cannot be deleted. Please check the license in first, and then try deleting again. ',
'select_asset_or_person' => 'You must select an asset or a user, but not both.',
'create' => array(
+1 -1
View File
@@ -152,7 +152,7 @@
} else {
handleAuditFail(data);
}
$('input#asset_tag').val('');
},
error: function (data) {
handleAuditFail(data);
+2 -2
View File
@@ -10,9 +10,9 @@
<!-- Select2 -->
<link rel="stylesheet" href="{{ asset('js/plugins/select2/select2.min.css') }}">
<link rel="stylesheet" href="{{ url(asset('js/plugins/select2/select2.min.css')) }}">
<link rel="stylesheet" href="{{ mix('css/dist/all.css') }}">
<link rel="stylesheet" href="{{ url(mix('css/dist/all.css')) }}">
<link rel="shortcut icon" type="image/ico" href="{{ asset('favicon.ico') }}">
+8 -8
View File
@@ -13,17 +13,17 @@
<meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
<!-- Select2 -->
<link rel="stylesheet" href="{{ asset('js/plugins/select2/select2.min.css') }}">
<link rel="stylesheet" href="{{ url(asset('js/plugins/select2/select2.min.css')) }}">
<!-- iCheck for checkboxes and radio inputs -->
<link rel="stylesheet" href="{{ asset('js/plugins/iCheck/all.css') }}">
<link rel="stylesheet" href="{{ url(asset('js/plugins/iCheck/all.css')) }}">
<!-- bootstrap tables CSS -->
<link rel="stylesheet" href="{{ asset('css/bootstrap-table.css') }}">
<link rel="stylesheet" href="{{ url(asset('css/bootstrap-table.css')) }}">
<link rel="stylesheet" href="{{ mix('css/dist/all.css') }}">
<link rel="stylesheet" href="{{ url(mix('css/dist/all.css')) }}">
<link rel="shortcut icon" type="image/ico" href="{{ asset('favicon.ico') }}">
<link rel="shortcut icon" type="image/ico" href="{{ url(asset('favicon.ico')) }}">
<meta name="csrf-token" content="{{ csrf_token() }}">
@@ -88,8 +88,8 @@
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
@else
<script src="{{ asset('js/html5shiv.js') }}"></script>
<script src="{{ asset('js/respond.js') }}"></script>
<script src="{{ url(asset('js/html5shiv.js')) }}"></script>
<script src="{{ url(asset('js/respond.js')) }}"></script>
@endif
<![endif]-->
</head>
@@ -662,7 +662,7 @@
<script src="{{ mix('js/dist/all.js') }}"></script>
<script src="{{ url(mix('js/dist/all.js')) }}"></script>
<script>
$(function () {
var datepicker = $.fn.datepicker.noConflict(); // return $.fn.datepicker to previously assigned value
+2 -2
View File
@@ -7,7 +7,7 @@
@show
</title>
<link rel="stylesheet" href="{{ mix('css/dist/all.css') }}">
<link rel="stylesheet" href="{{ url(mix('css/dist/all.css')) }}">
@@ -118,7 +118,7 @@
</div>
</div>
</div>
<script src="{{ asset(mix('js/dist/all.js')) }}"></script>
<script src="{{ url(mix('js/dist/all.js')) }}"></script>
<script>
$(function () {
@@ -215,7 +215,13 @@ $('.snipe-table').bootstrapTable({
// The user is allowed to check items out, AND the item is deployable
if ((row.available_actions.checkout == true) && (row.user_can_checkout == true) && (!row.assigned_to)) {
return '<a href="{{ url('/') }}/' + destination + '/' + row.id + '/checkout" class="btn btn-sm btn-primary" data-tooltip="true" title="Check this item out to a user">{{ trans('general.checkout') }}</a>';
// case for licenses
if (row.next_seat) {
return '<a href="{{ url('/') }}/' + destination + '/' + row.next_seat + '/checkout" class="btn btn-sm btn-primary" data-tooltip="true" title="Check this item out to a user">{{ trans('general.checkout') }}</a>';
} else {
return '<a href="{{ url('/') }}/' + destination + '/' + row.id + '/checkout" class="btn btn-sm btn-primary" data-tooltip="true" title="Check this item out to a user">{{ trans('general.checkout') }}</a>';
}
// The user is allowed to check items out, but the item is not deployable
} else if (((row.user_can_checkout == false)) && (row.available_actions.checkout == true) && (!row.assigned_to)) {
+2 -2
View File
@@ -165,9 +165,9 @@
{{ Form::label('login_note', trans('admin/settings/general.login_note')) }}
</div>
<div class="col-md-9">
@if (config('app.lock_passwords')===true)
@if (config('app.lock_passwords'))
<textarea class="form-control" name="login_note" placeholder="If you do not have a login or have found a device belonging to this company, please call technical support at 888-555-1212. Thank you." rows="2">{{ Input::old('login_note', $setting->login_note) }}</textarea>
<textarea class="form-control disabled" name="login_note" placeholder="If you do not have a login or have found a device belonging to this company, please call technical support at 888-555-1212. Thank you." rows="2" readonly>{{ Input::old('login_note', $setting->login_note) }}</textarea>
{!! $errors->first('login_note', '<span class="alert-msg">:message</span>') !!}
<p class="help-block">{{ trans('general.lock_passwords') }}</p>
@else
+1
View File
@@ -459,6 +459,7 @@ Route::group(['middleware' => 'web'], function () {
});
Auth::routes();
+108
View File
@@ -0,0 +1,108 @@
<?php
(PHP_SAPI !== 'cli' || isset($_SERVER['HTTP_USER_AGENT'])) && die('Access denied.');
echo "Welcome to the Snipe-IT upgrader.\n\n";
echo "If you have any encrypted custom fields, BE SURE TO run the recrypter. See the Snipe-IT documentation for help.\n\n";
echo "--------------------------------------------------------\n";
echo "STEP 1: Backing up database: \n";
echo "--------------------------------------------------------\n\n";
$backup = shell_exec('php artisan snipeit:backup');
echo '- '.$backup."\n\n";
echo "--------------------------------------------------------\n";
echo "STEP 2: Putting application into maintenance mode: \n";
echo "--------------------------------------------------------\n\n";
$down = shell_exec('php artisan down');
echo '- '.$down."\n\n";
echo "--------------------------------------------------------\n";
echo "Step 3: Cleaning up old cached files:\n";
echo "--------------------------------------------------------\n\n";
if (file_exists('bootstrap/cache/compiled.php')) {
echo "-- Deleting bootstrap/cache/compiled.php. It it no longer used.\n";
@unlink('bootstrap/cache/compiled.php');
} else {
echo "-- No bootstrap/cache/compiled.php, so nothing to delete.\n";
}
if (file_exists('bootstrap/cache/services.php')) {
echo "-- Deleting bootstrap/cache/services.php. It it no longer used.\n";
@unlink('bootstrap/cache/services.php');
} else {
echo "-- No bootstrap/cache/services.php, so nothing to delete.\n";
}
if (file_exists('bootstrap/cache/config.php')) {
echo "-- Deleting bootstrap/cache/config.php. It it no longer used.\n";
@unlink('bootstrap/cache/config.php');
} else {
echo "-- No bootstrap/cache/config.php, so nothing to delete.\n";
}
$config_clear = shell_exec('php artisan config:clear');
$cache_clear = shell_exec('php artisan cache:clear');
echo '- '.$config_clear;
echo '- '.$cache_clear;
echo "\n";
echo "--------------------------------------------------------\n";
echo "Step 4: Updating composer dependencies:\n";
echo "(This may take an moment.)\n";
echo "--------------------------------------------------------\n\n";
// Composer install
if (file_exists('composer.phar')) {
echo "- Local composer.phar detected, so we'll use that.\n\n";
$composer = shell_exec('php composer.phar install --prefer-source');
} else {
echo "- We couldn't find a local composer.phar - trying globally.\n\n";
$composer = shell_exec('composer install --prefer-source');
}
echo $composer."\n\n";
echo "--------------------------------------------------------\n";
echo "Step 5: Migrating database:\n";
echo "--------------------------------------------------------\n\n";
$migrations = shell_exec('php artisan migrate --force');
echo '- '.$migrations."\n\n";
echo "--------------------------------------------------------\n";
echo "Step 6: Checking for OAuth keys:\n";
echo "--------------------------------------------------------\n\n";
if ((!file_exists('storage/oauth-public.key')) || (!file_exists('storage/oauth-private.key'))) {
echo "- No OAuth keys detected. Running passport install now.\n\n";
$passport = shell_exec('php artisan passport:install');
echo $passport;
} else {
echo "- OAuth keys detected. Skipping passport install.\n\n";
}
echo "--------------------------------------------------------\n";
echo "Step 7: Taking application out of maintenance mode:\n";
echo "--------------------------------------------------------\n\n";
$up = shell_exec('php artisan up');
echo '- '.$up."\n\n";
echo "--------------------------------------------------------\n";
echo "FINISHED! Clear your browser cookies and re-login to use :\n";
echo "your upgraded Snipe-IT.\n";
echo "--------------------------------------------------------\n\n";