diff options
Diffstat (limited to 'httemplate/edit')
-rw-r--r-- | httemplate/edit/process/access_user.html | 3 | ||||
-rw-r--r-- | httemplate/edit/process/svc_dsl.html | 15 | ||||
-rwxr-xr-x | httemplate/edit/svc_acct.cgi | 7 |
3 files changed, 23 insertions, 2 deletions
diff --git a/httemplate/edit/process/access_user.html b/httemplate/edit/process/access_user.html index 0554bb940..bbe4268be 100644 --- a/httemplate/edit/process/access_user.html +++ b/httemplate/edit/process/access_user.html @@ -43,7 +43,8 @@ sub post_new_object_callback { if ( length($cgi->param('_password')) ) { my $password = scalar($cgi->param('_password')); - $access_user->change_password_fields($password); + my $error = $access_user->is_password_allowed($password) + || $access_user->change_password($password); } } diff --git a/httemplate/edit/process/svc_dsl.html b/httemplate/edit/process/svc_dsl.html index 627329a00..889366e07 100644 --- a/httemplate/edit/process/svc_dsl.html +++ b/httemplate/edit/process/svc_dsl.html @@ -1,5 +1,6 @@ <% include( 'elements/svc_Common.html', 'table' => 'svc_dsl', + 'precheck_callback' => $precheck_callback, ) %> <%init> @@ -7,4 +8,18 @@ die "access denied" unless $FS::CurrentUser::CurrentUser->access_right('Provision customer service'); #something else more specific? +my $precheck_callback = sub { + my $cgi = shift; + my $svcnum = $cgi->param('svcnum'); + my $error = ''; + if ( $svcnum ) { + my $old = FS::svc_dsl->by_key($svcnum); + my $newpass = $cgi->param('password'); + if ( $old and $newpass ne $old->password ) { + $error ||= $old->is_password_allowed($newpass); + } + } + $error; +}; + </%init> diff --git a/httemplate/edit/svc_acct.cgi b/httemplate/edit/svc_acct.cgi index 31678a991..0cf0c20e1 100755 --- a/httemplate/edit/svc_acct.cgi +++ b/httemplate/edit/svc_acct.cgi @@ -50,7 +50,12 @@ 'required' => $part_svc->part_svc_column('_password')->required ) %> <TD> <INPUT TYPE="text" ID="clear_password" NAME="clear_password" VALUE="<% $password %>" SIZE=<% $pmax2 %> MAXLENGTH=<% $pmax %>> - <& /elements/random_pass.html, 'clear_password' &> + <& /elements/random_pass.html, 'clear_password' &><BR> + <DIV ID="clear_password_result" STYLE="font-size: smaller"></DIV> + <& '/elements/validate_password.html', + 'fieldid' => 'clear_password', + 'svcnum' => $svcnum + &> </TD> </TR> %}else{ |