PHP Class Sulu\Bundle\SecurityBundle\UserManager\UserManager

Inheritance: implements Sulu\Bundle\AdminBundle\UserManager\UserManagerInterface, use trait Sulu\Component\Persistence\RelationTrait
Afficher le fichier Open project: sulu/sulu

Protected Properties

Свойство Type Description
$contactManager Sulu\Bundle\ContactBundle\Contact\ContactManager
$em Doctrine\Common\Persistence\ObjectManager
$userRepository Sulu\Component\Security\Authentication\UserRepositoryInterface

Méthodes publiques

Méthode Description
__construct ( Doctrine\Common\Persistence\ObjectManager $em, Symfony\Component\Security\Core\Encoder\EncoderFactory $encoderFactory = null, RoleRepository $roleRepository = null, GroupRepository $groupRepository = null, ContactManager $contactManager = null, SaltGenerator $saltGenerator = null, Sulu\Component\Security\Authentication\UserRepositoryInterface $userRepository = null )
delete ( ) : Closure Deletes a user with the given id.
enableUser ( integer $id ) : Sulu\Component\Security\Authentication\UserInterface
findAll ( ) : array Return all users.
findUserByContact ( integer $contactId ) : Sulu\Component\Security\Authentication\UserInterface Finds a user for a given contact id.
findUsersByAccount ( integer $accountId, $sortBy = [] ) : array Finds all users for the given account.
getFullNameByUserId ( integer $id ) : string returns fullName for given id.
getUserById ( integer $id ) : Sulu\Component\Security\Authentication\UserInterface Returns user for given id.
getUsernameByUserId ( integer $id ) : string Returns username for given id.
isEmailUnique ( string $email ) : boolean Checks if an email-adress is unique Null and empty will always return false.
isUsernameUnique ( string $username ) : boolean Checks if a username is unique Null and empty will always return false.
isValidPassword ( string $password ) : boolean Checks if the given password is a valid one.
processUserRoles ( Sulu\Component\Security\Authentication\UserInterface $user, array $userRoles ) : boolean Process all user roles from request.
save ( array $data, string $locale, null | integer $id = null, boolean $patch = false, boolean $flush = true ) : null | Sulu\Component\Security\Authentication\UserInterface Creates a new user with the given data.

Méthodes protégées

Méthode Description
processUserGroups ( Sulu\Component\Security\Authentication\UserInterface $user, $userGroups ) : boolean Process all user groups from request.

Private Methods

Méthode Description
addUserGroup ( Sulu\Component\Security\Authentication\UserInterface $user, $userGroupData ) : boolean Adds a new UserGroup to the given user.
addUserRole ( Sulu\Component\Security\Authentication\UserInterface $user, $userRoleData ) : boolean Adds a new UserRole to the given user.
encodePassword ( Sulu\Component\Security\Authentication\UserInterface $user, string $password, string $salt ) : string Encodes the given password, for the given passwort, with he given salt and returns the result.
generateSalt ( ) : string Generates a random salt for the password.
getContact ( integer $id ) : Contact Returns the contact with the given id.
getProperty ( array $data, string $key, string $default = null ) : string | null Return property for key or given default value.
processEmail ( Sulu\Component\Security\Authentication\UserInterface $user, string $email, null | array $contact = null ) Processes the email and adds it to the user.
resetIndexOfSubentites ( mixed $entities ) : mixed this is just a hack to avoid relations that start with index != 0 otherwise deserialization process will parse relations as object instead of an array reindex entities.
updateUserGroup ( UserGroup $userGroup, $userGroupData ) : boolean Updates an existing UserGroup with the given data.
updateUserRole ( Sulu\Bundle\SecurityBundle\Entity\UserRole $userRole, $userRoleData ) : boolean Updates an existing UserRole with the given data.

Method Details

__construct() public méthode

