41 Commits

Author SHA1 Message Date
Till Schäfer
26bab04599 replace php4 style constructors with __construct 2018-03-21 16:59:35 +01:00
Florian Schlichting
528f4dd62d add a log entry for login failures (fix #105) 2017-10-04 22:36:33 +02:00
Florian Schlichting
c305bef787 $principal->fullname is not a method (fixes #101) 2017-01-01 12:35:45 +01:00
Florian Schlichting
bd9d5eacf2 $session: document ->username, actually implement ->fullname 2016-12-31 15:15:33 +01:00
Florian Schlichting
eb7f2edc0c eliminate trailing whitespace, expand tabs 2016-12-30 08:52:44 +01:00
Timothy Brown
356c995aa3 Bugfix on Basic Auth username/password split.
Basic Auth uses a colon (":") to separate the username and
password values. Using the php 'explode' function on this
string without limiting the number of substrings returned
can truncate the users password if it contains a colon.
By limiting the explode to 2, we get back the username and
whatever else is left as the password (hence not truncated).
2014-12-29 13:04:17 -07:00
Christoph Anton Mitterer
35e471013b support Apache’s REDIRECT_REMOTE_USER CGI env var
* In places where the CGI variable REMOTE_USER is read, support alternatively
  REDIRECT_REMOTE_USER, which is used by the Apache HTTPD Server instead, when a
  redirect was used.

Note: This alone is not enough yet, to fully support it in DAViCal. An analogous
      change (commit 29ddd89baaf65bda2560e51665a2e761abef4147) is necessary in
      AWL.
2013-09-02 14:53:33 +12:00
Christoph Anton Mitterer
82757beba4 RFC compliant CGI AUTH_TYPE usage
* Handle the content of the CGI AUTH_TYPE variable case-insensitively as defined
  by RFC 3875 Section 4.1.1.
2013-09-02 14:53:12 +12:00
Andrew McMillan
5ace348339 Replace deprecated split() with explode() 2012-07-31 22:12:08 +12:00
Andrew McMillan
863b4ac87f Remove chance of unset variable warning. 2012-03-16 12:57:56 +13:00
Andrew McMillan
45eb571c15 Probably a smidgin more efficient this way around. 2012-01-14 19:10:09 +13:00
Andrew McMillan
c48d19895e Support use of HTTP_AUTHORIZATION in addition to AUTHORIZATION cgi.
This is supplied by older versions of FastCGI.
2012-01-12 14:01:44 +13:00
Andrew McMillan
b50b2d82ea Force output buffers to be flushed, if they're turned on.
If output buffering is turned on, PHP can be a bit slack about sending
the data to the client before closing the connection with exit(). These
changes ensure we call ob_flush() before we leave.  We call @ob_flush()
so we don't get noisy warnings when output buffering is off...
2011-11-02 18:43:10 +13:00
Andrew McMillan
fc0db0e23b Fix handling of active flag for general external authentication mechanisms. 2011-11-01 17:47:06 +13:00
Andrew McMillan
3067f367d2 Formatting. 2011-10-18 16:40:17 +13:00
Andrew McMillan
63f359d907 Support an array of server_auth_type since Kerberos can send different ones. 2011-10-16 12:03:48 +13:00
Andrew McMillan
32662509e9 When external authentication is optional, check internal first.
Internal authentication will always succeed or fail quickly, whereas
external auth may fail slowly, so we check the known quick failure case
first.
2011-09-24 14:31:00 +12:00
Andrew McMillan
c0a64931a2 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.
2011-08-28 16:35:42 +12:00
Andrew McMillan
086c7e5f12 Debugging, but commented out in case it's needed in the future. 2011-05-13 14:54:28 +12:00
Andrew McMillan
48f83e7c92 Reinstate Basic Auth fallback disabled for testing.
Signed-off-by: Andrew McMillan <andrew@morphoss.com>
2011-04-03 21:36:13 +12:00
Andrew McMillan
ba1e80d185 Add support for Digest authentication.
Signed-off-by: Andrew McMillan <andrew@morphoss.com>
2011-04-03 20:38:46 +12:00
Andrew McMillan
775ccceb58 Move debug logged password behind specific 'password' debug setting.
Signed-off-by: Andrew McMillan <andrew@morphoss.com>
2011-01-04 23:22:49 +13:00
Andrew McMillan
20ee255898 Refactor fetching of Principal records from database.
This is a significant refactoring, replacing the old getUserBy*()
functions with a new Principal class, and replacing the old
CalDAVPrincipal class with a new DAVPrincipal class which extends
the Principal class.

At this point all regression tests pass (again) but there could
well be issues for people who use alternative authenticators
such as LDAP, although I have endeavoured to resolve those
potential issues.

Signed-off-by: Andrew McMillan <andrew@morphoss.com>
2011-01-03 10:16:43 +13:00
Andrew McMillan
9f8d4b4346 Actually use new calculated per principal auth_realm.
Signed-off-by: Andrew McMillan <andrew@morphoss.com>
2010-12-30 18:59:19 +13:00
Andrew McMillan
5c0dd64d68 Let auth realm be 'per Principal' to work around Mozilla #247486
Signed-off-by: Andrew McMillan <andrew@morphoss.com>
2010-12-30 12:41:49 +13:00
Andrew McMillan
413618749c Be pedantic about checking user is active before we let them in. 2010-11-27 16:42:22 +13:00
Andrew McMillan
f644a31f9b Avoid potential unassigned variable warning. 2010-06-27 19:06:27 +12:00
Andrew McMillan
b296151724 Re-read local database record if the remote auth did not supply principal_id 2010-06-21 10:56:01 +12:00
Andrew McMillan
8958e99d37 Inactive users should not still be able to access their calendars. 2010-04-13 03:45:00 +12:00
Andrew McMillan
5bc17b0acd Switch to AwlQuery library. 2010-03-17 20:20:33 +13:00
Andrew McMillan
a6d692cde9 Switch always.php over to AwlQuery. 2010-03-04 01:39:40 +13:00
Andrew McMillan
3df6ccc4ba Getting 'MOVE' working has proven surprisingly complex. 2009-11-04 00:17:10 +13:00
Andrew McMillan
a4aedbef05 Add option for auth hook optionality - patch from Wolfgang Herget. 2009-10-06 18:17:17 +13:00
Andrew McMillan
066ae3f4e3 Release 0.9.6 2008-11-01 23:08:41 +13:00
Andrew McMillan
ff87efdc1d Use @todo: everywhere for phpdocumentor syntax. 2008-11-01 19:27:33 +13:00
Andrew McMillan
3acdc1eb7f Allow authentication to be configured as optional. 2008-10-25 16:52:20 +13:00
Andrew McMillan
5c8cfa4031 Rename @package to davical. 2008-09-18 12:03:00 +12:00
Andrew McMillan
8aebded95d Allow for authentication to happen externally to DAViCal. 2008-07-12 23:12:54 +12:00
Andrew McMillan
83cabf87ce Fix to work with FastCGI installation. 2008-01-21 16:01:32 +13:00
Andrew McMillan
1d1f987233 Ensure that we have a default auth mode. 2007-10-25 15:20:18 +13:00
Andrew McMillan
6b1286cf5b Add a framework for supporting Digest authentication. 2007-08-07 22:42:27 +12:00