PEAR Forum :: PHP Extension and Application Repository

PEAR Forum Forum Index
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
Net_LDAP2, $entry->replace() return val problem

 
Post new topic   Reply to topic    PEAR Forum Forum Index -> Networking
View previous topic :: View next topic  
Author Message
elifgakar



Joined: 22 Dec 2011
Posts: 1

PostPosted: Thu Dec 22, 2011 1:40 pm    Post subject: Net_LDAP2, $entry->replace() return val problem Reply with quote

Hello,
I have a problem about Net_LDAP2, $entry->replace(). When I try to replace an attribute in Ldap, $entry->replace() does not return false, if $entry->update() is unsuccesful. For example, I try to replace an attribute that is not existing in Ldap, 'replace' can not write Ldap surely, but it returns true anyways. How can I fix the problem?

Here is the part of my php code:

$dn = 'uid='.$username.',ou=XXX,dc=XXX,o=XXX';
$entry = $ldap->getEntry($dn, array('accountExpireDate'));

//this part returns false if anything is wrong
if (PEAR::isError($entry)) {
log::logError($entry->getMessage());
return false;
}
$result = $entry->replace(array('accountExpireDate'=> $expiredate));
$entry->update();

//this part returns true always.
//even if I write 'accountExpireD' instead of 'accountExpireDate'

if (Net_LDAP2::isError($entry)) {
log::logError($entry->getMessage());
return false;
}

log::logNotice($arguments);
return true;


Here is Ldap answers:

16:31:09.983524 IP y.y.y.y.59092 > x.x.x.x.ldap: Flags [P.], seq 483:597, ack 157, win 92, options [nop,nop,TS val 1300887024 ecr 1275452038], length 114
0x0000: 0006 5b8d 28e9 0050 5687 0038 0800 4500 ..[.(..PV..8..E.
0x0010: 00a6 0889 4000 4006 2e47 c18c c031 c18c ....@.@..G...1..
0x0020: c037 e6d4 0185 0b1c ff47 a995 40e2 8018 .7.......G..@...
0x0030: 005c 041b 0000 0101 080a 4d89 f5f0 4c05 .\........M...L.
0x0040: da86 3084 0000 006c 0201 0666 8400 0000 ..0....l...f....
0x0050: 6304 2c75 6964 3d65 6c69 662e 616b 6172 c.,uid=elif.akar
0x0060: 342c 6f75 3d70 656f 706c 652c 6463 3d62 4,ou=people,dc=b
0x0070: 6f75 6e2e 6564 752e 7472 2c6f 3d42 5530 oun.edu.tr,o=BU0
0x0080: 8400 0000 2f30 8400 0000 290a 0100 3084 ..../0....)...0.
0x0090: 0000 0020 0410 6163 636f 756e 7478 7069 ......accountxpi
0x00a0: 7265 4461 7465 3184 0000 0008 0406 3031 reDate1.......01
0x00b0: 3034 3132 0412
16:31:09.984181 IP x.x.x.x.ldap > y.y.y.y.59092: Flags [P.], seq 157:213, ack 597, win 33304, options [nop,nop,TS val 1275452039 ecr 1300887024], length 56
0x0000: 0050 5687 0038 0006 5b8d 28e9 0800 4500 .PV..8..[.(...E.
0x0010: 006c a2a4 4000 4006 9465 c18c c037 c18c .l..@.@..e...7..
0x0020: c031 0185 e6d4 a995 40e2 0b1c ffb9 8018 .1......@.......
0x0030: 8218 f010 0000 0101 080a 4c05 da87 4d89 ..........L...M.
0x0040: f5f0 3036 0201 0667 310a 0111 0400 042a ..06...g1......*
0x0050: 6163 636f 756e 7478 7069 7265 4461 7465 accountxpireDate
0x0060: 3a20 6174 7472 6962 7574 6520 7479 7065 :.attribute.type
0x0070: 2075 6e64 6566 696e 6564 .undefined


Any help is appreciated.
Thanks in advance.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    PEAR Forum Forum Index -> Networking All times are GMT + 2 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



PEAR Forum topic RSS feed 
Powered by phpBB © 2001, 2005 phpBB Group

Provided by Ministry of Web developement