Skip to content

Commit

Permalink
Fixed issue #9435: Trying to get property of non-object with debug=2 …
Browse files Browse the repository at this point in the history
…and AuditLog enabled
  • Loading branch information
Aestu committed Jan 16, 2015
1 parent 0130b97 commit 4b87916
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions plugins/AuditLog/AuditLog.php
Expand Up @@ -28,13 +28,17 @@ public function __construct(PluginManager $manager, $id) {
*/
public function beforeLogout()
{
$iUserID=$this->api->getCurrentUser()->uid;
$oAutoLog = $this->api->newModel($this, 'log');
$oAutoLog->uid=$iUserID;
$oAutoLog->entity='user';
$oAutoLog->entityid=$iUserID;
$oAutoLog->action='beforeLogout';
$oAutoLog->save();
$oUser = $this->api->getCurrentUser();
if ($oUser != false)
{
$iUserID = $oUser->uid;
$oAutoLog = $this->api->newModel($this, 'log');
$oAutoLog->uid=$iUserID;
$oAutoLog->entity='user';
$oAutoLog->entityid=$iUserID;
$oAutoLog->action='beforeLogout';
$oAutoLog->save();
}
}

/**
Expand Down

0 comments on commit 4b87916

Please sign in to comment.