Changeset 679


Ignore:
Timestamp:
01/20/10 17:57:40 (14 years ago)
Author:
nanardon
Message:
  • grouper les documentations
Files:
1 added
5 edited

Legend:

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

    r629 r679  
    100100} 
    101101 
     102sub check_ug_validity { 
     103    my ( $self, $c ) = @_; 
     104    my $val = $c->req->param('val'); 
     105    $c->stash->{validity} = LATMOS::Accounts::Utils::check_ug_validity($val); 
     106} 
     107 
    102108sub end : Private { 
    103109    my ( $self, $c ) = @_; 
  • LATMOS-Accounts-Web/root/html/create/user.tt

    r272 r679  
    55[% IF step %] 
    66<tr><td>[% IF idexists %]<img src="[% c.uri_for('/static', 'icons', 'dialog-cancel.png') %]">[% END %] 
    7 Login:</td><td><input type="text" name="id" value="[% c.req.param('id') | html %]"></td></tr> 
     7Login:</td><td><input type="text" id="name" name="id" value="[% c.req.param('id') | html %]"> 
     8<span id="name_validity"></span> 
     9</td></tr> 
     10[% c.prototype.observe_field('name', { 
     11    url => c.uri_for('/ajax', 'check_ug_validity'), 
     12    with   => "'val='+value", 
     13    update => 'name_validity', 
     14    frequency => 1, 
     15    min_chars => 1, 
     16}) %] 
    817[% END %] 
    918<tr><td>[% form.attr_label('sn') %]</td><td>[% form.attr_field('sn') %]</td></tr> 
  • LATMOS-Accounts/lib/LATMOS/Accounts/Bases.pm

    r671 r679  
    231231        return; 
    232232    }; 
     233    if (my $chk = (lc($otype) eq 'user' || lc($otype) eq 'group') 
     234        ? LATMOS::Accounts::Utils::check_ug_validity($id) 
     235        : LATMOS::Accounts::Utils::check_oid_validity($id)) { 
     236        $self->log(LA_ERR, "Cannot create $otype with ID $id `%s:'", $chk); 
     237        return; 
     238    } 
    233239    $self->_create_c_object($otype, $id, %cdata); 
    234240} 
  • LATMOS-Accounts/lib/LATMOS/Accounts/Bases/Dummy/User.pm

    r15 r679  
    1717} 
    1818 
     19sub _create { 
     20    my ($class, $id); 
     21    return 1; 
     22} 
     23 
    1924sub _canonical_fields { 
    2025    my ($self) = @_; 
  • LATMOS-Accounts/t/10_bases.t

    r103 r679  
    11use strict; 
    22use warnings; 
    3 use Test::More tests => 13; 
     3use Test::More tests => 15; 
    44 
    55use_ok('LATMOS::Accounts::Bases'); 
     
    2222is( $dummyb->get_field_name('user', 'homeDirectory'), "home", "can call get_fields_name"); 
    2323ok(!$dummyb->is_transactionnal, 'Dummy driver is not transactionnal'); 
     24 
     25ok($dummyb->create_c_object('user', 'toto'), "Can create object"); 
     26ok(!$dummyb->create_c_object('user', '1toto'), "Can't create object with wrong id"); 
Note: See TracChangeset for help on using the changeset viewer.