@@ -126,13 +126,9 @@ String getSessionAllowedAttrName() {
126
126
127
127
@ Override
128
128
public void fillSession (HttpServletRequest req , User user ) {
129
- boolean sessionAllowed ;
130
- LdapUser ldapUser ;
131
- Map <String , Set <String >> records = null ;
132
- Set <String > attributeValues ;
133
-
134
129
updateSession (req , false );
135
130
131
+ LdapUser ldapUser ;
136
132
if ((ldapUser = (LdapUser ) req .getSession ().
137
133
getAttribute (LdapUserPlugin .getSessionAttrName (ldapUserInstance ))) == null ) {
138
134
LOGGER .log (Level .WARNING , "cannot get {0} attribute from {1}" ,
@@ -142,8 +138,9 @@ public void fillSession(HttpServletRequest req, User user) {
142
138
143
139
// Check attributes cached in LDAP user object first, then query LDAP server
144
140
// (and if found, cache the result in the LDAP user object).
145
- attributeValues = ldapUser .getAttribute (ldapAttr );
141
+ Set < String > attributeValues = ldapUser .getAttribute (ldapAttr );
146
142
if (attributeValues == null ) {
143
+ Map <String , Set <String >> records = null ;
147
144
AbstractLdapProvider ldapProvider = getLdapProvider ();
148
145
try {
149
146
String dn = ldapUser .getDn ();
@@ -175,7 +172,7 @@ public void fillSession(HttpServletRequest req, User user) {
175
172
ldapUser .setAttribute (ldapAttr , attributeValues );
176
173
}
177
174
178
- sessionAllowed = attributeValues .stream ().anyMatch (whitelist ::contains );
175
+ boolean sessionAllowed = attributeValues .stream ().anyMatch (whitelist ::contains );
179
176
LOGGER .log (Level .FINEST , "LDAP user {0} {1} against {2}" ,
180
177
new Object []{ldapUser , sessionAllowed ? "allowed" : "denied" , filePath });
181
178
updateSession (req , sessionAllowed );
0 commit comments