1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-11 21:52:35 +01:00
invoiceninja/app/controllers/HomeController.php
Hillel Coren 0144f5b0f2 bug fixes
2014-01-02 15:21:15 +02:00

31 lines
626 B
PHP
Executable File

<?php
class HomeController extends BaseController {
protected $layout = 'master';
public function showWelcome()
{
return View::make('splash');
}
public function logError()
{
$count = Session::get('error_count', 0);
Session::put('error_count', ++$count);
if ($count > LOGGED_ERROR_LIMIT) return 'logged';
$data = [
'context' => 'JavaScript',
'user_id' => Auth::check() ? Auth::user()->id : 0,
'url' => Input::get('url'),
'user_agent' => $_SERVER['HTTP_USER_AGENT'],
'ip' => Request::getClientIp(),
'count' => $count
];
Log::error(Input::get('error'), $data);
return 'logged';
}
}