473,386 Members | 1,720 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

The ldap_modify command seems to be missing something?

Hi everyone,

While playing around with PHP, Squirrelmail, an Active Directory and
other assorted toys I ran into a strange limitation of the PHP
ldap_modify command.

In general, an ldap_modify should allow you to add values to an
attribute, delete selected values for an attribute, and replace all
values for an attribute. These are the three operations that are part of
what ldap_modify can do, outside PHP.

Imagine I have an LDIF like this:

dn: cn=test,cn=users,dc=test,dc=local
changetype: modify
delete: unicodePwd
unicodePwd:: IgB0AGUAcwB0ADEAMgAzAGEAYgBjACIA
-
add: unicodePwd
unicodePwd:: IgBuAGUAdwBQAGEAcwBzAHcAbwByAGQAIgA=
-

The above LDIF statement allows a 'mere' user to change his/her password
on a Windows Active Directory (W2k/W2k3) server [1]. The advantage to
this method is that the software in question would not need to know the
Administrator password at all to allow a user to change their password.

The idea is, you have to -delete- the old password entry to prove that
you actually know it, and then add a new one. The unicodePwd field is
write-only, you can never retrieve it's current value. By the way, these
values are BER-encoded WCHARS (16-byte characters).

In PHP, I can't seem to find a way to do this operation in a single LDAP
transaction. Doing it in two transactions won't work, and passing an
'empty' unicodePwd to get the old value deleted is not enough to satisfy
the Active Directory server, either. It seems like PHP does not have a
proper ldap_modify function. Compare e.g. the Perl::Ldap ldap_modify [2]
function, that allows you to specify exactly which attributes to add,
delete or replace.

Can anyone help me with applying the above LDIF from within PHP, or do
we need to extend/fix the ldap_modify command?

Regards, Paul Boven.

[1] http://support.microsoft.com/?kbid=269190
[2] http://search.cpan.org/~gbarr/perl-l...DAP.pod#modify
Jul 17 '05 #1
0 1649

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
by: Jack | last post by:
I'm trying to make a script that will search a list of files and remove the following line <meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>"> I'm doing this...
0
by: Tina Li | last post by:
Hello, I'm new to Python and pmw, and I might be missing something obvious, but...say I created a cascade menu 'Size' and am adding menu items: for size in ('tiny', 'small', 'average', 'big',...
4
by: Tom | last post by:
I want to open a recordset object on an .asp page. When I open the recordset I would like to use a stored procedure that expects a parameter to be passed for the stored procedure. I will then use...
8
by: Dawn Minnis | last post by:
Hey guys If I have a program (see codeSnippet1) that I compile to be called test.o Then run it as test.o n n 2 3 4 I want the code to be able to strip out the two characters at the start...
0
by: abhra.haldar | last post by:
Hi: I've been recently trying to use the command line C# compiler to compile a library for my ASP.NET application: *** csc /out:bin/ServiceBroker.dll...
5
by: Chris Hieronymus | last post by:
Hi, I have a bunch of x-y data contained in an array. I would like to plot the data using an external program (psxy in GMT). The plotting program takes x-y couples as standard input. ...
0
by: howardr101 | last post by:
Hi, Have hunted around on the groups and can't find anything, hence. I've tried this against 2 mail servers (mailtraq and hmailserver) and it occus with both. The problems seems to be that...
51
by: Ojas | last post by:
Hi!, I just out of curiosity want to know how top detect the client side application under which the script is getting run. I mean to ask the how to know whether the script is running under...
3
by: Sooraj | last post by:
Hi, I'm a mechanical engineer new to programming. I was trying to write a program in Visual Basic Express Edition 2005. I want to run a file using an application called madymo601 in command...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.