Class humhub\modules\user\models\User

Inheritancehumhub\modules\user\models\User » humhub\modules\content\components\ContentContainerActiveRecord » humhub\components\ActiveRecord » yii\db\ActiveRecord
ImplementsSerializable, humhub\modules\search\interfaces\Searchable, yii\web\IdentityInterface
Subclasseshumhub\modules\admin\models\UserApprovalSearch, humhub\modules\admin\models\UserSearch, humhub\modules\admin\models\forms\UserEditForm, humhub\modules\user\models\UserFilter

This is the model class for table "user".

Public Methods

Hide inherited methods

MethodDescriptionDefined By
__get() humhub\modules\user\models\User
afterDelete() humhub\modules\content\components\ContentContainerActiveRecord
afterSave() After Save Addons humhub\modules\user\models\User
attributeLabels() humhub\modules\user\models\User
beforeDelete() Before Delete of a User humhub\modules\user\models\User
beforeSave() Before Save Addons humhub\modules\user\models\User
behaviors() humhub\modules\user\models\User
can() Checks if the current user has the given Permission on this ContentContainerActiveRecord. humhub\modules\content\components\ContentContainerActiveRecord
canAccessPrivateContent() Checks if the user is allowed to access private content in this container humhub\modules\user\models\User
canApproveUsers() User can approve other users humhub\modules\user\models\User
createUrl() Creates url in content container scope. humhub\modules\content\components\ContentContainerActiveRecord
find() humhub\modules\user\models\User
findByGuid() humhub\modules\content\components\ContentContainerActiveRecord
findIdentity() humhub\modules\user\models\User
findIdentityByAccessToken() humhub\modules\user\models\User
getAuthKey() humhub\modules\user\models\User
getAuths() humhub\modules\user\models\User
getContentContainerRecord() Returns the related ContentContainer model (e.g. Space or User) humhub\modules\content\components\ContentContainerActiveRecord
getCreatedBy() Relation to User defined in created_by attribute humhub\components\ActiveRecord
getCurrentPassword() humhub\modules\user\models\User
getDefaultContentVisibility() humhub\modules\user\models\User
getDisplayName() Returns users display name humhub\modules\user\models\User
getDisplayNameSub() Returns the users display name sub text. humhub\modules\user\models\User
getErrorMessage() Returns the errors as string for all attribute or a single attribute. humhub\components\ActiveRecord
getFileManager() Returns the file manager for this record humhub\components\ActiveRecord
getFriends() Returns all user this user is related as friend as ActiveQuery. humhub\modules\user\models\User
getGroupUsers() Returns all GroupUser relations of this user as ActiveQuery humhub\modules\user\models\User
getGroups() Returns all Group relations of this user as ActiveQuery humhub\modules\user\models\User
getHttpSessions() humhub\modules\user\models\User
getId() humhub\modules\user\models\User
getManagerGroups() Returns all Groups this user is a maanger of as ActiveQuery. humhub\modules\user\models\User
getManagerGroupsUser() Returns all GroupUser relations this user is a manager of as ActiveQuery. humhub\modules\user\models\User
getModuleManager() Returns a ModuleManager humhub\modules\content\components\ContentContainerActiveRecord
getPermissionManager() Returns a ContentContainerPermissionManager instance for this ContentContainerActiveRecord as permission object and the given user (or current user if not given) as permission subject. humhub\modules\content\components\ContentContainerActiveRecord
getProfile() humhub\modules\user\models\User
getProfileBannerImage() Returns the Profile Banner Image Object for this Content Base humhub\modules\content\components\ContentContainerActiveRecord
getProfileImage() Returns the Profile Image Object for this Content Base humhub\modules\content\components\ContentContainerActiveRecord
getSearchAttributes() Returns an array of informations used by search subsystem. humhub\modules\user\models\User
getSpaces() humhub\modules\user\models\User
getTags() Returns an array with assigned Tags humhub\modules\user\models\User
getUniqueId() Returns a unique id for this record/model humhub\components\ActiveRecord
getUpdatedBy() Relation to User defined in updated_by attribute humhub\components\ActiveRecord
getUrl() Should be overwritten by implementation humhub\modules\content\components\ContentContainerActiveRecord
getUserGroup() TODO: deprecated humhub\modules\user\models\User
getUserGroups() Returns user groups humhub\modules\content\components\ContentContainerActiveRecord
getWallOut() Returns the wall output for this content container. humhub\modules\user\models\User
hasGroup() Checks if the user has at least one group assigned. humhub\modules\user\models\User
hasTags() Checks if user has tags humhub\modules\user\models\User
is() Checks if the given $user instance shares the same identity with this user instance. humhub\modules\user\models\User
isActive() humhub\modules\user\models\User
isArchived() Returns weather or not the contentcontainer is archived. (Default false). humhub\modules\content\components\ContentContainerActiveRecord
isCurrentUser() Checks if this user is the current logged in user. humhub\modules\user\models\User
isSystemAdmin() Checks if user is system administrator humhub\modules\user\models\User
isVisible() Specifies whether the user should appear in user lists or in the search. humhub\modules\user\models\User
isVisibleFor() Checks the current visibility setting of this ContentContainerActiveRecord humhub\modules\content\components\ContentContainerActiveRecord
rules() humhub\modules\user\models\User
scenarios() humhub\modules\user\models\User
serialize() Serializes attributes and oldAttributes of this record. humhub\components\ActiveRecord
setUpApproved() humhub\modules\user\models\User
softDelete() humhub\modules\user\models\User
tableName() humhub\modules\user\models\User
unserialize() Unserializes the given string, calls the init() function and sets the attributes and oldAttributes. humhub\components\ActiveRecord
updateSearch() Update user record in search index humhub\modules\user\models\User
validateAuthKey() humhub\modules\user\models\User

