Class JAuthenticateHelper

Description

Authorization helper class, provides static methods to perform various tasks relevant to the Joomla authorization routines

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

Located in /application/user/authenticate.php (line 333)


	
			
Method Summary
 string genRandomPassword ([int $length = 8])
 string getCryptedPassword (string $plaintext, [string $salt = ''], [string $encryption = 'md5-hex'], [boolean $show_encrypt = false])
 string getSalt ([string $encryption = 'md5-hex'], [string $seed = ''], [string $plaintext = ''])
 boolean isAuthenticated ()
 boolean loadPlugin (string $plugin, object &$subject)
 string _bin (string $hex)
 boolean _checkRemoteAddr ()
 boolean _checkUserAgent ()
 string _toAPRMD5 (string $value, integer $count)
Methods
genRandomPassword (line 517)

Generate a random password

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

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 448)

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.
isAuthenticated (line 538)

Is there an authenticated user in the current session

  • return: True of authenticated user exists.
  • since: 1.1
  • access: public
boolean isAuthenticated ()
loadPlugin (line 654)

Static method to load an auth plugin and attach it to the JEventDispatcher object.

This method should be invoked as:

  $isLoaded = JAuthenticateHelper::loadPlugin($plugin, $subject);

  • return: True if plugin is loaded
  • since: 1.1
  • static:
  • access: public
boolean loadPlugin (string $plugin, object &$subject)
  • string $plugin: The authentication plugin to use.
  • object $subject: Observable object for the plugin to observe
_bin (line 630)

Converts hexadecimal string to binary data.

  • return: Binary data.
  • since: 1.1
  • access: private
string _bin (string $hex)
  • string $hex: Hex data.
_checkRemoteAddr (line 584)

Performs check on session to see if IP Address has changed since the last access.

  • return: True if IP Address is the same as the last access.
  • since: 1.1
  • access: private
boolean _checkRemoteAddr ()
_checkUserAgent (line 596)

Performs check on session to see if user agent has changed since the last access.

  • return: True if browser user agent is the same as the last access.
  • since: 1.1
  • access: private
boolean _checkUserAgent ()
_toAPRMD5 (line 609)

Converts to allowed 64 characters for APRMD5 passwords.

  • return: converted to the 64 MD5 characters.
  • since: 1.1
  • access: private
string _toAPRMD5 (string $value, integer $count)
  • string $value
  • integer $count

Documentation generated on Sat, 4 Feb 2006 14:22:42 +0100 by phpDocumentor 1.3.0RC4