Class humhub\modules\user\authclient\AuthClientHelpers

Inheritancehumhub\modules\user\authclient\AuthClientHelpers
Available since version1.1

AuthClientHelper provides helper functions fo auth clients

Public Methods

Hide inherited methods

MethodDescriptionDefined By
createRegistration() Populates a Registration model with the information provided by the given AuthClient humhub\modules\user\authclient\AuthClientHelpers
createUser() Automatically creates user by auth client attributes humhub\modules\user\authclient\AuthClientHelpers
getAuthClientsByUser() Returns AuthClients used by given User humhub\modules\user\authclient\AuthClientHelpers
getSyncAttributesByUser() Returns a list of all synchornized user attributes humhub\modules\user\authclient\AuthClientHelpers
getUserByAuthClient() Returns the user object which is linked against given authClient humhub\modules\user\authclient\AuthClientHelpers
getUsersByAuthClient() Returns all users which are using an given authclient humhub\modules\user\authclient\AuthClientHelpers
removeAuthClientForUser() Removes Authclient for a user humhub\modules\user\authclient\AuthClientHelpers
storeAuthClientForUser() Stores an authClient to an user record humhub\modules\user\authclient\AuthClientHelpers
updateUser() Updates (or creates) a user in HumHub using AuthClients Attributes This method will be called after login or by cron sync. humhub\modules\user\authclient\AuthClientHelpers

Method Details

createRegistration() public static method

Populates a Registration model with the information provided by the given AuthClient

public static boolean|humhub\modules\user\models\forms\Registration|null createRegistration ( \yii\authclient\ClientInterface $authClient )
$authClient \yii\authclient\ClientInterface
createUser() public static method

Automatically creates user by auth client attributes

public static humhub\modules\user\models\User createUser ( \yii\authclient\ClientInterface $authClient )
$authClient \yii\authclient\BaseClient
return humhub\modules\user\models\User

The created user

getAuthClientsByUser() public static method

Returns AuthClients used by given User

public static \yii\authclient\ClientInterface[] getAuthClientsByUser ( humhub\modules\user\models\User $user )
$user humhub\modules\user\models\User
return \yii\authclient\ClientInterface[]

The users authclients

getSyncAttributesByUser() public static method

Returns a list of all synchornized user attributes

public static array getSyncAttributesByUser ( humhub\modules\user\models\User $user )
$user humhub\modules\user\models\User
return array

Attribute names

getUserByAuthClient() public static method

Returns the user object which is linked against given authClient

public static humhub\modules\user\models\User getUserByAuthClient ( \yii\authclient\ClientInterface $authClient )
$authClient \yii\authclient\ClientInterface

The authClient

return humhub\modules\user\models\User

The user model or null if not found

getUsersByAuthClient() public static method

Returns all users which are using an given authclient

public static \yii\db\ActiveQuery getUsersByAuthClient ( \yii\authclient\ClientInterface $authClient )
$authClient \yii\authclient\ClientInterface
removeAuthClientForUser() public static method

Removes Authclient for a user

public static void removeAuthClientForUser ( \yii\authclient\ClientInterface $authClient, humhub\modules\user\models\User $user )
$authClient \yii\authclient\BaseClient
$user humhub\modules\user\models\User
storeAuthClientForUser() public static method

Stores an authClient to an user record

public static void storeAuthClientForUser ( \yii\authclient\ClientInterface $authClient, humhub\modules\user\models\User $user )
$authClient \yii\authclient\BaseClient
$user humhub\modules\user\models\User
updateUser() public static method

Updates (or creates) a user in HumHub using AuthClients Attributes This method will be called after login or by cron sync.

public static boolean updateUser ( \yii\authclient\ClientInterface $authClient, humhub\modules\user\models\User $user null )
$authClient \yii\authclient\BaseClient
$user humhub\modules\user\models\User
return boolean

Succeed