summaryrefslogtreecommitdiff
path: root/httemplate/edit/process/access_user.html
diff options
context:
space:
mode:
authorIvan Kohler <ivan@freeside.biz>2013-05-09 01:42:39 -0700
committerIvan Kohler <ivan@freeside.biz>2013-05-09 01:42:39 -0700
commit120718856665ca90ad852535d1155f8ea8ecb6b6 (patch)
tree2ac0472c1fd67ecc843619597f1cca7d8f774204 /httemplate/edit/process/access_user.html
parentd8843f184a7f6ee87eec99724f2d6430c1df34ea (diff)
NG auth: pw changes, RT#21563
Diffstat (limited to 'httemplate/edit/process/access_user.html')
-rw-r--r--httemplate/edit/process/access_user.html28
1 files changed, 21 insertions, 7 deletions
diff --git a/httemplate/edit/process/access_user.html b/httemplate/edit/process/access_user.html
index 8e7e70a06..7fc7c25e1 100644
--- a/httemplate/edit/process/access_user.html
+++ b/httemplate/edit/process/access_user.html
@@ -3,14 +3,15 @@
% print $cgi->redirect(popurl(2) . "access_user.html?" . $cgi->query_string);
% } else {
<% include( 'elements/process.html',
- 'table' => 'access_user',
- 'viewall_dir' => 'browse',
- 'copy_on_empty' => [ '_password' ],
+ 'table' => 'access_user',
+ 'viewall_dir' => 'browse',
+ 'copy_on_empty' => [ '_password', '_password_encoding' ],
'clear_on_error' => [ '_password', '_password2' ],
- 'process_m2m' => { 'link_table' => 'access_usergroup',
- 'target_table' => 'access_group',
- },
- 'precheck_callback'=> \&precheck_callback,
+ 'process_m2m' => { 'link_table' => 'access_usergroup',
+ 'target_table' => 'access_group',
+ },
+ 'precheck_callback' => \&precheck_callback,
+ 'post_new_object_callback' => \&post_new_object_callback,
)
%>
% }
@@ -26,11 +27,24 @@ if ( FS::Conf->new->exists('disable_acl_changes') ) {
sub precheck_callback {
my $cgi = shift;
+
my $o = FS::access_user->new({username => $cgi->param('username')});
if( $o->is_system_user and !$cgi->param('usernum') ) {
$cgi->param('username','');
return "username '".$o->username."' reserved for system account."
}
+
return '';
}
+
+sub post_new_object_callback {
+ my( $cgi, $access_user ) = @_;
+
+ if ( length($cgi->param('_password')) ) {
+ my $password = scalar($cgi->param('_password'));
+ $access_user->change_password_fields($password);
+ }
+
+}
+
</%init>