Mailing List Archive

Problem with the authentication via LDAP
Hi arnaud,

1.) which version of DAViCal do you use?
2.) did you install the corresponding libawl?
3.) are you sure your PHP include path points to the correct libawl version?

sql_from_object is a method which is defined in DataUpdate.php in the libawl.
And in auth-functions.php is a include of DataUpdate.php, so all should be fine
- except if it finds a wrong version of that file...

with regards,
Matthias




HELPING HEADS for Hard- and Software
-------------------------------------------------------------------------
Fuer Ihre Projekte entwickeln wir massgeschneiderte Loesungen - schnell,
flexibel und direkt vor Ort. Unser eingespieltes Team an erfahrenen Hard-
und Software-Spezialisten unterstuetzt Sie dort, wo Sie uns brauchen.



--------------------------------------------------------------------------
SysDesign GmbH
Saentisstrasse 25
D-88079 Kressbronn am Bodensee

Geschaeftsfuehrer: Franz Kleiner
Handelsregister: Ulm 632138
--------------------------------------------------------------------------
Problem with the authentication via LDAP [ In reply to ]
Hello,

despite all the documentation about the LDAP authentication on the Wiki,
I didn't find any clue for my problem.

* when I login with the default admin/password there is no problem.
* when I try to login with a false ldap user, I'm rejected so it's ok
* when I try to login with an existing ldap user but a bad password, I'm
rejected so it's ok too
* BUT when I try to login with an existing ldap user but a good
password, I have the following white and black webpage error :

Fatal error: Call to undefined function sql_from_object() in
/usr/share/davical/inc/auth-functions.php on line 127

I've looked at this page and the class PgQuery doesn't seems to contain
the sql_from_object() function.

Does someone could help me ?

Regards,
arnaud
-------------- next part --------------
A non-text attachment was scrubbed...
Name: arnaud_icard.vcf
Type: text/x-vcard
Size: 335 bytes
Desc: not available
URL: <http://lists.morphoss.com/pipermail/davical-users/attachments/20091022/62e7d136/attachment.vcf>
-------------- next part --------------
Problem with the authentication via LDAP [ In reply to ]
On Thu, 2009-10-22 at 12:33 +0200, arnaud icard wrote:
> Hello,
>
> despite all the documentation about the LDAP authentication on the Wiki,
> I didn't find any clue for my problem.
>
> * when I login with the default admin/password there is no problem.
> * when I try to login with a false ldap user, I'm rejected so it's ok
> * when I try to login with an existing ldap user but a bad password, I'm
> rejected so it's ok too
> * BUT when I try to login with an existing ldap user but a good
> password, I have the following white and black webpage error :
>
> Fatal error: Call to undefined function sql_from_object() in
> /usr/share/davical/inc/auth-functions.php on line 127
>
> I've looked at this page and the class PgQuery doesn't seems to contain
> the sql_from_object() function.
>
> Does someone could help me ?

sql_from_object() is defined in the AWL libraries, in particular it's
defined in DataUpdate.php - which seems to be included by
auth-functions.php

Which version of DAViCal is this one? Which version of AWL?

I've released 0.9.7.5 tonight with fixes for some other duplicated
and/or missing includes in this area - and I *really* hope I haven't
screwed up again...

Cheers,
Andrew.

------------------------------------------------------------------------
andrew (AT) morphoss (DOT) com +64(272)DEBIAN
Don't look back, the lemmings are gaining on you.
------------------------------------------------------------------------

-------------- 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/20091023/e3dfbb8d/attachment.pgp>
-------------- next part --------------
Problem with the authentication via LDAP [ In reply to ]
Matthias, Andrew

thank you for your response!

I have installed it via apt-get (debian) so I guess it should be :
* DAViCal 0.9.7.5
* awl 0.38

but I don't know how to be sure of it.

I installed it this morning (in France) so it should be up to date.
'apt-get upgrade' confirmed it.

My PHP include path is :
include_path = ".:/usr/share/php:/usr/share/awl/inc"

I will try to follow the include to see if the problem comes from here.

Regards,
Arnaud.


