diff options
| author | Ivan Kohler <ivan@freeside.biz> | 2018-10-01 12:03:01 -0700 |
|---|---|---|
| committer | Ivan Kohler <ivan@freeside.biz> | 2018-10-01 12:03:01 -0700 |
| commit | d5988a9f7a3617de33da3058f2e9f1151b24420e (patch) | |
| tree | 3ed8d80cd6a81f160c76c90fcf089e81fe7ffddf /httemplate/edit/process/access_user.html | |
| parent | 1ab515df162a76347d8146cae4ff34656cc4bcd3 (diff) | |
| parent | b6088672c87e2c5984183326b4c0e2d9bd6c34f6 (diff) | |
Merge branch 'master' of git.freeside.biz:/home/git/freeside
Diffstat (limited to 'httemplate/edit/process/access_user.html')
| -rw-r--r-- | httemplate/edit/process/access_user.html | 28 |
1 files changed, 13 insertions, 15 deletions
diff --git a/httemplate/edit/process/access_user.html b/httemplate/edit/process/access_user.html index fcd210f83..c27262017 100644 --- a/httemplate/edit/process/access_user.html +++ b/httemplate/edit/process/access_user.html @@ -11,7 +11,7 @@ 'target_table' => 'access_group', }, 'precheck_callback' => \&precheck_callback, - #'post_new_object_callback' => \&post_new_object_callback, + 'post_new_object_callback' => \&post_new_object_callback, 'noerror_callback' => \&noerror_callback, ) %> @@ -38,24 +38,22 @@ sub precheck_callback { return ''; } -#sub post_new_object_callback { -# my( $cgi, $access_user ) = @_; -# -# if ( length($cgi->param('_password')) ) { -# my $password = scalar($cgi->param('_password')); -# my $error = $access_user->is_password_allowed($password); -# #XXX and then bubble the error back up to the UI -# } -#} +sub post_new_object_callback { + my( $cgi, $access_user ) = @_; + + return '' unless length($cgi->param('_password')); + + my $password = scalar($cgi->param('_password')); + my $error = $access_user->is_password_allowed($password); + return $error if $error; + + $access_user->change_password_fields($password); + ''; +} sub noerror_callback { my( $cgi, $access_user ) = @_; - if ( length($cgi->param('_password')) ) { - my $password = scalar($cgi->param('_password')); - $access_user->change_password($password); - } - #handle installer checkbox my @sched_item = $access_user->sched_item; my $sched_item = $sched_item[0]; |
