projects
/
freeside.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
032f01f
)
users-allow_comp config value to control creation of complimentary accounts and minor...
author
ivan
<ivan>
Fri, 5 Sep 2003 04:09:21 +0000
(
04:09
+0000)
committer
ivan
<ivan>
Fri, 5 Sep 2003 04:09:21 +0000
(
04:09
+0000)
FS/FS/Conf.pm
patch
|
blob
|
history
FS/FS/cust_main.pm
patch
|
blob
|
history
diff --git
a/FS/FS/Conf.pm
b/FS/FS/Conf.pm
index
d185f8d
..
86f59c4
100644
(file)
--- a/
FS/FS/Conf.pm
+++ b/
FS/FS/Conf.pm
@@
-1053,6
+1053,13
@@
httemplate/docs/config.html
'type' => 'text',
},
'type' => 'text',
},
+ {
+ 'key' => 'users-allow_comp',
+ 'section' => '',
+ 'description' => 'Usernames which can create complimentary customers, one per line. If no usernames are entered, all users can create complimentary accounts.'
+ 'type' => 'textarea',
+ },
+
);
1;
);
1;
diff --git
a/FS/FS/cust_main.pm
b/FS/FS/cust_main.pm
index
2af2e98
..
997f096
100644
(file)
--- a/
FS/FS/cust_main.pm
+++ b/
FS/FS/cust_main.pm
@@
-372,7
+372,7
@@
returns false.
This will completely remove all traces of the customer record. This is not
what you want when a customer cancels service; for that, cancel all of the
This will completely remove all traces of the customer record. This is not
what you want when a customer cancels service; for that, cancel all of the
-customer's packages (see L<
FS::cust_pkg
/cancel>).
+customer's packages (see L</cancel>).
If the customer has any uncancelled packages, you need to pass a new (valid)
customer number for those packages to be transferred to. Cancelled packages
If the customer has any uncancelled packages, you need to pass a new (valid)
customer number for those packages to be transferred to. Cancelled packages
@@
-490,6
+490,12
@@
sub replace {
local $SIG{TSTP} = 'IGNORE';
local $SIG{PIPE} = 'IGNORE';
local $SIG{TSTP} = 'IGNORE';
local $SIG{PIPE} = 'IGNORE';
+ if ( $self->payby eq 'COMP' && $self->payby ne $old->payby
+ && $conf->config('users-allow_comp') ) {
+ return "You are not permitted to create complimentary accounts."
+ unless grep { $_ eq getotaker } $conf->config('users-allow_comp');
+ }
+
my $oldAutoCommit = $FS::UID::AutoCommit;
local $FS::UID::AutoCommit = 0;
my $dbh = dbh;
my $oldAutoCommit = $FS::UID::AutoCommit;
local $FS::UID::AutoCommit = 0;
my $dbh = dbh;
@@
-603,7
+609,7
@@
sub check {
|| $self->ut_numbern('referral_custnum')
;
#barf. need message catalogs. i18n. etc.
|| $self->ut_numbern('referral_custnum')
;
#barf. need message catalogs. i18n. etc.
- $error .= "Please select a advertising source."
+ $error .= "Please select a
n
advertising source."
if $error =~ /^Illegal or empty \(numeric\) refnum: /;
return $error if $error;
if $error =~ /^Illegal or empty \(numeric\) refnum: /;
return $error if $error;
@@
-746,6
+752,11
@@
sub check {
} elsif ( $self->payby eq 'COMP' ) {
} elsif ( $self->payby eq 'COMP' ) {
+ if ( !$self->custnum && $conf->config('users-allow_comp') ) {
+ return "You are not permitted to create complimentary accounts."
+ unless grep { $_ eq getotaker } $conf->config('users-allow_comp');
+ }
+
$error = $self->ut_textn('payinfo');
return "Illegal comp account issuer: ". $self->payinfo if $error;
$error = $self->ut_textn('payinfo');
return "Illegal comp account issuer: ". $self->payinfo if $error;