Back to Joomla project (class list)

Class User - list of methods

User class. Handles all application interaction with a user

Extends

Package: Joomla\CMS\User
Copyright: (C) 2006 Open Source Matters, Inc.
License: GNU General Public License version 2 or later; see LICENSE.txt
Located at: Joomla/User/User.php
Project: Joomla

Method Summary

public
(mixed $identifier = 0)

Constructor activating the default information of the language
Parameters
  • int $identifier The primary key of the user to load (optional).
Since
  • 1.7.0
Show source code of this method: __construct Source Code

public static \Joomla\CMS\User\User
(mixed $identifier = 0)

Returns the global User object, only creating it if it doesn't already exist.
Parameters
  • int $identifier The primary key of the user to load (optional).
Returns
  • \Joomla\CMS\User\User The User object.
Since
  • 1.7.0
Deprecated
  • 5.0
Show source code of this method: getInstance Source Code

public mixed
(mixed $key, mixed $default = null)

Method to get a parameter value
Parameters
  • string $key Parameter key
  • mixed $default Parameter default value
Returns
  • mixed The value or the default if it did not exist
Since
  • 1.7.0
Show source code of this method: getParam Source Code

public mixed
(mixed $key, mixed $value)

Method to set a parameter
Parameters
  • string $key Parameter key
  • mixed $value Parameter value
Returns
  • mixed Set parameter value
Since
  • 1.7.0
Show source code of this method: setParam Source Code

public mixed
(mixed $key, mixed $value)

Method to set a default parameter if it does not exist
Parameters
  • string $key Parameter key
  • mixed $value Parameter value
Returns
  • mixed Set parameter value
Since
  • 1.7.0
Show source code of this method: defParam Source Code

public bool
(mixed $action, mixed $assetname = null)

Method to check User object authorisation against an access control object and optionally an access extension object
Parameters
  • string $action The name of the action to check for permission.
  • string $assetname The name of the asset on which to perform the action.
Returns
  • bool True if authorised
Since
  • 1.7.0
Show source code of this method: authorise Source Code

public array
(mixed $component, mixed $action)

Method to return a list of all categories that a user has permission for a given action
Parameters
  • string $component The component from which to retrieve the categories
  • string $action The name of the section within the component from which to retrieve the actions.
Returns
  • array List of categories that this group can do this action to (empty array if none). Categories must be published.
Since
  • 1.7.0
Show source code of this method: getAuthorisedCategories Source Code

public array
()

Gets an array of the authorised access levels for the user
Returns
  • array
Since
  • 1.7.0
Show source code of this method: getAuthorisedViewLevels Source Code

public array
()

Gets an array of the authorised user groups
Returns
  • array
Since
  • 1.7.0
Show source code of this method: getAuthorisedGroups Source Code

public void
()

Clears the access rights cache of this user
Returns
  • void
Since
  • 3.4.0
Show source code of this method: clearAccessRights Source Code

public bool
(mixed $timestamp = null)

Pass through method to the table for setting the last visit date
Parameters
  • int $timestamp The timestamp, defaults to 'now'.
Returns
  • bool True on success.
Since
  • 1.7.0
Show source code of this method: setLastVisit Source Code

public \DateTimeZone
()

Method to get the user timezone.
Returns
  • \DateTimeZone
Since
  • 3.7.0
Show source code of this method: getTimezone Source Code

public void
(mixed $params)

Method to get the user parameters
Parameters
  • object $params The user parameters object
Returns
  • void
Since
  • 1.7.0
Show source code of this method: setParameters Source Code

public static \Joomla\CMS\Table\Table
(mixed $type = null, mixed $prefix = 'JTable')

Method to get the user table object
Parameters
  • string $type The user table name to be used
  • string $prefix The user table prefix to be used
Returns
  • \Joomla\CMS\Table\Table The user table object
Since
  • 1.7.0
-
  • At 4.0 this method will no longer be static
Show source code of this method: getTable Source Code

public bool
(mixed &$array)

Method to bind an associative array of data to a user object
Parameters
  • array & $array The associative array to bind to the object
Returns
  • bool True on success
Since
  • 1.7.0
Show source code of this method: bind Source Code

public bool
(mixed $updateOnly = false)

Method to save the User object to the database
Parameters
  • bool $updateOnly Save the object only if not a new user Currently only used in the user reset password method.
Returns
  • bool True on success
Since
  • 1.7.0
-
  • \RuntimeException
Show source code of this method: save Source Code

public bool
()

Method to delete the User object from the database
Returns
  • bool True on success
Since
  • 1.7.0
Show source code of this method: delete Source Code

public bool
(mixed $id)

Method to load a User object by user id number
Parameters
  • mixed $id The user id of the user to load
Returns
  • bool True on success
Since
  • 1.7.0
Show source code of this method: load Source Code

public array
()

Method to allow serialize the object with minimal properties.
Returns
  • array The names of the properties to include in serialization.
Since
  • 3.6.0
Show source code of this method: __sleep Source Code

public void
()

Method to recover the full object on unserialize.
Returns
  • void
Since
  • 3.6.0
Show source code of this method: __wakeup Source Code

Properties Summary

protected bool
$isRoot
A cached switch for if this user has root access rights.
Since
  • 1.7.0
public int
$id
Unique id
Since
  • 1.7.0
public string
$name
The user's real name (or nickname)
Since
  • 1.7.0
public string
$username
The login name
Since
  • 1.7.0
public string
$email
The email
Since
  • 1.7.0
public string
$password
MD5 encrypted password
Since
  • 1.7.0
public string
$password_clear
Clear password, only available when a new password is set for a user
Since
  • 1.7.0
public int
$block
Block status
Since
  • 1.7.0
public int
$sendEmail
Should this user receive system email
Since
  • 1.7.0
public string
$registerDate
Date the user was registered
Since
  • 1.7.0
public string
$lastvisitDate
Date of last visit
Since
  • 1.7.0
public string
$activation
Activation hash
Since
  • 1.7.0
public \Joomla\Registry\Registry
$params
User parameters
Since
  • 1.7.0
public array
$groups
Associative array of user names => group ids
Since
  • 1.7.0
public int
$guest
Guest status
Since
  • 1.7.0
public string
$lastResetTime
Last Reset Time
Since
  • 3.0.1
public int
$resetCount
Count since last Reset Time
Since
  • 3.0.1
public int
$requireReset
Flag to require the user's password be reset
Since
  • 3.2
protected \Joomla\Registry\Registry
$_params
User parameters
Since
  • 1.7.0
protected array
$_authGroups
Authorised access groups
Since
  • 1.7.0
protected array
$_authLevels
Authorised access levels
Since
  • 1.7.0
protected array
$_authActions
Authorised access actions
Since
  • 1.7.0
protected string
$_errorMsg
Error message
Since
  • 1.7.0
protected static array
$instances
Since
  • 1.7.3

Tags Summary

Since
1.7.0