On Fri, 2009-11-20 at 16:18 +0100, Norbert P?schel wrote:
> Hello,
>
> does anybody have a shell script that allows the creation of new users
> and their calendars from the shell?
I don't, but if you're looking at writing one I would write it so that
it called a PHP script for the actual creation.
In the PHP script I would include auth-functions.php and then construct
a $usr object so I could make a call to:
UpdateUserFromExternal( $usr );
which would do the updating, calendar creation and so forth.
The problem with writing it directly in a shell script is that it might
not continue to do the right thing as fields get added to the database
over time.
In particular, 0.9.8 will add a 'resourcetype' column to the collection
table, and the default value for that is not the appropriate value for a
calendar collection.
Similarly, at some point in the future a default addressbook collection
will be added to the stuff that gets created by default, and a user
creation shell script would again need to be updated to add that, unless
it called the PHP to do the update.
Cheers,
Andrew.
------------------------------------------------------------------------
andrew (AT) morphoss (DOT) com +64(272)DEBIAN
He is now rising from affluence to poverty.
-- Mark Twain
------------------------------------------------------------------------
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part
URL: <http://lists.morphoss.com/pipermail/davical-users/attachments/20091121/3e8f7486/attachment.pgp>
-------------- next part --------------
> Hello,
>
> does anybody have a shell script that allows the creation of new users
> and their calendars from the shell?
I don't, but if you're looking at writing one I would write it so that
it called a PHP script for the actual creation.
In the PHP script I would include auth-functions.php and then construct
a $usr object so I could make a call to:
UpdateUserFromExternal( $usr );
which would do the updating, calendar creation and so forth.
The problem with writing it directly in a shell script is that it might
not continue to do the right thing as fields get added to the database
over time.
In particular, 0.9.8 will add a 'resourcetype' column to the collection
table, and the default value for that is not the appropriate value for a
calendar collection.
Similarly, at some point in the future a default addressbook collection
will be added to the stuff that gets created by default, and a user
creation shell script would again need to be updated to add that, unless
it called the PHP to do the update.
Cheers,
Andrew.
------------------------------------------------------------------------
andrew (AT) morphoss (DOT) com +64(272)DEBIAN
He is now rising from affluence to poverty.
-- Mark Twain
------------------------------------------------------------------------
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part
URL: <http://lists.morphoss.com/pipermail/davical-users/attachments/20091121/3e8f7486/attachment.pgp>
-------------- next part --------------