Support Joomla!

Joomla! 1.5 Documentation

Packages

Package: Joomla-Framework

Developer Network License

The Joomla! Developer Network content is © copyright 2006 by the individual contributors and can be used in accordance with the Creative Commons License, Attribution- NonCommercial- ShareAlike 2.5

 Class JUserHelper

Description

Authorization helper class, provides static methods to perform various tasks relevant to the Joomla user and authorization classes

This class has influences and some method logic from the Horde Auth package

Located in /joomla/user/helper.php (line 27)

Class JUserHelper   (Subpackage User)
Method Summary
Static method static string genRandomPassword ([int $length = 8])
Method boolean activateUser (string $activation)
Method string getCryptedPassword (string $plaintext, [string $salt = ''], [string $encryption = 'md5-hex'], [boolean $show_encrypt = false])
Method string getSalt ([string $encryption = 'md5-hex'], [string $seed = ''], [string $plaintext = ''])
Method int getUserId (string $username)
Methods
activateUser (line 36)

Method to activate a user

  • return: True on success
  • since: 1.5
boolean activateUser (string $activation)
  • string $activation: Activation string
genRandomPassword (line 270)

Generate a random password

  • return: Random Password
  • since: 1.5
string genRandomPassword ([int $length = 8])
  • int $length: Length of the password to generate
getCryptedPassword (line 106)

Formats a password using the current encryption.

  • return: The encrypted password.
  • access: public
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 pasword 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.
getSalt (line 200)

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.
  • access: public
string getSalt ([string $encryption = 'md5-hex'], [string $seed = ''], [string $plaintext = ''])
  • string $encryption: The kind of pasword 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.
getUserId (line 80)

Returns userid if a user exists

  • return: The user id or 0 if not found
int getUserId (string $username)
  • string $username: The username to search on

Documentation generated on Mon, 05 Mar 2007 21:05:44 +0000 by phpDocumentor 1.3.1