projects
/
freeside.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
contacts can be shared among customers / "duplicate contact emails", RT#27943
[freeside.git]
/
fs_selfservice
/
FS-SelfService
/
cgi
/
selfservice.cgi
diff --git
a/fs_selfservice/FS-SelfService/cgi/selfservice.cgi
b/fs_selfservice/FS-SelfService/cgi/selfservice.cgi
index
c232c45
..
2337fb5
100755
(executable)
--- a/
fs_selfservice/FS-SelfService/cgi/selfservice.cgi
+++ b/
fs_selfservice/FS-SelfService/cgi/selfservice.cgi
@@
-1,7
+1,7
@@
#!/usr/bin/perl -w
use strict;
#!/usr/bin/perl -w
use strict;
-use vars qw($DEBUG $cgi $session_id $form_max $template_dir);
+use vars qw($DEBUG $cgi $session_id $
pw_session_id $
form_max $template_dir);
use subs qw(do_template);
use CGI;
use CGI::Carp qw(fatalsToBrowser);
use subs qw(do_template);
use CGI;
use CGI::Carp qw(fatalsToBrowser);
@@
-81,6
+81,7
@@
my @actions = ( qw(
process_change_password
customer_suspend_pkg
process_suspend_pkg
process_change_password
customer_suspend_pkg
process_suspend_pkg
+ switch_cust
));
my @nologin_actions = (qw(
));
my @nologin_actions = (qw(
@@
-97,7
+98,7
@@
my $action = 'myaccount'; # sensible default
if ( $cgi->param('action') =~ /^process_forgot_password_session_(\w+)$/ ) {
$action = 'process_forgot_password_session';
if ( $cgi->param('action') =~ /^process_forgot_password_session_(\w+)$/ ) {
$action = 'process_forgot_password_session';
- $session_id = $1;
+ $
pw_
session_id = $1;
} elsif ( $cgi->param('action') =~ /^(\w+)$/ ) {
if (grep {$_ eq $1} @actions) {
$action = $1;
} elsif ( $cgi->param('action') =~ /^(\w+)$/ ) {
if (grep {$_ eq $1} @actions) {
$action = $1;
@@
-204,6
+205,12
@@
unless ( $nologin_actions{$action} ) {
# at this point $session_id is a real session
# at this point $session_id is a real session
+ if ( ! $login_rv->{'custnum'} && ! $login_rv->{'svcnum'} && $login_rv->{'customers'} ) {
+ #select a customer if we're a multi-contact customer
+ do_template('select_cust', { %$login_rv } );
+ exit;
+ }
+
}
warn "calling $action sub\n"
}
warn "calling $action sub\n"
@@
-212,6
+219,7
@@
$FS::SelfService::DEBUG = $DEBUG;
my $result = eval "&$action();";
die $@ if $@;
my $result = eval "&$action();";
die $@ if $@;
+use Data::Dumper;
warn Dumper($result) if $DEBUG;
if ( $result->{error} && ( $result->{error} eq "Can't resume session"
warn Dumper($result) if $DEBUG;
if ( $result->{error} && ( $result->{error} eq "Can't resume session"
@@
-237,7
+245,13
@@
do_template($action, {
#--
#--
-use Data::Dumper;
+sub switch_cust {
+ $action = 'myaccount';
+ FS::SelfService::switch_cust( 'session_id' => $session_id,
+ 'custnum' => scalar($cgi->param('custnum')),
+ );
+}
+
sub myaccount {
customer_info( 'session_id' => $session_id );
}
sub myaccount {
customer_info( 'session_id' => $session_id );
}
@@
-1059,7
+1073,7
@@
sub process_forgot_password {
sub process_forgot_password_session {
$action = 'process_forgot_password';
check_reset_passwd(
sub process_forgot_password_session {
$action = 'process_forgot_password';
check_reset_passwd(
- 'session_id' => $session_id,
+ 'session_id' => $
pw_
session_id,
);
}
);
}