Ignore:
Timestamp:
01/20/10 18:28:39 (14 years ago)
Author:
nanardon
Message:
  • online check login name validity and user does not exists
File:
1 edited

Legend:

Unmodified
Added
Removed
  • LATMOS-Accounts-Web/lib/LATMOS/Accounts/Web/Controller/Ajax.pm

    r679 r680  
    6666} 
    6767 
     68sub check_new_name : Local { 
     69    my ($self, $c, $otype) = @_; 
     70    my $base = $c->model('Accounts')->db; 
     71    my $val = $c->req->param('val'); 
     72 
     73    warn $otype; 
     74    if ($c->stash->{validity} = (lc($otype) eq 'user' || lc($otype) eq 'group') 
     75        ? LATMOS::Accounts::Utils::check_ug_validity($val) 
     76        : LATMOS::Accounts::Utils::check_oid_validity($val)) { 
     77        warn $c->stash->{validity}; 
     78        return; 
     79    } 
     80 
     81    if (my $obj = $base->get_object($otype, $val)) { 
     82        $c->stash->{validity} = "$val exists " . 
     83            ($obj->get_attributes('displayName') || '') 
     84    } 
     85} 
     86 
    6887sub objattrexist : Local { 
    6988    my ($self, $c, $otype, $attr) = @_; 
     
    100119} 
    101120 
    102 sub check_ug_validity { 
     121sub check_ug_validity : Local { 
    103122    my ( $self, $c ) = @_; 
    104123    my $val = $c->req->param('val'); 
Note: See TracChangeset for help on using the changeset viewer.