From 653846f8e90f4fde5d7e5977d33e173d247df10e Mon Sep 17 00:00:00 2001 From: Kurt Zeilenga Date: Tue, 27 Oct 1998 18:11:59 +0000 Subject: [PATCH] Initial revision --- contrib/php3-tool/COPYRIGHT | 8 + contrib/php3-tool/LICENSE | 122 +++++++++++++ contrib/php3-tool/Makefile | 2 + contrib/php3-tool/README | 6 + contrib/php3-tool/at.conf | 53 ++++++ contrib/php3-tool/at.conf2 | 53 ++++++ contrib/php3-tool/false.gif | Bin 0 -> 94 bytes contrib/php3-tool/images/I.gif | Bin 0 -> 114 bytes contrib/php3-tool/images/L.gif | Bin 0 -> 850 bytes contrib/php3-tool/images/Lminus.gif | Bin 0 -> 138 bytes contrib/php3-tool/images/Lplus.gif | Bin 0 -> 143 bytes contrib/php3-tool/images/T.gif | Bin 0 -> 857 bytes contrib/php3-tool/images/Tminus.gif | Bin 0 -> 139 bytes contrib/php3-tool/images/Tplus.gif | Bin 0 -> 145 bytes contrib/php3-tool/images/foldericon.gif | Bin 0 -> 923 bytes contrib/php3-tool/images/htmlicon.gif | Bin 0 -> 981 bytes contrib/php3-tool/images/openfoldericon.gif | Bin 0 -> 173 bytes contrib/php3-tool/images/top.gif | Bin 0 -> 1017 bytes contrib/php3-tool/images/topopen.gif | Bin 0 -> 1020 bytes contrib/php3-tool/images/white.gif | Bin 0 -> 837 bytes contrib/php3-tool/include/ldap_entry.inc | 110 ++++++++++++ .../include/ldap_entry_attribute.inc | 169 ++++++++++++++++++ contrib/php3-tool/include/ldap_manager.inc | 150 ++++++++++++++++ contrib/php3-tool/include/query_manager.inc | 141 +++++++++++++++ contrib/php3-tool/include/search_form.inc | 80 +++++++++ contrib/php3-tool/index.php3 | 138 ++++++++++++++ .../javascript/expandable-outlines.js | 133 ++++++++++++++ contrib/php3-tool/javascript/resize.js | 21 +++ contrib/php3-tool/ldap-photo.php3 | 46 +++++ contrib/php3-tool/true.gif | Bin 0 -> 91 bytes 30 files changed, 1232 insertions(+) create mode 100644 contrib/php3-tool/COPYRIGHT create mode 100644 contrib/php3-tool/LICENSE create mode 100644 contrib/php3-tool/Makefile create mode 100644 contrib/php3-tool/README create mode 100644 contrib/php3-tool/at.conf create mode 100644 contrib/php3-tool/at.conf2 create mode 100644 contrib/php3-tool/false.gif create mode 100644 contrib/php3-tool/images/I.gif create mode 100644 contrib/php3-tool/images/L.gif create mode 100644 contrib/php3-tool/images/Lminus.gif create mode 100644 contrib/php3-tool/images/Lplus.gif create mode 100644 contrib/php3-tool/images/T.gif create mode 100644 contrib/php3-tool/images/Tminus.gif create mode 100644 contrib/php3-tool/images/Tplus.gif create mode 100644 contrib/php3-tool/images/foldericon.gif create mode 100644 contrib/php3-tool/images/htmlicon.gif create mode 100644 contrib/php3-tool/images/openfoldericon.gif create mode 100644 contrib/php3-tool/images/top.gif create mode 100644 contrib/php3-tool/images/topopen.gif create mode 100644 contrib/php3-tool/images/white.gif create mode 100644 contrib/php3-tool/include/ldap_entry.inc create mode 100644 contrib/php3-tool/include/ldap_entry_attribute.inc create mode 100644 contrib/php3-tool/include/ldap_manager.inc create mode 100644 contrib/php3-tool/include/query_manager.inc create mode 100644 contrib/php3-tool/include/search_form.inc create mode 100644 contrib/php3-tool/index.php3 create mode 100644 contrib/php3-tool/javascript/expandable-outlines.js create mode 100644 contrib/php3-tool/javascript/resize.js create mode 100644 contrib/php3-tool/ldap-photo.php3 create mode 100644 contrib/php3-tool/true.gif 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 0000000000000000000000000000000000000000..b5a6fb3dd6db932d544df83cff4e7015a75e1abc GIT binary patch literal 94 zcmZ?wbhEHbIxs79 qB-~n;CZQz9<9ti>#xrNb&~ra@@1-Za+?=*(YuA*Vx+PN?7_0$JP$G-~ literal 0 HcmV?d00001 diff --git a/contrib/php3-tool/images/I.gif b/contrib/php3-tool/images/I.gif new file mode 100644 index 0000000000000000000000000000000000000000..e9067b2030285159e8fc579c42cc3819ccc981ea GIT binary patch literal 114 zcmZ?wbhEHb6lM@%*v!CCU0wa3;Xm;}@h1x-0|O(24g(N?%wS-VH#p(Bdh3H%XVc#$ c{AgWbHf_c9b(c;~ddGdt$o;ySI3t5K05AbU+5i9m literal 0 HcmV?d00001 diff --git a/contrib/php3-tool/images/L.gif b/contrib/php3-tool/images/L.gif new file mode 100644 index 0000000000000000000000000000000000000000..a11cead6f81697274f315d5aff05aa2c0423cf5c GIT binary patch literal 850 zcmZ?wbhEHb6lM@%_|5@@XKCPG&1qp}R1eEQ1JOUpc>5`D;^Egqs_;`%&)P z)89Q1<4E=_Vp_Pai_@% literal 0 HcmV?d00001 diff --git a/contrib/php3-tool/images/Lplus.gif b/contrib/php3-tool/images/Lplus.gif new file mode 100644 index 0000000000000000000000000000000000000000..701c16c778bfac4f3b97400a1730f97cce0ee0a1 GIT binary patch literal 143 zcmZ?wbhEHb6lM@%*vtR|)z#H4EiL~U{u2Wff3h$#FfcRdfOLY)U|_K+IN`Z^>%&)P z)89Q1<4E=_Vp_Pa8z<;b+9I+lYWo={@C|cq&S<-t^%8H@{2L=Xf E0PrUhWB>pF literal 0 HcmV?d00001 diff --git a/contrib/php3-tool/images/Tminus.gif b/contrib/php3-tool/images/Tminus.gif new file mode 100644 index 0000000000000000000000000000000000000000..1a3b056898bf7219da6ec45403f49cb6c6629114 GIT binary patch literal 139 zcmZ?wbhEHb6lM@%*vtR|)z#H4EiL~U{u2Wff3h$#FfcRdfOLY)U|_K*IN`Z^>%&)P z)89Q1<4E=_Vp_Pa%&)P z)89Q1<4E=_Vp_Pa8z<;b+9I+lY0Zu7 LGV3QU3=Gx)&w)#T literal 0 HcmV?d00001 diff --git a/contrib/php3-tool/images/foldericon.gif b/contrib/php3-tool/images/foldericon.gif new file mode 100644 index 0000000000000000000000000000000000000000..96b709eaf0d4f4d794d5d3e035d4685c0a514b4b GIT binary patch literal 923 zcmc(e&5O-p6vw~D2(z4PQW{BVN-1$>K~u`xxWh^o8ci{adr}q@3oPZOCd=8JTM9J` zjWQ)_c2kp3hl!1pHUEH;)$zH{KjB&Y>UqvN-}8OB_sq=nk)!h+?a&_$j!7$d>7}K;<=YbRM z>0V7Ci@8U5hF22|56Y3A>DBZ@i|#1T@@jVA7WUu=2A~*;XhH<6p$RXDuo-Bu0b`nW z>O62VqMDT`WHI;5sOBt!;Xyeosu@iz|z<8X-TD-&#STc+s7=U6VLK-Ys zLla&QVKdNR1I9G%)Op~vU*doG?EO2uNm|u`!S2C-LfdZZ=JxUK%G2Zb#zrTGZ>(H- zaP6Cax_j#3{QBJ3hpRuj)6Y&k8a=tN*!}W+ZKSj3#oX%Q^QZ6cpFMVV^1{;0<3qi# zx9)V7KKCatU;5a4_iN+H!L7Ttj4b-b>{Lwj`@i?SUmm~yb7<|&^2Jv>*B5r5d;9YH K>)z%eP5lF{YmSkk9}E z3q7#1u%+{Ue@5yPR-aI~9I zjAg=%2@73$rS$v`I2a|ePf%bEP!M=?9l*RlOFoP4KH|Sl|@gt-~!~P++o>g-u2yz+=JzrdHm7rB)jX4z9VeIbgTf zmJbJ;+j%PQ2fcl$iTqHpaYTw znZdvkb>W2P>ZK~rvpIjrAM}k&nANZ>^l4?&fq;aD?Ab;u-`x~=GHIH(fWQehhvp3# zN^+A=-P)j`AhKqQTJV9XiJ3 literal 0 HcmV?d00001 diff --git a/contrib/php3-tool/images/top.gif b/contrib/php3-tool/images/top.gif new file mode 100644 index 0000000000000000000000000000000000000000..7284af16f32602c6d1b2a54464a16511256fe9a4 GIT binary patch literal 1017 zcmZ?wbhEHb6lM@%_|5ypG?RMfusBD)jVbxBra@XWf6%_ z_|bkyu~Sr9r=Y@safuU;bfn3i1x1Hj*!9?x6h1Z{;Sf~dQBw#|U_93%VUp5ez;vXo zo;^y%piAL7H;0^p!;TLouNav*Ra7=`F*38Ti&#~d79?a{ZHbaKnX!TK==Jr<$JKHU zTyMI_n{zO)V0SqqGn=pk$BbDIR(1)9Flq>FkZ5FJNe(?wA!FIl#L)d&>B5;vMFs{Y fwt!=E9<+8{5|Q-xwXk0D_V$kA*Y{+N6d0@lz1IlR literal 0 HcmV?d00001 diff --git a/contrib/php3-tool/images/topopen.gif b/contrib/php3-tool/images/topopen.gif new file mode 100644 index 0000000000000000000000000000000000000000..9aa42400cadf72500a20c95fd5c8fa7d6259b266 GIT binary patch literal 1020 zcmZ?wbhEHb6lM@%_|5ypG?RMfusBD)jVbxBra@XWf6%_ z_|bkyu~Sr9r=Y@safuU;bfn3i1x1Hj*!9?x6h1Z{;Sf~dQBw#|U_93%VUp5ez;vXo zo;^y%piAL7H;0^p!;TLouNav*Ra7=`F*38Ti&#~d79?a{ZHbaKnX!TK==Jr<$JKHU zTyMI_n{zO)V0SqqGn=pk$BbDIR(1)9Flq>FkZ5FJNe(?wA!FIl#L)d&>B5;vMFs{Y jwt!=E9<+8{5|Q-xwXk0D_BN;agL`MK&EGXJFjxZs+vy4& literal 0 HcmV?d00001 diff --git a/contrib/php3-tool/images/white.gif b/contrib/php3-tool/images/white.gif new file mode 100644 index 0000000000000000000000000000000000000000..6a62ac8b2ad686f1f2e87368d4c0381dcae8dd65 GIT binary patch literal 837 zcmZ?wbhEHb6lM@%_|CvkU0wa3;r}QY4S|sv0*XIb7#SEC8FUzc0F);fIFuNeIb=LG kEI8QAA*>a1V#C72?E=bPb38UKI@&E^oOMUTK!L#;0K?i0RR910 literal 0 HcmV?d00001 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 @@ +\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 .= "\n\t"; + $s .= ''; + $s .= "\n\t\t

".$this->formatHTMLDN($this->dn)."

\n"; + $s .= "\t\t\n\t\n"; + $c = count($this->attributes); + for ($i=0; $i<$c; $i++) { + $attrib = $this->attributes[$i]; + if ($attrib->isVisible($attrib->name) == "TRUE") { + $s .= $attrib->formatHTMLValues(); + } + // switch ($attrib->name) { + // case "krbname": + // case "objectclass": + // case "nobatchupdates": + // case "uid": + // case "userpassword": break; + // default: + // $s .= $attrib->formatHTMLValues(); + // break; + // } + } + $a = $this->attributes[0]; + $v = $a->values[1]; + if ($v == "organizationalUnit" || $v == "organization") { + $s .= "\n\t\n"; + $s .= "\t\tdn).">Browse\n"; + $s .= "\t\t\n\t\n"; + } + else { + $s .= "\n\t\n\t\t \n\t\t\n\t\n"; + } + return $s; + } + + cfunction display() { + global $FILE, $host; + echo ""; + echo "

".ldap_dn2ufn($this->dn)."

"; + echo ""; + $c = count($this->attributes); + for ($i=0; $i<$c; $i++) { + $attrib = $this->attributes[$i]; + $attrib->display(); + } + $a = $this->attributes[0]; + $v = $a->values[1]; + if ($v == "organizationalUnit" || $v == "organization") { + echo ""; + echo "dn).">Browse"; + echo ""; + } + else { + echo " "; + } + } +} +?> diff --git a/contrib/php3-tool/include/ldap_entry_attribute.inc b/contrib/php3-tool/include/ldap_entry_attribute.inc new file mode 100644 index 0000000000..d20da40857 --- /dev/null +++ b/contrib/php3-tool/include/ldap_entry_attribute.inc @@ -0,0 +1,169 @@ +\n"; + $this->dn = $d; + $a = ldap_explode_dn($this->dn, 1); + $this->cn = $a[0]; + } + + cfunction getAttributeName($string) { + global $attribute_names; + for ($i=0; $iname."
\n"; + $this->values = ldap_get_values($l_i, $r_e_i, $this->name); + } + + cfunction display() { + echo "\n\t\n"; + echo "\t\t".$this->name."\n\t\t\n\t\n"; + echo "
    \n"; + for($i=0; $i<$this->values["count"]; $i++) { + //echo "Displaying value ".$i."
    \n"; + echo "
  • "; + $this->displayValue($i); + echo "
    \n"; + } + echo "
