main/core/Listener/CliListener.php
public function setDefaultUser(ConsoleCommandEvent $event)
    {
        $command = $event->getCommand();

        if ($command instanceof AdminCliCommand) {
            $user = $this->userManager->getDefaultClarolineAdmin();
            $token = new UsernamePasswordToken($user, null, 'main', $user->getRoles());
            $this->tokenStorage->setToken($token);
        }
    }
public function setDefaultUser(ConsoleCommandEvent $event)
    {
        $command = $event->getCommand();

        if ($command instanceof AdminCliCommand) {
            $user = $this->userManager->getDefaultClarolineAdmin();
            $token = new UsernamePasswordToken($user, null, 'main', $user->getRoles());
            $this->tokenStorage->setToken($token);
        }
    }
public function setDefaultUser ( ConsoleCommandEvent $ event ) { $ command = $ event -> getCommand ( ) ; if ( $ command instanceof AdminCliCommand ) { $ user = $ this -> userManager -> getDefaultClarolineAdmin ( ) ; $ token = new UsernamePasswordToken ( $ user , null , 'main' , $ user -> getRoles ( ) ) ; $ this -> tokenStorage -> setToken ( $ token ) ; } }
Sets claroline default admin for cli because it's very annoying otherwise to do it manually everytime.

@DI\Observe("console.command", priority = 17)

@param GetResponseEvent $event
Sets claroline default admin for cli because it s very annoying otherwise to do it manually everytime .