'; $server_info_list =array(); foreach( $servers as $id => $server ) { $base_dn = $server['base'] ? $server['base'] : try_to_get_root_dn( $id ); $server_info_list[$id]['id'] = $id; $server_info_list[$id]['name'] = $server['name']; $server_info_list[$id]['base_dn'] = $base_dn; if( $server['host'] ) { $server_menu_html .= ''; } } $server_menu_html .= ''; $filter = isset( $_GET['filter'] ) ? $_GET['filter'] : null; $filter = $filter; $attr = isset( $_GET['attribute'] ) ? $_GET['attribute'] : null; // grab the base dn for the search if( isset( $_GET['base_dn'] ) ) $base_dn = $_GET['base_dn']; elseif( '' != $servers[$server_id]['base'] ) $base_dn = $servers[$server_id]['base']; else $base_dn = try_to_get_root_dn( $server_id ); $criterion = isset( $_GET['criterion'] ) ? $_GET['criterion'] : null; $form = isset( $_GET['form'] ) ? $_GET['form'] : null; $scope = isset( $_GET['scope'] ) ? $_GET['scope'] : 'sub'; include 'header.php'; ?>


.
Searching...\n"; flush(); // prevent script from bailing early on a long delete @set_time_limit( 0 ); // grab the time limit set in config.php $size_limit = isset ( $search_result_size_limit ) && is_numeric( $search_result_size_limit ) ? $search_result_size_limit : 0; $time_start = utime(); if( $scope == 'base' ) $results = @ldap_read( $ds, $base_dn, $filter, $search_result_attributes, 0, 0, 0, LDAP_DEREF_ALWAYS ); elseif( $scope == 'one' ) $results = @ldap_list( $ds, $base_dn, $filter, $search_result_attributes, 0, 0, 0, LDAP_DEREF_ALWAYS ); else // scope == 'sub' $results = @ldap_search( $ds, $base_dn, $filter, $search_result_attributes, 0, 0, 0, LDAP_DEREF_ALWAYS ); $errno = @ldap_errno( $ds ); $time_end = utime(); $time_elapsed = round( $time_end - $time_start, 2 ); $count = @ldap_count_entries( $ds, $results ); ?>
(in seconds). Notice, search size limit exceeded.
\n"; } if( $size_limit > 0 && $count > $size_limit ) { echo "
Showing first $size_limit results.
\n"; } ?>
$size_limit ) { break; } $dn = ldap_get_dn( $ds, $entry_id ); $encoded_dn = rawurlencode( $dn ); $rdn = get_rdn( $dn ); ?>
"; echo "\n"; // Iterate over each attribute for this entry while( $attr ) { if( is_attr_binary( $server_id, $attr ) ) $values = array( "(binary)" ); else $values = ldap_get_values( $ds, $entry_id, $attr ); if( isset( $values['count'] ) ) unset( $values['count'] ); if( isset( $friendly_attrs[ strtolower( $attr ) ] ) ) $attr = "" . htmlspecialchars( $friendly_attrs[ strtolower($attr) ] ) . ""; else $attr = htmlspecialchars( $attr ); ?>
dn" . htmlspecialchars($dn) . "
\n"; ?>


.