From 645ebe3d40e6a148dca52054e91483253b3d7568 Mon Sep 17 00:00:00 2001 From: Jochen Wiedmann Date: Wed, 27 Apr 2011 15:20:55 -0700 Subject: Bug 423612 - Allow editing extern_id for users from the admin interface r=mkanat, a=mkanat --- Bugzilla/Auth/Login.pm | 9 +++++++++ Bugzilla/Auth/Login/Env.pm | 1 + Bugzilla/Auth/Login/Stack.pm | 6 ++++++ Bugzilla/Auth/Verify.pm | 9 +++++++++ Bugzilla/Auth/Verify/Stack.pm | 5 +++++ 5 files changed, 30 insertions(+) (limited to 'Bugzilla/Auth') 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. +=item C + +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. Whether or not users can manually create accounts in this type of account source. Defaults to C. +=item C + +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. + =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; -- cgit v1.2.3-24-g4f1b