From 6039b78ce0ef2c95674a81d047ace8048dd00695 Mon Sep 17 00:00:00 2001 From: Ivan Kohler Date: Mon, 30 Dec 2013 15:52:08 -0800 Subject: [PATCH] self-service access for contacts, RT#25533 --- FS/FS/ClientAPI/MyAccount.pm | 11 ++++++++++- fs_selfservice/FS-SelfService/cgi/forgot_password.html | 2 +- fs_selfservice/FS-SelfService/cgi/login.html | 2 +- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/FS/FS/ClientAPI/MyAccount.pm b/FS/FS/ClientAPI/MyAccount.pm index d17131f2d..d7914d64f 100644 --- a/FS/FS/ClientAPI/MyAccount.pm +++ b/FS/FS/ClientAPI/MyAccount.pm @@ -2841,6 +2841,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 +2860,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); diff --git a/fs_selfservice/FS-SelfService/cgi/forgot_password.html b/fs_selfservice/FS-SelfService/cgi/forgot_password.html index 607151138..a1ce851ea 100644 --- a/fs_selfservice/FS-SelfService/cgi/forgot_password.html +++ b/fs_selfservice/FS-SelfService/cgi/forgot_password.html @@ -14,7 +14,7 @@ -Please enter your email address. A password reset email will be sent to that address. +Please enter your email address. A password reset email will be sent to that address.

diff --git a/fs_selfservice/FS-SelfService/cgi/login.html b/fs_selfservice/FS-SelfService/cgi/login.html index f7af4e9d8..9cee01d14 100644 --- a/fs_selfservice/FS-SelfService/cgi/login.html +++ b/fs_selfservice/FS-SelfService/cgi/login.html @@ -47,7 +47,7 @@ if ( $single_domain ) { -- 2.11.0
Password - + Forgot your password?