Inclusion of lnauth module

This commit is contained in:
Deon George
2016-08-25 23:25:32 +10:00
parent b74fdc930f
commit 34e1e40f04
21 changed files with 29 additions and 843 deletions

View File

@@ -19,17 +19,19 @@ class Kohana_Exception extends Kohana_Kohana_Exception {
*/
public static function log(Exception $e,$level=Log::EMERGENCY) {
try {
$eo = ORM::factory('Log_Error');
$eo->message = Kohana_Exception::text($e);
$eo->account_id = (PHP_SAPI === 'cli' OR ! Auth::instance()->logged_in()) ? NULL : Auth::instance()->get_user()->id;
if (class_exists('Model_Log_Error')) {
$eo = ORM::factory('Log_Error');
$eo->message = Kohana_Exception::text($e);
$eo->account_id = (PHP_SAPI === 'cli' OR ! Auth::instance()->logged_in()) ? NULL : Auth::instance()->get_user()->id;
if (Request::current()) {
$eo->module = (Request::current()->directory() ? Request::current()->directory().'_' : '').Request::current()->controller();
$eo->method = Request::current()->action();
if (Request::current()) {
$eo->module = (Request::current()->directory() ? Request::current()->directory().'_' : '').Request::current()->controller();
$eo->method = Request::current()->action();
}
$eo->save();
}
$eo->save();
} catch (Exception $x) {
return parent::log($e,$level);
}
@@ -48,11 +50,13 @@ class Kohana_Exception extends Kohana_Kohana_Exception {
return parent::response($e);
} else {
SystemMessage::add(array(
'title'=>'An Error Occured.',
'type'=>'error',
'body'=>'Dont panic, its been logged.',
));
if (class_exists('SystemMessage')) {
SystemMessage::add(array(
'title'=>'An Error Occured.',
'type'=>'error',
'body'=>'Dont panic, its been logged.',
));
}
// We'll redirect to the main page.
$response = Response::factory();