summaryrefslogtreecommitdiffstats
path: root/Bugzilla/Auth
diff options
context:
space:
mode:
Diffstat (limited to 'Bugzilla/Auth')
-rw-r--r--Bugzilla/Auth/Persist/Cookie.pm10
1 files changed, 10 insertions, 0 deletions
diff --git a/Bugzilla/Auth/Persist/Cookie.pm b/Bugzilla/Auth/Persist/Cookie.pm
index fd910b118..06661101b 100644
--- a/Bugzilla/Auth/Persist/Cookie.pm
+++ b/Bugzilla/Auth/Persist/Cookie.pm
@@ -37,6 +37,7 @@ use Bugzilla::Util;
use Bugzilla::Token;
use List::Util qw(first);
+use List::MoreUtils qw(any);
sub new {
my ($class) = @_;
@@ -99,6 +100,15 @@ sub persist_login {
-value => $login_cookie,
%cookieargs);
+ my $securemail_groups = Bugzilla->can('securemail_groups') ? Bugzilla->securemail_groups : [ 'admin' ];
+
+ if (any { $user->in_group($_) } 'mozilla-employee-confidential', @$securemail_groups) {
+ my $auth_method = eval { ref($user->authorizer->successful_info_getter) } // 'unknown';
+
+ Bugzilla->audit(sprintf "successful login of %s from %s using \"%s\", authenticated by %s",
+ $user->login, $ip_addr, $cgi->user_agent // '', $auth_method);
+ }
+
return $login_cookie;
}