Framework update and updates from other projects,remove leenooks/laravel

Framework updates, and hack to get CI testing working
This commit is contained in:
Deon George 2021-12-03 13:36:25 +11:00
parent 88eb35a567
commit 2ccc1d3b83
33 changed files with 3424 additions and 2184 deletions

View File

@ -3,7 +3,7 @@ root = true
[*] [*]
charset = utf-8 charset = utf-8
end_of_line = lf end_of_line = lf
insert_final_newline = true insert_final_newline = false
indent_style = tab indent_style = tab
indent_size = 4 indent_size = 4
trim_trailing_whitespace = true trim_trailing_whitespace = true
@ -13,3 +13,6 @@ trim_trailing_whitespace = false
[*.{yml,yaml}] [*.{yml,yaml}]
indent_size = 2 indent_size = 2
[docker-compose.yml]
indent_size = 4

View File

@ -23,7 +23,7 @@ REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null REDIS_PASSWORD=null
REDIS_PORT=6379 REDIS_PORT=6379
MAIL_MAILER=smtp MAIL_DRIVER=smtp
MAIL_HOST=smtp.mailtrap.io MAIL_HOST=smtp.mailtrap.io
MAIL_PORT=2525 MAIL_PORT=2525
MAIL_USERNAME=null MAIL_USERNAME=null

View File

@ -1,5 +1,5 @@
test: test:
image: ${CI_REGISTRY}/leenooks/php:7.4-fpm-mp-test image: ${CI_REGISTRY}/leenooks/php:8.0-fpm-latest-test
stage: test stage: test

View File

@ -1,4 +1,4 @@
FROM registry.leenooks.net/leenooks/php:7.4-fpm-mp FROM registry.leenooks.net/leenooks/php:8.0-fpm-latest
COPY . /var/www/html/ COPY . /var/www/html/

View File

@ -22,34 +22,20 @@ class Handler extends ExceptionHandler
* @var array * @var array
*/ */
protected $dontFlash = [ protected $dontFlash = [
'current_password',
'password', 'password',
'password_confirmation', 'password_confirmation',
]; ];
/** /**
* Report or log an exception. * Register the exception handling callbacks for the application.
* *
* @param \Throwable $exception
* @return void * @return void
*
* @throws \Exception
*/ */
public function report(Throwable $exception) public function register()
{ {
parent::report($exception); $this->reportable(function (Throwable $e) {
} //
});
/**
* Render an exception into an HTTP response.
*
* @param \Illuminate\Http\Request $request
* @param \Throwable $exception
* @return \Symfony\Component\HttpFoundation\Response
*
* @throws \Throwable
*/
public function render($request, Throwable $exception)
{
return parent::render($request, $exception);
} }
} }

View File

@ -1,33 +0,0 @@
<?php
namespace App\Http\Controllers\Auth;
use Illuminate\Support\Facades\Auth;
use App\Http\Controllers\Controller;
use Socialite;
class SocialLoginController extends Controller
{
public function redirectToProvider($provider)
{
return Socialite::with($provider)->redirect();
}
public function handleProviderCallback($provider)
{
$openiduser = Socialite::with($provider)->user();
$user = Socialite::with($provider)->findOrCreateUser($openiduser);
Auth::login($user,FALSE);
/*
if (! $user->profile_update)
{
return redirect()->to(url('settings'));
}
*/
return redirect()->intended();
}
}

View File

