aboutsummaryrefslogtreecommitdiffstats
path: root/lib/CatDap/Controller
diff options
context:
space:
mode:
authorBuchan Milne <buchan@mageia.org>2011-02-16 15:05:33 +0000
committerBuchan Milne <buchan@mageia.org>2011-02-16 15:05:33 +0000
commitf31883ea438fc6ecabe3a1da24aecdced5e356e1 (patch)
tree637ad493f8f67a9dda27c772df634eef4153424c /lib/CatDap/Controller
parentc38c0dea5c102f2d1b476cd8060a196cde47ed2e (diff)
downloadidentity-f31883ea438fc6ecabe3a1da24aecdced5e356e1.tar
identity-f31883ea438fc6ecabe3a1da24aecdced5e356e1.tar.gz
identity-f31883ea438fc6ecabe3a1da24aecdced5e356e1.tar.bz2
identity-f31883ea438fc6ecabe3a1da24aecdced5e356e1.tar.xz
identity-f31883ea438fc6ecabe3a1da24aecdced5e356e1.zip
Fix displaying of groups with spaces in the name Fix non-ascii user details in 'promote' page
Diffstat (limited to 'lib/CatDap/Controller')
-rw-r--r--lib/CatDap/Controller/admin.pm17
1 files changed, 13 insertions, 4 deletions
diff --git a/lib/CatDap/Controller/admin.pm b/lib/CatDap/Controller/admin.pm
index da609bb..7fd5539 100644
--- a/lib/CatDap/Controller/admin.pm
+++ b/lib/CatDap/Controller/admin.pm
@@ -212,7 +212,16 @@ sub account_promote : Local {
my $mesg =
$c->model('user')
->search("(&(objectClass=inetOrgPerson)(!(objectClass=posixAccount)))");
- 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;
+ }
+
$c->stash( entries => \@entries );
push @errors, $mesg->error if $mesg->code;
$mesg = $c->model('user')->search("(objectClass=posixGroup)");
@@ -563,7 +572,7 @@ sub group : Local {
my $attribute = $c->req->param('attribute');
$attribute =~ s/[^\w\d]//g;
my $value = $c->req->param('value');
- $value =~ s/[^\w\d\*]//g;
+ $value =~ s/[^\w\d\* ]//g;
my $mesg =
$c->model('user')
->search("(&(objectclass=posixGroup)($attribute=$value))");
@@ -583,9 +592,9 @@ sub group_modify : Local {
$c->stash( subpages => gensubpages('account') );
my @errors;
$c->detach('/admin/group') if $group eq '';
- if ( $group !~ /^[\w\d]*$/ ) {
+ if ( $group !~ /^[\w\d ]*$/ ) {
push @errors, "Group contains illegal characters";
- $c->detach('admin/group');
+ $c->detach('/admin/group');
}
my $mesg =
$c->model('user')->search("(&(objectClass=posixGroup)(cn=$group))");