1 <!-- copyright, (C) Predrag Balorda, 1998 -->
4 <style type="text/css">
7 font-family: lucida sans unicode;
13 font-family: lucida sans unicode,Arial,Helvetica;
17 font-family: lucinda sans unicode;
22 font-family: Verdana,Arial,Helvetica;
39 include ('include/ldap_manager.inc');
40 include ('include/query_manager.inc');
41 include ('include/search_form.inc');
42 $FILE = "http://$HTTP_HOST$SCRIPT_NAME";
43 $JPEGFILE = "http://$HTTP_HOST/ldap/ldap-photo.php3";
44 $qm = new query_manager;
45 $lm = new ldap_manager;
46 $attribute_names = array();
49 $main_start_time = microtime();
50 global $lm, $qm, $FILE;
51 $qm = new query_manager;
52 $lm = new ldap_manager;
53 $lm->ldap_action = $qm->get_action();
54 $lm->base_dn = $qm->get_base_dn();
55 $lm->host = $qm->get_host();
56 $lm->search_filter = $qm->get_search_filter();
57 $lm->loadAttributeNames();
58 display_advanced_form();
59 if (!$lm->connect($lm->host)) {
60 echo "Couldn't connect to <b>".$lm->host."</b><br>\n";
64 if (!$lm->ldapTakeAction($lm->ldap_action) || $lm->entriesCount == 0) {
65 echo "Didn't find anything for ".$lm->ldap_action." on ".$lm->search_filter." from ".$lm->base_dn."<br>\n";
69 // echo "I got <b>".$lm->entriesCount."</b> entries for ".$lm->ldap_action." on ".$lm->search_filter." from ".$lm->base_dn."<br>\n";
70 $get_entries_s_t = microtime();
72 $get_entries_e_t = microtime();
73 // echo "Disconnecting from <b>".$lm->host."</b><br>\n";
76 if (($qm->get_mode() == "tree") && ($lm->ldap_action == "list")) {
77 $display_entries_s_t = microtime();
78 ?><table width="100%" border=1 cellpadding=0 cellspacing=0>
80 <td bgcolor="#9380DB" align=center valign=absmiddle>
81 <h3 class=head><?echo $lm->formatHTMLBaseDN($lm->base_dn);?></h3>
86 <script language="JavaScript" src="javascript/expandable-outlines.js">
88 $tokens = array( 0 => " ", 1 => ",");
90 $s = ldap_dn2ufn($e->dn);
91 $firstel = $lm->stripString($s, $tokens);
92 for ($i=0; $i<count($lm->entries); $i++) {
94 $e = $lm->entries[$i];
95 $s = ldap_dn2ufn($e->dn);
96 $tin = $lm->stripString($s, $tokens);
97 ?><div id="<? echo $tin; ?>Parent" class=parent>
99 <a href="#" onClick="expandIt('<? echo $tin; ?>'); return false">
100 <img name="imEx" src="false.gif" border=0 alt=""></a>
101 <? $n = ldap_explode_dn($e->dn, 1); echo $n[0]; ?></h3>
103 <div id="<? echo $tin; ?>Child" class=child>
104 <table border=1 cellspacing=0 cellpadding=0>
105 <? $c .= $e->formatHTMLAttributes(); echo $c; ?>
110 ?><script language="JavaScript"><!--
112 firstEl = "<? echo $firstel; ?>Parent";
113 firstInd = getIndex(firstEl);
120 $display_entries_s_t = microtime();
121 $c = $lm->formatHTMLEntries();
124 $display_entries_e_t = microtime();
125 // echo "<div align=right valign=bottom>";
126 // $t1 = $lm->calculateTime("getEntries()", $get_entries_s_t, $get_entries_e_t);
127 // $t2 = $lm->calculateTime("displayEntries()", $display_entries_s_t, $display_entries_e_t);
128 // $main_end_time = microtime();
129 // $t3 = $lm->calculateTime("main()", $main_start_time, $main_end_time);
130 // $t = $t3 - ($t1 + $t2);
131 // echo "Ether : ".$t." seconds<br>\n";