summaryrefslogtreecommitdiffstats
path: root/Bugzilla/Auth
diff options
context:
space:
mode:
authorJochen Wiedmann <jochen.wiedmann@gmail.com>2011-04-28 00:20:55 +0200
committerMax Kanat-Alexander <mkanat@bugzilla.org>2011-04-28 00:20:55 +0200
commit645ebe3d40e6a148dca52054e91483253b3d7568 (patch)
treedf9a0bdb22479b789668a051397a3f5cb658c7ab /Bugzilla/Auth
parent6233375db2f69e79f2fa7ba3030956aa2a6eafbe (diff)
downloadbugzilla-645ebe3d40e6a148dca52054e91483253b3d7568.tar.gz
bugzilla-645ebe3d40e6a148dca52054e91483253b3d7568.tar.xz
Bug 423612 - Allow editing extern_id for users from the admin interface
r=mkanat, a=mkanat
Diffstat (limited to 'Bugzilla/Auth')
-rw-r--r--Bugzilla/Auth/Login.pm9
-rw-r--r--Bugzilla/Auth/Login/Env.pm1
-rw-r--r--Bugzilla/Auth/Login/Stack.pm6
-rw-r--r--Bugzilla/Auth/Verify.pm9
-rw-r--r--Bugzilla/Auth/Verify/Stack.pm5
5 files changed, 30 insertions, 0 deletions
diff --git a/Bugzilla/Auth/Login.pm b/Bugzilla/Auth/Login.pm
index b3add7365..42ce51c62 100644
--- a/Bugzilla/Auth/Login.pm
+++ b/Bugzilla/Auth/Login.pm
@@ -28,6 +28,7 @@ use constant requires_persistence => 1;
use constant requires_verification => 1;
use constant user_can_create_account => 0;
use constant is_automatic => 0;
+use constant extern_id_used => 0;
sub new {
my ($class) = @_;
@@ -131,4 +132,12 @@ just passes us an environment variable on most page requests, and does not
ask the user for authentication information directly in Bugzilla.) Defaults
to C<false>.
+=item C<extern_id_used>
+
+Whether or not this login method uses the extern_id field. If
+used, users with editusers permission will be be allowed to
+edit the extern_id for all users.
+
+The default value is C<0>.
+
=back
diff --git a/Bugzilla/Auth/Login/Env.pm b/Bugzilla/Auth/Login/Env.pm
index f93034ef3..76227f18b 100644
--- a/Bugzilla/Auth/Login/Env.pm
+++ b/Bugzilla/Auth/Login/Env.pm
@@ -32,6 +32,7 @@ use constant can_login => 0;
use constant requires_persistence => 0;
use constant requires_verification => 0;
use constant is_automatic => 1;
+use constant extern_id_used => 1;
sub get_login_info {
my ($self) = @_;
diff --git a/Bugzilla/Auth/Login/Stack.pm b/Bugzilla/Auth/Login/Stack.pm
index f490d243b..0f3661954 100644
--- a/Bugzilla/Auth/Login/Stack.pm
+++ b/Bugzilla/Auth/Login/Stack.pm
@@ -28,6 +28,7 @@ use fields qw(
);
use Hash::Util qw(lock_keys);
use Bugzilla::Hook;
+use List::MoreUtils qw(any);
sub new {
my $class = shift;
@@ -97,4 +98,9 @@ sub user_can_create_account {
return 0;
}
+sub extern_id_used {
+ my ($self) = @_;
+ return any { $_->extern_id_used } @{ $self->{_stack} };
+}
+
1;
diff --git a/Bugzilla/Auth/Verify.pm b/Bugzilla/Auth/Verify.pm
index b293e2583..a8cd0af2c 100644
--- a/Bugzilla/Auth/Verify.pm
+++ b/Bugzilla/Auth/Verify.pm
@@ -25,6 +25,7 @@ use Bugzilla::User;
use Bugzilla::Util;
use constant user_can_create_account => 1;
+use constant extern_id_used => 0;
sub new {
my ($class, $login_type) = @_;
@@ -232,4 +233,12 @@ C<false>.
Whether or not users can manually create accounts in this type of
account source. Defaults to C<true>.
+=item C<extern_id_used>
+
+Whether or not this verifier method uses the extern_id field. If
+used, users with editusers permission will be be allowed to
+edit the extern_id for all users.
+
+The default value is C<false>.
+
=back
diff --git a/Bugzilla/Auth/Verify/Stack.pm b/Bugzilla/Auth/Verify/Stack.pm
index 2df3fcd25..dfc920420 100644
--- a/Bugzilla/Auth/Verify/Stack.pm
+++ b/Bugzilla/Auth/Verify/Stack.pm
@@ -86,4 +86,9 @@ sub user_can_create_account {
return 0;
}
+sub extern_id_used {
+ my ($self) = @_;
+ return any { $_->extern_id_used } @{ $self->{_stack} };
+}
+
1;