aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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))");