update v 1.0.7.5

This commit is contained in:
Sujit Prasad
2016-06-13 20:41:55 +05:30
parent aa9786d829
commit 283d97e3ea
5078 changed files with 339851 additions and 175995 deletions

View File

@@ -0,0 +1,43 @@
<?php
namespace App\Http\Middleware;
use App\Model\helpdesk\Settings\System;
use Closure;
/**
* CheckBoard.
* Checking if the system board is online or offline
*
* @author Ladybird <info@ladybirdweb.com>
*/
class CheckBoard {
/**
* Handle an incoming request.
* @param \Illuminate\Http\Request $request
* @param \Closure $next
* @return type Mixed
*/
public function handle($request, Closure $next) {
if ($this->checkBoard() == '1') {
return $next($request);
} else {
return redirect()->route('board.offline')->with('offline', 'the system seems to be offline please try later');
}
}
/**
* Function to get the system offline details
* @return type Mixed
*/
public function checkBoard() {
$res = 0;
$system = new System;
if ($system->first()) {
$res = $system->first()->status;
}
return $res;
}
}