\n"; + echo "\n\n"; + } + + cfunction formatHTMLValues() { + $ct = $this->values["count"]; + $str = ""; + $str .= "\n\t\n"; + $n = $this->getAttributeName($this->name); + $str .= "\t\t".$n."\n\t\t\n\t\n\t\t
    \n"; + // if ($ct > 1) { + // $str .= "\t\t
      \n"; + // } + for ($i=0; $i<$this->values["count"]; $i++) { + $str .= "\t\t\t
    • "; + $str .= $this->formatHTMLValue($i); + $str .= "
      \n"; + } + //if ($ct > 1) { $str .= "\t\t\t
    \n"; } + $str .= "\t\t\t
\n\t\t\n\t\n"; + return $str; + } + + cfunction formatHTMLValue($index) { + global $FILE, $JPEGFILE, $host; + $p = ""; + switch ($this->name) { + case "cn": + $p .= "dn).">".$this->values[$index].""; + break; + case "ou": + $p .= "dn).">".$this->values[$index].""; + break; + case "seealso": + case "member": + case "requeststo": + case "errorsto": + case "owner": + case "lastmodifiedby": + case "modifiersname": + $p .= "values[$index]).">".ldap_dn2ufn($this->values[$index]).""; + break; + case "mail": + $p .= "values[$index].">".$this->values[$index].""; + break; + case "postaladdress": + case "homepostaladdress": + $i=0; + $tok = strtok($this->values[$index], "$"); + while ($tok) { + $p .= $i." ".$tok."
\n"; + $tok = strtok("$"); + $i++; + } + break; + case "labeledurl": + $tok = strtok($this->values[$index], " "); + $tok2 = strtok("\0"); + $p .= ''.$tok2.''; + break; + case "lastmodifiedtime": + case "modifytimestamp": + $t = $this->values[$index]; + $hour = (int) $t[6].$t[7]; + $minute = (int) $t[8].$t[9]; + $second = (int) $t[10].$t[11]; + $month = (int) $t[2].$t[3]; + $day = (int) $t[4].$t[5]; + $year = (int) $t[0].$t[1]; + $timestamp = mktime($hour, $minute, $second, $month, $day, $year); + $date = date("h:i:sa, on l, dS of F Y", $timestamp); + $p .= $date; + break; + case "jpegphoto": + $p .= 'Image of '.$this->cn.''; + break; + default: + $p .= $this->values[$index]; + break; + } + return $p; + } + + cfunction displayValue($index) { + //echo "ldap_entry_attribute.displayValue(".$index.")
\n"; + global $FILE, $host; + if ($this->name == "cn") { + print "dn).">".$this->values[$index].""; + } + else if ($this->name == "ou") { + print "dn).">".$this->values[$index].""; + } + else if ($this->name == "seealso" || $this->name == "member" || $this->name == "requeststo" || $this->name == "errorsto" || $this->name == "owner" || $this->name == "lastmodifiedby" || $this->name == "modifiersname") { + print "values[$index]).">".ldap_dn2ufn($this->values[$index]).""; + } + else if ($this->name == "mail") { + print "values[$index].">".$this->values[$index].""; + } + else if ($this->name == "labeledurl") { + $tok = strtok($this->values[$index], " "); + $tok2 = strtok("\0"); + print ''.$tok2.''; + } + else if ($this->name == "lastmodifiedtime" || $this->name == "modifytimestamp") { + $t = $this->values[$index]; + $hour = (int) $t[6].$t[7]; + $minute = (int) $t[8].$t[9]; + $second = (int) $t[10].$t[11]; + $month = (int) $t[2].$t[3]; + $day = (int) $t[4].$t[5]; + $year = (int) $t[0].$t[1]; + $timestamp = mktime($hour, $minute, $second, $month, $day, $year); + $date = date("h:i:sa, on l, dS of F Y", $timestamp); + // $date = getdate($timestamp); + // $date = getdate($this->values[$index]); + // echo "".$date["hours"].":".$date["minutes"].", + // ".$date["weekday"].",".$date["month"]." ".$date["mday"].", ".$date["year"]."
\n"; + print $date; + } + else { + print $this->values[$index]; + } + } +} +?> diff --git a/contrib/php3-tool/include/ldap_manager.inc b/contrib/php3-tool/include/ldap_manager.inc new file mode 100644 index 0000000000..0861a9c1d9 --- /dev/null +++ b/contrib/php3-tool/include/ldap_manager.inc @@ -0,0 +1,150 @@ +link_identifier = ldap_connect($host); + if ($this->link_identifier) return 1; + return 0; + } + + function disconnect() { + ldap_close($this->link_identifier); + } + + function ldapTakeAction($a = "search") { + $func_ptr = "ldap_".$a; + if ($this->result_identifier = $func_ptr($this->link_identifier, $this->base_dn, $this->search_filter)) { + $this->entriesCount = ldap_count_entries($this->link_identifier, $this->result_identifier); + return 1; + } + return 0; + } + + cfunction getEntries() { + $i=0; + $entry = new ldap_entry($this->link_identifier); + $entry->r_e_i = ldap_first_entry($this->link_identifier, $this->result_identifier); + while($entry->r_e_i) { + $entry->dn = ldap_get_dn($this->link_identifier, $entry->r_e_i); + $entry->getAttributes(); + $this->entries[$i] = $entry; + $i++; + $r = $entry->r_e_i; + $entry = new ldap_entry($this->link_identifier); + $entry->r_e_i = ldap_next_entry($this->link_identifier, $r); + } +// ldap_free_result($this->result_identifier); + } + + cfunction displayEntries() { + echo $this->formatHTMLEntries(); + } + + cfunction loadAttributeNames() { + global $attribute_names; + if (count($attribute_names) != 0) { + //This is bullshit here..how do we make php3 + //preserve an array in memory between re-loads? + //And no, I'm not going to send it every time + //I make a subsequent request.. + //If we don't fix these things it won't run + //on anything smaller than a StarFire 10000 + //EVEN THOUGH this stuff is suprisingly fast. + echo "I have got attribute_names here
\n"; + } + else { + //echo "I dont have attribute_names here
\n"; + $fp = fopen("at.conf", "r"); + $i = 0; + while (!feof($fp)) { + $string = ""; + $foo = ""; + $string = fgets($fp, 80); + $foo = strtok($string, ","); + $attribute_names[$i][0] = $foo; + $foo = strtok(","); + $attribute_names[$i][1] = $foo; + $foo = strtok("\n"); + $attribute_names[$i][2] = $foo; + $i++; + } + } + // echo "Hello world:".count($attribute_names)."\n"; + // for ($i=0; $i".$attribute_names[$i][1]." - ".$attribute_names[$i][2]."
\n"; + // } + return $attribute_names; + } + cfunction formatHTMLBaseDN($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].", "; + } + } + return $string; + } + + cfunction formatHTMLEntries() { + $string = ""; + $string .= ''; + $string .= "\n"; + for ($i=0; $ientries); $i++) { + $e = $this->entries[$i]; + $string .= $e->formatHTMLAttributes(); + } + $string .= "
\n"; + return $string; + } + + cfunction calculateTime($string, $s_t, $e_t) { + $tok1 = strtok($s_t, " "); + $msecs1 = $tok1; + $tok1 = strtok(" "); + $secs1 = $tok1; + + $tok2 = strtok($e_t, " "); + $msecs2 = $tok2; + $tok2 = strtok(" "); + $secs2 = $tok2; + $t_t = (float) ($secs2 + $msecs2) - (float) ($secs1 + $msecs1); + echo "execution time for ".$string." : ".$t_t." seconds
\n"; + // echo "start: ".$secs1."
\n"; + // echo "end: ".$secs2."
\n"; + return (float) $t_t; + } + + cfunction stripString($string, $tokens) { + $s = $string; + for ($i=0; $i diff --git a/contrib/php3-tool/include/query_manager.inc b/contrib/php3-tool/include/query_manager.inc new file mode 100644 index 0000000000..0e38f24f71 --- /dev/null +++ b/contrib/php3-tool/include/query_manager.inc @@ -0,0 +1,141 @@ +
> +
+ + + +
+\n"; + for ($i=0; $i\n"; + echo "\n\t\n"; + echo $parameter[0]; + echo "\t\t\n\t"; + echo "\n\t\n"; + echo "\t\t\n"; + echo "\t\t\n\t\n"; + echo "\t\t\n"; + echo "\t\t\n\t\n\n"; + } + echo "\n"; + } + + cfunction display_console() { + echo ''; + echo ''; + echo '

LDAP Console

'; + $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 '
'; + } +} +?> diff --git a/contrib/php3-tool/include/search_form.inc b/contrib/php3-tool/include/search_form.inc new file mode 100644 index 0000000000..6dee433ad7 --- /dev/null +++ b/contrib/php3-tool/include/search_form.inc @@ -0,0 +1,80 @@ + + + + + + + + +
> +
+ + +
+ + + + +
+

+

> + Find + within + whose
+ + + + +
+

+
+ diff --git a/contrib/php3-tool/index.php3 b/contrib/php3-tool/index.php3 new file mode 100644 index 0000000000..d74a38af5a --- /dev/null +++ b/contrib/php3-tool/index.php3 @@ -0,0 +1,138 @@ + + + + + + +ldap_action = $qm->get_action(); + $lm->base_dn = $qm->get_base_dn(); + $lm->host = $qm->get_host(); + $lm->search_filter = $qm->get_search_filter(); + $lm->loadAttributeNames(); + display_advanced_form(); + if (!$lm->connect($lm->host)) { + echo "Couldn't connect to ".$lm->host."
\n"; + echo "Bye"; + return 0; + } + if (!$lm->ldapTakeAction($lm->ldap_action) || $lm->entriesCount == 0) { + echo "Didn't find anything for ".$lm->ldap_action." on ".$lm->search_filter." from ".$lm->base_dn."
\n"; + return 0; + } + else { + // echo "I got ".$lm->entriesCount." entries for ".$lm->ldap_action." on ".$lm->search_filter." from ".$lm->base_dn."
\n"; + $get_entries_s_t = microtime(); + $lm->getEntries(); + $get_entries_e_t = microtime(); + // echo "Disconnecting from ".$lm->host."
\n"; + $lm->disconnect(); + } + if (($qm->get_mode() == "tree") && ($lm->ldap_action == "list")) { + $display_entries_s_t = microtime(); + ?> + + + +
+

formatHTMLBaseDN($lm->base_dn);?>

+
+

+ " ", 1 => ","); + $e = $lm->entries[0]; + $s = ldap_dn2ufn($e->dn); + $firstel = $lm->stripString($s, $tokens); + for ($i=0; $ientries); $i++) { + $c = ""; + $e = $lm->entries[$i]; + $s = ldap_dn2ufn($e->dn); + $tin = $lm->stripString($s, $tokens); + ?>

+

+ + + dn, 1); echo $n[0]; ?>

