Tracks users changing nicks

@param  Event  $event Event object
15505
public function onNick(Event $event)
    {
        $msg = $event->getMessage();

        $oldNick = $msg['nick'];
        $newNick = $msg['params']['nickname'];

        $this->storage->updateNickname($oldNick, $newNick);
    }
286351
public function onRequestCreate(Event $event)
    {
        $event['request']->setAuth($this->username, $this->password, $this->scheme);
    }
780049
public static function onPreUpdate(Event $event)
    {
        $page = $event->getTarget();
        $eventArgs = $event->getEventArgs();
        $updateParents = false;
        $new = $old = null;

        $pageCountModifier = -1;
        if ($eventArgs instanceof PreUpdateEventArgs) {
            if ($page instanceof Page && $eventArgs->hasChangedField('_section')) {
                $old = $eventArgs->getOldValue('_section');
                $new = $eventArgs->getNewValue('_section');

                if ($new->getUid() === $page->getUid()) {
                    return;
                }
                $updateParents = true;
            }

            if ($page instanceof Page && $eventArgs->hasChangedField('_state')) {
                if ($page->getParent() !== null) {
                    if ($eventArgs->getNewValue('_state') >= 4) {
                        $old = $page->getParent()->getSection();
                        if (!$page->isLeaf()) {
                            $pageCountModifier = 0;
                        }
                    } else {
                        $new = $page->getParent()->getSection();
                    }
                    $updateParents = true;
                }
            }

            if ($page instanceof Section && $eventArgs->hasChangedField('_parent')) {
                $old = $eventArgs->getOldValue('_parent');
                $new = $eventArgs->getNewValue('_parent');
                $updateParents = true;
            }

            if ($updateParents) {
                $em = $event->getApplication()->getEntityManager();

                self::setSectionHasChildren($em, $old, $pageCountModifier);
                self::setSectionHasChildren($em, $new, +1);
            }
        }
    }
67948
public function onSuccessActivate(Event $event)
    {
        /** @var User|bool $user */
        $user = $event->getData('user');
        $this->_getMailer($user)->sendActivationMessage();
    }
586192
public function determineEventBinding(Event $event)
    {
        switch ($event->getCode()) {
            case Event::RESOURCE_DELETED:
                return 'delete';
                break;
            case Event::RESOURCE_CREATED:
                return 'create';
                break;
            case Event::RESOURCE_MODIFIED:
                return 'modify';
            break;
        }
    }
145538
public function col_relatedfullnameuser($event) {
        // Add affected user.
        if (!empty($event->relateduserid) && isset($this->userfullnames[$event->relateduserid])) {
            $params = array('id' => $event->relateduserid);
            if ($event->courseid) {
                $params['course'] = $event->courseid;
            }
            return html_writer::link(new moodle_url("/user/view.php", $params), $this->userfullnames[$event->relateduserid]);
        } else {
            return '-';
        }
    }
1366514
public function beforeFilter(Event $event)
    {
        parent::beforeFilter($event);
        $this->Auth->deny();

        if (!$this->Auth->user()) {
            $this->Auth->config('authError', false);
        } else {
            Wasabi::user(new User($this->Auth->user()));

            $currentUrlArray = Wasabi::getCurrentUrlArray();
            $currentRequestPath = join('.', [
                $currentUrlArray['plugin'],
                $currentUrlArray['controller'],
                $currentUrlArray['action']
            ]);

            if (!$this->request->is('ajax') || $currentRequestPath !== 'Wasabi/Core.Users.heartBeat') {
                $this->request->session()->write('loginTime', time());
            }
        }

        $this->_allow();

        Wasabi::loadLanguages(null, true);

        // Load all menu items from all plugins.
        $this->eventManager()->dispatch(new Event('Wasabi.Backend.Menu.initMain', Nav::createMenu('backend.main')));

        $this->_setSectionCssClass();

        $this->set('heartBeatFrequency', $this->_calculateHeartBeatFrequency());
        if (isset($_COOKIE['sidebar-collapsed'])) {
            $this->set('sidebarCollapsed', (bool)$_COOKIE['sidebar-collapsed'] ? 'sidebar-is-collapsed' : '');
        }

        if ($this->request->is('ajax')) {
            $this->viewClass = null;
        }
    }