public __construct ( Doctrine\Common\Persistence\ObjectManager $em, Symfony\Component\Security\Core\Encoder\EncoderFactory $encoderFactory = null, RoleRepository $roleRepository = null, GroupRepository $groupRepository = null, ContactManager $contactManager = null, SaltGenerator $saltGenerator = null, Sulu\Component\Security\Authentication\UserRepositoryInterface $userRepository = null )
$em Doctrine\Common\Persistence\ObjectManager
$encoderFactory Symfony\Component\Security\Core\Encoder\EncoderFactory
$roleRepository Sulu\Bundle\SecurityBundle\Entity\RoleRepository
$groupRepository Sulu\Bundle\SecurityBundle\Entity\GroupRepository
$contactManager Sulu\Bundle\ContactBundle\Contact\ContactManager
$saltGenerator Sulu\Component\Security\Authentication\SaltGenerator
$userRepository Sulu\Component\Security\Authentication\UserRepositoryInterface

delete() public méthode

Deletes a user with the given id.
public delete ( ) : Closure
Résultat Closure

enableUser() public méthode

public enableUser ( integer $id ) : Sulu\Component\Security\Authentication\UserInterface
$id integer
Résultat Sulu\Component\Security\Authentication\UserInterface

findAll() public méthode

Return all users.
public findAll ( ) : array
Résultat array

findUserByContact() public méthode

Finds a user for a given contact id.
public findUserByContact ( integer $contactId ) : Sulu\Component\Security\Authentication\UserInterface
$contactId integer
Résultat Sulu\Component\Security\Authentication\UserInterface

findUsersByAccount() public méthode

Finds all users for the given account.
public findUsersByAccount ( integer $accountId, $sortBy = [] ) : array
$accountId integer
Résultat array

getFullNameByUserId() public méthode

returns fullName for given id.
public getFullNameByUserId ( integer $id ) : string
$id integer userId
Résultat string

getUserById() public méthode

Returns user for given id.
public getUserById ( integer $id ) : Sulu\Component\Security\Authentication\UserInterface
$id integer userId
Résultat Sulu\Component\Security\Authentication\UserInterface

getUsernameByUserId() public méthode

Returns username for given id.
public getUsernameByUserId ( integer $id ) : string
$id integer userId
Résultat string

isEmailUnique() public méthode

Checks if an email-adress is unique Null and empty will always return false.
public isEmailUnique ( string $email ) : boolean
$email string
Résultat boolean

isUsernameUnique() public méthode

Checks if a username is unique Null and empty will always return false.
public isUsernameUnique ( string $username ) : boolean
$username string
Résultat boolean

isValidPassword() public méthode

Checks if the given password is a valid one.
public isValidPassword ( string $password ) : boolean
$password string The password to check
Résultat boolean True if the password is valid, otherwise false

processUserGroups() protected méthode

Process all user groups from request.
protected processUserGroups ( Sulu\Component\Security\Authentication\UserInterface $user, $userGroups ) : boolean
$user Sulu\Component\Security\Authentication\UserInterface
$userGroups
Résultat boolean True if the processing was successful, otherwise false

processUserRoles() public méthode

Process all user roles from request.
public processUserRoles ( Sulu\Component\Security\Authentication\UserInterface $user, array $userRoles ) : boolean
$user Sulu\Component\Security\Authentication\UserInterface
$userRoles array
Résultat boolean True if the processing was successful, otherwise false

save() public méthode

Creates a new user with the given data.
public save ( array $data, string $locale, null | integer $id = null, boolean $patch = false, boolean $flush = true ) : null | Sulu\Component\Security\Authentication\UserInterface
$data array
$locale string
$id null | integer
$patch boolean
$flush boolean
Résultat null | Sulu\Component\Security\Authentication\UserInterface

Property Details

$contactManager protected_oe property

protected ContactManager,Sulu\Bundle\ContactBundle\Contact $contactManager
Résultat Sulu\Bundle\ContactBundle\Contact\ContactManager

$em protected_oe property

protected ObjectManager,Doctrine\Common\Persistence $em
Résultat Doctrine\Common\Persistence\ObjectManager

$userRepository protected_oe property

protected UserRepositoryInterface,Sulu\Component\Security\Authentication $userRepository
Résultat Sulu\Component\Security\Authentication\UserRepositoryInterface