summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorivan <ivan>2006-04-03 23:26:03 +0000
committerivan <ivan>2006-04-03 23:26:03 +0000
commit7344abba907bdf860ee9afe602768ec44ded6c21 (patch)
tree47963fe7c035a64fe2d9f4ce1c759ec7e5195824
parent8e9dcecdfc1cad277dcce3fd58d51b20566f9ec9 (diff)
option to disable global uniqueness checking
-rw-r--r--FS/FS/Conf.pm4
-rw-r--r--FS/FS/svc_acct.pm5
2 files changed, 5 insertions, 4 deletions
diff --git a/FS/FS/Conf.pm b/FS/FS/Conf.pm
index 6be6db5c5..c33f68b6c 100644
--- a/FS/FS/Conf.pm
+++ b/FS/FS/Conf.pm
@@ -1455,9 +1455,9 @@ httemplate/docs/config.html
{
'key' => 'global_unique-username',
'section' => 'username',
- 'description' => 'Global username uniqueness control: none (usual setting - check uniqueness per exports), username (all usernames are globally unique, regardless of domain or exports), or username@domain (all username@domain pairs are globally unique, regardless of exports)',
+ 'description' => 'Global username uniqueness control: none (usual setting - check uniqueness per exports), username (all usernames are globally unique, regardless of domain or exports), or username@domain (all username@domain pairs are globally unique, regardless of exports). disabled turns off duplicate checking completely and is STRONGLY NOT RECOMMENDED unless you REALLY need to turn this off.',
'type' => 'select',
- 'select_enum' => [ 'none', 'username', 'username@domain' ],
+ 'select_enum' => [ 'none', 'username', 'username@domain', 'disabled' ],
},
{
diff --git a/FS/FS/svc_acct.pm b/FS/FS/svc_acct.pm
index 2872a5f74..aa3e592a3 100644
--- a/FS/FS/svc_acct.pm
+++ b/FS/FS/svc_acct.pm
@@ -902,6 +902,9 @@ per export and with identical I<svcpart> values.
sub _check_duplicate {
my $self = shift;
+ my $global_unique = $conf->config('global_unique-username') || 'none';
+ return '' if $global_unique eq 'disabled';
+
#this is Pg-specific. what to do for mysql etc?
# ( mysql LOCK TABLES certainly isn't equivalent or useful here :/ )
warn "$me locking svc_acct table for duplicate search" if $DEBUG;
@@ -914,8 +917,6 @@ sub _check_duplicate {
return 'unknown svcpart '. $self->svcpart;
}
- my $global_unique = $conf->config('global_unique-username') || 'none';
-
my @dup_user = grep { !$self->svcnum || $_->svcnum != $self->svcnum }
qsearch( 'svc_acct', { 'username' => $self->username } );
return gettext('username_in_use')