When email addresses are used as user names in Davical, the

MacOS X 10.6 Addressbook cannot login to CardDav account. This
is caused by a bug in Addressbook URL parsing and cannot be
fixed on the client side. To allow "user@domainname" users to
login as "user" I created a patch which solves this problem
on server side.

There is a new configuration option:

$c->login_append_domain_if_missing

and if it is set to 1, then the "@$c->domain_name" is appended
to user login (before the authentication) if it not
contains @ character.

From 'mate' on IRC.
This commit is contained in:
Andrew McMillan 2011-08-28 16:35:42 +12:00
parent 4edb01930f
commit c0a64931a2

View File

@ -269,6 +269,9 @@ class HTTPAuthSession {
function CheckPassword( $username, $password ) {
global $c;
if(isset($c->login_append_domain_if_missing) && $c->login_append_domain_if_missing && !preg_match('/@/',$username))
$username.='@'.$c->domain_name;
if ( isset($c->authenticate_hook) && isset($c->authenticate_hook['call']) && function_exists($c->authenticate_hook['call']) ) {
/**
* The authenticate hook needs to: