server; $search = @ldap_read( $ds, $dn, "(objectClass=*)", array($attr)); if( ! $search ) { echo $_SESSION['header']; echo "LDAP Account Manager\n"; echo "\n"; echo "\n"; StatusMessage("ERROR", _('Encountered an error while performing search.'), ldap_error($ds)); echo ""; exit; } $entry = ldap_first_entry( $ds, $search ); $attrs = ldap_get_attributes( $ds, $entry ); $attr = ldap_first_attribute( $ds, $entry, $attrs ); $values = ldap_get_values_len( $ds, $entry, $attr ); $count = $values['count']; // Dump the binary data to the browser header( "Content-type: octet-stream" ); header( "Content-disposition: attachment; filename=$attr" ); header( "Expires: Mon, 26 Jul 1997 05:00:00 GMT" ); header( "Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT" ); echo $values[$value_num]; ?>