diff options
author | Ivan Kohler <ivan@freeside.biz> | 2015-11-22 19:44:48 -0800 |
---|---|---|
committer | Ivan Kohler <ivan@freeside.biz> | 2015-11-22 19:44:48 -0800 |
commit | c20f301dd7c437a0d8be414a174dd09721bd8e9a (patch) | |
tree | c50bbbed20fc6ce2bc3d2f95d675ef6fe8f66453 /httemplate/edit/process | |
parent | 76f5eb6da76cf9444a5cfee13d6f5d7fd7e0315f (diff) | |
parent | 45d0f6c6325fb8ab5fdc478a7dc278872defa479 (diff) |
Merge branch 'master' of git.freeside.biz:/home/git/freeside
Diffstat (limited to 'httemplate/edit/process')
-rw-r--r-- | httemplate/edit/process/access_user.html | 3 | ||||
-rw-r--r-- | httemplate/edit/process/svc_dsl.html | 15 |
2 files changed, 17 insertions, 1 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> |