UserHelper
class UserHelper
Authorisation helper class, provides static methods to perform various tasks relevant to the Joomla user and authorisation classes
This class has influences and some method logic from the Horde Auth package
Methods
Method to add a user to a group.
Method to get a list of groups a user is in.
Method to remove a user from a group.
Method to set the groups for a user.
Gets the user profile information
Method to activate a user
Returns userid if a user exists
Hashes a password using the current encryption.
Formats a password using the current encryption. If the user ID is given and the hash does not fit the current hashing algorithm, it automatically updates the hash.
Formats a password using the old encryption methods.
Returns a salt for the appropriate kind of password encryption using the old encryption methods.
Generate a random password
Method to remove a cookie record from the database and the browser
Clear all expired tokens for all users.
Method to get the remember me cookie data
Method to get a hashed user agent string that does not include browser version.
Check if there is a super user in the user ids.
Details
static
boolean
removeUserFromGroup(
integer $userId,
integer $groupId)
Method to remove a user from a group.
static
string
hashPassword(
string $password,
integer $algorithm = PASSWORD_BCRYPT,
array $options = array())
Hashes a password using the current encryption.
static
boolean
verifyPassword(
string $password,
string $hash,
integer $user_id)
Formats a password using the current encryption. If the user ID is given and the hash does not fit the current hashing algorithm, it automatically updates the hash.
static
string
getCryptedPassword(
string $plaintext,
string $salt = '',
string $encryption = 'md5-hex',
boolean $show_encrypt = false)
Formats a password using the old encryption methods.
static
string
getSalt(
string $encryption = 'md5-hex',
string $seed = '',
string $plaintext = '')
Returns a salt for the appropriate kind of password encryption using the old encryption methods.
Optionally takes a seed and a plaintext password, to extract the seed of an existing password, or for encryption types that use the plaintext in the generation of the salt.
static
boolean
invalidateCookie(
string $userId,
string $cookieName)
Method to remove a cookie record from the database and the browser