Events

Hide inherited events

EventTypeDescriptionDefined By
EVENT_BEFORE_SOFT_DELETE humhub\modules\user\events\UserEvent An event that is triggered when the user is soft deleted (without contents) and also before complete deletion. humhub\modules\user\models\User
EVENT_CHECK_VISIBILITY \humhub\modules\user\models\Event An event that is triggered when the user visibility is checked via isVisible(). humhub\modules\user\models\User

Constants

Hide inherited constants

ConstantValueDescriptionDefined By
STATUS_DISABLED 0 User Status Flags humhub\modules\user\models\User
STATUS_ENABLED 1 humhub\modules\user\models\User
STATUS_NEED_APPROVAL 2 humhub\modules\user\models\User
STATUS_SOFT_DELETED 3 humhub\modules\user\models\User
USERGROUP_FRIEND 'u_friend' humhub\modules\user\models\User
USERGROUP_GUEST 'u_guest' humhub\modules\user\models\User
USERGROUP_SELF 'u_self' User Groups humhub\modules\user\models\User
USERGROUP_USER 'u_user' humhub\modules\user\models\User
VISIBILITY_ALL 2 humhub\modules\user\models\User
VISIBILITY_REGISTERED_ONLY 1 Visibility Modes humhub\modules\user\models\User

Property Details

$controllerBehavior public property

Class name of additional the controller behavior

public string $controllerBehavior = \humhub\modules\user\behaviors\ProfileController::class
$defaultRoute public property
public string $defaultRoute '/user/profile'
$registrationGroupId public property

Method Details

__get() public method

public void __get ( $name )
$name
afterSave() public method

After Save Addons

public void afterSave ( $insert, $changedAttributes )
$insert
$changedAttributes
attributeLabels() public method

public void attributeLabels ( )
beforeDelete() public method

Before Delete of a User

public void beforeDelete ( )
beforeSave() public method

Before Save Addons

public boolean beforeSave ( $insert )
$insert boolean
behaviors() public method

public void behaviors ( )
canAccessPrivateContent() public method

Checks if the user is allowed to access private content in this container

public boolean canAccessPrivateContent ( humhub\modules\user\models\User $user null )
$user humhub\modules\user\models\User
return boolean

Can access private content

canApproveUsers() public method

User can approve other users

public boolean canApproveUsers ( )
find() public static method

