diff options
Diffstat (limited to 'httemplate/edit')
| -rw-r--r-- | httemplate/edit/access_user.html | 5 | ||||
| -rw-r--r-- | httemplate/edit/process/access_user.html | 19 | 
2 files changed, 17 insertions, 7 deletions
| diff --git a/httemplate/edit/access_user.html b/httemplate/edit/access_user.html index df580a20d..a8cb341e6 100644 --- a/httemplate/edit/access_user.html +++ b/httemplate/edit/access_user.html @@ -4,6 +4,7 @@                   'fields' => [                                 'username',                                 { field=>'_password', type=>'password' }, +                               { field=>'_password2', type=>'password' },                                 'last',                                 'first',                                 { field=>'disabled', type=>'checkbox', value=>'Y' }, @@ -12,10 +13,14 @@                                 'usernum'   => 'User number',                                 'username'  => 'Username',                                 '_password' => 'Password', +                               '_password2'=> 'Re-enter Password',                                 'last'      => 'Last name',                                 'first'     => 'First name',                                 'disabled'  => 'Disable employee',                               }, +                 'edit_callback' => sub { my( $c, $o ) = @_;  +                                          $o->set('_password2', $o->_password); +                                        },                   'viewall_dir' => 'browse',                   'html_bottom' =>                     sub { diff --git a/httemplate/edit/process/access_user.html b/httemplate/edit/process/access_user.html index 78857c525..ebbcdca17 100644 --- a/httemplate/edit/process/access_user.html +++ b/httemplate/edit/process/access_user.html @@ -1,8 +1,13 @@ -<% include( 'elements/process.html', -               'table'       => 'access_user', -               'viewall_dir' => 'browse', -               'process_m2m' => { 'link_table'   => 'access_usergroup', -                                  'target_table' => 'access_group', -                                }, -           ) +%  if ( $cgi->param('_password') ne $cgi->param('_password2') ) { +%    $cgi->param('error', "The passwords do not match"); +%    print $cgi->redirect(popurl(2) . "access_user.html?" . $cgi->query_string); +%  } else { +<%   include( 'elements/process.html', +                 'table'       => 'access_user', +                 'viewall_dir' => 'browse', +                 'process_m2m' => { 'link_table'   => 'access_usergroup', +                                    'target_table' => 'access_group', +                                  }, +             )  %> +%   } | 
