Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: DAViCal: General

default collections are not created for new prinipals

 

 

DAViCal general RSS feed   Index | Next | Previous | View Threaded


cs at mail

Jun 6, 2012, 12:35 PM

Post #1 of 3 (265 views)
Permalink
default collections are not created for new prinipals

so, now from the correct mailaddress and complete, I hope:

tested with 1.0.2 and todays git (2012-06-06) on debian squeeze amd64

Hello List

The default collections (calendar and addressbook) are not created
anymore when a new pricipal is created. I tracked it down to function
CreateHomeCollections in auth-functions.php. If either is_calendar or
is_addressbook is set to false it will result in a null sting and the
sql command will fail.
Changing false to 0 on line 97 and 127 in version 1.0.2 or line 113 and
114 in todays git version seems to resolves the problem but I'm not sure
if this is the real solution.
I don't have a clue in php programming, but I'm wondering if this
peculiar behavior of false resulting in a null string is intended in php
or just an error in debian squeezes php. I suppose true and false are
build in values in php without further investigating.

So the next question is, is this constuct really working:
...
$qry = new AwlQuery( $sql, $params );
if ( $qry->Exec() ) {
...
else {
...
...
since the sql insert obviously fails, but it is reported that the
collection has actually been created.
Help me out here please to understand a bit php code:
I suppose 'new AwlQuery( $sql, $params )' returns an object to $qry,
but what does '$qry->Exec()' do?

Greetings, Chris
Attachments: auth-functions.php_1.0.2.patch (0.99 KB)
  auth-functions.php_git2012-06-06.patch (1.18 KB)


c_schwamborn at web

Jun 6, 2012, 7:58 AM

Post #2 of 3 (251 views)
Permalink
default collections are not created for new prinipals [In reply to]

tested with 1.0.2 and todays git (2012-06-06) on debian squeeze amd64

The default collections (calendar and addressbook) are not created
anymore when a new pricipal is created. I tracked it down to function
CreateHomeCollections in auth-functions.php. If either is_calendar or
is_addressbook is set to false it will result in a null sting and the
sql command will fail.
Changing false to 0 on line 97 and 127 in version 1.0.2 or line 113 and
114 in todays git version seems to resolves the problem but I'm not sure
if this is the real solution.
I don't have a clue in php programming, but I'm wondering if this
peculiar behavior of false resulting in a null string is intended in php
or just an error in debian squeezes php. I suppose true and false are
build in values in php without further investigating.

Greetings, Chris
Attachments: auth-functions.php_1.0.2.patch (0.99 KB)
  auth-functions.php_git2012-06-06.patch (1.18 KB)


andrew at morphoss

Jun 10, 2012, 12:15 AM

Post #3 of 3 (234 views)
Permalink
Re: default collections are not created for new prinipals [In reply to]

On Wed, 2012-06-06 at 21:35 +0200, Christian Schwamborn wrote:
> so, now from the correct mailaddress and complete, I hope:
>
> tested with 1.0.2 and todays git (2012-06-06) on debian squeeze amd64
>
> Hello List

Hi,

Thanks for the problem report...

> The default collections (calendar and addressbook) are not created
> anymore when a new pricipal is created. I tracked it down to function
> CreateHomeCollections in auth-functions.php. If either is_calendar or
> is_addressbook is set to false it will result in a null sting and the
> sql command will fail.
> Changing false to 0 on line 97 and 127 in version 1.0.2 or line 113 and
> 114 in todays git version seems to resolves the problem but I'm not sure
> if this is the real solution.
> I don't have a clue in php programming, but I'm wondering if this
> peculiar behavior of false resulting in a null string is intended in php
> or just an error in debian squeezes php. I suppose true and false are
> build in values in php without further investigating.
>
> So the next question is, is this constuct really working:
> ...
> $qry = new AwlQuery( $sql, $params );
> if ( $qry->Exec() ) {
> ...
> else {
> ...
> ...
> since the sql insert obviously fails, but it is reported that the
> collection has actually been created.

It depends on the 'fail'. If the query fails due to an SQL syntax error
then $qry->Exec() should definitely return false, so that would be a bug
in AWL somewhere.

The error log should show the failing SQL. Can you include that so I
can validate your proposed solution? This could be something related to
different versions of PHP, although I thought Squeeze should be fine...


> Help me out here please to understand a bit php code:
> I suppose 'new AwlQuery( $sql, $params )' returns an object to $qry,

It returns a query object, but there are possibly some things you might
want to do with that yet. These are fairly uncommon things, like switch
the database you are going to query, etc.


> but what does '$qry->Exec()' do?

It executes the query.

Cheers,
Andrew.
--
------------------------------------------------------------------------
andrew (AT) morphoss (DOT) com +64(272)DEBIAN
You recoil from the crude; you tend naturally toward the exquisite.
------------------------------------------------------------------------
Attachments: signature.asc (0.82 KB)

DAViCal general RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.