[ Extension] Audittrail 2

This is designed for discussion about the AuditTrail 2 extension here: http://www.yiiframework.com/extension/audittrail2/

Please note you can also file an issue on Github here: https://github.com/Sammaye/audittrail/issues?state=open

This is a DBMS issue, but it came up when I used this extension as the Loggable Behavior, when configured to use timestamps, attempts to use the PHP function time(). In my situation with MySQL, the DBMS was not accepting an integer value for timestamp, even after changing the ‘stamp’ field from datetime to timestamp.

http://www.yiiframework.com/forum/index.php/topic/17756-db-attribute-with-timestamp-not-possible-to-save-timestamp/

Edit: This may only occur when changing the stamp field datatype to timestamp from datetime.

Also, for those that may be interested, I chose to attach the core Timestamp behavior to the AuditTrail model and comment out the $log->stamp setting in LoggableBehavior:




//AuditTrail.php

public function behaviors() {

  return array(

    'CTimestampBehavior' => array(

      'class' => 'zii.behaviors.CTimestampBehavior',

        'createAttribute' => 'stamp',

        'updateAttribute' => 'stamp',

        'setUpdateOnCreate' => true

    )

  );

}

//LoggableBehavior.php

//$log->stamp = $this->storeTimestamp ? time() : date($this->dateFormat);



I really need to extend this to logging of certain searches? I see there is an after find already setup. Anybody have a good idea how to make it log the criteria that was used? Is that even possible?

hi,

nice extension! is it possible to log ALL actions, not only update-create-delete, but read also? in fact, ALL actions? login, admin, view etc? UPDATE: in the meanwhile I’ve figured it out how to adapt this to login (in fact it logs lastvisit value change).

it would be a nice feature if we could define certain actions to be affected by AuditTrail behaviour. for example:




'on' => array('view', 'create', 'update'),



by the way, where can I find AuditLog model?

thanks a lot!

BR

c