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

ComCept Soliva soliva at comcept.ch
Thu Jan 28 13:11:22 CET 2010


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    }


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




More information about the devel mailing list