2017 © Pedro Peláez
 

yii2-extension yii2-actionlog

Logs user actions like create, read, update, delete and custom

image

cakebake/yii2-actionlog

Logs user actions like create, read, update, delete and custom

  • Monday, June 2, 2014
  • by cakebake
  • Repository
  • 6 Watchers
  • 13 Stars
  • 3,594 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 5 Forks
  • 3 Open issues
  • 3 Versions
  • 9 % Grown

The README.md

Yii2 Action Log

Automatically logs user actions like create, update, delete. In addition, you can manually apply the method ActionLog::add('Save sample message'), where you will need., (*1)

Installation

The preferred way to install this extension is through composer., (*2)

Either run, (*3)

php composer.phar require --prefer-dist cakebake/yii2-actionlog "*"

or add, (*4)

"cakebake/yii2-actionlog": "*"

to the require section of your composer.json file., (*5)

Database Migration

Check your database settings and run migration from your console:, (*6)

php yii migrate --migrationPath=@vendor/cakebake/yii2-actionlog/migrations

For more informations see Database Migration Documentation, (*7)

Configuration

To access the module, you need to add this to your application configuration:, (*8)

......
'modules' => [
    'actionlog' => [
        'class' => 'cakebake\actionlog\Module',
    ],
],
......

Add the new menu item to your navbar:, (*9)

......
['label' => 'Log', 'url' => ['/actionlog/log/index']],
......

You may have to customize the user rights for the access log view. You could do it by editing controllers/LogController.php., (*10)

Example manual usage

This is an example in the login method from the module cakebake/yii2-accounts., (*11)

use cakebake\actionlog\model\ActionLog;

......
public function login()
{
    $user = $this->getUser();
    if ($this->validate()) {
        ActionLog::add('success', $user->id); //log message for success

        return Yii::$app->user->login($user, $this->rememberMe ? 3600 * 24 * 30 : 0);
    } else {
        ActionLog::add('error', $user->id); //log message for error

        return false;
    }
}
......

The Versions

02/06 2014

dev-master

9999999-dev

Logs user actions like create, read, update, delete and custom

  Sources   Download

LGPL-V3

by cakebake (Jens A.)

log extension yii2 activerecord actionlog

25/05 2014

v1.0.0-beta

1.0.0.0-beta

Logs user actions like create, read, update, delete and custom

  Sources   Download

LGPL-V3

by cakebake (Jens A.)

log extension yii2 activerecord actionlog

21/05 2014

v1.0.0-alpha

1.0.0.0-alpha

Logs user actions like create, read, update, delete and custom

  Sources   Download

GPL-3.0

by cakebake (Jens A.)

log extension yii2 activerecord actionlog