Jump to content

FredPenner

Members
  • Posts

    10
  • Joined

  • Last visited

Everything posted by FredPenner

  1. I have an application that uses the PHP LDAP library to connect to the Windows Active Directory: $ds = ldap_connect($ini['ad_server']) or die("Could not connect"); $admin = $ini['ad_user']; $passwd = $ini['ad_password']; $passwd = base64_decode($passwd); $dn = $ini['ad_basedn']; ldap_set_option($ds, LDAP_OPT_PROTOCOL_VERSION, 3); ldap_set_option($ds, LDAP_OPT_REFERRALS, 0); $rInTouch = ldap_bind($ds, $admin, $passwd); I am wondering if anyone knows if this upcoming patch "2020 LDAP channel binding and LDAP signing" coming from Microsoft will break any PHP applications that are using this ldap library. Thanks in advance, M
  2. What is the best approach to merge/join XML data via PHP? File#1: <users> <user> <name>Mark</name> <id>100</id> </user> <user> <name>Fred</name> <id>100</id> </user> </users> File#2: <users> <user> <id>100</id> <lat>50</lat> <lon>122</lon> </user> </users> Desired output (only keep records where a match is found): <users> <user> <id>100</id> <lat>50</lat> <lon>122</lon> <name>Mark</name> </user> </users> Thanks in advance! M
  3. Hi there, I am trying to get ldap_modify to change an attribute in my Active Directory. $activeUser="Test Guy"; $floorname = "First Floor"; $entry[physicaldeliveryofficename] = $floorname $results = ldap_modify($ds,"CN=$activeUser,OU=Test,DC=LDAPSERVER,DC=COM", $entry); if (TRUE === $result) { echo "The entry was successfully modified."; } else { echo "The entry could not be modified."; } Am I doing something wrong? Thanks in advance, ML
  4. I have a very simple script that basically searches an xml file for a node based on the id of another node. I then update the node I found with a new value. For some reason my code is not performing the update. It is actually creating another node within the existing node. Any idea why? XML: <?xml version="1.0" encoding="UTF-8" ?> <users> <user> <id>1</id> <firstname>Bob</firstname> <lastname>Marley</lastname> </user> <user> <id>2</id> <firstname>Bruce</firstname> <lastname>Springsteen</lastname> </user> </users> PHP Code: <?php $file = "officedata.xml"; $xml=simplexml_load_file($file); foreach ($xml->xpath('//user[id="2"]/lastname') as $desc) { echo "$desc\n"; $desc->lastname = "Penner"; } file_put_contents($file, $xml->asXML()); ?> The updated XML looks like this: <?xml version="1.0" encoding="UTF-8" ?> <users> <user> <id>1</id> <firstname>Bob</firstname> <lastname>Marley</lastname> </user> <user> <id>2</id> <firstname>Bruce</firstname> <lastname> Springsteen <lastname>Penner</lastname> </lastname> </user> </users>
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.