X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2FClientAPI%2FMyAccount.pm;h=54d53063d651e8739696b50f50328927185415de;hb=bdf9732a992deb1332b3496ba112885806a67798;hp=8a0bbd4f0b61b0858a477296fd26a925c9cfd511;hpb=7785677b084c8d3d5b0aa61d1dff965ac28e2746;p=freeside.git diff --git a/FS/FS/ClientAPI/MyAccount.pm b/FS/FS/ClientAPI/MyAccount.pm index 8a0bbd4f0..54d53063d 100644 --- a/FS/FS/ClientAPI/MyAccount.pm +++ b/FS/FS/ClientAPI/MyAccount.pm @@ -2854,6 +2854,16 @@ sub myaccount_passwd { $svc_acct->set_password($p->{'new_password'}); $error ||= $svc_acct->replace(); + #regular pw change in self-service should change contact pw too, otherwise its + #way too confusing. hell its confusing they're separate at all, but alas. + #need to support the "ISP provides email that's used as a contact email" case + #as well as we can. + my $contact = FS::contact->by_selfservice_email($svc_acct->email); + if ( $contact && $contact->custnum == $custnum ) { + #svc_acct was successful but this one returns an error? "shouldn't happen" + $error ||= $contact->change_password($p->{'new_password'}); + } + my($label, $value) = $svc_acct->cust_svc->label; return { 'error' => $error, @@ -2863,7 +2873,6 @@ sub myaccount_passwd { } -#regular pw change in self-service should change contact pw too, otherwise its way too confusing. hell its confusing they're separate at all, but alas. need to support the "ISP provides email that's used as a contact email" case as well as we can. # sub contact_passwd { # my $p = shift; # my($context, $session, $custnum) = _custoragent_session_custnum($p);