Matthias Mohr a ?crit :
> Hi arnaud,
>
> 1.) which version of DAViCal do you use?
> 2.) did you install the corresponding libawl?
> 3.) are you sure your PHP include path points to the correct libawl version?
>
> sql_from_object is a method which is defined in DataUpdate.php in the libawl.
> And in auth-functions.php is a include of DataUpdate.php, so all should be fine
> - except if it finds a wrong version of that file...
>
> with regards,
> Matthias
>
>
>
>
> HELPING HEADS for Hard- and Software
> -------------------------------------------------------------------------
> Fuer Ihre Projekte entwickeln wir massgeschneiderte Loesungen - schnell,
> flexibel und direkt vor Ort. Unser eingespieltes Team an erfahrenen Hard-
> und Software-Spezialisten unterstuetzt Sie dort, wo Sie uns brauchen.
>
>
>
> --------------------------------------------------------------------------
> SysDesign GmbH
> Saentisstrasse 25
> D-88079 Kressbronn am Bodensee
>
> Geschaeftsfuehrer: Franz Kleiner
> Handelsregister: Ulm 632138
> --------------------------------------------------------------------------
>
>
Problem with the authentication via LDAP [ In reply to ]
Hi Andrew,

I was faster with my answer :-)
And I did nearly suggest the same as you - that's unbelievable!

> I've released 0.9.7.5 tonight with fixes for some other duplicated
> and/or missing includes in this area - and I *really* hope I haven't
> screwed up again...
Don't find any special - BTW, it's a nice idea to ask for the existance of a specific function before including the
auth-functions.php
Is this worth the effort and really faster than a simple "include_once"?

The small changes for making the eMail case insensitive and using the SetOrdering method are not included in that version.
Was this intended?

regards,
Matthias




HELPING HEADS for Hard- and Software
-------------------------------------------------------------------------
Fuer Ihre Projekte entwickeln wir massgeschneiderte Loesungen - schnell,
flexibel und direkt vor Ort. Unser eingespieltes Team an erfahrenen Hard-
und Software-Spezialisten unterstuetzt Sie dort, wo Sie uns brauchen.



--------------------------------------------------------------------------
SysDesign GmbH
Saentisstrasse 25
D-88079 Kressbronn am Bodensee

Geschaeftsfuehrer: Franz Kleiner
Handelsregister: Ulm 632138
--------------------------------------------------------------------------
Problem with the authentication via LDAP [ In reply to ]
I don't know if it's really the problem but at the beginning of the file
auth-functions, just before the :
require_once("DataUpdate.php")
there is this test :
if ( function_exists('CreateHomeCalendar') ) return;

As this function exists, the require_once is not executed.

I put 'die("hey dude")'
just after the test and this is never executed.


I don't know if this will help you.

arnaud icard a ?crit :
> Matthias, Andrew
>
> thank you for your response!
>
> I have installed it via apt-get (debian) so I guess it should be :
> * DAViCal 0.9.7.5
> * awl 0.38
>
> but I don't know how to be sure of it.
>
> I installed it this morning (in France) so it should be up to date.
> 'apt-get upgrade' confirmed it.
>
> My PHP include path is :
> include_path = ".:/usr/share/php:/usr/share/awl/inc"
>
> I will try to follow the include to see if the problem comes from here.
>
> Regards,
> Arnaud.
>
>
> Matthias Mohr a ?crit :
>> Hi arnaud,
>>
>> 1.) which version of DAViCal do you use?
>> 2.) did you install the corresponding libawl?
>> 3.) are you sure your PHP include path points to the correct libawl
>> version?
>>
>> sql_from_object is a method which is defined in DataUpdate.php in the
>> libawl.
>> And in auth-functions.php is a include of DataUpdate.php, so all
>> should be fine
>> - except if it finds a wrong version of that file...
>>
>> with regards,
>> Matthias
>>
>>
>>
>>
>> HELPING HEADS for Hard- and Software
>> -------------------------------------------------------------------------
>> Fuer Ihre Projekte entwickeln wir massgeschneiderte Loesungen - schnell,
>> flexibel und direkt vor Ort. Unser eingespieltes Team an erfahrenen Hard-
>> und Software-Spezialisten unterstuetzt Sie dort, wo Sie uns brauchen.
>>
>>
>>
>> --------------------------------------------------------------------------
>>
>> SysDesign GmbH
>> Saentisstrasse 25
>> D-88079 Kressbronn am Bodensee
>>
>> Geschaeftsfuehrer: Franz Kleiner
>> Handelsregister: Ulm 632138
>> --------------------------------------------------------------------------
>>
>>
>>
Problem with the authentication via LDAP [ In reply to ]
Hi,

I just to updated my developer version to 0.9.7.5.

And now I can confirm the error - it also happens here.


> I don't know if it's really the problem but at the beginning of the file
> auth-functions, just before the :
> require_once("DataUpdate.php")
> there is this test :
> if ( function_exists('CreateHomeCalendar') ) return;
This is the problem.
Just comment this line out and everything works ;-)

