PHP Class Jarves\Client\UserOperator

Show file Open project: jarves/jarves Class Usage Examples

Public Methods

Method Description
__construct ( Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface $tokenStorage, UserProvider $userProvider, Psr\Log\LoggerInterface $logger, Symfony\Component\Security\Core\Encoder\EncoderFactoryInterface $encoderFactory, Symfony\Component\EventDispatcher\EventDispatcherInterface $eventDispatcher, Symfony\Component\HttpFoundation\RequestStack $requestStack )
getToken ( ) : null | Symfony\Component\Security\Core\Authentication\Token\TokenInterface
getUser ( ) : User | null Returns the current logged in User if available. Null if not or another token than Jarves' is active.
isLoggedIn ( ) : boolean Returns true when a non AnonymousToken is set (which primarily means a real User is logged in)
login ( string $username, string $password, null | string $requiredGroupRole = null ) : boolean
logout ( )
manualLogin ( User $user )

Method Details

__construct() public method

public __construct ( Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface $tokenStorage, UserProvider $userProvider, Psr\Log\LoggerInterface $logger, Symfony\Component\Security\Core\Encoder\EncoderFactoryInterface $encoderFactory, Symfony\Component\EventDispatcher\EventDispatcherInterface $eventDispatcher, Symfony\Component\HttpFoundation\RequestStack $requestStack )
$tokenStorage Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface
$userProvider UserProvider
$logger Psr\Log\LoggerInterface
$encoderFactory Symfony\Component\Security\Core\Encoder\EncoderFactoryInterface
$eventDispatcher Symfony\Component\EventDispatcher\EventDispatcherInterface
$requestStack Symfony\Component\HttpFoundation\RequestStack

getToken() public method

public getToken ( ) : null | Symfony\Component\Security\Core\Authentication\Token\TokenInterface
return null | Symfony\Component\Security\Core\Authentication\Token\TokenInterface

getUser() public method

Returns the current logged in User if available. Null if not or another token than Jarves' is active.
public getUser ( ) : User | null
return Jarves\Model\User | null

isLoggedIn() public method

Returns true when a non AnonymousToken is set (which primarily means a real User is logged in)
public isLoggedIn ( ) : boolean
return boolean

login() public method

public login ( string $username, string $password, null | string $requiredGroupRole = null ) : boolean
$username string
$password string
$requiredGroupRole null | string
return boolean

logout() public method

public logout ( )

manualLogin() public method

public manualLogin ( User $user )
$user Jarves\Model\User