Changeset 680
- Timestamp:
- 01/20/10 18:28:39 (14 years ago)
- Location:
- LATMOS-Accounts-Web
- Files:
-
- 1 added
- 2 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
LATMOS-Accounts-Web/lib/LATMOS/Accounts/Web/Controller/Ajax.pm
r679 r680 66 66 } 67 67 68 sub 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 68 87 sub objattrexist : Local { 69 88 my ($self, $c, $otype, $attr) = @_; … … 100 119 } 101 120 102 sub check_ug_validity {121 sub check_ug_validity : Local { 103 122 my ( $self, $c ) = @_; 104 123 my $val = $c->req->param('val'); -
LATMOS-Accounts-Web/root/html/ajax/check_ug_validity.tt
r679 r680 1 [% IF valid ty %]1 [% IF validity %] 2 2 <img src="[% c.uri_for('/static', 'images', 'dialog-cancel.png') %]"> 3 ([% valid ty %])3 ([% validity %]) 4 4 [% END %] -
LATMOS-Accounts-Web/root/html/create/user.tt
r679 r680 9 9 </td></tr> 10 10 [% c.prototype.observe_field('name', { 11 url => c.uri_for('/ajax', 'check_ ug_validity'),11 url => c.uri_for('/ajax', 'check_new_name', 'user'), 12 12 with => "'val='+value", 13 13 update => 'name_validity', … … 20 20 <tr><td>[% form.attr_label('description') %]</td><td>[% form.attr_field('description') %]</td></tr> 21 21 [% IF ! step %] 22 <tr><td>Login (si pas de nom)</th><td><input type="text" name="id" value="[% c.req.param('id') | html %]"></td></tr> 22 <tr><td>Login (si pas de nom)</th><td><input type="text" id="name" name="id" value="[% c.req.param('id') | html %]"> 23 <span id="name_validity"></span> 24 </td></tr> 25 [% c.prototype.observe_field('name', { 26 url => c.uri_for('/ajax', 'check_new_name', 'user'), 27 with => "'val='+value", 28 update => 'name_validity', 29 frequency => 1, 30 min_chars => 1, 31 }) %] 23 32 <input type="hidden" name="step" value="1"> 24 33
Note: See TracChangeset
for help on using the changeset viewer.