Andrew, I assume the return without parameter is the problem.
Here is something from the php manual:

Note: If no parameter is supplied, then the parentheses must be omitted and NULL will be returned.

with regards,
Matthias

HELPING HEADS for Hard- and Software
-------------------------------------------------------------------------
Fuer Ihre Projekte entwickeln wir massgeschneiderte Loesungen - schnell,
flexibel und direkt vor Ort. Unser eingespieltes Team an erfahrenen Hard-
und Software-Spezialisten unterstuetzt Sie dort, wo Sie uns brauchen.



--------------------------------------------------------------------------
SysDesign GmbH
Saentisstrasse 25
D-88079 Kressbronn am Bodensee

Geschaeftsfuehrer: Franz Kleiner
Handelsregister: Ulm 632138
--------------------------------------------------------------------------
Problem with the authentication via LDAP [ In reply to ]
On Thu, 2009-10-22 at 14:24 +0200, Matthias Mohr wrote:
> Hi Andrew,
>
> I was faster with my answer :-)
> And I did nearly suggest the same as you - that's unbelievable!
>
> > I've released 0.9.7.5 tonight with fixes for some other duplicated
> > and/or missing includes in this area - and I *really* hope I haven't
> > screwed up again...
> Don't find any special - BTW, it's a nice idea to ask for the existance of a specific function before including the
> auth-functions.php
> Is this worth the effort and really faster than a simple "include_once"?

Yep, it is. The check for function existence is much less intensive,
and in particular does not have to hit all over the disk as it goes
through the search path.


> The small changes for making the eMail case insensitive and using the SetOrdering method are not included in that version.
> Was this intended?

The 0.9.7 branch is thoroughly forked from the main code now, where they
are included (but perhaps not yet committed). There are a stack of
commits on the main line now and they just kind of got lost in the
noise.

Cheers,
Andrew.

------------------------------------------------------------------------
andrew (AT) morphoss (DOT) com +64(272)DEBIAN
If you can read this, you're too close.
------------------------------------------------------------------------

-------------- 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/20091023/a94797e8/attachment-0001.pgp>
-------------- next part --------------
Problem with the authentication via LDAP [ In reply to ]
On Thu, 2009-10-22 at 15:08 +0200, Matthias Mohr wrote:
>
> > I don't know if it's really the problem but at the beginning of the file
> > auth-functions, just before the :
> > require_once("DataUpdate.php")
> > there is this test :
> > if ( function_exists('CreateHomeCalendar') ) return;
> This is the problem.
> Just comment this line out and everything works ;-)
>
> Andrew, I assume the return without parameter is the problem.
> Here is something from the php manual:

OK. I've changed it to return(true); I'll just go through the rest of
my e-mail and see if there're any further screwups before I push out
0.9.7.6.

I think once I release 0.9.8 I'm going to need to write some regression
tests for the admin interface - just too many silly problems have
occurred with the few small changes that have gone into this 0.9.7
series. No point doing it now, however, given the level of change
piling up in 0.9.8 at this point.

I guess I also need to have a test setup somewhere against an LDAP
server too, which is something I currently have to depend on others to
test against.

Cheers,
Andrew.

------------------------------------------------------------------------
andrew (AT) morphoss (DOT) com +64(272)DEBIAN
You have the power to influence all with whom you come in contact.
------------------------------------------------------------------------

-------------- 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/20091023/6839e31c/attachment.pgp>
-------------- next part --------------
Problem with the authentication via LDAP [ In reply to ]
Thank you very much.

I look forward for the future version !

Best regards,
Arnaud.

Andrew McMillan a ?crit :
> On Thu, 2009-10-22 at 15:08 +0200, Matthias Mohr wrote:
>>> I don't know if it's really the problem but at the beginning of the file
>>> auth-functions, just before the :
>>> require_once("DataUpdate.php")
>>> there is this test :
>>> if ( function_exists('CreateHomeCalendar') ) return;
>> This is the problem.
>> Just comment this line out and everything works ;-)
>>
>> Andrew, I assume the return without parameter is the problem.
>> Here is something from the php manual:
Problem with the authentication via LDAP [ In reply to ]
Hi Andrew,

>> So I assume the include of "auth-functions.php" fails in that case.
>> Don't know what that means for the script execution...
>> ... but when you "return(true);" instead of just "return;" everything seems to work...
>
> OK. I've changed it to return(true); I'll just go through the rest of
> my e-mail and see if there're any further screwups before I push out
> 0.9.7.6.
-----------------------------------------------------------------
if ( function_exists('CreateHomeCalendar') ) return(true);
-----------------------------------------------------------------

