实施行动日志
是否有任何类可以对用户的操作进行审核? 我的意思是用户添加、删除或修改记录的操作?
前段时间我使用过 phpmyedit,它有一个“logtable
”选项 ($opts['logtable'] = 'changelog';
),可以用来“审核”或跟踪该特殊表的活动。
是否可以做到这一点,或者我是否必须在 $f->update()
之前实现它(例如)?
Is there any class available to do auditing of actions of users?
I mean actions that users do with add, delete or modify a record?
Some time ago I've used phpmyedit and It has a "logtable
" option ($opts['logtable'] = 'changelog';
), that one can use to "audit" or track the activity to that special table.
Is it possible to do this or do I have to implement it (for instance) before $f->update()
?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
没有这样的类,但我已经实现了好几次了。这涉及“推送”标准 Model_Table 类以将功能包含到所有模型中。这是食谱。
如果您只对成功操作感兴趣,可以省略“beforeInsert”中的“update”。创建一些测试。不要忘记确保 Model_Audit 不会继承您的类以避免递归。实际上,您可以以不同的方式命名类,只要您记得将其用于模型即可。
Agile Toolkit 将在某个时候通过 Controller 提供无缝审计支持,最有可能在 4.2 中。
There is no such class, but I have implemented this several times. This involves "pushing" standard Model_Table class to include functionality into ALL of your models. Here is recipe.
You can omit "update" from "beforeInsert" if you are only interested in successful operations. Create some tests. Don't forget to make sure Model_Audit does NOT inherit your class to avoid recursion. You can actually name class differently, as long as you remember to use it for the models.
Agile Toolkit will have seamless audit support through Controller at some point, most probably in 4.2.