Mailing List Archive

adding DAViCal users from an external system
Hello,

We are using de CalDAVClient.php to administer our events.
Is there a similar elegant way to administer DAViCal users?

Cheers,
Ewout
_______________________________________________
DAViCal-dev mailing list
DAViCal-dev@lists.davical.org
http://lists.davical.org/listinfo/davical-dev
Re: adding DAViCal users from an external system [ In reply to ]
Hey Ewout,

Davical offers an authentication hook you can easily use:

http://wiki.davical.org/w/Configuration/hooks/Authentication

The Wiki doesn't show a custom auth, but it's basically something like the following...

config.php:
require_once('/path/to/your/custom/authfile.php');
$c->authenticate_hook['optional'] = false; // Don't fall back to Davical auth
$c->authenticate_hook['call'] = 'MyAuthFunction'; // Name of your custom function

authfile.php:
function MyAuthFunction($username, $password)
{
// Do your authentication
$myUser = DoSomeMagicThing();

// Check some stuff like
// Create/Update Davical user and create home collection
// Fetch the corresponding Davical user
$davUser = DoSomeMoreMagic($myUser);

return $davUser;
}

See the Wiki, Docs and comments in Davical's auth-functions.php. It takes some time to dug into the stuff, but then it's quite easy at the end. :)

Cheers
Matthias


_______________________________________________
DAViCal-dev mailing list
DAViCal-dev@lists.davical.org
http://lists.davical.org/listinfo/davical-dev
Re: adding DAViCal users from an external system [ In reply to ]
Hey Daniel,

I haven't worked with custom fields yet, but I had some brainstorming on the topic:

>ensuring that DAViCal will persist the field name and value in the
>database - does the DB support arbitrary attribute/value pairs, or must
>a new column be created for each X-<something>?
Davical is storing the whole VCALENDAR as a single plain text field in 'caldav_data' and parses all the RFC fields into 'calendar_item'. So any X-field will just be in the database and not get touched by Davical. (Hoping to not tell any bulls***, but Andrew can correct me in that case. ^^)

>making some kind of user accessible report based on custom fields (or
even reporting against the standard fields)
With the above this will be tricky as you cannot access the custom fields directly. For a report you could still fetch all the data and parse them in PHP for reporting. The RFC fields are directly queryable in the DB.

>adding the field to the windows in Lightning
Dunno if this is possible without custom builds.


My main concern with custom fields is that you cannot rely on them, if they are filled from external sources as you simply can add what you're up to... but this depends on the scenario you're trying to cover.

Cheers
Matthias
_______________________________________________
DAViCal-dev mailing list
DAViCal-dev@lists.davical.org
http://lists.davical.org/listinfo/davical-dev