I told you, that the above line in auth-functions.php works here -
unfortunately that was wrong :-(
I works sometimes but not always - I assume it has something to do with some
kind of cache...
When the above line is active, I'm unable to login at the GUI - I get a white
browser screen and still the strange error message about the unknown
sql_from_object method in the log file.
When I comment out the above line, I'm able to login at the GUI.
When I then reactivate the above line, logout from the GUI and login again,
everything still works and no error message is shown in the log!
Maybe the browser or the apache server does some kind of caching and still
knows about the sql_from_object method?

I've no idea why this error occurs and why a function which is defined
in DataUpdate.php (which is included by a require_once statement) is not
known in aut-functions.php (but only if the above mentioned line is active).
Very strange!

BTW, I'm curious about how you measured the time differences between an
"include" and an include_once"-call?
When I searched in the internet for performance differences between
include/require vs. include_once/require_once I found these pages:
---------------------------------------------------------------------------
http://arin.me/blog/php/php-require-vs-include-vs-require_once-vs-include_once-performance-test
http://arin.me/php/update-phps-require-require_once-include-include_once-memory-performance
---------------------------------------------------------------------------
It's a bit old (11/2007) and maybe outdated or wrong - but it's interesting ;-)

I also found other places where it's said that the include_once/require_once
methods are slower, but not notably than their counterparts without _once.
Even at the offical manual pages people are discussing about the performance
differences between the methods:
---------------------------------------------------------------------------
http://de.php.net/manual/en/function.require-once.php#90017
---------------------------------------------------------------------------

So how did you experience that the _once are a lot slower than their counterparts?

with regards,
Matthias

HELPING HEADS for Hard- and Software
-------------------------------------------------------------------------
Fuer Ihre Projekte entwickeln wir massgeschneiderte Loesungen - schnell,
flexibel und direkt vor Ort. Unser eingespieltes Team an erfahrenen Hard-
und Software-Spezialisten unterstuetzt Sie dort, wo Sie uns brauchen.



--------------------------------------------------------------------------
SysDesign GmbH
Saentisstrasse 25
D-88079 Kressbronn am Bodensee

Geschaeftsfuehrer: Franz Kleiner
Handelsregister: Ulm 632138
--------------------------------------------------------------------------
Problem with the authentication via LDAP [ In reply to ]
Matthias Mohr wrote:
> Hi Andrew,
>
>>> So I assume the include of "auth-functions.php" fails in that case.
>>> Don't know what that means for the script execution...
>>> ... but when you "return(true);" instead of just "return;" everything seems to work...
>> OK. I've changed it to return(true); I'll just go through the rest of
>> my e-mail and see if there're any further screwups before I push out
>> 0.9.7.6.
> -----------------------------------------------------------------
> if ( function_exists('CreateHomeCalendar') ) return(true);
> -----------------------------------------------------------------
>
> I told you, that the above line in auth-functions.php works here -
> unfortunately that was wrong :-(
> I works sometimes but not always - I assume it has something to do with some
> kind of cache...
> When the above line is active, I'm unable to login at the GUI - I get a white
> browser screen and still the strange error message about the unknown
> sql_from_object method in the log file.
> When I comment out the above line, I'm able to login at the GUI.
> When I then reactivate the above line, logout from the GUI and login again,
> everything still works and no error message is shown in the log!
> Maybe the browser or the apache server does some kind of caching and still
> knows about the sql_from_object method?
>
> I've no idea why this error occurs and why a function which is defined
> in DataUpdate.php (which is included by a require_once statement) is not
> known in aut-functions.php (but only if the above mentioned line is active).
> Very strange!
>
> BTW, I'm curious about how you measured the time differences between an
> "include" and an include_once"-call?
> When I searched in the internet for performance differences between
> include/require vs. include_once/require_once I found these pages:

Forget include : the bad thing is that include doesn't raise anything if not found

Which in most case lead to malfunction, herratic behaviour etc ...

require_once is the best choice and the speed is quiet nice from php >5.2
You can also adjust some path cache inside php.ini
realpath_cache_size = 128K
realpath_cache_ttl = 600

There was some interesting debate around speed diff between require and auto_loader in the Zend_Framework ML.

Just another remark (I've not check the code ) found in php comment
If you are trying to use this for testing a "function" within a class, then you need to use method_exists(). A "function"
within an object is a method, not a function.

I would have tendency to check it if ( function_exists('CreateHomeCalendar') === TRUE ) return(true);
Just to not be catched by Null or some "bizarre" return which can return a 1 which is considered as true.


--

Bruno Friedmann
Problem with the authentication via LDAP [ In reply to ]
On Wed, 2009-10-28 at 17:41 +0100, Bruno Friedmann wrote:
>
> Forget include : the bad thing is that include doesn't raise anything if not found
>
> Which in most case lead to malfunction, herratic behaviour etc ...
>
> require_once is the best choice and the speed is quiet nice from php >5.2

Yeah, I'd reviewed the literature some more since my earlier decision
and had decided to standardise on require_once / require in particular
due to the bad effects on cache software and so forth.

Some of my more recent commits reflect this return to sanity :-)


> You can also adjust some path cache inside php.ini
> realpath_cache_size = 128K
> realpath_cache_ttl = 600

Interesting.


> There was some interesting debate around speed diff between require and auto_loader in the Zend_Framework ML.
>
> Just another remark (I've not check the code ) found in php comment
> If you are trying to use this for testing a "function" within a class, then you need to use method_exists(). A "function"
> within an object is a method, not a function.
>
> I would have tendency to check it if ( function_exists('CreateHomeCalendar') === TRUE ) return(true);
> Just to not be catched by Null or some "bizarre" return which can return a 1 which is considered as true.

Well... at some point you have to trust the documented behaviour :-)

Cheers,
Andrew.

------------------------------------------------------------------------
andrew (AT) morphoss (DOT) com +64(272)DEBIAN
Does the turtle move for you? www.kame.net
------------------------------------------------------------------------

-------------- 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/20091029/73db1ad9/attachment.pgp>
-------------- next part --------------
Problem with the authentication via LDAP [ In reply to ]
On Thu, 29 Oct 2009 08:31:36 +1300
Andrew McMillan <andrew at morphoss.com> wrote:

>
> Yeah, I'd reviewed the literature some more since my earlier decision
> and had decided to standardise on require_once / require in particular
> due to the bad effects on cache software and so forth.
>
> Some of my more recent commits reflect this return to sanity :-)
>
Well, there is one important downside to using require/require_once.
The downside is that you cannot use require/require_once in control
structures. eg.

