/functions/auth.php

Description

auth.php

Contains functions used to do authentication.

Dependencies: functions/global.php functions/strings.php.

Functions
cram_md5_response (line 105)

Given the challenge from the server, supply the response using cram-md5 (See RFC 2195 for details)

  • return: The response to be sent to the IMAP server
  • since: 1.4.0
string cram_md5_response (string $username, string $password, string $challenge)
  • string $username: User ID
  • string $password: User password supplied by User
  • string $challenge: The challenge supplied by the server
digest_md5_parse_challenge (line 183)

Parse Digest-MD5 challenge.

This function parses the challenge sent during DIGEST-MD5 authentication and returns an array. See the RFC for details on what's in the challenge string.

  • return: Digest-MD5 challenge decoded data
  • since: 1.4.0
array digest_md5_parse_challenge (string $challenge)
  • string $challenge: Digest-MD5 Challenge
digest_md5_response (line 128)

Return Digest-MD5 response.

Given the challenge from the server, calculate and return the response-string for digest-md5 authentication. (See RFC 2831 for more details)

  • return: The response to be sent to the IMAP server
  • since: 1.4.0
string digest_md5_response (string $username, string $password, string $challenge, string $service, string $host)
  • string $username: User ID
  • string $password: User password supplied by User
  • string $challenge: The challenge supplied by the server
  • string $service: The service name, usually 'imap'; it is used to define the digest-uri.
  • string $host: The host name, usually the server's FQDN; it is used to define the digest-uri.
get_smtp_user (line 260)

Fillin user and password based on SMTP auth settings.

  • since: 1.5.0
void get_smtp_user ( &$user,  &$pass, string $user, string $pass)
  • string $user: Reference to SMTP username
  • string $pass: Reference to SMTP password (unencrypted)
  • &$user
  • &$pass
hmac_md5 (line 230)

Creates a HMAC digest that can be used for auth purposes See RFCs 2104, 2617, 2831 Uses mhash() extension if available

  • return: HMAC Digest string
  • since: 1.4.0
string hmac_md5 (string $data, [string $key = ''])
  • string $data: Data to apply hash function to.
  • string $key: Optional key, which, if supplied, will be used to calculate data's HMAC.
sqauth_is_logged_in (line 32)

Detect whether user is logged in

Function is similar to is_logged_in() function. If user is logged in, function returns true. If user is not logged in or session is expired, function saves $_POST and $PHP_SELF in session and returns false. POST information is saved in 'session_expired_post' variable, PHP_SELF is saved in 'session_expired_location'.

Script that uses this function instead of is_logged_in() function, must handle user level messages.

  • since: 1.5.1
boolean sqauth_is_logged_in ()
sqauth_read_password (line 61)

Reads and decodes stored user password information

Direct access to password information is deprecated.

  • return: password in plain text
  • since: 1.5.1
string sqauth_read_password ()
sqauth_save_password (line 85)

Saves or updates user password information

This function is used to update password information that SquirrelMail stores during existing web session. It does not modify password stored in authentication system used by IMAP server.

Function must be called before any html output started. Direct access to password information is deprecated. Saved password information is available only to next executed SquirrelMail script. If your script needs access to saved password after sqauth_save_password() call, use returned OTP encrypted key.

  • return: password encrypted with OTP. In case script wants to access password information before reloading page.
  • since: 1.5.1
string sqauth_save_password (string $pass)
  • string $pass: password

Documentation generated on Sat, 07 Oct 2006 16:08:56 +0300 by phpDocumentor 1.3.0RC6