[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: Keeping track of lastModifiedTime and lastModifiedBy



Pierangelo Masarati wrote:
> 
> Sudhakar Chandra wrote:
> 
> > Hi,
> >
> > I'm using the core, inetorgperson and cosine schemas with my LDAP
> > server.  I want to store the lastModifiedTime and lastModifiedBy with
> > each person entry in the directory.  Can I configure slapd to
> > automagically add this upon an entry's modification?  Or do I need to do
> > this from the LDAP client that is modifying the entry?
> 
> They're operational attributes: you cannot modify them;
> all you need to do is set lastmod on (BTW it is on by default).
> However, you need to explicitly require them when searching.
> Note that the special code '+' (a plus) allows to ask for ALL
> the operational attrs when querying the server.
> So:
> 
> ldapsearch '*' '+'
> 
> will require ALL the available attrs, while
> 
> ldapsearch creatorsName createTimestamp modifiersName modifyTimestamp
> 
> will return the create/modify attribs for all the entries.
> 
> Pierangelo.
> 
> --
> Dr. Pierangelo Masarati               | voice: +39 02 2399 8309
> Dip. Ing. Aerospaziale                | fax:   +39 02 2399 8334
> Politecnico di Milano                 | mailto:masarati@aero.polimi.it
> via La Masa 34, 20156 Milano, Italy   | http://www.aero.polimi.it/~masarati

Hi,

I can't make it work with php_ldap...

When I do a ldapsearch, it vorks. Once in php, attributs stay empty...
am I missing something ?

Here is my ldapsearch :

/usr/local/openldap/bin/ldapsearch -LLL -D "cn=manager, dc=lecentre,
dc=net"  -b "uid=xxx, ou=users, ou=lecentre.net, dc=lecentre, dc=net" -W
"(uid=*)"  '*' '+'

here is my php ldapsearch :

 $sr=ldap_search($ds,"uid=xxx, ou=users, ou=lecentre.net, dc=lecentre,
dc=net","uid=*", $return_attr);  
 
$return_attr=array('cn', 'creatorsName', 'createTimestamp'); 
or
$return_attr=array('*','+');
or whatever...

please, help :)