Added phpinfo page if debugging is enabled

This commit is contained in:
snipe 2017-07-08 00:09:39 -07:00
parent ab2b2f3043
commit c2927c4a2e
4 changed files with 57 additions and 7 deletions

View file

@ -687,6 +687,18 @@ class SettingsController extends Controller
}
/**
* Return a form to allow a super admin to update settings.
*
* @author [A. Gianotto] [<snipe@snipe.net>]
* @since [v4.0]
* @return View
*/
public function getPhpInfo()
{
return view('settings.phpinfo');
}
/**
* Return a form to allow a super admin to update settings.

View file

@ -163,7 +163,18 @@
</div>
</div>
@if (config('app.debug')=== true)
<div class="col-md-4 col-lg-3 col-sm-6 col-xl-1">
<div class="box box-default">
<div class="box-body text-center">
<a href="{{ route('settings.phpinfo.index') }}" class="btn btn-lg btn-white"><i class="fa fa-server fa-3x"></i></a>
<br>
PHP
<p class="help-block">PHP System Info</p>
</div>
</div>
</div>
@endif
<div class="col-md-4 col-lg-3 col-sm-6 col-xl-1">
<div class="box box-danger">
@ -176,12 +187,6 @@
</div>
</div>
</div>
@ -229,6 +234,7 @@
</div><!--/row-->
@stop

View file

@ -0,0 +1,31 @@
@extends('layouts/default')
{{-- Page title --}}
@section('title')
PHP Info
@parent
@stop
@section('header_right')
<a href="{{ route('settings.index') }}" class="btn btn-default"> {{ trans('general.back') }}</a>
@stop
{{-- Page content --}}
@section('content')
@if (config('app.debug')=== true)
<div class="row">
<div class="col-md-12">
<?php phpinfo(); ?>
</div> <!-- /.col-md-12-->
</div> <!-- /.row-->
@else
<div class="col-md-12">
<div class="alert alert-danger">
This information is only available when debug is enabled.
</div>
@endif
@stop

View file

@ -140,6 +140,7 @@ Route::group([ 'prefix' => 'admin','middleware' => ['authorize:superuser']], fun
Route::get('ldap', ['as' => 'settings.ldap.index','uses' => 'SettingsController@getLdapSettings' ]);
Route::post('ldap', ['as' => 'settings.ldap.save','uses' => 'SettingsController@postLdapSettings' ]);
Route::get('phpinfo', ['as' => 'settings.phpinfo.index','uses' => 'SettingsController@getPhpInfo' ]);
Route::get('oauth', [ 'as' => 'settings.oauth.index', 'uses' => 'SettingsController@api' ]);