Fixed #12772 - use the APP_URL config more consistently

Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
snipe 2023-04-05 16:05:40 -07:00
parent 6aec73c720
commit 161999fbca
27 changed files with 75 additions and 75 deletions

View file

@ -84,7 +84,7 @@ class SettingsController extends Controller
}
$pageURL = $protocol.$host.$_SERVER['REQUEST_URI'];
$start_settings['url_config'] = url('/').'/setup';
$start_settings['url_config'] = config('app.url').'/setup';
$start_settings['url_valid'] = ($start_settings['url_config'] === $pageURL);
$start_settings['real_url'] = $pageURL;
$start_settings['php_version_min'] = true;

View file

@ -20,13 +20,13 @@ class CheckForSetup
if (Setting::setupCompleted()) {
if ($request->is('setup*')) {
return redirect(url('/'));
return redirect(config('app.url'));
} else {
return $next($request);
}
} else {
if (! ($request->is('setup*')) && ! ($request->is('.env')) && ! ($request->is('health'))) {
return redirect(url('/').'/setup');
return redirect(config('app.url').'/setup');
}
return $next($request);

View file

@ -267,7 +267,7 @@ class Location extends SnipeModel
foreach ($locations_with_children[$parent_id] as $location) {
$location->use_text = $prefix.' '.$location->name;
$location->use_image = ($location->image) ? url('/').'/uploads/locations/'.$location->image : null;
$location->use_image = ($location->image) ? config('app.url').'/uploads/locations/'.$location->image : null;
$results[] = $location;
//now append the children. (if we have any)
if (array_key_exists($location->id, $locations_with_children)) {

View file

@ -24,7 +24,7 @@ class FirstAdminNotification extends Notification
$this->_data['last_name'] = $content['last_name'];
$this->_data['username'] = $content['username'];
$this->_data['password'] = $content['password'];
$this->_data['url'] = url('/');
$this->_data['url'] = config('app.url');
}
/**

View file

@ -24,7 +24,7 @@ class WelcomeNotification extends Notification
$this->_data['last_name'] = htmlspecialchars_decode($content['last_name']);
$this->_data['username'] = htmlspecialchars_decode($content['username']);
$this->_data['password'] = htmlspecialchars_decode($content['password']);
$this->_data['url'] = url('/');
$this->_data['url'] = config('app.url');
}
/**

View file

@ -210,7 +210,7 @@ class AssetModelPresenter extends Presenter
public function imageUrl()
{
if (! empty($this->image)) {
return '<img src="'.url('/').'/uploads/models/'.$this->image.'" alt="'.$this->name.'" height="50" width="50">';
return '<img src="'.config('app.url').'/uploads/models/'.$this->image.'" alt="'.$this->name.'" height="50" width="50">';
}
return '';
@ -223,7 +223,7 @@ class AssetModelPresenter extends Presenter
public function imageSrc()
{
if (! empty($this->image)) {
return url('/').'/uploads/models/'.$this->image;
return config('app.url').'/uploads/models/'.$this->image;
}
return '';

View file

@ -406,7 +406,7 @@ class UserPresenter extends Presenter
}
// Set a fun, gender-neutral default icon
return url('/').'/img/default-sm.png';
return config('app.url').'/img/default-sm.png';
}
/**

View file

@ -161,7 +161,7 @@ class Saml
//Let onelogin/php-saml know to use 'X-Forwarded-*' headers if it is from a trusted proxy
OneLogin_Saml2_Utils::setProxyVars(request()->isFromTrustedProxy());
data_set($settings, 'sp.entityId', url('/'));
data_set($settings, 'sp.entityId', config('app.url'));
data_set($settings, 'sp.assertionConsumerService.url', route('saml.acs'));
data_set($settings, 'sp.singleLogoutService.url', route('saml.sls'));
data_set($settings, 'sp.x509cert', $setting->saml_sp_x509cert);

View file

@ -104,8 +104,8 @@
<td>
@if ($requestableModel->image)
<a href="{{ url('/') }}/uploads/models/{{ $requestableModel->image }}" data-toggle="lightbox" data-type="image">
<img src="{{ url('/') }}/uploads/models/{{ $requestableModel->image }}" style="max-height: {{ $snipeSettings->thumbnail_max_h }}px; width: auto;" class="img-responsive">
<a href="{{ config('app.url') }}/uploads/models/{{ $requestableModel->image }}" data-toggle="lightbox" data-type="image">
<img src="{{ config('app.url') }}/uploads/models/{{ $requestableModel->image }}" style="max-height: {{ $snipeSettings->thumbnail_max_h }}px; width: auto;" class="img-responsive">
</a>
@endif

View file

@ -54,11 +54,11 @@
function maintenanceActions(value, row) {
var actions = '<nobr>';
if ((row) && (row.available_actions.update === true)) {
actions += '<a href="{{ url('/') }}/hardware/maintenances/' + row.id + '/edit" class="btn btn-sm btn-warning" data-tooltip="true" title="Update"><i class="fas fa-pencil-alt"></i></a>&nbsp;';
actions += '<a href="{{ config('app.url') }}/hardware/maintenances/' + row.id + '/edit" class="btn btn-sm btn-warning" data-tooltip="true" title="Update"><i class="fas fa-pencil-alt"></i></a>&nbsp;';
}
actions += '</nobr>'
if ((row) && (row.available_actions.delete === true)) {
actions += '<a href="{{ url('/') }}/hardware/maintenances/' + row.id + '" '
actions += '<a href="{{ config('app.url') }}/hardware/maintenances/' + row.id + '" '
+ ' class="btn btn-danger btn-sm delete-asset" data-tooltip="true" '
+ ' data-toggle="modal" '
+ ' data-content="{{ trans('general.sure_to_delete') }} ' + row.name + '?" '

View file

@ -16,11 +16,11 @@
<div class="col-md-8 col-md-offset-2">
<div style="padding-top: 200px">
<img src="{{ url('/') }}/img/sad-panda.png" style="width: 200px; height: 200px;" class="pull-left">
<img src="{{ config('app.url') }}/img/sad-panda.png" style="width: 200px; height: 200px;" class="pull-left">
<div class="error-content">
<h2><i class="fas fa-exclamation-triangle text-yellow"></i> 403 Forbidden.</h2>
<p>
Sad panda. You are not authorized to do the thing. Maybe <a href="{{ url('/') }}">return to the dashboard</a>, or contact your administrator.
Sad panda. You are not authorized to do the thing. Maybe <a href="{{ config('app.url') }}">return to the dashboard</a>, or contact your administrator.
</p>
</div>

View file

@ -16,12 +16,12 @@
<div class="col-md-8 col-md-offset-2">
<div style="padding-top: 200px">
<img src="{{ url('/') }}/img/sad-panda.png" style="width: 200px; height: 200px;" class="pull-left">
<img src="{{ config('app.url') }}/img/sad-panda.png" style="width: 200px; height: 200px;" class="pull-left">
<div class="error-content">
<h2><i class="fas fa-exclamation-triangle text-yellow"></i> 404 Page not found.</h2>
<p>
Sad panda. We could not find the page you were looking for.
You should maybe <a href="{{ url('/') }}">return to the dashboard</a>.
You should maybe <a href="{{ config('app.url') }}">return to the dashboard</a>.
</p>
</div>

View file

@ -29,7 +29,7 @@
<div class="col-md-12">
<div class="col-md-2">
<img src="{{ url('/') }}/img/sad-panda.png" class="pull-right" style="width: 140px; height: 140px;">
<img src="{{ config('app.url') }}/img/sad-panda.png" class="pull-right" style="width: 140px; height: 140px;">
</div>
<div class="alert alert-warning fade in">
<h2> {{ trans('general.maintenance_mode') }}</h2>

View file

@ -198,7 +198,7 @@
$.ajax({
type: 'GET',
url: "{{ url('/') }}/models/" + modelid + "/custom_fields",
url: "{{ config('app.url') }}/models/" + modelid + "/custom_fields",
headers: {
"X-Requested-With": 'XMLHttpRequest',
"X-CSRF-TOKEN": $('meta[name="csrf-token"]').attr('content')
@ -230,7 +230,7 @@
if (status_id != '') {
$(".status_spinner").css("display", "inline");
$.ajax({
url: "{{url('/') }}/api/v1/statuslabels/" + status_id + "/deployable",
url: "{{config('app.url') }}/api/v1/statuslabels/" + status_id + "/deployable",
headers: {
"X-Requested-With": 'XMLHttpRequest',
"X-CSRF-TOKEN": $('meta[name="csrf-token"]').attr('content')

View file

@ -64,7 +64,7 @@
@if (($request->itemType() == "asset") && ($request->requestable))
<a href="{{ $request->requestable->getImageUrl() }}" data-toggle="lightbox" data-type="image"><img src="{{ $request->requestable->getImageUrl() }}" style="max-height: {{ $snipeSettings->thumbnail_max_h }}px; width: auto;" class="img-responsive" alt="{{ $request->requestable->name }}"></a>
@elseif (($request->itemType() == "asset_model") && ($request->requestable))
<a href="{{ url('/') }}/uploads/models/{{ $request->requestable->image }}" data-toggle="lightbox" data-type="image"><img src="{{ url('/') }}/uploads/models/{{ $request->requestable->image }}" style="max-height: {{ $snipeSettings->thumbnail_max_h }}px; width: auto;" class="img-responsive" alt="{{ $request->requestable->name }}"></a>
<a href="{{ config('app.url') }}/uploads/models/{{ $request->requestable->image }}" data-toggle="lightbox" data-type="image"><img src="{{ config('app.url') }}/uploads/models/{{ $request->requestable->image }}" style="max-height: {{ $snipeSettings->thumbnail_max_h }}px; width: auto;" class="img-responsive" alt="{{ $request->requestable->name }}"></a>
@endif
@ -72,11 +72,11 @@
<td>
@if ($request->itemType() == "asset")
<a href="{{ url('/') }}/hardware/{{ $request->requestable->id }}">
<a href="{{ config('app.url') }}/hardware/{{ $request->requestable->id }}">
{{ $request->name() }}
</a>
@elseif ($request->itemType() == "asset_model")
<a href="{{ url('/') }}/models/{{ $request->requestable->id }}">
<a href="{{ config('app.url') }}/models/{{ $request->requestable->id }}">
{{ $request->name() }}
</a>
@endif
@ -95,7 +95,7 @@
</td>
<td>
@if ($request->requestingUser())
<a href="{{ url('/') }}/users/{{ $request->requestingUser()->id }}">
<a href="{{ config('app.url') }}/users/{{ $request->requestingUser()->id }}">
{{ $request->requestingUser()->present()->fullName() }}
</a>
@else
@ -106,9 +106,9 @@
<td>
@if ($request->itemType() == "asset")
@if ($request->requestable->assigned_to=='')
<a href="{{ url('/') }}/hardware/{{ $request->requestable->id }}/checkout" class="btn btn-sm bg-maroon" data-tooltip="true" title="{{ trans('general.checkout_user_tooltip') }}">{{ trans('general.checkout') }}</a>
<a href="{{ config('app.url') }}/hardware/{{ $request->requestable->id }}/checkout" class="btn btn-sm bg-maroon" data-tooltip="true" title="{{ trans('general.checkout_user_tooltip') }}">{{ trans('general.checkout') }}</a>
@else
<a href="{{ url('/') }}/hardware/{{ $request->requestable->id }}/checkin" class="btn btn-sm bg-purple" data-tooltip="true" title="{{ trans('general.checkin_toolip') }}">{{ trans('general.checkin') }}</a>
<a href="{{ config('app.url') }}/hardware/{{ $request->requestable->id }}/checkin" class="btn btn-sm bg-purple" data-tooltip="true" title="{{ trans('general.checkin_toolip') }}">{{ trans('general.checkin') }}</a>
@endif
@endif

View file

@ -21,7 +21,7 @@
<meta name="csrf-token" content="{{ csrf_token() }}">
<meta name="baseUrl" content="{{ url('/') }}/">
<meta name="baseUrl" content="{{ config('app.url') }}/">
<script nonce="{{ csrf_token() }}">
window.Laravel = { csrfToken: '{{ csrf_token() }}' };
@ -105,21 +105,21 @@
<div class="nav navbar-nav navbar-left">
<div class="left-navblock">
@if ($snipeSettings->brand == '3')
<a class="logo navbar-brand no-hover" href="{{ url('/') }}">
<a class="logo navbar-brand no-hover" href="{{ config('app.url') }}">
@if ($snipeSettings->logo!='')
<img class="navbar-brand-img" src="{{ Storage::disk('public')->url($snipeSettings->logo) }}" alt="{{ $snipeSettings->site_name }} logo">
@endif
{{ $snipeSettings->site_name }}
</a>
@elseif ($snipeSettings->brand == '2')
<a class="logo navbar-brand no-hover" href="{{ url('/') }}">
<a class="logo navbar-brand no-hover" href="{{ config('app.url') }}">
@if ($snipeSettings->logo!='')
<img class="navbar-brand-img" src="{{ Storage::disk('public')->url($snipeSettings->logo) }}" alt="{{ $snipeSettings->site_name }} logo">
@endif
<span class="sr-only">{{ $snipeSettings->site_name }}</span>
</a>
@else
<a class="logo navbar-brand no-hover" href="{{ url('/') }}">
<a class="logo navbar-brand no-hover" href="{{ config('app.url') }}">
{{ $snipeSettings->site_name }}
</a>
@endif

View file

@ -36,13 +36,13 @@
<h3>
@if ($snipeSettings->logo!='')
<img class="print-logo" src="{{ url('/') }}/uploads/{{ $snipeSettings->logo }}">
<img class="print-logo" src="{{ config('app.url') }}/uploads/{{ $snipeSettings->logo }}">
@endif
{{ $snipeSettings->site_name }}
</h3>
@elseif ($snipeSettings->brand == '2')
@if ($snipeSettings->logo!='')
<img class="print-logo" src="{{ url('/') }}/uploads/{{ $snipeSettings->logo }}">
<img class="print-logo" src="{{ config('app.url') }}/uploads/{{ $snipeSettings->logo }}">
@endif
@else
<h3>{{ $snipeSettings->site_name }}</h3>

View file

@ -10,7 +10,7 @@ Go To {{$snipeSettings->site_name}}
{{ trans('mail.best_regards') }} <br>
@if ($snipeSettings->show_url_in_emails=='1')
<p><a href="{{ url('/') }}">{{ $snipeSettings->site_name }}</a></p>
<p><a href="{{ config('app.url') }}">{{ $snipeSettings->site_name }}</a></p>
@else
<p>{{ $snipeSettings->site_name }}</p>
@endif

View file

@ -12,7 +12,7 @@ Go To {{$snipeSettings->site_name}}
{{ trans('mail.best_regards') }} <br>
@if ($snipeSettings->show_url_in_emails=='1')
<p><a href="{{ url('/') }}">{{ $snipeSettings->site_name }}</a></p>
<p><a href="{{ config('app.url') }}">{{ $snipeSettings->site_name }}</a></p>
@else
<p>{{ $snipeSettings->site_name }}</p>
@endif

View file

@ -13,7 +13,7 @@
$.ajax({
type: 'GET',
url: '{{ url('/') }}/api/v1/users/' + userid + '/assets',
url: '{{ config('app.url') }}/api/v1/users/' + userid + '/assets',
headers: {
"X-Requested-With": 'XMLHttpRequest',
"X-CSRF-TOKEN": $('meta[name="csrf-token"]').attr('content')
@ -45,7 +45,7 @@
} else {
table_html += "<td></td> ";
}
table_html += '<td><a href="{{ url('/') }}/hardware/' + asset.id + '">';
table_html += '<td><a href="{{ config('app.url') }}/hardware/' + asset.id + '">';
if ((asset.name == '') && (asset.name != null)) {
table_html += " " + asset.model.name;

View file

@ -173,7 +173,7 @@
function genericRowLinkFormatter(destination) {
return function (value,row) {
if (value) {
return '<a href="{{ url('/') }}/' + destination + '/' + row.id + '">' + value + '</a>';
return '<a href="{{ config('app.url') }}/' + destination + '/' + row.id + '">' + value + '</a>';
}
};
}
@ -215,7 +215,7 @@
text_help = '';
}
return '<nobr><a href="{{ url('/') }}/' + destination + '/' + value.id + '" data-toggle="tooltip" title="'+ status_meta[value.status_meta] + '"> <i class="fa ' + icon_style + ' text-' + text_color + '"></i> ' + value.name + ' ' + text_help + ' </a> </nobr>';
return '<nobr><a href="{{ config('app.url') }}/' + destination + '/' + value.id + '" data-toggle="tooltip" title="'+ status_meta[value.status_meta] + '"> <i class="fa ' + icon_style + ' text-' + text_color + '"></i> ' + value.name + ' ' + text_help + ' </a> </nobr>';
} else if ((value) && (value.name)) {
// Add some overrides for any funny urls we have
@ -225,13 +225,13 @@
var dpolymorphicItemFormatterest = 'fields/';
}
return '<nobr><a href="{{ url('/') }}/' + dpolymorphicItemFormatterest + dest + '/' + value.id + '">' + value.name + '</a></span>';
return '<nobr><a href="{{ config('app.url') }}/' + dpolymorphicItemFormatterest + dest + '/' + value.id + '">' + value.name + '</a></span>';
}
};
}
function hardwareAuditFormatter(value, row) {
return '<a href="{{ url('/') }}/hardware/audit/' + row.id + '/" class="btn btn-sm bg-yellow" data-tooltip="true" title="Audit this item">{{ trans('general.audit') }}</a>';
return '<a href="{{ config('app.url') }}/hardware/audit/' + row.id + '/" class="btn btn-sm bg-yellow" data-tooltip="true" title="Audit this item">{{ trans('general.audit') }}</a>';
}
@ -261,15 +261,15 @@
}
if ((row.available_actions) && (row.available_actions.clone === true)) {
actions += '<a href="{{ url('/') }}/' + dest + '/' + row.id + '/clone" class="btn btn-sm btn-info" data-tooltip="true" title="{{ trans('general.clone_item') }}"><i class="far fa-clone" aria-hidden="true"></i><span class="sr-only">Clone</span></a>&nbsp;';
actions += '<a href="{{ config('app.url') }}/' + dest + '/' + row.id + '/clone" class="btn btn-sm btn-info" data-tooltip="true" title="{{ trans('general.clone_item') }}"><i class="far fa-clone" aria-hidden="true"></i><span class="sr-only">Clone</span></a>&nbsp;';
}
if ((row.available_actions) && (row.available_actions.update === true)) {
actions += '<a href="{{ url('/') }}/' + dest + '/' + row.id + '/edit" class="btn btn-sm btn-warning" data-tooltip="true" title="{{ trans('general.update') }}"><i class="fas fa-pencil-alt" aria-hidden="true"></i><span class="sr-only">{{ trans('general.update') }}</span></a>&nbsp;';
actions += '<a href="{{ config('app.url') }}/' + dest + '/' + row.id + '/edit" class="btn btn-sm btn-warning" data-tooltip="true" title="{{ trans('general.update') }}"><i class="fas fa-pencil-alt" aria-hidden="true"></i><span class="sr-only">{{ trans('general.update') }}</span></a>&nbsp;';
}
if ((row.available_actions) && (row.available_actions.delete === true)) {
actions += '<a href="{{ url('/') }}/' + dest + '/' + row.id + '" '
actions += '<a href="{{ config('app.url') }}/' + dest + '/' + row.id + '" '
+ ' class="btn btn-danger btn-sm delete-asset" data-toggle="tooltip" '
+ ' data-toggle="modal" '
+ ' data-content="{{ trans('general.sure_to_delete') }} ' + row.name + '?" '
@ -281,7 +281,7 @@
if ((row.available_actions) && (row.available_actions.restore === true)) {
actions += '<form style="display: inline;" method="POST" action="{{ url('/') }}/' + dest + '/' + row.id + '/restore"> ';
actions += '<form style="display: inline;" method="POST" action="{{ config('app.url') }}/' + dest + '/' + row.id + '/restore"> ';
actions += '@csrf';
actions += '<button class="btn btn-sm btn-warning" data-toggle="tooltip" title="{{ trans('general.restore') }}"><i class="fas fa-retweet"></i></button>&nbsp;';
}
@ -332,7 +332,7 @@
value.name = value.name + ' (' + value.username + ')';
}
return '<nobr><a href="{{ url('/') }}/' + item_destination +'/' + value.id + '" data-tooltip="true" title="' + value.type + '"><i class="' + item_icon + ' text-{{ $snipeSettings->skin!='' ? $snipeSettings->skin : 'blue' }} "></i> ' + value.name + '</a></nobr>';
return '<nobr><a href="{{ config('app.url') }}/' + item_destination +'/' + value.id + '" data-tooltip="true" title="' + value.type + '"><i class="' + item_icon + ' text-{{ $snipeSettings->skin!='' ? $snipeSettings->skin : 'blue' }} "></i> ' + value.name + '</a></nobr>';
} else {
return '';
@ -364,9 +364,9 @@
function licenseSeatInOutFormatter(value, row) {
// The user is allowed to check the license seat out and it's available
if ((row.available_actions.checkout == true) && (row.user_can_checkout == true) && ((!row.asset_id) && (!row.assigned_to))) {
return '<a href="{{ url('/') }}/licenses/' + row.license_id + '/checkout/'+row.id+'" class="btn btn-sm bg-maroon" data-toggle="tooltip" title="{{ trans('general.checkout_tooltip') }}">{{ trans('general.checkout') }}</a>';
return '<a href="{{ config('app.url') }}/licenses/' + row.license_id + '/checkout/'+row.id+'" class="btn btn-sm bg-maroon" data-toggle="tooltip" title="{{ trans('general.checkout_tooltip') }}">{{ trans('general.checkout') }}</a>';
} else {
return '<a href="{{ url('/') }}/licenses/' + row.id + '/checkin" class="btn btn-sm bg-purple" data-toggle="tooltip" title="Check in this license seat.">{{ trans('general.checkin') }}</a>';
return '<a href="{{ config('app.url') }}/licenses/' + row.id + '/checkin" class="btn btn-sm bg-purple" data-toggle="tooltip" title="Check in this license seat.">{{ trans('general.checkin') }}</a>';
}
}
@ -376,7 +376,7 @@
// 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.asset_id) && (!row.assigned_to))) {
return '<a href="{{ url('/') }}/' + destination + '/' + row.id + '/checkout" class="btn btn-sm bg-maroon" data-toggle="tooltip" title="{{ trans('general.checkout_tooltip') }}">{{ trans('general.checkout') }}</a>';
return '<a href="{{ config('app.url') }}/' + destination + '/' + row.id + '/checkout" class="btn btn-sm bg-maroon" data-toggle="tooltip" title="{{ trans('general.checkout_tooltip') }}">{{ 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)) {
@ -385,9 +385,9 @@
// The user is allowed to check items in
} else if (row.available_actions.checkin == true) {
if (row.assigned_to) {
return '<a href="{{ url('/') }}/' + destination + '/' + row.id + '/checkin" class="btn btn-sm bg-purple" data-toggle="tooltip" title="Check this item in so it is available for re-imaging, re-issue, etc.">{{ trans('general.checkin') }}</a>';
return '<a href="{{ config('app.url') }}/' + destination + '/' + row.id + '/checkin" class="btn btn-sm bg-purple" data-toggle="tooltip" title="Check this item in so it is available for re-imaging, re-issue, etc.">{{ trans('general.checkin') }}</a>';
} else if (row.assigned_pivot_id) {
return '<a href="{{ url('/') }}/' + destination + '/' + row.assigned_pivot_id + '/checkin" class="btn btn-sm bg-purple" data-toggle="tooltip" title="Check this item in so it is available for re-imaging, re-issue, etc.">{{ trans('general.checkin') }}</a>';
return '<a href="{{ config('app.url') }}/' + destination + '/' + row.assigned_pivot_id + '/checkin" class="btn btn-sm bg-purple" data-toggle="tooltip" title="Check this item in so it is available for re-imaging, re-issue, etc.">{{ trans('general.checkin') }}</a>';
}
}
@ -403,9 +403,9 @@
if (value.assigned_to_self == true){
return '<button class="btn btn-danger btn-sm disabled" data-toggle="tooltip" title="Cancel this item request">{{ trans('button.cancel') }}</button>';
} else if (value.available_actions.cancel == true) {
return '<form action="{{ url('/') }}/account/request-asset/'+ value.id + '" method="POST">@csrf<button class="btn btn-danger btn-sm" data-toggle="tooltip" title="Cancel this item request">{{ trans('button.cancel') }}</button></form>';
return '<form action="{{ config('app.url') }}/account/request-asset/'+ value.id + '" method="POST">@csrf<button class="btn btn-danger btn-sm" data-toggle="tooltip" title="Cancel this item request">{{ trans('button.cancel') }}</button></form>';
} else if (value.available_actions.request == true) {
return '<form action="{{ url('/') }}/account/request-asset/'+ value.id + '" method="POST">@csrf<button class="btn btn-primary btn-sm" data-toggle="tooltip" title="Request this item">{{ trans('button.request') }}</button></form>';
return '<form action="{{ config('app.url') }}/account/request-asset/'+ value.id + '" method="POST">@csrf<button class="btn btn-primary btn-sm" data-toggle="tooltip" title="Request this item">{{ trans('button.request') }}</button></form>';
}
}
@ -506,7 +506,7 @@
if (value) {
var groups = '';
for (var index in value.rows) {
groups += '<a href="{{ url('/') }}/admin/groups/' + value.rows[index].id + '" class="label label-default">' + value.rows[index].name + '</a> ';
groups += '<a href="{{ config('app.url') }}/admin/groups/' + value.rows[index].id + '" class="label label-default">' + value.rows[index].name + '</a> ';
}
return groups;
}
@ -535,20 +535,20 @@
function deployedLocationFormatter(row, value) {
if ((row) && (row!=undefined)) {
return '<a href="{{ url('/') }}/locations/' + row.id + '">' + row.name + '</a>';
return '<a href="{{ config('app.url') }}/locations/' + row.id + '">' + row.name + '</a>';
} else if (value.rtd_location) {
return '<a href="{{ url('/') }}/locations/' + value.rtd_location.id + '" data-toggle="tooltip" title="Default Location">' + value.rtd_location.name + '</a>';
return '<a href="{{ config('app.url') }}/locations/' + value.rtd_location.id + '" data-toggle="tooltip" title="Default Location">' + value.rtd_location.name + '</a>';
}
}
function groupsAdminLinkFormatter(value, row) {
return '<a href="{{ url('/') }}/admin/groups/' + row.id + '">' + value + '</a>';
return '<a href="{{ config('app.url') }}/admin/groups/' + row.id + '">' + value + '</a>';
}
function assetTagLinkFormatter(value, row) {
if ((row.asset) && (row.asset.id)) {
return '<a href="{{ url('/') }}/hardware/' + row.asset.id + '">' + row.asset.asset_tag + '</a>';
return '<a href="{{ config('app.url') }}/hardware/' + row.asset.id + '">' + row.asset.asset_tag + '</a>';
}
return '';
@ -556,14 +556,14 @@
function departmentNameLinkFormatter(value, row) {
if ((row.assigned_user) && (row.assigned_user.department) && (row.assigned_user.department.name)) {
return '<a href="{{ url('/') }}/department/' + row.assigned_user.department.id + '">' + row.assigned_user.department.name + '</a>';
return '<a href="{{ config('app.url') }}/department/' + row.assigned_user.department.id + '">' + row.assigned_user.department.name + '</a>';
}
}
function assetNameLinkFormatter(value, row) {
if ((row.asset) && (row.asset.name)) {
return '<a href="{{ url('/') }}/hardware/' + row.asset.id + '">' + row.asset.name + '</a>';
return '<a href="{{ config('app.url') }}/hardware/' + row.asset.id + '">' + row.asset.name + '</a>';
}
}
@ -602,19 +602,19 @@
function assetCompanyFilterFormatter(value, row) {
if (value) {
return '<a href="{{ url('/') }}/hardware/?company_id=' + row.id + '">' + value + '</a>';
return '<a href="{{ config('app.url') }}/hardware/?company_id=' + row.id + '">' + value + '</a>';
}
}
function assetCompanyObjFilterFormatter(value, row) {
if ((row) && (row.company)) {
return '<a href="{{ url('/') }}/hardware/?company_id=' + row.company.id + '">' + row.company.name + '</a>';
return '<a href="{{ config('app.url') }}/hardware/?company_id=' + row.company.id + '">' + row.company.name + '</a>';
}
}
function usersCompanyObjFilterFormatter(value, row) {
if (value) {
return '<a href="{{ url('/') }}/users/?company_id=' + row.id + '">' + value + '</a>';
return '<a href="{{ config('app.url') }}/users/?company_id=' + row.id + '">' + value + '</a>';
} else {
return value;
}
@ -623,13 +623,13 @@
function employeeNumFormatter(value, row) {
if ((row) && (row.assigned_to) && ((row.assigned_to.employee_number))) {
return '<a href="{{ url('/') }}/users/' + row.assigned_to.id + '">' + row.assigned_to.employee_number + '</a>';
return '<a href="{{ config('app.url') }}/users/' + row.assigned_to.id + '">' + row.assigned_to.employee_number + '</a>';
}
}
function orderNumberObjFilterFormatter(value, row) {
if (value) {
return '<a href="{{ url('/') }}/hardware/?order_number=' + row.order_number + '">' + row.order_number + '</a>';
return '<a href="{{ config('app.url') }}/hardware/?order_number=' + row.order_number + '">' + row.order_number + '</a>';
}
}

View file

@ -67,7 +67,7 @@
<!-- SAML SP Details -->
<!-- SAML SP Entity ID -->
{{ Form::label('saml_sp_entitiyid', trans('admin/settings/general.saml_sp_entityid')) }}
{{ Form::text('saml_sp_entitiyid', url('/'), ['class' => 'form-control', 'readonly']) }}
{{ Form::text('saml_sp_entitiyid', config('app.url'), ['class' => 'form-control', 'readonly']) }}
<br>
<!-- SAML SP ACS -->
{{ Form::label('saml_sp_acs_url', trans('admin/settings/general.saml_sp_acs_url')) }}

View file

@ -14,6 +14,6 @@
{{ trans('general.create_admin_success') }}
</div>
</div>
<p>{{ trans('general.create_admin_redirect') }} <a href="{{ url('/') }}">{{ url('/') }}</a></p>
<p>{{ trans('general.create_admin_redirect') }} <a href="{{ config('app.url') }}">{{ config('app.url') }}</a></p>
</div>
@stop

View file

@ -106,7 +106,7 @@
function statuslabelsAssetLinkFormatter(value, row) {
if ((row) && (row.name)) {
return '<a href="{{ url('/') }}/hardware/?status_id=' + row.id + '"> ' + row.name + '</a>';
return '<a href="{{ config('app.url') }}/hardware/?status_id=' + row.id + '"> ' + row.name + '</a>';
}
}

View file

@ -36,13 +36,13 @@
<h2>
@if ($snipeSettings->logo!='')
<img class="print-logo" src="{{ url('/') }}/uploads/{{ $snipeSettings->logo }}">
<img class="print-logo" src="{{ config('app.url') }}/uploads/{{ $snipeSettings->logo }}">
@endif
{{ $snipeSettings->site_name }}
</h2>
@elseif ($snipeSettings->brand == '2')
@if ($snipeSettings->logo!='')
<img class="print-logo" src="{{ url('/') }}/uploads/{{ $snipeSettings->logo }}">
<img class="print-logo" src="{{ config('app.url') }}/uploads/{{ $snipeSettings->logo }}">
@endif
@else
<h2>{{ $snipeSettings->site_name }}</h2>

View file

@ -6,13 +6,13 @@
@if ($snipeSettings->brand == '3')
@if ($snipeSettings->logo!='')
<img class="navbar-brand-img logo" src="{{ url('/') }}/uploads/{{ $snipeSettings->logo }}">
<img class="navbar-brand-img logo" src="{{ config('app.url') }}/uploads/{{ $snipeSettings->logo }}">
@endif
{{ $snipeSettings->site_name }}
@elseif ($snipeSettings->brand == '2')
@if ($snipeSettings->logo!='')
<img class="navbar-brand-img logo" src="{{ url('/') }}/uploads/{{ $snipeSettings->logo }}">
<img class="navbar-brand-img logo" src="{{ config('app.url') }}/uploads/{{ $snipeSettings->logo }}">
@endif
@else
{{ $snipeSettings->site_name }}

View file

@ -86,13 +86,13 @@ $style = [
@if ($snipeSettings->brand == '3')
@if ($logo!='')
<img class="navbar-brand-img logo" style="max-width: 50px;" src="{{ url('/') }}/uploads/{{ $logo }}">
<img class="navbar-brand-img logo" style="max-width: 50px;" src="{{ config('app.url') }}/uploads/{{ $logo }}">
@endif
{{ $snipeSettings->site_name }}
@elseif ($snipeSettings->brand == '2')
@if ($logo!='')
<img class="navbar-brand-img logo" style="max-width: 50px;" src="{{ url('/') }}/uploads/{{ $logo }}">
<img class="navbar-brand-img logo" style="max-width: 50px;" src="{{ config('app.url') }}/uploads/{{ $logo }}">
@endif
@else
{{ $snipeSettings->site_name }}
@ -203,7 +203,7 @@ $style = [
<td style="{{ $fontFamily }} {{ $style['email-footer_cell'] }}">
<p style="{{ $style['paragraph-sub'] }}">
&copy; {{ date('Y') }}
<a style="{{ $style['anchor'] }}" href="{{ url('/') }}" target="_blank">{{ $snipeSettings->site_name }}</a>.
<a style="{{ $style['anchor'] }}" href="{{ config('app.url') }}" target="_blank">{{ $snipeSettings->site_name }}</a>.
{{ trans('mail.rights_reserved') }}
</p>