+
+
+ + formatHTMLAttributes(); echo $c; ?> +
+
+
formatHTMLEntries(); + echo $c; + } + $display_entries_e_t = microtime(); +// echo "
"; +// $t1 = $lm->calculateTime("getEntries()", $get_entries_s_t, $get_entries_e_t); +// $t2 = $lm->calculateTime("displayEntries()", $display_entries_s_t, $display_entries_e_t); +// $main_end_time = microtime(); +// $t3 = $lm->calculateTime("main()", $main_start_time, $main_end_time); +// $t = $t3 - ($t1 + $t2); +// echo "Ether : ".$t." seconds
\n"; +// echo "
"; + return 1; +} +$return = main(); +?> + + diff --git a/contrib/php3-tool/javascript/expandable-outlines.js b/contrib/php3-tool/javascript/expandable-outlines.js new file mode 100644 index 0000000000..83c1c937af --- /dev/null +++ b/contrib/php3-tool/javascript/expandable-outlines.js @@ -0,0 +1,133 @@ + var bV=parseInt(navigator.appVersion); + NS4=(document.layers) ? true : false; + IE4=((document.all)&&(bV>=4))?true:false; + ver4 = (NS4 || IE4) ? true : false; + function expandIt(){return} + function expandAll(){return} + isExpanded = false; + + function getIndex(el) { + ind = null; + for (i=0; i"); + if (NS4) { + write(".parent {position:absolute; visibility:hidden}"); + write(".child {position:absolute; visibility:hidden}"); + write(".regular {position:absolute; visibility:hidden}") + } + else { + write(".child {display:none}") + } + write("\n"); +} +onload = initIt; diff --git a/contrib/php3-tool/javascript/resize.js b/contrib/php3-tool/javascript/resize.js new file mode 100644 index 0000000000..01dfc1b80f --- /dev/null +++ b/contrib/php3-tool/javascript/resize.js @@ -0,0 +1,21 @@ +/** + * resize.js 0.3 970811 + * by gary smith + * js component for "reloading page onResize" + */ + +if(!window.saveInnerWidth) { + window.onresize = resize; + window.saveInnerWidth = window.innerWidth; + window.saveInnerHeight = window.innerHeight; +} + +function resize() { + if (saveInnerWidth < window.innerWidth || + saveInnerWidth > window.innerWidth || + saveInnerHeight > window.innerHeight || + saveInnerHeight < window.innerHeight ) + { + window.history.go(0); + } +} diff --git a/contrib/php3-tool/ldap-photo.php3 b/contrib/php3-tool/ldap-photo.php3 new file mode 100644 index 0000000000..54d8c3b8d0 --- /dev/null +++ b/contrib/php3-tool/ldap-photo.php3 @@ -0,0 +1,46 @@ +\n"; +} +if (isset($cn)) { +// echo urldecode ($cn)."
\n"; +} +$link_identifier = ldap_connect("127.0.0.1"); +$result_identifier = ldap_read($link_identifier, $base_dn, 'objectclass=*'); +if(!$result_identifier) { + echo "No results.\n"; +} +else { + $num_entries = ldap_count_entries($link_identifier, $result_identifier); + if ($num_entries == 0) { + echo "No results\n"; + return 1; + } + Header("Content-type: image/jpeg"); + $info = ldap_get_entries($link_identifier, $result_identifier); + ldap_close($link_identifier); + for ($i=0; $i<$info["count"]; $i++) { +// echo $i; + if ($info[$i]["cn"][0] == $cn) { + //echo "".$info[$i]["cn"][0]."
"; + } + for ($j=0; $j<$info[$i]["count"]; $j++) { + $attribute = $info[$i][$j]; + if (strtolower ($attribute) == "jpegphoto") { + // $file = fopen("/tmp/tmpphoto.jpg", "w"); + // echo $info[$i]["jpegphoto"][0]; + $p = $info[$i]["jpegphoto"][0]; + $photo = base64_decode($p); + echo $photo; + // fwrite($file, $photo); + // flush(); + // fclose($file); + // $file = fopen("/tmp/tmpphoto.jpg", r); + // $contents = fread ($file, filesize("/tmp/tmpphoto.jpg")); + // fclose($file); + // echo $contents; + } + } + } +} +?> diff --git a/contrib/php3-tool/true.gif b/contrib/php3-tool/true.gif new file mode 100644 index 0000000000000000000000000000000000000000..306d3416ed8469a0fa7de722f7953d1b0809396b GIT binary patch literal 91 zcmZ?wbhEHbIxs76 n?7E}PH^b50kY(1{-I>Rxx~80za9qVFvBW1#`efQ$6$Wbn)D<5x literal 0 HcmV?d00001 -- 2.39.5