X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2FClientAPI%2FMyAccount.pm;h=862cceb2adaf87a60c8637408a370495ac085fa0;hb=86d3bab91d8baadcbe33e5bbceeb607990efa1eb;hp=d17131f2d7a6770ab6d8a95a600c594b384f6301;hpb=7b268e364a68b076e1f3bd3741159fb51759ee19;p=freeside.git diff --git a/FS/FS/ClientAPI/MyAccount.pm b/FS/FS/ClientAPI/MyAccount.pm index d17131f2d..862cceb2a 100644 --- a/FS/FS/ClientAPI/MyAccount.pm +++ b/FS/FS/ClientAPI/MyAccount.pm @@ -555,7 +555,9 @@ sub customer_info_short { 1, ##nobalance ); - $return{name} = $cust_main->first. ' '. $cust_main->get('last'); +warn $return{first} = $cust_main->first; +warn $return{'last'} = $cust_main->get('last'); + $return{name} = $cust_main->first. ' '. $cust_main->get('last'); $return{payby} = $cust_main->payby; @@ -565,8 +567,10 @@ sub customer_info_short { } #maybe a little more expensive, but it should be cached by now for (@location_editable_fields) { - $return{$_} = $cust_main->bill_location->get($_); - $return{'ship_'.$_} = $cust_main->ship_location->get($_); + $return{$_} = $cust_main->bill_location->get($_) + if $cust_main->bill_locationnum; + $return{'ship_'.$_} = $cust_main->ship_location->get($_) + if $cust_main->ship_locationnum; } if ( $cust_main->payby =~ /^(CARD|DCRD)$/ ) { @@ -2841,6 +2845,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, @@ -2850,7 +2864,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);