Tea or Coffee ?

0
0%
1
100%
0
0%

Lorem ipsum dolor sit amet

Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.

Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat.

Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat : 

  • vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto
  • odio dignissim qui blandit praesent luptatum zzril
  • delenit augue duis dolore te feugait nulla facilisi

 

Nam liber tempor cum soluta nobis eleifend option congue nihil imperdiet doming id quod mazim placerat facer possim assum. heureux

 

<?php
namespace App\Event;

use Cake\Event\Event;
use Cake\Event\EventListenerInterface;
use Cake\ORM\TableRegistry;

class Logs implements EventListenerInterface
{
    /**
     * ImplementedEvents method.
     *
     * @return array
     */
    public function implementedEvents()
    {
        return [
            'Log.User' => 'userLog'
        ];
    }

    /**
     * An user has doing an important action, we log it.
     *
     * @param Event $event The event that was fired.
     *
     * @return bool
     */
    public function userLog(Event $event)
    {
        $this->UsersLogs = TableRegistry::get('UsersLogs');

        $data = [
            'user_id' => $event->getData('user_id'),
            'username' => $event->getData('username'),
            'user_ip' => $event->getData('user_ip'),
            'user_agent' => $event->getData('user_agent'),
            'action' => $event->getData('action')
        ];

        $entity = $this->UsersLogs->newEntity($data);
        $this->UsersLogs->save($entity);

        return true;
    }
}

 

10 Commentaires

  1. Xeta

    Xeta

    Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.

  2. Test

    Test

    Admin has said :

    Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.

    Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi.

  3. jjjjj

    jjjjj

    effectivement
  4. test45

    test45

    prieer

  5. Testshc

    Testshc

    s

  6. edsonti

    edsonti

    y7uio78yui

  7. eraph

    eraph

    qsdfqsdfq

  8. eraph

    eraph

    yeah

  9. Adakhoerudin

    Adakhoerudin

    /vendor/autoload.php not found in github
  10. Gregs62

    Gregs62

    Test