@ -59,7 +59,7 @@ class HomeController extends Controller
$attrs = collect(); $attrs = collect();
} }
return view('widgets.dn') return view('frames.dn')
->with('dn',__('Server Info')) ->with('dn',__('Server Info'))
->with('leaf',$root) ->with('leaf',$root)
->with('attributes',$this->sortAttrs($attrs)); ->with('attributes',$this->sortAttrs($attrs));
@ -69,7 +69,7 @@ class HomeController extends Controller
{ {
$dn = Crypt::decryptString($request->post('key')); $dn = Crypt::decryptString($request->post('key'));
return view('widgets.dn') return view('frames.dn')
->with('dn',$dn) ->with('dn',$dn)
->with('leaf',$x=(new Server)->fetch($dn)) ->with('leaf',$x=(new Server)->fetch($dn))
->with('attributes',$x ? $this->sortAttrs(collect($x->getAttributes())) : []); ->with('attributes',$x ? $this->sortAttrs(collect($x->getAttributes())) : []);

View File

@ -5,6 +5,8 @@ namespace App\Http;
use Illuminate\Foundation\Http\Kernel as HttpKernel; use Illuminate\Foundation\Http\Kernel as HttpKernel;
use Laravel\Passport\Http\Middleware\CreateFreshApiToken; use Laravel\Passport\Http\Middleware\CreateFreshApiToken;
use App\Http\Middleware\GuestUser;
class Kernel extends HttpKernel class Kernel extends HttpKernel
{ {
/** /**
@ -39,6 +41,7 @@ class Kernel extends HttpKernel
\App\Http\Middleware\VerifyCsrfToken::class, \App\Http\Middleware\VerifyCsrfToken::class,
\Illuminate\Routing\Middleware\SubstituteBindings::class, \Illuminate\Routing\Middleware\SubstituteBindings::class,
\Laravel\Passport\Http\Middleware\CreateFreshApiToken::class, \Laravel\Passport\Http\Middleware\CreateFreshApiToken::class,
GuestUser::class,
], ],
'api' => [ 'api' => [

View File

@ -0,0 +1,27 @@
<?php
namespace App\Http\Middleware;
use App\Ldap\User;
use Closure;
/**
* Class GuestUser
* @package Leenooks\Laravel\Http\Middleware
*/
class GuestUser
{
/**
* Handle an incoming request.
*
* @param \Illuminate\Http\Request $request
* @param \Closure $next
* @return mixed
*/
public function handle($request,Closure $next)
{
view()->share('user', auth()->user() ?: new User);
return $next($request);
}
}

View File

@ -2,27 +2,32 @@
namespace App\Providers; namespace App\Providers;
use Illuminate\Cache\RateLimiting\Limit;
use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider; use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\RateLimiter;
use Illuminate\Support\Facades\Route; use Illuminate\Support\Facades\Route;
class RouteServiceProvider extends ServiceProvider class RouteServiceProvider extends ServiceProvider
{ {
/**
* This namespace is applied to your controller routes.
*
* In addition, it is set as the URL generator's root namespace.
*
* @var string
*/
protected $namespace = 'App\Http\Controllers';
/** /**
* The path to the "home" route for your application. * The path to the "home" route for your application.
* *
* This is used by Laravel authentication to redirect users after login.
*
* @var string * @var string
*/ */
public const HOME = '/home'; public const HOME = '/home';
/**
* The controller namespace for the application.
*
* When present, controller route declarations will automatically be prefixed with this namespace.
*
* @var string|null
*/
// protected $namespace = 'App\\Http\\Controllers';
/** /**
* Define your route model bindings, pattern filters, etc. * Define your route model bindings, pattern filters, etc.
* *
@ -30,51 +35,29 @@ class RouteServiceProvider extends ServiceProvider
*/ */
public function boot() public function boot()
{ {
// $this->configureRateLimiting();
parent::boot(); $this->routes(function () {
}
/**
* Define the routes for the application.
*
* @return void
*/
public function map()
{
$this->mapApiRoutes();
$this->mapWebRoutes();
//
}
/**
* Define the "web" routes for the application.
*
* These routes all receive session state, CSRF protection, etc.
*
* @return void
*/
protected function mapWebRoutes()
{
Route::middleware('web')
->namespace($this->namespace)
->group(base_path('routes/web.php'));
}
/**
* Define the "api" routes for the application.
*
* These routes are typically stateless.
*
* @return void
*/
protected function mapApiRoutes()
{
Route::prefix('api') Route::prefix('api')
->middleware('api') ->middleware('api')
->namespace($this->namespace) ->namespace($this->namespace)
->group(base_path('routes/api.php')); ->group(base_path('routes/api.php'));
Route::middleware('web')
->namespace($this->namespace)
->group(base_path('routes/web.php'));
});
}
/**
* Configure the rate limiters for the application.
*
* @return void
*/
protected function configureRateLimiting()
{
RateLimiter::for('api', function (Request $request) {
return Limit::perMinute(60)->by(optional($request->user())->id ?: $request->ip());
});
} }
} }

2
artisan Normal file → Executable file
View File

@ -11,7 +11,7 @@ define('LARAVEL_START', microtime(true));
| Composer provides a convenient, automatically generated class loader | Composer provides a convenient, automatically generated class loader
| for our application. We just need to utilize it! We'll require it | for our application. We just need to utilize it! We'll require it
| into the script here so that we do not have to worry about the | into the script here so that we do not have to worry about the
| loading of any our classes "manually". Feels great to relax. | loading of any of our classes manually. It's great to relax.
| |
*/ */

View File

@ -2,49 +2,34 @@
"name": "laravel/laravel", "name": "laravel/laravel",
"type": "project", "type": "project",
"description": "The Laravel Framework.", "description": "The Laravel Framework.",
"keywords": [ "keywords": [ "framework", "laravel" ],
"framework",
"laravel"
],
"license": "MIT", "license": "MIT",
"require": { "require": {
"php": "^7.2.5", "php": "^7.4|^8.0",
"directorytree/ldaprecord-laravel": "^1.7", "directorytree/ldaprecord-laravel": "^1.7",
"fideloper/proxy": "^4.2", "fideloper/proxy": "^4.4",
"fruitcake/laravel-cors": "^2.0", "fruitcake/laravel-cors": "^2.0",
"guzzlehttp/guzzle": "^6.3", "guzzlehttp/guzzle": "^7.0.1",
"laravel/framework": "^7.22.2", "laravel/framework": "^8.54",
"laravel/passport": "^9.3", "laravel/passport": "^10.1",
"laravel/ui": "^2.1", "laravel/ui": "^3.2",
"leenooks/laravel": "7.0", "mcamara/laravel-localization": "^1.6",
"mcamara/laravel-localization": "^1.6" "orchestra/asset": "^6.1"
}, },
"require-dev": { "require-dev": {
"facade/ignition": "^2.0", "barryvdh/laravel-debugbar": "^3.5",
"fzaninotto/faker": "^1.9.1", "facade/ignition": "^2.5",
"laravel/tinker": "^2.0", "fakerphp/faker": "^1.9.1",
"mockery/mockery": "^1.3.1", "mockery/mockery": "^1.4.2",
"nunomaduro/collision": "^4.1", "nunomaduro/collision": "^5.0",
"phpunit/phpunit": "^8.5" "phpunit/phpunit": "^9.3.3"
},
"config": {
"optimize-autoloader": true,
"preferred-install": "dist",
"sort-packages": true
},
"extra": {
"laravel": {
"dont-discover": []
}
}, },
"autoload": { "autoload": {
"psr-4": { "psr-4": {
"App\\": "app/" "App\\": "app/",
}, "Database\\Factories\\": "database/factories/",
"classmap": [ "Database\\Seeders\\": "database/seeders/"
"database/seeds", }
"database/factories"
]
}, },
"autoload-dev": { "autoload-dev": {
"psr-4": { "psr-4": {
@ -57,8 +42,6 @@
"url": "https://dev.leenooks.net/leenooks/laravel" "url": "https://dev.leenooks.net/leenooks/laravel"
} }
], ],
"minimum-stability": "dev",
"prefer-stable": true,
"scripts": { "scripts": {
"post-autoload-dump": [ "post-autoload-dump": [
"Illuminate\\Foundation\\ComposerScripts::postAutoloadDump", "Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
@ -70,5 +53,17 @@
"post-create-project-cmd": [ "post-create-project-cmd": [
"@php artisan key:generate --ansi" "@php artisan key:generate --ansi"
] ]
},
"extra": {
"laravel": {
"dont-discover": []
} }
},
"config": {
"optimize-autoloader": true,
"preferred-install": "dist",
"sort-packages": true
},
"minimum-stability": "dev",
"prefer-stable": true
} }

5070
composer.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -211,6 +211,7 @@ return [
'Config' => Illuminate\Support\Facades\Config::class, 'Config' => Illuminate\Support\Facades\Config::class,
'Cookie' => Illuminate\Support\Facades\Cookie::class, 'Cookie' => Illuminate\Support\Facades\Cookie::class,
'Crypt' => Illuminate\Support\Facades\Crypt::class, 'Crypt' => Illuminate\Support\Facades\Crypt::class,
'Date' => Illuminate\Support\Facades\Date::class,
'DB' => Illuminate\Support\Facades\DB::class, 'DB' => Illuminate\Support\Facades\DB::class,
'Eloquent' => Illuminate\Database\Eloquent\Model::class, 'Eloquent' => Illuminate\Database\Eloquent\Model::class,
'Event' => Illuminate\Support\Facades\Event::class, 'Event' => Illuminate\Support\Facades\Event::class,
@ -224,8 +225,9 @@ return [
'Notification' => Illuminate\Support\Facades\Notification::class, 'Notification' => Illuminate\Support\Facades\Notification::class,
'Password' => Illuminate\Support\Facades\Password::class, 'Password' => Illuminate\Support\Facades\Password::class,
'Queue' => Illuminate\Support\Facades\Queue::class, 'Queue' => Illuminate\Support\Facades\Queue::class,
'RateLimiter' => Illuminate\Support\Facades\RateLimiter::class,
'Redirect' => Illuminate\Support\Facades\Redirect::class, 'Redirect' => Illuminate\Support\Facades\Redirect::class,
'Redis' => Illuminate\Support\Facades\Redis::class, // 'Redis' => Illuminate\Support\Facades\Redis::class,
'Request' => Illuminate\Support\Facades\Request::class, 'Request' => Illuminate\Support\Facades\Request::class,
'Response' => Illuminate\Support\Facades\Response::class, 'Response' => Illuminate\Support\Facades\Response::class,
'Route' => Illuminate\Support\Facades\Route::class, 'Route' => Illuminate\Support\Facades\Route::class,

View File

@ -15,7 +15,7 @@ return [
| |
*/ */
'paths' => ['api/*'], 'paths' => ['api/*', 'sanctum/csrf-cookie'],
'allowed_methods' => ['*'], 'allowed_methods' => ['*'],

View File

@ -44,13 +44,13 @@ return [
'single' => [ 'single' => [
'driver' => 'single', 'driver' => 'single',
'path' => storage_path('logs/laravel.log'), 'path' => storage_path('logs/laravel.log'),
'level' => 'debug', 'level' => env('LOG_LEVEL', 'debug'),
], ],
'daily' => [ 'daily' => [
'driver' => 'daily', 'driver' => 'daily',
'path' => storage_path('logs/laravel.log'), 'path' => storage_path('logs/laravel.log'),
'level' => 'debug', 'level' => env('LOG_LEVEL', 'debug'),
'days' => 14, 'days' => 14,
], ],
@ -59,12 +59,12 @@ return [
'url' => env('LOG_SLACK_WEBHOOK_URL'), 'url' => env('LOG_SLACK_WEBHOOK_URL'),
'username' => 'Laravel Log', 'username' => 'Laravel Log',
'emoji' => ':boom:', 'emoji' => ':boom:',
'level' => 'critical', 'level' => env('LOG_LEVEL', 'critical'),
], ],
'papertrail' => [ 'papertrail' => [
'driver' => 'monolog', 'driver' => 'monolog',
'level' => 'debug', 'level' => env('LOG_LEVEL', 'debug'),
'handler' => SyslogUdpHandler::class, 'handler' => SyslogUdpHandler::class,
'handler_with' => [ 'handler_with' => [
'host' => env('PAPERTRAIL_URL'), 'host' => env('PAPERTRAIL_URL'),
@ -74,6 +74,7 @@ return [
'stderr' => [ 'stderr' => [
'driver' => 'monolog', 'driver' => 'monolog',
'level' => env('LOG_LEVEL', 'debug'),
'handler' => StreamHandler::class, 'handler' => StreamHandler::class,
'formatter' => env('LOG_STDERR_FORMATTER'), 'formatter' => env('LOG_STDERR_FORMATTER'),
'with' => [ 'with' => [
@ -83,12 +84,12 @@ return [
'syslog' => [ 'syslog' => [
'driver' => 'syslog', 'driver' => 'syslog',
'level' => 'debug', 'level' => env('LOG_LEVEL', 'debug'),
], ],
'errorlog' => [ 'errorlog' => [
'driver' => 'errorlog', 'driver' => 'errorlog',
'level' => 'debug', 'level' => env('LOG_LEVEL', 'debug'),
], ],
'null' => [ 'null' => [

0
htdocs/images/default/key.png Executable file → Normal file
View File

Before

Width:  |  Height:  |  Size: 519 B

After

Width:  |  Height:  |  Size: 519 B

View File

@ -2,28 +2,17 @@
"private": true, "private": true,
"scripts": { "scripts": {
"dev": "npm run development", "dev": "npm run development",
"development": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js", "development": "mix",
"watch": "npm run development -- --watch", "watch": "mix watch",
"watch-poll": "npm run watch -- --watch-poll", "watch-poll": "mix watch -- --watch-options-poll=1000",
"hot": "cross-env NODE_ENV=development node_modules/webpack-dev-server/bin/webpack-dev-server.js --inline --hot --config=node_modules/laravel-mix/setup/webpack.config.js", "hot": "mix watch --hot",
"prod": "npm run production", "prod": "npm run production",
"production": "cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --no-progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js" "production": "mix --production"
}, },
"devDependencies": { "devDependencies": {
"cross-env": "^5.2.1", "axios": "^0.21",
"laravel-mix": "^5.0.1", "laravel-mix": "^6.0.6",
"resolve-url-loader": "^2.3.1", "lodash": "^4.17.19",
"sass": "^1.15.2", "postcss": "^8.1.14"
"sass-loader": "^8.0.0",
"vue-template-compiler": "^2.6.11"
},
"dependencies": {
"axios": "^0.19",
"bootstrap": "^4.2.1",
"jquery": "^3.5.1",
"laravel-echo": "^1.6.1",
"lodash": "^4.17.13",
"popper.js": "^1.16.0",
"pusher-js": "^5.0.3"
} }
} }

View File

@ -1,13 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" <phpunit backupGlobals="false"
xsi:noNamespaceSchemaLocation="./vendor/phpunit/phpunit/phpunit.xsd" backupStaticAttributes="false"
bootstrap="vendor/autoload.php" bootstrap="vendor/autoload.php"
colors="true" colors="true"
> convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="false"
stopOnFailure="false">
<testsuites> <testsuites>
<testsuite name="Unit"> <testsuite name="Unit">
<directory suffix="Test.php">./tests/Unit</directory> <directory suffix="Test.php">./tests/Unit</directory>
</testsuite> </testsuite>
<testsuite name="Feature"> <testsuite name="Feature">
<directory suffix="Test.php">./tests/Feature</directory> <directory suffix="Test.php">./tests/Feature</directory>
</testsuite> </testsuite>
@ -18,14 +23,11 @@
</whitelist> </whitelist>
</filter> </filter>
<php> <php>
<server name="APP_ENV" value="testing"/> <env name="APP_ENV" value="testing"/>
<server name="BCRYPT_ROUNDS" value="4"/> <env name="BCRYPT_ROUNDS" value="4"/>
<server name="CACHE_DRIVER" value="array"/> <env name="CACHE_DRIVER" value="array"/>
<!-- <server name="DB_CONNECTION" value="sqlite"/> --> <env name="MAIL_DRIVER" value="array"/>
<!-- <server name="DB_DATABASE" value=":memory:"/> --> <env name="QUEUE_CONNECTION" value="sync"/>
<server name="MAIL_MAILER" value="array"/> <env name="SESSION_DRIVER" value="array"/>
<server name="QUEUE_CONNECTION" value="sync"/>
<server name="SESSION_DRIVER" value="array"/>
<server name="TELESCOPE_ENABLED" value="false"/>
</php> </php>
</phpunit> </phpunit>

24
public/css/fixes.css vendored
View File

@ -1,20 +1,26 @@
body {
font-size: 0.85em;
}
/* Fixes for data tables */ /* Fixes for data tables */
/* Fix pagination buttons */
.dataTables_wrapper .dataTables_paginate .paginate_button { .dataTables_wrapper .dataTables_paginate .paginate_button {
padding: 0em 0em; padding: 0 0;
margin-left: 0px; margin-left: 0;
border: 0px solid; border: 0 solid;
} }
.dataTables_wrapper .dataTables_paginate .paginate_button:hover { .dataTables_wrapper .dataTables_paginate .paginate_button:hover {
border: 0px solid; border: 0 solid;
background: #fff; background: #fff;
} }
.dataTables_wrapper .dataTables_paginate .paginate_button:active { .dataTables_wrapper .dataTables_paginate .paginate_button:active {
box-shadow: 0 0 0px #fff; box-shadow: 0 0 0 #fff;
background-color: #fff; background-color: #fff;
} }
/* Remove multiple sorting images on tables */
table.dataTable thead .sorting_asc { table.dataTable thead .sorting_asc {
background-image: none !important; background-image: none !important;
} }
@ -56,10 +62,6 @@ table.dataTable thead .sorting {
font-size: 1.0rem; font-size: 1.0rem;
} }
body {
font-size: 0.85em;
}
/** SIDEBAR FIXES **/ /** SIDEBAR FIXES **/
/** /**
@ -79,12 +81,12 @@ body {
/* Fancy Tree Fixes */ /* Fancy Tree Fixes */
/** Remove the border around the tree **/ /** Remove the border around the tree **/
ul.fancytree-container { ul.fancytree-container {
border: 0px; border: 0;
} }
/** Tree Placement **/ /** Tree Placement **/
#tree > ul { #tree > ul {
padding-left: 0px; padding-left: 0;
} }
/** Fix tree rendering **/ /** Fix tree rendering **/
.fancytree-node { .fancytree-node {

View File

@ -1,23 +1,33 @@
<?php <?php
/** use Illuminate\Contracts\Http\Kernel;
* Laravel - A PHP Framework For Web Artisans use Illuminate\Http\Request;
*
* @package Laravel
* @author Taylor Otwell <taylor@laravel.com>
*/
define('LARAVEL_START', microtime(true)); define('LARAVEL_START', microtime(true));
/*
|--------------------------------------------------------------------------
| Check If The Application Is Under Maintenance
|--------------------------------------------------------------------------
|
| If the application is in maintenance / demo mode via the "down" command
| we will load this file so that any pre-rendered content can be shown
| instead of starting the framework, which could cause an exception.
|
*/
if (file_exists(__DIR__.'/../storage/framework/maintenance.php')) {
require __DIR__.'/../storage/framework/maintenance.php';
}
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| Register The Auto Loader | Register The Auto Loader
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| |
| Composer provides a convenient, automatically generated class loader for | Composer provides a convenient, automatically generated class loader for
| our application. We just need to utilize it! We'll simply require it | this application. We just need to utilize it! We'll simply require it
| into the script here so that we don't have to worry about manual | into the script here so we don't need to manually load our classes.
| loading any of our classes later on. It feels great to relax.
| |
*/ */
@ -25,36 +35,21 @@ require __DIR__.'/../vendor/autoload.php';
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| Turn On The Lights | Run The Application
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| |
| We need to illuminate PHP development, so let us turn on the lights. | Once we have the application, we can handle the incoming request using
| This bootstraps the framework and gets it ready for use, then it | the application's HTTP kernel. Then, we will send the response back
| will load up this application so that we can run it and send | to this client's browser, allowing them to enjoy our application.
| the responses back to the browser and delight our users.
| |
*/ */
$app = require_once __DIR__.'/../bootstrap/app.php'; $app = require_once __DIR__.'/../bootstrap/app.php';
/* $kernel = $app->make(Kernel::class);
|--------------------------------------------------------------------------
| Run The Application
|--------------------------------------------------------------------------
|
| Once we have the application, we can handle the incoming request
| through the kernel, and send the associated response back to
| the client's browser allowing them to enjoy the creative
| and wonderful application we have prepared for them.
|
*/
$kernel = $app->make(Illuminate\Contracts\Http\Kernel::class); $response = tap($kernel->handle(
$request = Request::capture()
$response = $kernel->handle( ))->send();
$request = Illuminate\Http\Request::capture()
);
$response->send();
$kernel->terminate($request, $response); $kernel->terminate($request, $response);

View File

@ -1,4 +1,3 @@
window.$ = window.jQuery = require('jquery');
window._ = require('lodash'); window._ = require('lodash');
/** /**
@ -17,19 +16,13 @@ window.axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest';
* allows your team to easily build robust real-time web applications. * allows your team to easily build robust real-time web applications.
*/ */
import Echo from 'laravel-echo'; // import Echo from 'laravel-echo';
/* // window.Pusher = require('pusher-js');
window.Pusher = require('pusher-js');
window.Echo = new Echo({ // window.Echo = new Echo({
broadcaster: 'pusher', // broadcaster: 'pusher',
key: process.env.MIX_PUSHER_APP_KEY, // key: process.env.MIX_PUSHER_APP_KEY,
wsHost: window.location.hostname, // cluster: process.env.MIX_PUSHER_APP_CLUSTER,
wsPort: 6001, // forceTLS: true
disableStats: true, // });
useTLS: false,
});
*/
//require('bootstrap');

View File

@ -1,5 +1,5 @@
<!doctype html> <!DOCTYPE html>
<html lang="en"> <html>
@section('htmlheader') @section('htmlheader')
@include('architect::layouts.partials.htmlheader') @include('architect::layouts.partials.htmlheader')
@show @show

View File

@ -1,18 +1,21 @@
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
@section('htmlheader') @section('htmlheader')
@include('architect::layouts.partials.htmlheader') @include('architect::layouts.partials.htmlheader')
@show @show
<body class="hold-transition login-page"> <body class="hold-transition login-page">
<div id="app"> <div id="app">
@yield('content') @yield('content')
</div> </div>
@section('scripts') @section('scripts')
@include('architect::auth.partials.scripts') @include('architect::auth.partials.scripts')
{{-- Scripts --}}
{!! Asset::scripts() !!}
@yield('page-scripts') @yield('page-scripts')
@show @show
</body> </body>
</html> </html>

View File

@ -1,4 +1,4 @@
@extends('architect::layouts.dn') @extends('layouts.dn')
@section('page_title') @section('page_title')
{{ $dn }} {{ $dn }}

View File

@ -1,8 +1,9 @@
<?php <?php
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Route; use Illuminate\Support\Facades\Route;
use App\Http\Controllers\APIController;
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| API Routes | API Routes
@ -15,8 +16,8 @@ use Illuminate\Support\Facades\Route;
*/ */
Route::group([],function() { Route::group([],function() {
Route::get('/bases','APIController@bases'); Route::get('/bases',[APIController::class,'bases']);
Route::get('/children','APIController@children'); Route::get('/children',[APIController::class,'children']);
}); });
Route::group(['middleware'=>'auth:api','prefix'=>'user'],function() { Route::group(['middleware'=>'auth:api','prefix'=>'user'],function() {

View File

@ -2,6 +2,9 @@
use Illuminate\Support\Facades\Route; use Illuminate\Support\Facades\Route;
use App\Http\Controllers\HomeController;
use App\Http\Controllers\Auth\LoginController;
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| Web Routes | Web Routes
@ -23,14 +26,14 @@ Route::group(['prefix' => LaravelLocalization::setLocale()], function() {
'register' => FALSE, 'register' => FALSE,
]); ]);
Route::get('home','HomeController@home'); Route::get('home',[HomeController::class,'home']);
Route::get('info','HomeController@info'); Route::get('info',[HomeController::class,'info']);
Route::post('render','HomeController@render'); Route::post('render',[HomeController::class,'render']);
}); });
Route::redirect('/','home'); Route::redirect('/','home');
Route::get('logout','Auth\LoginController@logout'); Route::get('logout',[LoginController::class,'logout']);
Route::group(['prefix'=>'user'],function() { Route::group(['prefix'=>'user'],function() {
Route::get('image','HomeController@user_image'); Route::get('image',[HomeController::class,'user_image']);
}); });

View File

@ -3,7 +3,6 @@
namespace Tests\Feature; namespace Tests\Feature;
use Tests\TestCase; use Tests\TestCase;
use Illuminate\Foundation\Testing\RefreshDatabase;
class ExampleTest extends TestCase class ExampleTest extends TestCase
{ {

View File

@ -7,4 +7,16 @@ use Illuminate\Foundation\Testing\TestCase as BaseTestCase;
abstract class TestCase extends BaseTestCase abstract class TestCase extends BaseTestCase
{ {
use CreatesApplication; use CreatesApplication;
/**
* Hack to get testing working
*/
protected function tearDown(): void
{
$config = app('config');
$events = app('events');
parent::tearDown();
app()->instance('config', $config);
app()->instance('events', $events);
}
} }

View File

@ -0,0 +1,19 @@
<?php
namespace Tests\Unit;
use Tests\TestCase;
use Illuminate\Foundation\Testing\RefreshDatabase;
class ExampleTest extends TestCase
{
/**
* A basic test example.
*
* @return void
*/
public function testBasicTest()
{
$this->assertTrue(true);
}
}

View File

@ -2,9 +2,6 @@
namespace Tests\Unit; namespace Tests\Unit;
use Illuminate\Support\Collection;
use Illuminate\Foundation\Testing\WithFaker;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Tests\TestCase; use Tests\TestCase;
use App\Ldap\Entry; use App\Ldap\Entry;
@ -24,6 +21,6 @@ class GetBaseDNTest extends TestCase
$this->assertIsObject($o); $this->assertIsObject($o);
$this->assertCount(1,$o->toArray()); $this->assertCount(1,$o->toArray());
$this->assertContains('dc=Test',$o->toArray()); $this->assertEquals('dc=Test',$o->first()->getDn());
} }
} }

View File

@ -2,8 +2,6 @@
namespace Tests\Unit; namespace Tests\Unit;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Illuminate\Foundation\Testing\WithFaker;
use Tests\TestCase; use Tests\TestCase;
use App\Classes\LDAP\Server; use App\Classes\LDAP\Server;