diff --git a/contrib/php3-tool/COPYRIGHT b/contrib/php3-tool/COPYRIGHT
new file mode 100644
index 0000000000..cf1515dd54
--- /dev/null
+++ b/contrib/php3-tool/COPYRIGHT
@@ -0,0 +1,8 @@
+Copyright 1998 Predrag Balorda, London, UK
+All rights reserved.
+
+Redistribution and use in source and binary forms are permitted only
+as authorized by the OpenLDAP Public License. A copy of this
+license is available at http://www.OpenLDAP.org/license.html or
+in file LICENSE in the top-level directory of the distribution.
+
diff --git a/contrib/php3-tool/LICENSE b/contrib/php3-tool/LICENSE
new file mode 100644
index 0000000000..5731d2cffd
--- /dev/null
+++ b/contrib/php3-tool/LICENSE
@@ -0,0 +1,122 @@
+The OpenLDAP Public License
+
+Version 1.2, 1 September 1998
+Copyright 1998, The OpenLDAP Foundation.
+All Rights Reserved.
+
+Note:
+ This license is derived from the "Artistic License" as distributed
+ with the Perl Programming Language. As differences may exist, the
+ complete license should be read.
+
+PREAMBLE
+
+The intent of this document is to state the conditions under which a
+Package may be copied, such that the Copyright Holder maintains some
+semblance of artistic control over the development of the package,
+while giving the users of the package the right to use and distribute
+the Package in a more-or-less customary fashion, plus the right to make
+reasonable modifications.
+
+Definitions:
+
+ "Package" refers to the collection of files distributed by the
+ Copyright Holder, and derivatives of that collection of files
+ created through textual modification.
+
+ "Standard Version" refers to such a Package if it has not been
+ modified, or has been modified in accordance with the wishes
+ of the Copyright Holder.
+
+ "Copyright Holder" is whoever is named in the copyright or
+ copyrights for the package.
+
+ "You" is you, if you're thinking about copying or distributing
+ this Package.
+
+ "Reasonable copying fee" is whatever you can justify on the
+ basis of media cost, duplication charges, time of people involved,
+ and so on. (You will not be required to justify it to the
+ Copyright Holder, but only to the computing community at large
+ as a market that must bear the fee.)
+
+ "Freely Available" means that no fee is charged for the item
+ itself, though there may be fees involved in handling the item.
+ It also means that recipients of the item may redistribute it
+ under the same conditions they received it.
+
+1. You may make and give away verbatim copies of the source form of the
+Standard Version of this Package without restriction, provided that you
+duplicate all of the original copyright notices and associated disclaimers.
+
+2. You may apply bug fixes, portability fixes and other modifications
+derived from the Public Domain or from the Copyright Holder. A Package
+modified in such a way shall still be considered the Standard Version.
+
+3. You may otherwise modify your copy of this Package in any way, provided
+that you insert a prominent notice in each changed file stating how and
+when you changed that file, and provided that you do at least ONE of the
+following:
+
+ a) place your modifications in the Public Domain or otherwise make them
+ Freely Available, such as by posting said modifications to Usenet or
+ an equivalent medium, or placing the modifications on a major archive
+ site such as uunet.uu.net, or by allowing the Copyright Holder to include
+ your modifications in the Standard Version of the Package.
+
+ b) use the modified Package only within your corporation or organization.
+
+ c) rename any non-standard executables so the names do not conflict
+ with standard executables, which must also be provided, and provide
+ a separate manual page for each non-standard executable that clearly
+ documents how it differs from the Standard Version.
+
+ d) make other distribution arrangements with the Copyright Holder.
+
+4. You may distribute the programs of this Package in object code or
+executable form, provided that you do at least ONE of the following:
+
+ a) distribute a Standard Version of the executables and library files,
+ together with instructions (in the manual page or equivalent) on where
+ to get the Standard Version.
+
+ b) accompany the distribution with the machine-readable source of
+ the Package with your modifications.
+
+ c) accompany any non-standard executables with their corresponding
+ Standard Version executables, giving the non-standard executables
+ non-standard names, and clearly documenting the differences in manual
+ pages (or equivalent), together with instructions on where to get
+ the Standard Version.
+
+ d) make other distribution arrangements with the Copyright Holder.
+
+5. You may charge a reasonable copying fee for any distribution of this
+Package. You may charge any fee you choose for support of this Package.
+You may not charge a fee for this Package itself. However,
+you may distribute this Package in aggregate with other (possibly
+commercial) programs as part of a larger (possibly commercial) software
+distribution provided that you do not advertise this Package as a
+product of your own.
+
+6. The scripts and library files supplied as input to or produced as
+output from the programs of this Package do not automatically fall
+under the copyright of this Package, but belong to whomever generated
+them, and may be sold commercially, and may be aggregated with this
+Package.
+
+7. C subroutines supplied by you and linked into this Package in order
+to emulate subroutines and variables of the language defined by this
+Package shall not be considered part of this Package, but are the
+equivalent of input as in Paragraph 6, provided these subroutines do
+not change the language in any way that would cause it to fail the
+regression tests for the language.
+
+8. The name of the Copyright Holder may not be used to endorse or promote
+products derived from this software without specific prior written permission.
+
+9. THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR
+IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
+WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+
+The End
diff --git a/contrib/php3-tool/Makefile b/contrib/php3-tool/Makefile
new file mode 100644
index 0000000000..345c8a8e82
--- /dev/null
+++ b/contrib/php3-tool/Makefile
@@ -0,0 +1,2 @@
+all:
+ @printf "Hehe, these are scripts..you don't \033[1mcompile\033[0m them\n"
diff --git a/contrib/php3-tool/README b/contrib/php3-tool/README
new file mode 100644
index 0000000000..ff98acc809
--- /dev/null
+++ b/contrib/php3-tool/README
@@ -0,0 +1,6 @@
+blah blah blah yadda yadda yadda don't forget to modify at.conf
+blah blah
+/me hopes you'll like this
+
+p.s. do _NOT_ forget to add this to your /etc/httpd/conf/srm.conf (or wherever your put it):
+DorectoryIndex .... index.php3 ...
diff --git a/contrib/php3-tool/at.conf b/contrib/php3-tool/at.conf
new file mode 100644
index 0000000000..0c46a6a599
--- /dev/null
+++ b/contrib/php3-tool/at.conf
@@ -0,0 +1,53 @@
+aliasedObjectName,Aliased Object Name,TRUE
+associatedname,Associated Name,TRUE
+associateddomain,Associated Domain,TRUE
+audio,Audio Sample,TRUE
+cn,Common Name,TRUE
+dn,Distinguished Name,TRUE
+description,Description,TRUE
+documentauthor,Document Author,TRUE
+drink,Favourite Drink,TRUE
+errorsto,Errors To,TRUE
+facsimiletelephonenumber,Fax Number,TRUE
+fax,Fax Number,TRUE
+homephone,Home Telephone Number,TRUE
+homepostaladdress,Home Postal Address,TRUE
+joinable,Can be joined,TRUE
+jpegphoto,Photograph,TRUE
+krbname,Kerberos Name,TRUE
+l,Location,TRUE
+labeledurl,Web Page,TRUE
+lastmodifiedby,Last Modified by,TRUE
+lastmodifiedtime,Last Modified at,TRUE
+mail,E-mail,TRUE
+manager,Manager,TRUE
+member,Mambers,TRUE
+mobile,Mobile Phone Number,TRUE
+mobiletelephonenumber,Mobile Phone Number,TRUE
+modifytimestamp,Modified at,TRUE
+modifiersname,Modified by,TRUE
+multilinedescription,Multi-lined description,TRUE
+naminglink,Naming Link,TRUE
+nobatchupdates,No Batch Updates,TRUE
+notice,Notice,TRUE
+o,Organization,TRUE
+objectclass,Object Class,TRUE
+onvacation,On Vacation,TRUE
+ou,Organizational Unit,TRUE
+owner,Owner,TRUE
+pager,Pager Number,TRUE
+pagertelephonenumber,Pager Number,TRUE
+personalsignature,Personal Signature,TRUE
+photo,Photograph,TRUE
+postaladdress,Postal Address,TRUE
+reciprocalnaminglink,Reciprocal Naming Link,TRUE
+requeststo,Requests To,TRUE
+secretary,Secretary,TRUE
+seealso,See Also,TRUE
+sn,Surname,TRUE
+st,State,TRUE
+streetaddress,Streed Address,TRUE
+telephonenumber,Telephone Number,TRUE
+title,Title,TRUE
+userpassword,User Password,TRUE
+uid,User ID,TRUE
diff --git a/contrib/php3-tool/at.conf2 b/contrib/php3-tool/at.conf2
new file mode 100644
index 0000000000..0c46a6a599
--- /dev/null
+++ b/contrib/php3-tool/at.conf2
@@ -0,0 +1,53 @@
+aliasedObjectName,Aliased Object Name,TRUE
+associatedname,Associated Name,TRUE
+associateddomain,Associated Domain,TRUE
+audio,Audio Sample,TRUE
+cn,Common Name,TRUE
+dn,Distinguished Name,TRUE
+description,Description,TRUE
+documentauthor,Document Author,TRUE
+drink,Favourite Drink,TRUE
+errorsto,Errors To,TRUE
+facsimiletelephonenumber,Fax Number,TRUE
+fax,Fax Number,TRUE
+homephone,Home Telephone Number,TRUE
+homepostaladdress,Home Postal Address,TRUE
+joinable,Can be joined,TRUE
+jpegphoto,Photograph,TRUE
+krbname,Kerberos Name,TRUE
+l,Location,TRUE
+labeledurl,Web Page,TRUE
+lastmodifiedby,Last Modified by,TRUE
+lastmodifiedtime,Last Modified at,TRUE
+mail,E-mail,TRUE
+manager,Manager,TRUE
+member,Mambers,TRUE
+mobile,Mobile Phone Number,TRUE
+mobiletelephonenumber,Mobile Phone Number,TRUE
+modifytimestamp,Modified at,TRUE
+modifiersname,Modified by,TRUE
+multilinedescription,Multi-lined description,TRUE
+naminglink,Naming Link,TRUE
+nobatchupdates,No Batch Updates,TRUE
+notice,Notice,TRUE
+o,Organization,TRUE
+objectclass,Object Class,TRUE
+onvacation,On Vacation,TRUE
+ou,Organizational Unit,TRUE
+owner,Owner,TRUE
+pager,Pager Number,TRUE
+pagertelephonenumber,Pager Number,TRUE
+personalsignature,Personal Signature,TRUE
+photo,Photograph,TRUE
+postaladdress,Postal Address,TRUE
+reciprocalnaminglink,Reciprocal Naming Link,TRUE
+requeststo,Requests To,TRUE
+secretary,Secretary,TRUE
+seealso,See Also,TRUE
+sn,Surname,TRUE
+st,State,TRUE
+streetaddress,Streed Address,TRUE
+telephonenumber,Telephone Number,TRUE
+title,Title,TRUE
+userpassword,User Password,TRUE
+uid,User ID,TRUE
diff --git a/contrib/php3-tool/false.gif b/contrib/php3-tool/false.gif
new file mode 100644
index 0000000000..b5a6fb3dd6
Binary files /dev/null and b/contrib/php3-tool/false.gif differ
diff --git a/contrib/php3-tool/images/I.gif b/contrib/php3-tool/images/I.gif
new file mode 100644
index 0000000000..e9067b2030
Binary files /dev/null and b/contrib/php3-tool/images/I.gif differ
diff --git a/contrib/php3-tool/images/L.gif b/contrib/php3-tool/images/L.gif
new file mode 100644
index 0000000000..a11cead6f8
Binary files /dev/null and b/contrib/php3-tool/images/L.gif differ
diff --git a/contrib/php3-tool/images/Lminus.gif b/contrib/php3-tool/images/Lminus.gif
new file mode 100644
index 0000000000..c316c834a7
Binary files /dev/null and b/contrib/php3-tool/images/Lminus.gif differ
diff --git a/contrib/php3-tool/images/Lplus.gif b/contrib/php3-tool/images/Lplus.gif
new file mode 100644
index 0000000000..701c16c778
Binary files /dev/null and b/contrib/php3-tool/images/Lplus.gif differ
diff --git a/contrib/php3-tool/images/T.gif b/contrib/php3-tool/images/T.gif
new file mode 100644
index 0000000000..5803c1d50a
Binary files /dev/null and b/contrib/php3-tool/images/T.gif differ
diff --git a/contrib/php3-tool/images/Tminus.gif b/contrib/php3-tool/images/Tminus.gif
new file mode 100644
index 0000000000..1a3b056898
Binary files /dev/null and b/contrib/php3-tool/images/Tminus.gif differ
diff --git a/contrib/php3-tool/images/Tplus.gif b/contrib/php3-tool/images/Tplus.gif
new file mode 100644
index 0000000000..536dbc9a1b
Binary files /dev/null and b/contrib/php3-tool/images/Tplus.gif differ
diff --git a/contrib/php3-tool/images/foldericon.gif b/contrib/php3-tool/images/foldericon.gif
new file mode 100644
index 0000000000..96b709eaf0
Binary files /dev/null and b/contrib/php3-tool/images/foldericon.gif differ
diff --git a/contrib/php3-tool/images/htmlicon.gif b/contrib/php3-tool/images/htmlicon.gif
new file mode 100644
index 0000000000..2a8fd4f300
Binary files /dev/null and b/contrib/php3-tool/images/htmlicon.gif differ
diff --git a/contrib/php3-tool/images/openfoldericon.gif b/contrib/php3-tool/images/openfoldericon.gif
new file mode 100644
index 0000000000..c60c811a60
Binary files /dev/null and b/contrib/php3-tool/images/openfoldericon.gif differ
diff --git a/contrib/php3-tool/images/top.gif b/contrib/php3-tool/images/top.gif
new file mode 100644
index 0000000000..7284af16f3
Binary files /dev/null and b/contrib/php3-tool/images/top.gif differ
diff --git a/contrib/php3-tool/images/topopen.gif b/contrib/php3-tool/images/topopen.gif
new file mode 100644
index 0000000000..9aa42400ca
Binary files /dev/null and b/contrib/php3-tool/images/topopen.gif differ
diff --git a/contrib/php3-tool/images/white.gif b/contrib/php3-tool/images/white.gif
new file mode 100644
index 0000000000..6a62ac8b2a
Binary files /dev/null and b/contrib/php3-tool/images/white.gif differ
diff --git a/contrib/php3-tool/include/ldap_entry.inc b/contrib/php3-tool/include/ldap_entry.inc
new file mode 100644
index 0000000000..d3f19d862d
--- /dev/null
+++ b/contrib/php3-tool/include/ldap_entry.inc
@@ -0,0 +1,110 @@
+
+include 'include/ldap_entry_attribute.inc';
+class ldap_entry {
+ var $attributes;
+ var $dn;
+ var $parent;
+ var $attributeCount;
+ var $link_identifier;
+ var $r_e_i;
+
+ cfunction ldap_entry($l_i) {
+ // echo "creating new ldap_entry \n";
+ $this->link_identifier = $l_i;
+ }
+
+ cfunction getAttributes() {
+ $i=0;
+ $attrib = new ldap_entry_attribute($this->dn);
+ $n = ldap_first_attribute($this->link_identifier, $this->r_e_i, &$ber);
+ while ($n) {
+ $attrib->name = $n;
+ $attrib->getValues($this->link_identifier,$this->r_e_i);
+ $this->attributes[$i] = $attrib;
+ $i++;
+ $attrib = new ldap_entry_attribute($this->dn);
+ $n = ldap_next_attribute($this->link_identifier, $this->r_e_i, $ber);
+ }
+ }
+
+ cfunction formatHTMLDN($dn) {
+ global $FILE, $host;
+ $string = "";
+ $attribs = ldap_explode_dn($dn, 0);
+ $names = ldap_explode_dn($dn, 1);
+ for ($i=0; $i<$attribs["count"]; $i++) {
+ $s = $attribs[$i];
+ for ($j=$i+1; $j<$attribs["count"]; $j++) {
+ $s .= ",".$attribs[$j];
+ }
+ if (($s[0] == "c") && ($s[1] == "n")) {
+ $string .= "".$names[$i]."";
+ }
+ else {
+ $string .= "".$names[$i]."";
+ }
+ if ($i<$attribs["count"]-1) { $string .= ", "; }
+ }
+ return $string;
+ }
+
+ cfunction formatHTMLAttributes() {
+ global $FILE, $host;
+ $s = "";
+ $s .= "
';
+ $things = array(
+ 0 => array("Bind (authenticate) to the directory.", "bind", "who"),
+ 1 => array("Change the search base.", "cb", "where"),
+ 2 => array("Change information associated with an entry","change","entry"),
+ 3 => array("Create a new group entry","create","group"),
+ 4 => array("Edit a complete Directory entry","vedit","entry"),
+ 5 => array("Find an entry in the directory.","find","entry")
+ );
+ $this->makeForm($things);
+ echo '
';
+ $things = array(
+ 0 => array("Change the group base.","groupbase","where"),
+ 1 => array("Display detailed help for a function","help","command"),
+ 2 => array("Subscribe to a group.","join","group"),
+ 3 => array("List the groups owned by someone","list","who"),
+ 4 => array("List out the groups in which someone is a member.", "memberships", "who"),
+ 5 => array("Remove obsolete entries from a group.", "purge", "group")
+ );
+ $this->makeForm($things);
+ echo '