personal.php Profile
personal.php Personal Information
- payment_accounts.php Payment Accounts
password.php Change Password
payment.php Payments
}
+sub get_mac_address {
+ my $p = shift;
+
+## access radius exports acct tables to get mac
+ my @part_export = ();
+ @part_export = (
+ qsearch( 'part_export', { 'exporttype' => 'sqlradius' } ),
+ qsearch( 'part_export', { 'exporttype' => 'sqlradius_withdomain' } ),
+ qsearch( 'part_export', { 'exporttype' => 'broadband_sqlradius' } ),
+ );
+
+ my @sessions;
+ foreach my $part_export (@part_export) {
+ push @sessions, ( @{ $part_export->usage_sessions( {
+ 'ip' => $p->{'ip'},
+ } ) } );
+ }
+
+ my $mac = $sessions[0]->{'callingstationid'};
+
+ return { 'mac_address' => $mac, };
+}
+
sub login_info {
my $p = shift;
$svc_x = $svc_phone;
+ } elsif ( $p->{'domain'} eq 'ip_mac' ) {
+
+ my $mac_address = $p->{'username'};
+ $mac_address =~ s/\://g;
+
+ my $svc_broadband = qsearchs( 'svc_broadband', { 'mac_addr' => $mac_address } );
+ return { error => 'MAC address not found '.$p->{'username'} }
+ unless $svc_broadband;
+ $svc_x = $svc_broadband;
+
} elsif ( $p->{email}
&& (my $contact = FS::contact->by_selfservice_email($p->{email}))
)
return { 'error' => '',
'session_id' => $session_id,
+ %$session,
};
}
for (@cust_main_editable_fields) {
$return{$_} = $cust_main->get($_);
}
+ $return{$_} = $cust_main->masked($_) for qw/ss stateid/;
+
#maybe a little more expensive, but it should be cached by now
for (@location_editable_fields) {
$return{$_} = $cust_main->bill_location->get($_);
or return { 'error' => "unknown custnum $custnum" };
my $conf = new FS::Conf;
- if (($p->{payby} eq "CHEK" || $p->{payby} eq "DCHEK") && $conf->exists('selfservice-ACH_info_readonly')) {
+ if (($p->{payby} eq "CHEK" || $p->{payby} eq "DCHK") && $conf->exists('selfservice-ACH_info_readonly')) {
return { 'error' => "You do not have authority to add a bank account" };
}
$return{paybatch} = $return{payunique}; #back compat
$return{credit_card_surcharge_percentage} = $conf->config('credit-card-surcharge-percentage', $cust_main->agentnum);
+ $return{credit_card_surcharge_flatfee} = $conf->config('credit-card-surcharge-flatfee', $cust_main->agentnum);
return { 'error' => '',
%return,
if $cust_main->paymask eq $payinfo;
my $achonfile = 0;
- foreach my $cust_payby ($cust_main->cust_payby('CHEK','DCHK')) {
- if ( $cust_payby->paymask eq $payinfo ) {
- $payinfo = $cust_payby->payinfo;
+ if ( $cust_main->paymask eq $payinfo ) {
+ $payinfo = $cust_main->payinfo;
$achonfile = 1;
- last;
}
- }
if ($conf->exists('selfservice-ACH_info_readonly') && !$achonfile) {
return { 'error' => "You are not allowed to change your payment information." };
}
1;
-