176814
public function preUpdate(UpdateEvent $event)
    {
        $oldData = $event->getOldData();
        $user = $event->getObject();

        if (!empty($oldData) && $oldData['username'] !== $user->getUsername()) {
            $userRole = $this->roleManager->getUserRole($oldData['username']);
            $this->roleManager->renameUserRole($userRole, $user->getUsername());
            // TODO : rename personal WS if user is renamed
        }
    }
127443
public function handle(UpdatedEvent $event)
    {
        if ($event->oldemail === $event->user->email) {
            $data = sprintf('**Verified:** _<%s>_', $event->user->email);
        } else {
            $data = implode("\n", [
                sprintf('**Updated:** _<%s>_', $event->user->email),
                sprintf('**Old:** _<%s>_', $event->oldemail),
            ]);
        }

        $this->track(Settings::TYPEID_UPDATED, $event->user->id, 25, $data);
    }
641521
public function onInitIPAddress($event)
    {
        $sender = $event->sender;
        $request = $sender->getWebRequest();
        if ($sender->enableIP && $request && empty($sender->ipAddress)) {
            $sender->ipAddress = $request->userIP;
        }
    }
1073194
public function onJoin(Event $event)
    {
        $msg = $event->getMessage();

        if (!isset($msg['nick'])) {
            return;
        }

        $chan = $msg['params']['channels'];
        $nick = $msg['nick'];

        $this->storage->setUserMode($nick, $chan, self::REGULAR);
    }
962671
public function afterLogout(Event $event)
    {
        $this->_controller()->Cookie->delete('Jwt');
        $this->_controller()->Cookie->delete('CookieAuth');
    }
531968
public function beforeUpdate($event)
    {
        $fields = $this->fields;
        $nowDate = gmdate($this->databaseTimeFormat);
        if (!$this->isActuallyDirty()) {
            return;
        }

        if (isset($this->fields['modifiedField']) && !$this->owner->isAttributeChanged($this->fields['modifiedField'])) {
            $this->owner->{$this->fields['modifiedField']} = $nowDate;
        }
        if (isset($this->fields['modifiedByField']) && !$this->owner->isAttributeChanged($this->fields['modifiedByField'])) {
            $this->owner->{$this->fields['modifiedByField']} = self::_getUserId();
        }
    }
1011092
final private function replayChange(Event $event)
    {
        $this->apply($event->payload());
        $this->lastCommittedEventSequenceNumber = $event->sequenceNumber();
    }
1118595
public function beforeFilter(\Cake\Event\Event $event)
    {
        parent::beforeFilter($event);

        $this->Auth->allow([]);
    }
441530
public function beforeFilter(Event $event)
    {
        if (!$this->_controller()->Auth->user() &&
            $this->_controller()->Cookie->read('CookieAuth')) {

            $user = $this->_controller()->Auth->identify();
            if ($user) {
                $this->_controller()->Auth->setUser($user);
            } else {
                $this->_controller()->Cookie->delete('CookieAuth');
            }
        }
    }
730519
public function onPasswordReset(PostPasswordResetEvent $event): void
    {
        $user = $event->getUser();

        $this->mailHelper
            ->sendMail(
                [$user->email => $this->getUserName($user)],
                'ngsite.user.forgot_password.password_changed.subject',
                $this->configResolver->getParameter('template.user.mail.forgot_password_password_changed', 'ngsite'),
                [
                    'user' => $user,
                ]
            );

        $this->ezUserAccountKeyRepository->removeByUserId($user->id);
    }