if ($event_class == 'work')
include 'event_handling_work.php';
else
include 'event_handling_private.php';

require/require_once are a compile time option while
include/include_once are a runtime option.

--
Hilsen/Regards
Michael Rasmussen

Get my public GnuPG keys:
michael <at> rasmussen <dot> cc
http://pgp.mit.edu:11371/pks/lookup?op=get&search=0xD3C9A00E
mir <at> datanom <dot> net
http://pgp.mit.edu:11371/pks/lookup?op=get&search=0xE501F51C
mir <at> miras <dot> org
http://pgp.mit.edu:11371/pks/lookup?op=get&search=0xE3E80917
--------------------------------------------------------------
Forrest Gump: "I'm sorry for ruining your party, Lieutenant
Dan. She tasted of cigarettes"
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.morphoss.com/pipermail/davical-users/attachments/20091028/c9ed4500/attachment.pgp>
-------------- next part --------------
Problem with the authentication via LDAP [ In reply to ]
On Wed, 2009-10-28 at 22:34 +0100, Michael Rasmussen wrote:
> On Thu, 29 Oct 2009 08:31:36 +1300
> Andrew McMillan <andrew at morphoss.com> wrote:
>
> >
> > Yeah, I'd reviewed the literature some more since my earlier decision
> > and had decided to standardise on require_once / require in particular
> > due to the bad effects on cache software and so forth.
> >
> > Some of my more recent commits reflect this return to sanity :-)
> >
> Well, there is one important downside to using require/require_once.
> The downside is that you cannot use require/require_once in control
> structures. eg.
>
> if ($event_class == 'work')
> include 'event_handling_work.php';
> else
> include 'event_handling_private.php';
>
> require/require_once are a compile time option while
> include/include_once are a runtime option.

Yes. Mainly what I'm talking about are the various class & function
includes at the top of most of the files.

In the few places where there is an in-line code fragment to be included
it is indeed done with 'include()', and in some rare cases where it's a
kind of optional thing that *might* be there I've done it as @include()

Cheers,
Andrew.

------------------------------------------------------------------------
andrew (AT) morphoss (DOT) com +64(272)DEBIAN
Time to be aggressive. Go after a tattooed Virgo.
------------------------------------------------------------------------

-------------- 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/20091029/a3ba194f/attachment.pgp>
-------------- next part --------------