Permalink
Browse files

Merge pull request #16 from marschap/next

preparation for the next release
  • Loading branch information...
2 parents 4a462af + 143daa5 commit 069426ad08967071e06494ef978d3926639ac985 @marschap marschap committed Jan 1, 2013
Showing with 896 additions and 653 deletions.
  1. +25 −29 lib/LWP/Protocol/ldap.pm
  2. +127 −133 lib/Net/LDAP.pm
  3. +1 −7 lib/Net/LDAP/ASN.pm
  4. +4 −4 lib/Net/LDAP/Bind.pm
  5. +15 −15 lib/Net/LDAP/Constant.pm
  6. +8 −8 lib/Net/LDAP/Control.pm
  7. +1 −1 lib/Net/LDAP/Control/Assertion.pm
  8. +1 −1 lib/Net/LDAP/Control/EntryChange.pm
  9. +1 −1 lib/Net/LDAP/Control/ManageDsaIT.pm
  10. +4 −4 lib/Net/LDAP/Control/MatchedValues.pm
  11. +4 −4 lib/Net/LDAP/Control/Paged.pm
  12. +5 −5 lib/Net/LDAP/Control/PasswordPolicy.pm
  13. +1 −1 lib/Net/LDAP/Control/PersistentSearch.pm
  14. +1 −1 lib/Net/LDAP/Control/PostRead.pm
  15. +5 −5 lib/Net/LDAP/Control/PreRead.pm
  16. +3 −3 lib/Net/LDAP/Control/ProxyAuth.pm
  17. +6 −6 lib/Net/LDAP/Control/Sort.pm
  18. +3 −3 lib/Net/LDAP/Control/SortResult.pm
  19. +1 −1 lib/Net/LDAP/Control/SyncDone.pm
  20. +4 −4 lib/Net/LDAP/Control/SyncRequest.pm
  21. +1 −1 lib/Net/LDAP/Control/SyncState.pm
  22. +5 −5 lib/Net/LDAP/Control/VLV.pm
  23. +1 −1 lib/Net/LDAP/Control/VLVResponse.pm
  24. +42 −41 lib/Net/LDAP/DSML.pm
  25. +46 −48 lib/Net/LDAP/Entry.pm
  26. +3 −3 lib/Net/LDAP/Extension.pm
  27. +1 −1 lib/Net/LDAP/Extension/Cancel.pm
  28. +2 −2 lib/Net/LDAP/Extension/Refresh.pm
  29. +1 −1 lib/Net/LDAP/Extension/SetPassword.pm
  30. +1 −1 lib/Net/LDAP/Extension/WhoAmI.pm
  31. +2 −2 lib/Net/LDAP/Extra.pm
  32. +2 −2 lib/Net/LDAP/Extra/AD.pm
  33. +20 −3 lib/Net/LDAP/FAQ.pod
  34. +32 −32 lib/Net/LDAP/Filter.pm
  35. +13 −13 lib/Net/LDAP/FilterMatch.pm
  36. +6 −6 lib/Net/LDAP/Intermediate.pm
  37. +8 −8 lib/Net/LDAP/Intermediate/SyncInfo.pm
  38. +88 −90 lib/Net/LDAP/LDIF.pm
  39. +1 −1 lib/Net/LDAP/LDIF.pod
  40. +14 −14 lib/Net/LDAP/Message.pm
  41. +1 −1 lib/Net/LDAP/RootDSE.pm
  42. +43 −42 lib/Net/LDAP/Schema.pm
  43. +17 −17 lib/Net/LDAP/Search.pm
  44. +79 −79 lib/Net/LDAP/Util.pm
  45. +1 −1 lib/Net/LDAPI.pm
  46. +1 −1 lib/Net/LDAPS.pm
  47. +1 −1 t/70sortctrl.t
  48. +120 −0 t/71preread.t
  49. +124 −0 t/72postread.t
