Inclusion of lnauth module
This commit is contained in:
@@ -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();
|
||||
|
Reference in New Issue
Block a user