diff options
| -rw-r--r-- | Changes | 3 | ||||
| -rw-r--r-- | lib/DJabberd/Plugin/VCard/LDAP.pm | 8 |
2 files changed, 7 insertions, 4 deletions
| @@ -1,5 +1,8 @@ | |||
| 1 | Revision history for DJabberd-VCard-LDAP | 1 | Revision history for DJabberd-VCard-LDAP |
| 2 | 2 | ||
| 3 | 0.03 2007-09-04 | ||
| 4 | Make sure to Base64 encode the jpegPhoto | ||
| 5 | |||
| 3 | 0.02 2007-08-23 | 6 | 0.02 2007-08-23 |
| 4 | More complete vCard. Support substituting domain as well as userid in filter | 7 | More complete vCard. Support substituting domain as well as userid in filter |
| 5 | 8 | ||
diff --git a/lib/DJabberd/Plugin/VCard/LDAP.pm b/lib/DJabberd/Plugin/VCard/LDAP.pm index 63a2a6a..1320dd8 100644 --- a/lib/DJabberd/Plugin/VCard/LDAP.pm +++ b/lib/DJabberd/Plugin/VCard/LDAP.pm | |||
| @@ -6,6 +6,7 @@ use strict; | |||
| 6 | use base 'DJabberd::Plugin::VCard'; | 6 | use base 'DJabberd::Plugin::VCard'; |
| 7 | 7 | ||
| 8 | use Net::LDAP; | 8 | use Net::LDAP; |
| 9 | use MIME::Base64; | ||
| 9 | 10 | ||
| 10 | our $logger = DJabberd::Log->get_logger(); | 11 | our $logger = DJabberd::Log->get_logger(); |
| 11 | 12 | ||
| @@ -15,11 +16,11 @@ DJabberd::VCard::LDAP - LDAP VCard Provider for DJabberd | |||
| 15 | 16 | ||
| 16 | =head1 VERSION | 17 | =head1 VERSION |
| 17 | 18 | ||
| 18 | Version 0.02 | 19 | Version 0.03 |
| 19 | 20 | ||
| 20 | =cut | 21 | =cut |
| 21 | 22 | ||
| 22 | our $VERSION = '0.02'; | 23 | our $VERSION = '0.03'; |
| 23 | 24 | ||
| 24 | =head1 SYNOPSIS | 25 | =head1 SYNOPSIS |
| 25 | 26 | ||
| @@ -120,7 +121,7 @@ sub load_vcard { | |||
| 120 | my $entry = $srch->entry(0); | 121 | my $entry = $srch->entry(0); |
| 121 | my $photo = $entry->get_value('jpegPhoto'); | 122 | my $photo = $entry->get_value('jpegPhoto'); |
| 122 | if (defined $photo) { | 123 | if (defined $photo) { |
| 123 | $photo = '<PHOTO><BINVAL>'.$photo.'</BINVAL></PHOTO>'; | 124 | $photo = '<PHOTO><BINVAL>'.encode_base64($photo).'</BINVAL></PHOTO>'; |
| 124 | } else { | 125 | } else { |
| 125 | $photo = ''; | 126 | $photo = ''; |
| 126 | } | 127 | } |
| @@ -155,7 +156,6 @@ sub load_vcard { | |||
| 155 | .$photo | 156 | .$photo |
| 156 | .'<DESC>'._isdef($entry->get_value('description')).'</DESC>' | 157 | .'<DESC>'._isdef($entry->get_value('description')).'</DESC>' |
| 157 | .'</vCard>'; | 158 | .'</vCard>'; |
| 158 | $logger->info($vCard); | ||
| 159 | undef($entry); | 159 | undef($entry); |
| 160 | undef($srch); | 160 | undef($srch); |
| 161 | return $vCard; | 161 | return $vCard; |
