DAViCal
|
Public Member Functions | |
__construct () | |
AuthFailedResponse ( $auth_header="") | |
BasicAuthSession () | |
DigestAuthSession () | |
ParseDigestHeader ($auth_header) | |
CheckPassword ( $username, $password) | |
AllowedTo ( $whatever) | |
GetRoles () | |
AssignSessionDetails ( $principal) | |
Public Attributes | |
$username | |
$user_no | |
$principal_id | |
$fullname | |
$groups | |
Definition at line 17 of file HTTPAuthSession.php.
HTTPAuthSession::__construct | ( | ) |
#- The constructor, which just calls the type supplied or configured
Definition at line 63 of file HTTPAuthSession.php.
HTTPAuthSession::AllowedTo | ( | $whatever | ) |
Checks whether a user is allowed to do something.
The check is performed to see if the user has that role.
string | $whatever | The role we want to know if the user has. |
Definition at line 350 of file HTTPAuthSession.php.
HTTPAuthSession::AssignSessionDetails | ( | $principal | ) |
Internal function used to assign the session details to a user's new session.
object | $u | The user+session object we (probably) read from the database. |
Definition at line 374 of file HTTPAuthSession.php.
HTTPAuthSession::AuthFailedResponse | ( | $auth_header = "" | ) |
Authorisation failed, so we send some headers to say so.
string | $auth_header | The WWW-Authenticate header details. |
Definition at line 85 of file HTTPAuthSession.php.
HTTPAuthSession::BasicAuthSession | ( | ) |
Handle Basic HTTP Authentication (not secure unless https)
Get HTTP Auth to work with PHP+FastCGI
The authentication has happened in the server, and we should accept it.
Since we still need to get the user's details from somewhere. We change the default authentication hook to auth_external which simply retrieves a user row from the DB and does no password checking.
Fall through to the normal PHP authentication variables.
Maybe some external authentication didn't return false for an inactive user, so we'll be pedantic here.
Definition at line 115 of file HTTPAuthSession.php.
HTTPAuthSession::CheckPassword | ( | $username, | |
$password | |||
) |
CheckPassword does all of the password checking and returns a user record object, or false if it all ends in tears.
The authenticate hook needs to:
It can expect that:
Definition at line 301 of file HTTPAuthSession.php.
HTTPAuthSession::DigestAuthSession | ( | ) |
Handle Digest HTTP Authentication (no passwords were harmed in this transaction!)
Note that this will not actually work, unless we can either: (A) store the password plain text in the database (B) store an md5( username || realm || password ) in the database
The problem is that potentially means that the administrator can collect the sorts of things people use as passwords. I believe this is quite a bad idea. In scenario (B) while they cannot see the password itself, they can see a hash which only varies when the password varies, so can see when two users have the same password, or can use some of the reverse lookup sites to attempt to reverse the hash. I think this is a less bad idea, but not ideal. Probably better than running Basic auth of HTTP though!
Definition at line 206 of file HTTPAuthSession.php.
HTTPAuthSession::GetRoles | ( | ) |
Internal function used to get the user's roles from the database.
Definition at line 358 of file HTTPAuthSession.php.
HTTPAuthSession::ParseDigestHeader | ( | $auth_header | ) |
Parse the HTTP Digest Auth Header
Definition at line 268 of file HTTPAuthSession.php.