Small fix to the syslog

pull/762/head
iglocska 2015-10-22 10:00:59 +02:00
parent ef1d3949e7
commit 0ae9c963a5
1 changed files with 3 additions and 2 deletions

View File

@ -271,7 +271,8 @@ class SysLogLogableBehavior extends LogableBehavior {
}
$this->schema = $this->Log->schema();
App::import('Component', 'Auth');
if (!empty(AuthComponent::user())) $this->user[$this->settings[$Model->alias]['userModel']] = AuthComponent::user();
$user = AuthComponent::user();
if (!empty($user)) $this->user[$this->settings[$Model->alias]['userModel']] = AuthComponent::user();
else $this->user['User'] = array('email' => 'SYSTEM', 'Organisation' => array('name' => 'SYSTEM'), 'id' => 0);
}
}
}