View
@@ -13,7 +13,7 @@ use LWP::MediaTypes ();
require LWP::Protocol;
our @ISA = qw(LWP::Protocol);
-our $VERSION = "1.23";
+our $VERSION = '1.23';
use strict;
eval {
@@ -24,9 +24,9 @@ my $init_failed = $@ ? $@ : undef;
sub request {
my($self, $request, $proxy, $arg, $size, $timeout) = @_;
- $size = 4096 unless $size;
+ $size = 4096 unless $size;
- LWP::Debug::trace('()') if defined &LWP::Debug::trace;
+ LWP::Debug::trace('()') if defined &LWP::Debug::trace;
# check proxy
if (defined $proxy) {
@@ -61,7 +61,7 @@ sub request {
$init_failed);
}
- my ($user, $password) = defined($userinfo) ? split(":", $userinfo, 2) : ();
+ my ($user, $password) = defined($userinfo) ? split(':', $userinfo, 2) : ();
my %extn = $url->extensions;
my $tls = exists($extn{'x-tls'}) ? 1 : 0;
my $format = lc($extn{'x-format'} || 'html');
@@ -79,7 +79,7 @@ sub request {
# we only accept Basic authorization for now
if ($authorization =~ /^Basic\s+([A-Z0-9+\/=]+)$/i) {
require MIME::Base64;
- ($user, $password) = split(":", MIME::Base64::decode_base64($1), 2);
+ ($user, $password) = split(':', MIME::Base64::decode_base64($1), 2);
}
}
}
@@ -88,7 +88,7 @@ sub request {
my $ldap = new Net::LDAP($url->as_string);
if (!$ldap) {
return $self->_error(HTTP_BAD_REQUEST,
- "Connection to LDAP server failed", "$@");
+ 'Connection to LDAP server failed', "$@");
}
# optional: startTLS
@@ -116,7 +116,7 @@ sub request {
return $self->_ldap_error($mesg) if ($mesg->code);
# Create an initial response object
- my $response = HTTP::Response->new(HTTP_OK, "Document follows");
+ my $response = HTTP::Response->new(HTTP_OK, 'Document follows');
$response->request($request);
# return data in the format requested
@@ -125,10 +125,10 @@ sub request {
if ($format eq 'ldif') {
require Net::LDAP::LDIF;
- open(my $fh, ">", \$content);
- my $ldif = Net::LDAP::LDIF->new($fh, "w", version => 1);
+ open(my $fh, '>', \$content);
+ my $ldif = Net::LDAP::LDIF->new($fh, 'w', version => 1);
- while(my $entry = $mesg->shift_entry) {
+ while (my $entry = $mesg->shift_entry) {
$ldif->write_entry($entry);
}
$ldif->done;
@@ -137,11 +137,11 @@ sub request {
elsif ($format eq 'dsml') {
require Net::LDAP::DSML;
- open(my $fh, ">", \$content);
+ open(my $fh, '>', \$content);
my $dsml = Net::LDAP::DSML->new(output => $fh, pretty_print => 1);
$dsml->start_dsml();
- while(my $entry = $mesg->shift_entry) {
+ while (my $entry = $mesg->shift_entry) {
$dsml->write_entry($entry);
}
$dsml->end_dsml();
@@ -151,10 +151,9 @@ sub request {
require JSON;
my $entry;
- my $index;
my %objects;
- for ($index = 0 ; $entry = $mesg->entry($index); $index++) {
+ for (my $index = 0 ; $entry = $mesg->entry($index); $index++) {
my $dn = $entry->dn;
$objects{$dn} = {};
@@ -172,35 +171,32 @@ sub request {
$content = "<head><title>Directory Search Results</title></head>\n<body>";
for ($index = 0 ; $entry = $mesg->entry($index); $index++) {
- my $attr;
-
- $content .= $index ? qq{<tr><th colspan="2"><hr>&nbsp</tr>\n} : "<table>";
+ $content .= $index ? qq{<tr><th colspan="2"><hr>&nbsp</tr>\n} : '<table>';
$content .= qq{<tr><th colspan="2">} . $entry->dn . "</th></tr>\n";
- foreach $attr ($entry->attributes) {
+ foreach my $attr ($entry->attributes) {
my $vals = $entry->get_value($attr, asref => 1);
- my $val;
$content .= q{<tr><td align="right" valign="top"};
$content .= q{ rowspan="} . scalar(@$vals) . q{"}
if (@$vals > 1);
- $content .= ">" . $attr . "&nbsp</td>\n";
+ $content .= '>' . $attr . "&nbsp</td>\n";
my $j = 0;
- foreach $val (@$vals) {
- $val = qq!<a href="$val">$val</a>! if $val =~ /^https?:/;
- $val = qq!<a href="mailto:$val">$val</a>! if $val =~ /^[-\w]+\@[-.\w]+$/;
- $content .= "<tr>" if $j++;
+ foreach my $val (@$vals) {
+ $val = qq!<a href="$val">$val</a>! if $val =~ /^https?:/;
+ $val = qq!<a href="mailto:$val">$val</a>! if $val =~ /^[-\w]+\@[-.\w]+$/;
+ $content .= "<tr>" if $j++;
$content .= "<td>" . $val . "</td></tr>\n";
}
}
}
- $content .= "</table>" if $index;
- $content .= "<hr>";
- $content .= $index ? sprintf("%s Match%s found",$index, $index>1 ? "es" : "")
- : "<b>No Matches found</b>";
+ $content .= '</table>' if $index;
+ $content .= '<hr>';
+ $content .= $index ? sprintf('%s Match%s found', $index, $index>1 ? 'es' : '')
+ : '<b>No Matches found</b>';
$content .= "</body>\n";
}
$response->header('Content-Type' => $mime_type.'; charset=utf-8');
@@ -227,7 +223,7 @@ sub _error
my $res = HTTP::Response->new($code, $message);
if ($content) {
- $res->content_type("text/plain");
+ $res->content_type('text/plain');
$res->content($content);
}
Oops, something went wrong.

0 comments on commit 069426a

Please sign in to comment.