\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(); } } $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 if ($v == "person") { $s .= "\n\t\n"; $s .= "\t\tdn).">Modify\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 " "; } } } ?>