Changeset 679
- Timestamp:
- 01/20/10 17:57:40 (14 years ago)
- Files:
-
- 1 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
LATMOS-Accounts-Web/lib/LATMOS/Accounts/Web/Controller/Ajax.pm
r629 r679 100 100 } 101 101 102 sub 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 102 108 sub end : Private { 103 109 my ( $self, $c ) = @_; -
LATMOS-Accounts-Web/root/html/create/user.tt
r272 r679 5 5 [% IF step %] 6 6 <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> 7 Login:</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 }) %] 8 17 [% END %] 9 18 <tr><td>[% form.attr_label('sn') %]</td><td>[% form.attr_field('sn') %]</td></tr> -
LATMOS-Accounts/lib/LATMOS/Accounts/Bases.pm
r671 r679 231 231 return; 232 232 }; 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 } 233 239 $self->_create_c_object($otype, $id, %cdata); 234 240 } -
LATMOS-Accounts/lib/LATMOS/Accounts/Bases/Dummy/User.pm
r15 r679 17 17 } 18 18 19 sub _create { 20 my ($class, $id); 21 return 1; 22 } 23 19 24 sub _canonical_fields { 20 25 my ($self) = @_; -
LATMOS-Accounts/t/10_bases.t
r103 r679 1 1 use strict; 2 2 use warnings; 3 use Test::More tests => 1 3;3 use Test::More tests => 15; 4 4 5 5 use_ok('LATMOS::Accounts::Bases'); … … 22 22 is( $dummyb->get_field_name('user', 'homeDirectory'), "home", "can call get_fields_name"); 23 23 ok(!$dummyb->is_transactionnal, 'Dummy driver is not transactionnal'); 24 25 ok($dummyb->create_c_object('user', 'toto'), "Can create object"); 26 ok(!$dummyb->create_c_object('user', '1toto'), "Can't create object with wrong id");
Note: See TracChangeset
for help on using the changeset viewer.