Skip to content

Commit

Permalink
Fixed Issue #11454 Audit Log plugin fire a notice when adding a new t…
Browse files Browse the repository at this point in the history
…oken
  • Loading branch information
Markus Flür committed Jul 18, 2016
2 parents 0d9ae7f + 8e8a6b1 commit e20a386
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions plugins/AuditLog/AuditLog.php
Expand Up @@ -201,17 +201,21 @@ public function beforeTokenSave()
{
$sAction = 'create';
$oldvalues = array();
$currentUID = false;
}
else
{
$sAction = 'update';
$oCurrentUser=$this->api->getCurrentUser();
$oCurrentUser = $this->api->getCurrentUser();
$currentUID = $oCurrentUser->uid;
$oldvalues= $this->api->getToken($iSurveyID, $oNewParticipant->token)->getAttributes();
}

$newValues=$oNewParticipant->getAttributes();

if (count(array_diff_assoc($newValues,$oldvalues))){
$oAutoLog = $this->api->newModel($this, 'log');
$oAutoLog->uid=$oCurrentUser->uid;
$oAutoLog->uid=$currentUID;
$oAutoLog->entity='token';
$oAutoLog->action=$sAction;
$oAutoLog->entityid=$newValues['tid'];
Expand Down

0 comments on commit e20a386

Please sign in to comment.