Hi,

I used phpldapadmin-1.2.0.4 !
I have a problem with hooks functions.
I want modify attributes before the post method!

add_hook('post_entry_create','example_post_entry_create');

function example_post_entry_create() {
        $args = func_get_args();
        list($serverid, $methos, $dn, $attrs) = $args;
....

Ther problem is:
lib/ds_ldap_pla.php

if(run_hook('pre_entry_create',array('server_id'=>$this->index,'method'=>$method,'dn'=>$dn,'attrs'=>$entry_array)))

$entry_array <= is not global value or not pointer!
...

How I change the attributes before the post metod with my hook function?

How I use the php ldap function in my hook (@ldap_modify, @ldap_add)?

One Answer,
If I modify the attributes after post method:

add_hook('post_entry_create','example_post_entry_create');

function example_post_entry_create(){
   $args = func_get_args();
   list($serverid, $methos, $dn, $attrs) = $args;

   // I'm paranoid :)
   // get the stored attribute value from stored dn
   $ldapserver=$_SESSION[APPCONFIG]->getServer(get_request('server_id_src') );
   $currattrs = $ldapserver->getDNAttrValues( $dn, $method,  
LDAP_DEREF_NEVER, array( '*' ) );
...

if I change the currattrs, how I modify or store the my ldap?

$result = @ldap_modify( $ldapserver->connect(), $dn, $attrs); <= it's  
a problem the connect() is protected function!!

I want use the phpldapadmin class and function,
I'm not create new connection to ldap server in my hook functions!

Please Help!
thanks
G.









----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.


------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
phpldapadmin-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/phpldapadmin-users

Reply via email to