public static humhub\modules\user\components\ActiveQueryUser find ( )
findIdentity() public static method

public static void findIdentity ( $id )
$id
findIdentityByAccessToken() public static method

public static void findIdentityByAccessToken ( $token, $type null )
$token
$type
getAuthKey() public method

public void getAuthKey ( )
getAuths() public method

public \yii\db\ActiveQuery getAuths ( )
getCurrentPassword() public method

public void getCurrentPassword ( )
getDefaultContentVisibility() public method

public void getDefaultContentVisibility ( )
getDisplayName() public method

Returns users display name

public string getDisplayName ( )
return string

The users display name (e.g. firstname + lastname)

getDisplayNameSub() public method

Returns the users display name sub text.

Per default as sub text the 'title' profile attribute is used

public string getDisplayNameSub ( )
return string

The display name sub text

getFriends() public method

Returns all user this user is related as friend as ActiveQuery.

Returns null if the friendship module is deactivated.

public \yii\db\ActiveQuery getFriends ( )
getGroupUsers() public method

Returns all GroupUser relations of this user as ActiveQuery

public \yii\db\ActiveQuery getGroupUsers ( )
getGroups() public method

Returns all Group relations of this user as ActiveQuery

public \yii\db\ActiveQuery getGroups ( )
getHttpSessions() public method

public \yii\db\ActiveQuery getHttpSessions ( )
getId() public method

public void getId ( )
getManagerGroups() public method

Returns all Groups this user is a maanger of as ActiveQuery.

public \yii\db\ActiveQuery getManagerGroups ( )
getManagerGroupsUser() public method

Returns all GroupUser relations this user is a manager of as ActiveQuery.

public \yii\db\ActiveQuery getManagerGroupsUser ( )
getProfile() public method

public void getProfile ( )
getSearchAttributes() public method

Returns an array of informations used by search subsystem.

Function is defined in interface ISearchable

public array getSearchAttributes ( )
getSpaces() public method

public \yii\db\ActiveQuery getSpaces ( )
getTags() public method

Returns an array with assigned Tags

public array getTags ( )
return array

Tags

getUserGroup() public method

TODO: deprecated

public string getUserGroup ( humhub\modules\user\models\User $user null )
$user humhub\modules\user\models\User|null
getWallOut() public method

Returns the wall output for this content container.

This is e.g. used in search results.

public string getWallOut ( )
hasGroup() public method

Checks if the user has at least one group assigned.

public boolean hasGroup ( )
hasTags() public method

Checks if user has tags

public boolean hasTags ( )
return boolean

Has tags set

is() public method

Checks if the given $user instance shares the same identity with this user instance.

public boolean is ( humhub\modules\user\models\User $user null )
$user humhub\modules\user\models\User
isActive() public method

public boolean isActive ( )
return boolean

True if the user status is enabled else false

isCurrentUser() public method

Checks if this user is the current logged in user.

public void isCurrentUser ( )
isSystemAdmin() public method

Checks if user is system administrator

public boolean isSystemAdmin ( $cached true )
$cached boolean

Used cached result if available

return boolean

User is system admin

isVisible() public method (available since version 1.2.3)

Specifies whether the user should appear in user lists or in the search.

public boolean isVisible ( )
return boolean

Is visible

rules() public method

public void rules ( )
scenarios() public method

public void scenarios ( )
setUpApproved() public method

public void setUpApproved ( )
softDelete() public method (available since version 1.3)

public void softDelete ( )
throws \yii\base\Exception
tableName() public static method

public static void tableName ( )
updateSearch() public method

Update user record in search index

If the user is not visible, the user will be removed from the search index.

public void updateSearch ( )
validateAuthKey() public method

public void validateAuthKey ( $authKey )
$authKey

Event Details

EVENT_BEFORE_SOFT_DELETE event of type humhub\modules\user\events\UserEvent

An event that is triggered when the user is soft deleted (without contents) and also before complete deletion.

EVENT_CHECK_VISIBILITY event of type \humhub\modules\user\models\Event

An event that is triggered when the user visibility is checked via isVisible().