[phpldapadmin] [ phpldapadmin-Bugs-2832502 ] Autonumber error
"SourceForge.net" <[email protected]>
| Newsgroups | gmane.comp.ldap.davedap |
|---|---|
| Message-ID | <[email protected]> |
Bugs item #2832502, was opened at 2009-08-05 08:40
Message generated for change (Comment added) made by wsnel
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=498546&aid=2832502&group_id=61828
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group: 1.2.x
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Walter Snel (wsnel)
Assigned to: Nobody/Anonymous (nobody)
Summary: Autonumber error
Initial Comment:
In combination with openldap 2.3.39 the query for attributes returns an arry while a single value is expected.
Results of query:
[root@control ldap.lab.tmns.com]# tail -f /var/log/php.log
'dn' => 'cn=testgroup,dc=lab,dc=tmns,dc=com',
'gidnumber' =>
array (
0 => '1354',
),
),
)
I don't know if this is somehow related to the openldap servers support for RFC2307 in addition to RFC2252 (this seems to affect these attributes). However it can be solved by replacing the following code in the lib/functions.php:
line 1425: array_push($autonum,$values[$attr]);
Replace with:
if(is_array($values[$attr])) {
$autonum = array_merge($autonum,$values[$attr]);
} else {
array_push($autonum,$values[$attr]);
}
With kind regards,
Walter
----------------------------------------------------------------------
>Comment By: Walter Snel (wsnel)
Date: 2009-08-05 09:45
Message:
The PickList function seems to suffer from the same defect.
----------------------------------------------------------------------
Comment By: Walter Snel (wsnel)
Date: 2009-08-05 09:13
Message:
It turns out there is another problem as well... In case there are no prior
entries in the LDAP, and the serach returns null, nothing is returned. Not
even the minumum number set in the configuration file. In order to fix
this the code on line 1417/1418:
if (! count($search))
return null
should be replace with:
if (! count($search)) {
if(!is_null($startmin))
return $startmin;
if (count($server->getValue('auto_number','min'))) {
$min =
array_change_key_case($server->getValue('auto_number','min'));
if (isset($min[$attr]))
return $min[$attr];
}
return 999;
}
With kind regards,
Walter
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=498546&aid=2832502&group_id=61828
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now. http://p.sf.net/sfu/bobj-july
______________________________________
phpLDAPadmin development mailing list.
To unsbuscribe: https://lists.sourceforge.net/lists/listinfo/phpldapadmin-devel
http://phpldapadmin.sourceforge.net/