From: ivan Date: Tue, 9 Sep 2008 22:35:19 +0000 (+0000) Subject: allow implied primary services to log into selfservice when selfservice_server-primar... X-Git-Tag: freeside_1_7_4rc1~195 X-Git-Url: http://git.freeside.biz/gitweb/?a=commitdiff_plain;h=9c34be9ec304d9c3f936bdf4dd6d6c23a847c34f;p=freeside.git allow implied primary services to log into selfservice when selfservice_server-primary_only is on --- diff --git a/FS/FS/ClientAPI/MyAccount.pm b/FS/FS/ClientAPI/MyAccount.pm index 0f851c4f2..e8806e0c4 100644 --- a/FS/FS/ClientAPI/MyAccount.pm +++ b/FS/FS/ClientAPI/MyAccount.pm @@ -66,14 +66,16 @@ sub login { return { error => 'User not found.' } unless $svc_acct; my $conf = new FS::Conf; + #my $pkg_svc = $svc_acct->cust_svc->pkg_svc; #return { error => 'Only primary user may log in.' } # if $conf->exists('selfservice_server-primary_only') # && ( ! $pkg_svc || $pkg_svc->primary_svc ne 'Y' ); my $cust_svc = $svc_acct->cust_svc; + my $part_pkg = $cust_svc->cust_pkg->part_pkg; return { error => 'Only primary user may log in.' } if $conf->exists('selfservice_server-primary_only') - && $cust_svc->svcpart != $cust_svc->cust_pkg->svcpart('svc_acct'); + && $cust_svc->svcpart != $part_pkg->svcpart('svc_acct'); return { error => 'Incorrect password.' } unless $svc_acct->check_password($p->{'password'});