/[soft]/identity/CatDap/trunk/lib/CatDap/Controller/admin.pm
ViewVC logotype

Diff of /identity/CatDap/trunk/lib/CatDap/Controller/admin.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 561 by buchan, Tue Feb 15 23:01:21 2011 UTC revision 562 by buchan, Wed Feb 16 15:05:33 2011 UTC
# Line 212  sub account_promote : Local { Line 212  sub account_promote : Local {
212      my $mesg =      my $mesg =
213        $c->model('user')        $c->model('user')
214        ->search("(&(objectClass=inetOrgPerson)(!(objectClass=posixAccount)))");        ->search("(&(objectClass=inetOrgPerson)(!(objectClass=posixAccount)))");
215      my @entries = $mesg->entries;      my @orig_entries = $mesg->entries;
216        my @entries;
217        foreach my $entry (@orig_entries) {
218            my %new_entry;
219            foreach my $attr($entry->attributes) {
220                $new_entry{$attr} = Encode::decode_utf8($entry->get_value($attr));
221            }
222            push @entries, \%new_entry;
223        }
224                
225      $c->stash( entries => \@entries );      $c->stash( entries => \@entries );
226      push @errors, $mesg->error if $mesg->code;      push @errors, $mesg->error if $mesg->code;
227      $mesg = $c->model('user')->search("(objectClass=posixGroup)");      $mesg = $c->model('user')->search("(objectClass=posixGroup)");
# Line 563  sub group : Local { Line 572  sub group : Local {
572      my $attribute = $c->req->param('attribute');      my $attribute = $c->req->param('attribute');
573      $attribute =~ s/[^\w\d]//g;      $attribute =~ s/[^\w\d]//g;
574      my $value = $c->req->param('value');      my $value = $c->req->param('value');
575      $value =~ s/[^\w\d\*]//g;      $value =~ s/[^\w\d\* ]//g;
576      my $mesg =      my $mesg =
577        $c->model('user')        $c->model('user')
578        ->search("(&(objectclass=posixGroup)($attribute=$value))");        ->search("(&(objectclass=posixGroup)($attribute=$value))");
# Line 583  sub group_modify : Local { Line 592  sub group_modify : Local {
592      $c->stash( subpages => gensubpages('account') );      $c->stash( subpages => gensubpages('account') );
593      my @errors;      my @errors;
594      $c->detach('/admin/group') if $group eq '';      $c->detach('/admin/group') if $group eq '';
595      if ( $group !~ /^[\w\d]*$/ ) {      if ( $group !~ /^[\w\d ]*$/ ) {
596          push @errors, "Group contains illegal characters";          push @errors, "Group contains illegal characters";
597          $c->detach('admin/group');          $c->detach('/admin/group');
598      }      }
599      my $mesg =      my $mesg =
600        $c->model('user')->search("(&(objectClass=posixGroup)(cn=$group))");        $c->model('user')->search("(&(objectClass=posixGroup)(cn=$group))");

Legend:
Removed from v.561  
changed lines
  Added in v.562

  ViewVC Help
Powered by ViewVC 1.1.28