Class JUserHelper

Description

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

  • abstract:
  • since: 11.1

Located in /libraries/joomla/user/helper.php (line 22)


	
			
Method Summary
static boolean activateUser (string $activation)
static mixed addUserToGroup (integer $userId, integer $groupId)
static string genRandomPassword ([integer $length = 8])
static string getCryptedPassword (string $plaintext, [string $salt = ''], [string $encryption = 'md5-hex'], [boolean $show_encrypt = false])
static string getSalt ([string $encryption = 'md5-hex'], [string $seed = ''], [string $plaintext = ''])
static mixed getUserGroups (integer $userId)
static integer getUserId (string $username)
static mixed removeUserFromGroup (integer $userId, integer $groupId)
static mixed setUserGroups (integer $userId, array $groups)
static string _bin (string $hex)
static string _toAPRMD5 (string $value, integer $count)
object getProfile ([integer $userId = 0])
Methods
static method activateUser (line 246)

Method to activate a user

  • return: True on success
  • since: 11.1
  • access: public
static boolean activateUser (string $activation)
  • string $activation: Activation string
static method addUserToGroup (line 34)

Method to add a user to a group.

  • return: Boolean true on success, Exception on error.
  • since: 11.1
  • access: public
static mixed addUserToGroup (integer $userId, integer $groupId)
  • integer $userId: The id of the user.
  • integer $groupId: The id of the group.
static method genRandomPassword (line 525)

Generate a random password

  • return: Random Password
  • since: 11.1
  • access: public
static string genRandomPassword ([integer $length = 8])
  • integer $length: Length of the password to generate
static method getCryptedPassword (line 323)

Formats a password using the current encryption.

  • return: The encrypted password.
  • since: 11.1
  • access: public
static string getCryptedPassword (string $plaintext, [string $salt = ''], [string $encryption = 'md5-hex'], [boolean $show_encrypt = false])
  • string $plaintext: The plaintext password to encrypt.
  • string $salt: The salt to use to encrypt the password. [] If not present, a new salt will be generated.
  • string $encryption: The kind of password encryption to use. Defaults to md5-hex.
  • boolean $show_encrypt: Some password systems prepend the kind of encryption to the crypted password ({SHA}, etc). Defaults to false.
static method getSalt (line 426)

Returns a salt for the appropriate kind of password encryption.

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.

  • return: The generated or extracted salt.
  • since: 11.1
  • access: public
static string getSalt ([string $encryption = 'md5-hex'], [string $seed = ''], [string $plaintext = ''])
  • string $encryption: The kind of password encryption to use. Defaults to md5-hex.
  • string $seed: The seed to get the salt from (probably a previously generated password). Defaults to generating a new seed.
  • string $plaintext: The plaintext password that we're generating a salt for. Defaults to none.
static method getUserGroups (line 96)

Method to get a list of groups a user is in.

  • return: Array on success, JException on error.
  • since: 11.1
  • access: public
static mixed getUserGroups (integer $userId)
  • integer $userId: The id of the user.
static method getUserId (line 294)

Returns userid if a user exists

  • return: The user id or 0 if not found.
  • since: 11.1
  • access: public
static integer getUserId (string $username)
  • string $username: The username to search on.
static method removeUserFromGroup (line 114)

Method to remove a user from a group.

  • return: Boolean true on success, JException on error.
  • since: 11.1
  • access: public
static mixed removeUserFromGroup (integer $userId, integer $groupId)
  • integer $userId: The id of the user.
  • integer $groupId: The id of the group.
static method setUserGroups (line 157)

Method to set the groups for a user.

  • return: Boolean true on success, Exception on error.
  • since: 11.1
  • access: public
static mixed setUserGroups (integer $userId, array $groups)
  • integer $userId: The id of the user.
  • array $groups: An array of group ids to put the user in.
static method _bin (line 583)

Converts hexadecimal string to binary data.

  • return: Binary data.
  • since: 11.1
  • access: private
static string _bin (string $hex)
  • string $hex: Hex data.
static method _toAPRMD5 (line 559)

Converts to allowed 64 characters for APRMD5 passwords.

  • return: converted to the 64 MD5 characters.
  • since: 11.1
  • access: protected
static string _toAPRMD5 (string $value, integer $count)
  • string $value: The value to convert.
  • integer $count: The number of characters to convert.
getProfile (line 216)

Gets the user profile information

  • since: 11.1
  • access: public
object getProfile ([integer $userId = 0])
  • integer $userId: The id of the user.

Documentation generated on Mon, 25 Jun 2012 13:55:23 -0500 by phpDocumentor 1.4.4