projects
/
freeside.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
option to only allow primary users access to the self-service server
[freeside.git]
/
FS
/
FS
/
ClientAPI
/
MyAccount.pm
diff --git
a/FS/FS/ClientAPI/MyAccount.pm
b/FS/FS/ClientAPI/MyAccount.pm
index
271d0c2
..
f2cd488
100644
(file)
--- a/
FS/FS/ClientAPI/MyAccount.pm
+++ b/
FS/FS/ClientAPI/MyAccount.pm
@@
-60,6
+60,8
@@
sub login {
'domsvc' => $svc_domain->svcnum, }
);
return { error => 'User not found.' } unless $svc_acct;
'domsvc' => $svc_domain->svcnum, }
);
return { error => 'User not found.' } unless $svc_acct;
+
+
return { error => 'Incorrect password.' }
unless $svc_acct->check_password($p->{'password'});
return { error => 'Incorrect password.' }
unless $svc_acct->check_password($p->{'password'});
@@
-73,6
+75,12
@@
sub login {
$session->{'custnum'} = $cust_main->custnum;
}
$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(). $$))
my $session_id;
do {
$session_id = md5_hex(md5_hex(time(). {}. rand(). $$))