diff options
author | jeff <jeff> | 2007-01-17 00:40:57 +0000 |
---|---|---|
committer | jeff <jeff> | 2007-01-17 00:40:57 +0000 |
commit | eab5690e7cd970706f709ac0ef4f1c3e317fcd7d (patch) | |
tree | 22fd2670f897c5ab7a7ec8fd8c72d1e3c35476f5 | |
parent | f849597b839a3ce1f497b35fa17f39ff66d39e30 (diff) |
employee edit (ticket 1412)
-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', + }, + ) %> +% } |