Migracia na 6.0
- oprava chyb v log - welcome.blade url uprava
This commit is contained in:
10
app/Http/Controllers/Auth/ForgotPasswordController.php
Normal file → Executable file
10
app/Http/Controllers/Auth/ForgotPasswordController.php
Normal file → Executable file
@@ -19,14 +19,4 @@ class ForgotPasswordController extends Controller
|
||||
*/
|
||||
|
||||
use SendsPasswordResetEmails;
|
||||
|
||||
/**
|
||||
* Create a new controller instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$this->middleware('guest');
|
||||
}
|
||||
}
|
||||
|
||||
3
app/Http/Controllers/Auth/LoginController.php
Normal file → Executable file
3
app/Http/Controllers/Auth/LoginController.php
Normal file → Executable file
@@ -3,6 +3,7 @@
|
||||
namespace App\Http\Controllers\Auth;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Providers\RouteServiceProvider;
|
||||
use Illuminate\Foundation\Auth\AuthenticatesUsers;
|
||||
|
||||
class LoginController extends Controller
|
||||
@@ -25,7 +26,7 @@ class LoginController extends Controller
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $redirectTo = '/home';
|
||||
protected $redirectTo = RouteServiceProvider::HOME;
|
||||
|
||||
/**
|
||||
* Create a new controller instance.
|
||||
|
||||
16
app/Http/Controllers/Auth/RegisterController.php
Normal file → Executable file
16
app/Http/Controllers/Auth/RegisterController.php
Normal file → Executable file
@@ -2,10 +2,12 @@
|
||||
|
||||
namespace App\Http\Controllers\Auth;
|
||||
|
||||
use App\User;
|
||||
use App\Http\Controllers\Controller;
|
||||
use Illuminate\Support\Facades\Validator;
|
||||
use App\Providers\RouteServiceProvider;
|
||||
use App\User;
|
||||
use Illuminate\Foundation\Auth\RegistersUsers;
|
||||
use Illuminate\Support\Facades\Hash;
|
||||
use Illuminate\Support\Facades\Validator;
|
||||
|
||||
class RegisterController extends Controller
|
||||
{
|
||||
@@ -27,7 +29,7 @@ class RegisterController extends Controller
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $redirectTo = '/home';
|
||||
protected $redirectTo = RouteServiceProvider::HOME;
|
||||
|
||||
/**
|
||||
* Create a new controller instance.
|
||||
@@ -48,9 +50,9 @@ class RegisterController extends Controller
|
||||
protected function validator(array $data)
|
||||
{
|
||||
return Validator::make($data, [
|
||||
'name' => 'required|string|max:255',
|
||||
'email' => 'required|string|email|max:255|unique:users',
|
||||
'password' => 'required|string|min:6|confirmed',
|
||||
'name' => ['required', 'string', 'max:255'],
|
||||
'email' => ['required', 'string', 'email', 'max:255', 'unique:users'],
|
||||
'password' => ['required', 'string', 'min:8', 'confirmed'],
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -65,7 +67,7 @@ class RegisterController extends Controller
|
||||
return User::create([
|
||||
'name' => $data['name'],
|
||||
'email' => $data['email'],
|
||||
'password' => bcrypt($data['password']),
|
||||
'password' => Hash::make($data['password']),
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
13
app/Http/Controllers/Auth/ResetPasswordController.php
Normal file → Executable file
13
app/Http/Controllers/Auth/ResetPasswordController.php
Normal file → Executable file
@@ -3,6 +3,7 @@
|
||||
namespace App\Http\Controllers\Auth;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Providers\RouteServiceProvider;
|
||||
use Illuminate\Foundation\Auth\ResetsPasswords;
|
||||
|
||||
class ResetPasswordController extends Controller
|
||||
@@ -25,15 +26,5 @@ class ResetPasswordController extends Controller
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $redirectTo = '/home';
|
||||
|
||||
/**
|
||||
* Create a new controller instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$this->middleware('guest');
|
||||
}
|
||||
protected $redirectTo = RouteServiceProvider::HOME;
|
||||
}
|
||||
|
||||
6
app/Http/Controllers/Controller.php
Normal file → Executable file
6
app/Http/Controllers/Controller.php
Normal file → Executable file
@@ -2,10 +2,10 @@
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use Illuminate\Foundation\Bus\DispatchesJobs;
|
||||
use Illuminate\Routing\Controller as BaseController;
|
||||
use Illuminate\Foundation\Validation\ValidatesRequests;
|
||||
use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
|
||||
use Illuminate\Foundation\Bus\DispatchesJobs;
|
||||
use Illuminate\Foundation\Validation\ValidatesRequests;
|
||||
use Illuminate\Routing\Controller as BaseController;
|
||||
|
||||
class Controller extends BaseController
|
||||
{
|
||||
|
||||
6
app/Http/Controllers/Logging.php
Normal file → Executable file
6
app/Http/Controllers/Logging.php
Normal file → Executable file
@@ -8,7 +8,7 @@ use Illuminate\Support\Facades\DB;
|
||||
class Logging extends Controller
|
||||
{
|
||||
|
||||
private $_items = [ 'netstat_sent' => 'i', 'netstat_recv' => 'i', 'memory_free' => 'f', 'memory_total' => 'f', 'memory_used' => 'f', 'disk_free' => 'B', 'disk_percent' => 'f', 'disk_used' => 'B', 'disk_total' => 'B', 'processes' => 'i', 'temp' => 'i', 'load' => 'f', 'username' =>'s', 'computer' => 's'];
|
||||
public static $_items = [ 'netstat_sent' => 'i', 'netstat_recv' => 'i', 'memory_free' => 'f', 'memory_total' => 'f', 'memory_used' => 'f', 'disk_free' => 'B', 'disk_percent' => 'f', 'disk_used' => 'B', 'disk_total' => 'B', 'processes' => 'i', 'temp' => 'i', 'load' => 'f', 'username' =>'s', 'computer' => 's'];
|
||||
|
||||
private $_values = [];
|
||||
private $_ucache = [];
|
||||
@@ -46,7 +46,7 @@ class Logging extends Controller
|
||||
$id = DB::table('computers')->insertGetId(['computer' => $comp]);
|
||||
$this->_ccache[$comp] = $id;
|
||||
|
||||
\apc_store('computers',$this->_ccache);
|
||||
\apcu_store('computers',$this->_ccache);
|
||||
|
||||
return $id;
|
||||
}
|
||||
@@ -97,7 +97,7 @@ class Logging extends Controller
|
||||
}
|
||||
}
|
||||
|
||||
foreach ($this->_items as $k => $t) {
|
||||
foreach (self::$_items as $k => $t) {
|
||||
$val = $this->_values[$k];
|
||||
if ($t == 's') continue;
|
||||
|
||||
|
||||
0
app/Http/Controllers/Network.php
Normal file → Executable file
0
app/Http/Controllers/Network.php
Normal file → Executable file
0
app/Http/Controllers/Push.php
Normal file → Executable file
0
app/Http/Controllers/Push.php
Normal file → Executable file
62
app/Http/Controllers/Search.php
Normal file → Executable file
62
app/Http/Controllers/Search.php
Normal file → Executable file
@@ -10,19 +10,53 @@ use Illuminate\Support\Facades\DB;
|
||||
class Search extends Controller
|
||||
{
|
||||
public function autocomplete(){
|
||||
$term = Request::input('term');
|
||||
$results = array();
|
||||
|
||||
$queries = DB::table('network')
|
||||
->select('user')->distinct()
|
||||
->where('user', 'LIKE', $term.'%')
|
||||
->get();
|
||||
|
||||
foreach ($queries as $query)
|
||||
{
|
||||
$results[] = $query->user ;
|
||||
}
|
||||
return Response::json($results);
|
||||
}
|
||||
$term = Request::input('term');
|
||||
$users = array();
|
||||
$computers = array();
|
||||
$uin = [];
|
||||
$cin = [];
|
||||
$results = [];
|
||||
|
||||
$queries = DB::table('users')
|
||||
->select('id','name')
|
||||
->get();
|
||||
|
||||
foreach ($queries as $query)
|
||||
{
|
||||
$users[$query->id] = $query->name;
|
||||
if ($term && strpos($query->name, $term) === 0) {
|
||||
$uin[] = $query->id;
|
||||
}
|
||||
}
|
||||
|
||||
$queries = DB::table('computers')
|
||||
->select('id','computer')
|
||||
->get();
|
||||
|
||||
foreach ($queries as $query)
|
||||
{
|
||||
$computers[$query->id] = $query->computer ;
|
||||
if ($term && strpos(strtolower($query->computer),strtolower($term)) === 0) {
|
||||
$cin[] = $query->id;
|
||||
}
|
||||
}
|
||||
|
||||
$queries = DB::table('user_ip')
|
||||
->select('computer_id','user_id')->distinct()
|
||||
->whereIn('computer_id',$cin)
|
||||
->orWhereIn('user_id',$uin)
|
||||
->get();
|
||||
|
||||
foreach ($queries as $query) {
|
||||
$results[] = [ 'id' => $query->computer_id, 'computer' => $computers[$query->computer_id], 'user' => $users[$query->user_id]];
|
||||
}
|
||||
return Response::json($results);
|
||||
}
|
||||
|
||||
public function search($var = null)
|
||||
{
|
||||
$ip = Request::input('ip');
|
||||
$user = Request::input('user');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
0
app/Http/Controllers/Temperature.php
Normal file → Executable file
0
app/Http/Controllers/Temperature.php
Normal file → Executable file
29
app/Http/Kernel.php
Normal file → Executable file
29
app/Http/Kernel.php
Normal file → Executable file
@@ -14,11 +14,11 @@ class Kernel extends HttpKernel
|
||||
* @var array
|
||||
*/
|
||||
protected $middleware = [
|
||||
\Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode::class,
|
||||
\App\Http\Middleware\TrustProxies::class,
|
||||
\App\Http\Middleware\CheckForMaintenanceMode::class,
|
||||
\Illuminate\Foundation\Http\Middleware\ValidatePostSize::class,
|
||||
\App\Http\Middleware\TrimStrings::class,
|
||||
\Illuminate\Foundation\Http\Middleware\ConvertEmptyStringsToNull::class,
|
||||
\App\Http\Middleware\TrustProxies::class,
|
||||
];
|
||||
|
||||
/**
|
||||
@@ -39,7 +39,7 @@ class Kernel extends HttpKernel
|
||||
|
||||
'api' => [
|
||||
'throttle:60,1',
|
||||
'bindings',
|
||||
\Illuminate\Routing\Middleware\SubstituteBindings::class,
|
||||
],
|
||||
];
|
||||
|
||||
@@ -51,11 +51,32 @@ class Kernel extends HttpKernel
|
||||
* @var array
|
||||
*/
|
||||
protected $routeMiddleware = [
|
||||
'auth' => \Illuminate\Auth\Middleware\Authenticate::class,
|
||||
'auth' => \App\Http\Middleware\Authenticate::class,
|
||||
'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class,
|
||||
'bindings' => \Illuminate\Routing\Middleware\SubstituteBindings::class,
|
||||
'cache.headers' => \Illuminate\Http\Middleware\SetCacheHeaders::class,
|
||||
'can' => \Illuminate\Auth\Middleware\Authorize::class,
|
||||
'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class,
|
||||
'password.confirm' => \Illuminate\Auth\Middleware\RequirePassword::class,
|
||||
'signed' => \Illuminate\Routing\Middleware\ValidateSignature::class,
|
||||
'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class,
|
||||
'verified' => \Illuminate\Auth\Middleware\EnsureEmailIsVerified::class,
|
||||
];
|
||||
|
||||
/**
|
||||
* The priority-sorted list of middleware.
|
||||
*
|
||||
* This forces non-global middleware to always be in the given order.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $middlewarePriority = [
|
||||
\Illuminate\Session\Middleware\StartSession::class,
|
||||
\Illuminate\View\Middleware\ShareErrorsFromSession::class,
|
||||
\App\Http\Middleware\Authenticate::class,
|
||||
\Illuminate\Routing\Middleware\ThrottleRequests::class,
|
||||
\Illuminate\Session\Middleware\AuthenticateSession::class,
|
||||
\Illuminate\Routing\Middleware\SubstituteBindings::class,
|
||||
\Illuminate\Auth\Middleware\Authorize::class,
|
||||
];
|
||||
}
|
||||
|
||||
0
app/Http/Middleware/EncryptCookies.php
Normal file → Executable file
0
app/Http/Middleware/EncryptCookies.php
Normal file → Executable file
3
app/Http/Middleware/RedirectIfAuthenticated.php
Normal file → Executable file
3
app/Http/Middleware/RedirectIfAuthenticated.php
Normal file → Executable file
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace App\Http\Middleware;
|
||||
|
||||
use App\Providers\RouteServiceProvider;
|
||||
use Closure;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
|
||||
@@ -18,7 +19,7 @@ class RedirectIfAuthenticated
|
||||
public function handle($request, Closure $next, $guard = null)
|
||||
{
|
||||
if (Auth::guard($guard)->check()) {
|
||||
return redirect('/home');
|
||||
return redirect(RouteServiceProvider::HOME);
|
||||
}
|
||||
|
||||
return $next($request);
|
||||
|
||||
0
app/Http/Middleware/TrimStrings.php
Normal file → Executable file
0
app/Http/Middleware/TrimStrings.php
Normal file → Executable file
16
app/Http/Middleware/TrustProxies.php
Normal file → Executable file
16
app/Http/Middleware/TrustProxies.php
Normal file → Executable file
@@ -2,28 +2,22 @@
|
||||
|
||||
namespace App\Http\Middleware;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use Fideloper\Proxy\TrustProxies as Middleware;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class TrustProxies extends Middleware
|
||||
{
|
||||
/**
|
||||
* The trusted proxies for this application.
|
||||
*
|
||||
* @var array
|
||||
* @var array|string
|
||||
*/
|
||||
protected $proxies;
|
||||
|
||||
/**
|
||||
* The current proxy header mappings.
|
||||
* The headers that should be used to detect proxies.
|
||||
*
|
||||
* @var array
|
||||
* @var int
|
||||
*/
|
||||
protected $headers = [
|
||||
Request::HEADER_FORWARDED => 'FORWARDED',
|
||||
Request::HEADER_X_FORWARDED_FOR => 'X_FORWARDED_FOR',
|
||||
Request::HEADER_X_FORWARDED_HOST => 'X_FORWARDED_HOST',
|
||||
Request::HEADER_X_FORWARDED_PORT => 'X_FORWARDED_PORT',
|
||||
Request::HEADER_X_FORWARDED_PROTO => 'X_FORWARDED_PROTO',
|
||||
];
|
||||
protected $headers = Request::HEADER_X_FORWARDED_ALL;
|
||||
}
|
||||
|
||||
7
app/Http/Middleware/VerifyCsrfToken.php
Normal file → Executable file
7
app/Http/Middleware/VerifyCsrfToken.php
Normal file → Executable file
@@ -6,6 +6,13 @@ use Illuminate\Foundation\Http\Middleware\VerifyCsrfToken as Middleware;
|
||||
|
||||
class VerifyCsrfToken extends Middleware
|
||||
{
|
||||
/**
|
||||
* Indicates whether the XSRF-TOKEN cookie should be set on the response.
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
protected $addHttpCookie = true;
|
||||
|
||||
/**
|
||||
* The URIs that should be excluded from CSRF verification.
|
||||
*
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
<?php
|
||||
|
||||
Route::get('/log',function () {
|
||||
echo "TEST";
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user