[Kolab-devel] Search: Invalid DN syntax function.ldap-search

Gunnar Wrobel wrobel at pardus.de
Thu Feb 11 22:10:10 CET 2010


Hi Andrea,

Quoting ComCept Soliva <soliva at comcept.ch>:

> Hi
>
> It is from my point of view clear the search function but even I see the
> lines I can not identify what is false and why?:
>
> syntax in /opt/kolab/var/kolab/php/admin/include/ldap.class.php on line 204
>
>
> 201    function search( $base, $filter, $attrs = false ) {
>    202      $this->freeSearchResult();
>    203      if( $attrs ) {
>    204            $this->search_result = ldap_search( $this->connection,
> $base, $filter, $attrs );
>    205          } else {
>    206            $this->search_result = ldap_search( $this->connection,
> $base, $filter );
>    207          }
>    208      return $this->search_result;
>    209    }

The error sounds as if $base contains an invalid value. You could add  
a "var_dump($base);" in the code to display the value.

Both log entries you mentioned are just warnings though. The code  
won't stop on a warning. And the code of the web admin is not exactly  
clean when it comes to notices and warnings. Quite the contrary. So  
what you see might not be a real problem.

But I did not quite understand what kind of problems you saw in the  
actual frontend. Did you see any specific errors that were displayed?  
Or did the web admin just show you a blank page (the PHP white screen  
of death)?

Cheers,

Gunnar

>
>
> is not a valid ldap result resource in
> /opt/kolab/var/kolab/php/admin/include/ldap.class.php on line 424
>
>    411    // Count the number of occurences of an email address
>    412    // in users' mail and alias attributes and in dist. lists.
>    413    // This can be used to check for uniqueness etc.
>    414    function countMail( $base, $mail , $excludedn=false ) {
>    415          // First count users
>    416          $filter = '(|(|(mail='.$this->escape($mail).')
>    417                         (alias='.$this->escape($mail).')
>    418                       )
>    419                       (uid='.$this->escape($mail).')
>    420                     )';
>    421          $res = $this->search( $this->dn_escape($base), $filter,
> array( 'dn' ) );
>    422          $count = 0;
>    423
>    424          $entries = ldap_get_entries( $this->connection, $res );
>    425          if( $excludedn ) {
>    426            for ( $i = 0; $i < count( $entries ); $i++ ) {
>    427                  if( is_null( $entries[$i] ) ) continue;
>    428                  if( KolabLDAP::unescape_dn_value($entries[$i]['dn'])
> == KolabLDAP::unescape_dn_value($excludedn) ) continue;
>    429                  debug("found ".$entries[$i]['dn'] );
>    430                  $count++;
>    431            }
>    432          } else $count += $entries['count'];
>
>
> Kind regards
>
> Andrea Soliva
>
> Mail: soliva at comcept.ch
> -----Ursprüngliche Nachricht-----
> Von: Bernhard Reiter [mailto:bernhard at intevation.de] Im Auftrag von
> kolab-devel-bounces at kolab.org
> Gesendet: Montag, 25. Januar 2010 14:37
> An: kolab-devel at kolab.org
> Betreff: Re: [Kolab-devel] Search: Invalid DN syntax function.ldap-search
>
> Am Sonntag, 24. Januar 2010 11:31:48 schrieb ComCept Soliva:
>> [23-Jan-2010 14:59:36] PHP Warning:  ldap_search() [<a
>> href='function.ldap-search'>function.ldap-search</a>]: Search: Invalid DN
>> syntax in /opt/kolab/var/kolab/php/admin/include/ldap.class.php on line
> 204
>> [23-Jan-2010 14:59:36] PHP Warning:  ldap_get_entries(): supplied argument
>> is not a valid ldap result resource in
>> /opt/kolab/var/kolab/php/admin/include/ldap.class.php on line 424
>>
>> Is this already recognized? Is it not known....I tried to figure out what
>> is wrong but actually I could not?!
>>
>> Any suggestion?
>
> My suggestion is to check the given line 204 and see which argument
> is used there (maybe add a statement to print it out).
>
>> By the way is there a documentation about Master/Slave configuration
>> meaning how this works etc. I could not find anything. Any hints would be
>> appriciated.
>
> I think the documentation is in the architecture documents.
> The idea is pretty simple: Replicate the directory server on the slave
> (for which there is a bootstrap) have all read access on the slave accounts
> go
> to the slave LDAP server and all write access (only by webadmin) to the
> master.
>
> Bernhard
>
> --
> Managing Director - Owner: www.intevation.net       (Free Software Company)
> Germany Coordinator: fsfeurope.org. Coordinator: www.Kolab-Konsortium.com.
> Intevation GmbH, Osnabrück, DE; Amtsgericht Osnabrück, HRB 18998
> Geschäftsführer Frank Koormann, Bernhard Reiter, Dr. Jan-Oliver Wagner
>
> _______________________________________________
> Kolab-devel mailing list
> Kolab-devel at kolab.org
> https://kolab.org/mailman/listinfo/kolab-devel
>



-- 
____ http://www.pardus.de _________________ http://gunnarwrobel.de _

E-mail : p at rdus.de                                 Dr. Gunnar Wrobel
Tel.   : +49 700 6245 0000                         Bundesstrasse 29
Fax    : +49 721 1513 52322                        D-20146 Hamburg
--------------------------------------------------------------------
    >> Mail at ease - Rent a kolab groupware server at p at rdus <<
--------------------------------------------------------------------





More information about the devel mailing list