Item12281: LdapContrib update to 5.03 stops breaks foswiki:

pencil
Priority: Urgent
Current State: Closed
Released In: n/a
Target Release:
Applies To: Extension
Component: LdapContrib
Branches: trunk
Reported By: BertoldAltaner
Waiting For:
Last Change By: MichaelDaum
-- BertoldAltaner - 02 Dec 2012 -- BertoldAltaner - 02 Dec 2012
 
LdapContrib update from 5.02 to 5.03 stops breaks foswiki: Error Message: Foswiki detected an internal error - please check your Foswiki logs and webserver logs for more information.

Can't locate object method "toSiteCharSet" via package "Foswiki::Contrib::LdapContrib"

We use Foswiki::LoginManager::LdapApacheLogin

We run foswiki 1.1.6

Bertold

I added following at the end of LdapContrib.pm - that solves my problem...
=pod

---++ toSiteCharSet($string) -> $string

recode strings coming from ldap to the site's character set

=cut

sub toSiteCharSet {
  my ($this, $string) = @_;

  my $siteCharSet = $Foswiki::cfg{Site}{CharSet};
  my $ldapCharSet = $Foswiki::cfg{Ldap}{CharSet} || 'utf-8';

  my $octets = Encode::decode($ldapCharSet, $string);
  return Encode::encode($siteCharSet, $octets);
}
Topic revision: r3 - 13 Dec 2012, MichaelDaum
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License    Legal Imprint    Privacy Policy