aboutsummaryrefslogtreecommitdiffstats
path: root/lib/CatDap
diff options
context:
space:
mode:
authorBuchan Milne <buchan@mageia.org>2011-02-15 23:01:21 +0000
committerBuchan Milne <buchan@mageia.org>2011-02-15 23:01:21 +0000
commit2bf1d4b2e19579a84d61b1d05b398eacfcf50ce2 (patch)
treebd6706a2aad9c8c845d6531a459a55afc94daeaa /lib/CatDap
parente245fa424e6a6f7dd3a1da5e56a6b90bf7780d6f (diff)
downloadidentity-2bf1d4b2e19579a84d61b1d05b398eacfcf50ce2.tar
identity-2bf1d4b2e19579a84d61b1d05b398eacfcf50ce2.tar.gz
identity-2bf1d4b2e19579a84d61b1d05b398eacfcf50ce2.tar.bz2
identity-2bf1d4b2e19579a84d61b1d05b398eacfcf50ce2.tar.xz
identity-2bf1d4b2e19579a84d61b1d05b398eacfcf50ce2.zip
Fix display of non-ascii characters (may need some work in admin for multi-valued attributes)
Diffstat (limited to 'lib/CatDap')
-rw-r--r--lib/CatDap/Controller/admin.pm11
-rw-r--r--lib/CatDap/Controller/user.pm1
2 files changed, 11 insertions, 1 deletions
diff --git a/lib/CatDap/Controller/admin.pm b/lib/CatDap/Controller/admin.pm
index 914b2d0..da609bb 100644
--- a/lib/CatDap/Controller/admin.pm
+++ b/lib/CatDap/Controller/admin.pm
@@ -143,7 +143,15 @@ sub account : Local {
my $mesg =
$c->model('user')
->search("(&(objectClass=inetOrgPerson)($attribute=$value))");
- my @entries = $mesg->entries;
+ my @orig_entries = $mesg->entries;
+ my @entries;
+ foreach my $entry (@orig_entries) {
+ my %new_entry;
+ foreach my $attr ($entry->attributes) {
+ $new_entry{$attr} = Encode::decode_utf8($entry->get_value($attr));
+ }
+ push @entries, \%new_entry;
+ }
push @errors, $mesg->error if $mesg->code;
$c->stash( entries => \@entries );
$c->stash( errors => \@errors );
@@ -295,6 +303,7 @@ sub account_modify : Local {
if grep /$attr/,
@{ ${ $c->config }{'Controller::User'}{'skip_attrs'} };
my @vals = $entry->get_value($attr);
+ foreach (@vals) { $_ = Encode::decode_utf8( $_ ); }
$attrdef = $schema->attribute($attr)
or die("getting schema failed: $!");
my %valhash = (
diff --git a/lib/CatDap/Controller/user.pm b/lib/CatDap/Controller/user.pm
index b3edb32..2d0ba04 100644
--- a/lib/CatDap/Controller/user.pm
+++ b/lib/CatDap/Controller/user.pm
@@ -202,6 +202,7 @@ sub index :Path :Args(0) {
next if ($attr eq "objectClass");
next if grep /$attr/,@{${$c->config}{'Controller::User'}{'skip_attrs'}};
my @vals = $entry->get_value($attr);
+ foreach (@vals) { $_ = Encode::decode_utf8( $_ ); }
$attrdef = $schema->attribute($attr) or die ("getting schema failed: $!");
my %valhash = (
name => $attr,