diff options
author | ivan <ivan> | 2004-06-21 10:45:15 +0000 |
---|---|---|
committer | ivan <ivan> | 2004-06-21 10:45:15 +0000 |
commit | a9060f5bf7ee105eb2f3bb379feb4dd3e59ee27a (patch) | |
tree | 8e3e61b83350c635b54cdcb94f92f8a624990b83 /FS/FS/ClientAPI | |
parent | edf90a3eb4219f72c8962ad86caacf409b896e8f (diff) |
field name is primary_svc, not primary
Diffstat (limited to 'FS/FS/ClientAPI')
-rw-r--r-- | FS/FS/ClientAPI/MyAccount.pm | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/FS/FS/ClientAPI/MyAccount.pm b/FS/FS/ClientAPI/MyAccount.pm index f2cd488..6caa197 100644 --- a/FS/FS/ClientAPI/MyAccount.pm +++ b/FS/FS/ClientAPI/MyAccount.pm @@ -61,6 +61,11 @@ 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' ); return { error => 'Incorrect password.' } unless $svc_acct->check_password($p->{'password'}); @@ -75,12 +80,6 @@ sub login { $session->{'custnum'} = $cust_main->custnum; } - 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 ne 'Y' ); - my $session_id; do { $session_id = md5_hex(md5_hex(time(). {}. rand(). $$)) |