auth.php
Contains functions used to do authentication.
Dependencies: functions/global.php functions/strings.php.
Given the challenge from the server, supply the response using cram-md5 (See RFC 2195 for details)
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 response.
Given the challenge from the server, calculate and return the response-string for digest-md5 authentication. (See RFC 2831 for more details)
Fillin user and password based on SMTP auth settings.
Creates a HMAC digest that can be used for authentication purposes See RFCs 2104, 2617, 2831
Uses PHP's Hash extension if available (enabled by default in PHP 5.1.2+ - see http://www.php.net/manual/en/hash.requirements.php or, if installed on earlier PHP versions, the PECL hash module - see http://pecl.php.net/package/hash
Otherwise, will attempt to use the Mhash extension - see http://www.php.net/manual/en/mhash.requirements.php
Finally, a fall-back custom implementation is used if none of the above are available.
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 PAGE_NAME in session and returns false. POST information is saved in 'session_expired_post' variable, PAGE_NAME is saved in 'session_expired_location'.
This function optionally checks the referrer of this page request. If the administrator wants to impose a check that the referrer of this page request is another page on the same domain (otherwise, the page request is likely the result of a XSS or phishing attack), then they need to specify the acceptable referrer domain in a variable named $check_referrer in config/config.php (or the configuration tool) for which the value is usually the same as the $domain setting (for example: $check_referrer = 'example.com'; However, in some cases (where proxy servers are in use, etc.), the acceptable referrer might be different. If $check_referrer is set to "###DOMAIN###", then the current value of $domain is used (useful in situations where $domain might change at runtime (when using the Login Manager plugin to host multiple domains with one SquirrelMail installation, for example)): $check_referrer = '###DOMAIN###'; NOTE HOWEVER, that referrer checks are not foolproof - they can be spoofed by browsers, and some browsers intentionally don't send them, in which case SquirrelMail silently ignores referrer checks.
Script that uses this function instead of is_logged_in() function, must handle user level messages.
Reads and decodes stored user password information
Direct access to password information is deprecated.
Saves or updates user password information
This function is used to update the password information that SquirrelMail stores in the existing PHP session. It does NOT modify the password stored in the authentication system used by the IMAP server.
This function must be called before any html output is started. Direct access to password information is deprecated. The saved password information is available only to the SquirrelMail script that is called/executed AFTER the current one. If your script needs access to the saved password after a sqauth_save_password() call, use the returned OTP encrypted key.
Documentation generated on Mon, 13 Jan 2020 04:22:01 +0100 by phpDocumentor 1.4.3