home *** CD-ROM | disk | FTP | other *** search
/ Australian Personal Computer 2004 July / APC0407D2.iso / workshop / apache / files / ActivePerl-5.6.1.638-MSWin32-x86.msi / _228ffe7d455d28668d9542df249ac601 < prev    next >
Encoding:
Text File  |  2004-04-13  |  3.1 KB  |  123 lines

  1. # Copyright (c) 1998 Graham Barr <gbarr@pobox.com>. All rights reserved.
  2. # This program is free software; you can redistribute it and/or
  3. # modify it under the same terms as Perl itself.
  4.  
  5. package URI::ldap;
  6.  
  7. use strict;
  8.  
  9. use vars qw(@ISA $VERSION);
  10. $VERSION = "1.11";
  11.  
  12. require URI::_server;
  13. require URI::_ldap;
  14. @ISA=qw(URI::_ldap URI::_server);
  15.  
  16. sub default_port { 389 }
  17.  
  18. sub _nonldap_canonical {
  19.     my $self = shift;
  20.     $self->URI::_server::canonical(@_);
  21. }
  22.  
  23. 1;
  24.  
  25. __END__
  26.  
  27. =head1 NAME
  28.  
  29. URI::ldap - LDAP Uniform Resource Locators
  30.  
  31. =head1 SYNOPSIS
  32.  
  33.   use URI;
  34.  
  35.   $uri = URI->new("ldap:$uri_string");
  36.   $dn     = $uri->dn;
  37.   $filter = $uri->filter;
  38.   @attr   = $uri->attributes;
  39.   $scope  = $uri->scope;
  40.   %extn   = $uri->extensions;
  41.  
  42.   $uri = URI->new("ldap:");  # start empty
  43.   $uri->host("ldap.itd.umich.edu");
  44.   $uri->dn("o=University of Michigan,c=US");
  45.   $uri->attributes(qw(postalAddress));
  46.   $uri->scope('sub');
  47.   $uri->filter('(cn=Babs Jensen)');
  48.   print $uri->as_string,"\n";
  49.  
  50. =head1 DESCRIPTION
  51.  
  52. C<URI::ldap> provides an interface to parse an LDAP URI in its
  53. constituent parts and also build a URI as described in
  54. RFC 2255.
  55.  
  56. =head1 METHODS
  57.  
  58. C<URI::ldap> support all the generic and server methods defined by
  59. L<URI>, plus the following.
  60.  
  61. Each of the following methods can be used to set or get the value in
  62. the URI. The values are passed in unescaped form.  None of these will
  63. return undefined values, but elements without a default can be empty.
  64. If arguments are given then a new value will be set for the given part
  65. of the URI.
  66.  
  67. =over 4
  68.  
  69. =item $uri->dn( [$new_dn] )
  70.  
  71. Set or get the I<Distinguised Name> part of the URI.  The DN
  72. identifies the base object of the LDAP search.
  73.  
  74. =item $uri->attributes( [@new_attrs] )
  75.  
  76. Set or get the list of attribute names which will be
  77. returned by the search.
  78.  
  79. =item $uri->scope( [$new_scope] )
  80.  
  81. Set or get the scope that the search will use. The value can be one of
  82. C<"base">, C<"one"> or C<"sub">. If none is given in the URI then the
  83. return value will default to C<"base">.
  84.  
  85. =item $uri->_scope( [$new_scope] )
  86.  
  87. Same as scope(), but does not default to anything.
  88.  
  89. =item $uri->filter( [$new_filter] )
  90.  
  91. Set or get the filter that the search will use. If none is given in
  92. the URI then the return value will default to C<"(objectClass=*)">.
  93.  
  94. =item $uri->_filter( [$new_filter] )
  95.  
  96. Same as filter(), but does not default to anything.
  97.  
  98. =item $uri->extensions( [$etype => $evalue,...] )
  99.  
  100. Set or get the extensions used for the search. The list passed should
  101. be in the form etype1 => evalue1, etype2 => evalue2,... This is also
  102. the form of list that will be returned.
  103.  
  104. =back
  105.  
  106. =head1 SEE ALSO
  107.  
  108. L<RFC-2255|http://www.cis.ohio-state.edu/htbin/rfc/rfc2255.html>
  109.  
  110. =head1 AUTHOR
  111.  
  112. Graham Barr E<lt>F<gbarr@pobox.com>E<gt>
  113.  
  114. Slightly modified by Gisle Aas to fit into the URI distribution.
  115.  
  116. =head1 COPYRIGHT
  117.  
  118. Copyright (c) 1998 Graham Barr. All rights reserved. This program is
  119. free software; you can redistribute it and/or modify it under the same
  120. terms as Perl itself.
  121.  
  122. =cut
  123.