Migracia a male opravy
- csrf ocharana, vypnutie pre /log - oprava loggovania pamate - pridanie vue skriptov
This commit is contained in:
40
app/Http/Controllers/Auth/ConfirmPasswordController.php
Executable file
40
app/Http/Controllers/Auth/ConfirmPasswordController.php
Executable file
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Auth;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Providers\RouteServiceProvider;
|
||||
use Illuminate\Foundation\Auth\ConfirmsPasswords;
|
||||
|
||||
class ConfirmPasswordController extends Controller
|
||||
{
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Confirm Password Controller
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This controller is responsible for handling password confirmations and
|
||||
| uses a simple trait to include the behavior. You're free to explore
|
||||
| this trait and override any functions that require customization.
|
||||
|
|
||||
*/
|
||||
|
||||
use ConfirmsPasswords;
|
||||
|
||||
/**
|
||||
* Where to redirect users when the intended url fails.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $redirectTo = RouteServiceProvider::HOME;
|
||||
|
||||
/**
|
||||
* Create a new controller instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$this->middleware('auth');
|
||||
}
|
||||
}
|
||||
42
app/Http/Controllers/Auth/VerificationController.php
Executable file
42
app/Http/Controllers/Auth/VerificationController.php
Executable file
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Auth;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Providers\RouteServiceProvider;
|
||||
use Illuminate\Foundation\Auth\VerifiesEmails;
|
||||
|
||||
class VerificationController extends Controller
|
||||
{
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Email Verification Controller
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This controller is responsible for handling email verification for any
|
||||
| user that recently registered with the application. Emails may also
|
||||
| be re-sent if the user didn't receive the original email message.
|
||||
|
|
||||
*/
|
||||
|
||||
use VerifiesEmails;
|
||||
|
||||
/**
|
||||
* Where to redirect users after verification.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $redirectTo = RouteServiceProvider::HOME;
|
||||
|
||||
/**
|
||||
* Create a new controller instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$this->middleware('auth');
|
||||
$this->middleware('signed')->only('verify');
|
||||
$this->middleware('throttle:6,1')->only('verify', 'resend');
|
||||
}
|
||||
}
|
||||
29
app/Http/Controllers/DataController.php
Executable file
29
app/Http/Controllers/DataController.php
Executable file
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\User;
|
||||
use Request;
|
||||
use App\Http\Controllers\Controller;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
class DataController extends Controller
|
||||
{
|
||||
/**
|
||||
* Show the profile for the given user.
|
||||
*
|
||||
* @param int $computer_id
|
||||
*/
|
||||
public function get($id=null)
|
||||
{
|
||||
$where = [];
|
||||
$computer_id = Request::input('computer_id');
|
||||
$from = Request::input('from');
|
||||
$to = Request::input('to');
|
||||
$where[] = ["computer_id", '=', $computer_id];
|
||||
if ($from) $where[] = ["created_at", '>=', $from];
|
||||
if ($to) $where[] = ["created_at", '<=', $to];
|
||||
$queries = DB::table('values')->where($where)->get();
|
||||
return response()->json($queries);
|
||||
}
|
||||
}
|
||||
@@ -8,7 +8,7 @@ use Illuminate\Support\Facades\DB;
|
||||
class Logging extends Controller
|
||||
{
|
||||
|
||||
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'];
|
||||
public static $_items = [ 'netstat_sent' => 'i', 'netstat_recv' => 'i', 'memory_free' => 'B', 'memory_total' => 'B', 'memory_used' => 'B', '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 = [];
|
||||
@@ -32,7 +32,7 @@ class Logging extends Controller
|
||||
if ($ret == false ) {
|
||||
$q = DB::table('computers')->select('id', 'computer')->get();
|
||||
foreach ($q as $v) {
|
||||
$this->_ucache[$v->computer] = $v->id;
|
||||
$this->_ccache[$v->computer] = $v->id;
|
||||
}
|
||||
\apcu_store('computers',$this->_ccache);
|
||||
}
|
||||
@@ -67,9 +67,9 @@ class Logging extends Controller
|
||||
$units = explode(' ', ' K M G T P E Z Y');
|
||||
|
||||
|
||||
preg_match('/([0-9]+)([GKMTgkmT])?B/',$v,$vu);
|
||||
preg_match('/([0-9\.]+)([GKMTgkmT])?B/',$v,$vu);
|
||||
|
||||
$v1 = $vu[1];
|
||||
$v1 = $vu[1];
|
||||
if (count($vu) == 3)
|
||||
$v2 = $vu[2];
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user