UserWrapper
Wrapper class for UserHelper
| since |
3.4 |
|---|---|
| deprecated |
4.0 Use |
| package |
Joomla CMS |
Methods
activateUser
Helper wrapper method for activateUser
activateUser(string activation) : bool
| see | UserHelper::activateUser() |
|---|---|
| since |
3.4 |
| deprecated |
4.0 Use |
Arguments
- activation
stringActivation string
Response
boolTrue on success
addUserToGroup
Helper wrapper method for addUserToGroup
addUserToGroup(int userId, int groupId) : bool
| see | UserHelper::addUserToGroup() |
|---|---|
| since |
3.4 |
| throws |
|
| deprecated |
4.0 Use |
Arguments
- userId
intThe id of the user.- groupId
intThe id of the group.
Response
boolTrue on success
clearExpiredTokens
Helper wrapper method for clearExpiredTokens
clearExpiredTokens() : mixed
genRandomPassword
Helper wrapper method for genRandomPassword
genRandomPassword(int length = 8) : string
| see | UserHelper::genRandomPassword() |
|---|---|
| since |
3.4 |
| deprecated |
4.0 Use |
Arguments
- length
intLength of the password to generate
Response
stringRandom Password
getCryptedPassword
Helper wrapper method for getCryptedPassword
getCryptedPassword(string plaintext, string salt = '', string encryption = 'md5-hex', bool showEncrypt = false) : string
| see | UserHelper::getCryptedPassword() |
|---|---|
| since |
3.4 |
| deprecated |
4.0 |
Arguments
- plaintext
stringThe plaintext password to encrypt.- salt
stringThe salt to use to encrypt the password. [] If not present, a new salt will be generated.- encryption
stringThe kind of password encryption to use. Defaults to md5-hex.- showEncrypt
boolSome password systems prepend the kind of encryption to the crypted password ({SHA}, etc). Defaults to false.
Response
stringThe encrypted password.
getProfile
Helper wrapper method for getProfile
getProfile(int userId) : object
| see | UserHelper::getProfile() |
|---|---|
| since |
3.4 |
| deprecated |
4.0 Use |
Arguments
- userId
intThe id of the user.
Response
object
getRememberCookieData
Helper wrapper method for getRememberCookieData
getRememberCookieData() : mixed
| see | UserHelper::getRememberCookieData() |
|---|---|
| since |
3.4 |
| deprecated |
4.0 |
Response
mixedAn array of information from an authentication cookie or false if there is no cookie
getSalt
Helper wrapper method for getSalt
getSalt(string encryption = 'md5-hex', string seed = '', string plaintext = '') : string
| see | UserHelper::getSalt() |
|---|---|
| since |
3.4 |
| deprecated |
4.0 |
Arguments
- encryption
stringThe kind of password encryption to use. Defaults to md5-hex.- seed
stringThe seed to get the salt from (probably a previously generated password). Defaults to generating a new seed.- plaintext
stringThe plaintext password that we're generating a salt for. Defaults to none.
Response
stringThe generated or extracted salt.
getShortHashedUserAgent
Helper wrapper method for getShortHashedUserAgent
getShortHashedUserAgent() : string
| see | UserHelper::getShortHashedUserAgent() |
|---|---|
| since |
3.4 |
| deprecated |
4.0 Use |
Response
stringA hashed user agent string with version replaced by 'abcd'
getUserGroups
Helper wrapper method for getUserGroups
getUserGroups(int userId) : array
| see | UserHelper::addUserToGroup() |
|---|---|
| since |
3.4 |
| deprecated |
4.0 Use |
Arguments
- userId
intThe id of the user.
Response
arrayList of groups
getUserId
Helper wrapper method for getUserId
getUserId(string username) : int
| see | UserHelper::getUserId() |
|---|---|
| since |
3.4 |
| deprecated |
4.0 Use |
Arguments
- username
stringThe username to search on.
Response
intThe user id or 0 if not found.
hashPassword
Helper wrapper method for hashPassword
hashPassword(string password, int algorithm = PASSWORD_BCRYPT, array options = array()) : string
| see | UserHelper::hashPassword() |
|---|---|
| since |
3.4 |
| deprecated |
4.0 Use |
Arguments
- password
stringThe plaintext password to encrypt.- algorithm
intThe hashing algorithm to use, represented byPASSWORD_*constants.- options
arrayThe options for the algorithm to use.
Response
stringThe encrypted password.
invalidateCookie
Helper wrapper method for invalidateCookie
invalidateCookie(string userId, string cookieName) : bool
| see | UserHelper::invalidateCookie() |
|---|---|
| since |
3.4 |
| deprecated |
4.0 |
Arguments
- userId
stringUser ID for this user- cookieName
stringSeries id (cookie name decoded)
Response
boolTrue on success
removeUserFromGroup
Helper wrapper method for removeUserFromGroup
removeUserFromGroup(int userId, int groupId) : bool
| see | UserHelper::removeUserFromGroup() |
|---|---|
| since |
3.4 |
| deprecated |
4.0 Use |
Arguments
- userId
intThe id of the user.- groupId
intThe id of the group.
Response
boolTrue on success
setUserGroups
Helper wrapper method for setUserGroups
setUserGroups(int userId, array groups) : bool
| see | UserHelper::setUserGroups() |
|---|---|
| since |
3.4 |
| deprecated |
4.0 Use |
Arguments
- userId
intThe id of the user.- groups
arrayAn array of group ids to put the user in.
Response
boolTrue on success
verifyPassword
Helper wrapper method for verifyPassword
verifyPassword(string password, string hash, int userId) : bool
| see | UserHelper::verifyPassword() |
|---|---|
| since |
3.4 |
| deprecated |
4.0 Use |
Arguments
- password
stringThe plaintext password to check.- hash
stringThe hash to verify against.- userId
intID of the user if the password hash should be updated
Response
boolTrue if the password and hash match, false otherwise