Class humhub\modules\user\components\User

Inheritancehumhub\modules\user\components\User » yii\web\User

Description of User

Constants

Hide inherited constants

ConstantValueDescriptionDefined By
EVENT_BEFORE_SWITCH_IDENTITY 'beforeSwitchIdentity' humhub\modules\user\components\User

Property Details

$permissionManager protected property

Method Details

afterLogin() public method

public void afterLogin ( $identity, $cookieBased, $duration )
$identity
$cookieBased
$duration
can() public method (available since version 1.2)

Verifies global GroupPermissions of this User component.

The following example checks if this User is granted the GroupPermission

if(Yii::$app->user->can(MyGroupPermission::class) {
  // ...
}

See also humhub\modules\user\components\PermissionManager::can().

public boolean can ( $permission, $params = [], $allowCaching true )
$permission string|string[]|\humhub\modules\user\components\BasePermission
$params
$allowCaching
throws \yii\base\InvalidConfigException
throws Throwable
canChangeEmail() public method

Determines if this user is able to change the email address.

public boolean canChangeEmail ( )
throws Throwable
canChangePassword() public method

Determines if this user is able to change the password.

public boolean canChangePassword ( )
canChangeUsername() public method

Determines if this user is able to change his username.

public boolean canChangeUsername ( )
throws Throwable
canDeleteAccount() public method

Determines if this user is able to delete his account.

public boolean canDeleteAccount ( )
getAuthClients() public method

public void getAuthClients ( )
getCurrentAuthClient() public method

public void getCurrentAuthClient ( )
getGuid() public method

public void getGuid ( )
getLanguage() public method

public void getLanguage ( )
getPermissionManager() public method

public humhub\modules\user\components\PermissionManager getPermissionManager ( )
return humhub\modules\user\components\PermissionManager

Instance with the related identity instance as permission subject.

throws Throwable
getTimeZone() public method

public void getTimeZone ( )
isAdmin() public method

public void isAdmin ( )
isGuestAccessEnabled() public static method
Deprecated since 1.4

Checks if the system configuration allows access for guests

public static boolean isGuestAccessEnabled ( )
return boolean

Is guest access enabled and allowed

setCurrentAuthClient() public method

public void setCurrentAuthClient ( \yii\authclient\ClientInterface $authClient )
$authClient
switchIdentity() public method

public void switchIdentity ( $identity, $duration 0 )
$identity
$duration