From 7c65990927b3ededebdcd05d3ca71800a7a2458b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Buclin?= Date: Sun, 15 Oct 2017 14:41:44 +0200 Subject: Display the external ID in editusers.cgi (used by LDAP) --- Bugzilla/Auth/Verify/LDAP.pm | 1 + editusers.cgi | 4 +++- template/en/default/admin/users/list.html.tmpl | 3 +++ template/en/default/admin/users/search.html.tmpl | 1 + template/en/default/admin/users/userdata.html.tmpl | 4 ++-- 5 files changed, 10 insertions(+), 3 deletions(-) diff --git a/Bugzilla/Auth/Verify/LDAP.pm b/Bugzilla/Auth/Verify/LDAP.pm index 9687363d6..3063a19a9 100644 --- a/Bugzilla/Auth/Verify/LDAP.pm +++ b/Bugzilla/Auth/Verify/LDAP.pm @@ -26,6 +26,7 @@ use Net::LDAP::Util qw(escape_filter_value); use constant admin_can_create_account => 0; use constant user_can_create_account => 0; +use constant extern_id_used => 1; sub check_credentials { my ($self, $params) = @_; diff --git a/editusers.cgi b/editusers.cgi index 37665b12d..5dea7c8a0 100755 --- a/editusers.cgi +++ b/editusers.cgi @@ -72,7 +72,7 @@ if ($action eq 'search') { my $grouprestrict = $cgi->param('grouprestrict') || '0'; # 0 = disabled only, 1 = enabled only, 2 = everyone my $is_enabled = $cgi->param('is_enabled') // 2; - my $query = 'SELECT DISTINCT userid, login_name, realname, is_enabled, ' . + my $query = 'SELECT DISTINCT userid, login_name, realname, extern_id, is_enabled, ' . $dbh->sql_date_format('last_seen_date', '%Y-%m-%d') . ' AS last_seen_date ' . 'FROM profiles'; my @bindValues; @@ -129,6 +129,8 @@ if ($action eq 'search') { $expr = "profiles.userid"; } elsif ($matchvalue eq 'realname') { $expr = "profiles.realname"; + } elsif ($matchvalue eq 'extern_id') { + $expr = "profiles.extern_id"; } else { $expr = "profiles.login_name"; } diff --git a/template/en/default/admin/users/list.html.tmpl b/template/en/default/admin/users/list.html.tmpl index f90996882..0b3c46eef 100644 --- a/template/en/default/admin/users/list.html.tmpl +++ b/template/en/default/admin/users/list.html.tmpl @@ -35,6 +35,9 @@ {name => 'realname' heading => 'Real name' } + {name => 'extern_id' + heading => 'External ID' + } {name => 'last_seen_date' heading => 'Last Login' } diff --git a/template/en/default/admin/users/search.html.tmpl b/template/en/default/admin/users/search.html.tmpl index 17477a012..bab4338ae 100644 --- a/template/en/default/admin/users/search.html.tmpl +++ b/template/en/default/admin/users/search.html.tmpl @@ -32,6 +32,7 @@ + diff --git a/template/en/default/admin/users/userdata.html.tmpl b/template/en/default/admin/users/userdata.html.tmpl index c08cd0018..705168380 100644 --- a/template/en/default/admin/users/userdata.html.tmpl +++ b/template/en/default/admin/users/userdata.html.tmpl @@ -65,7 +65,6 @@ # if we ever have a login system that can create accounts through # createaccount.cgi but can't change passwords. #%] - [% password_complexity = Param('password_complexity') %] [% IF editusers %] [% IF user.authorizer.can_change_password %] @@ -73,7 +72,8 @@ - [% IF password_complexity == "mixed_letters" %] + [% password_complexity = Param('password_complexity') %] + [% IF password_complexity == "mixed_letters" %] (Password must contain at least one UPPER and one lowercase letter.) [% ELSIF password_complexity == "letters_numbers" %] (Password must contain at least one UPPER and one lower case letter and a number.) -- cgit v1.2.1