Skip to content

Commit 7b6dc65

Browse files
author
Vladimir Kotal
committed
sessionAllowed
1 parent 1efc521 commit 7b6dc65

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

plugins/src/opengrok/auth/plugin/LdapAttrPlugin.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -45,14 +45,14 @@ public class LdapAttrPlugin extends AbstractLdapPlugin {
4545
protected static final String ATTR_PARAM = "attribute";
4646
protected static final String FILE_PARAM = "file";
4747

48-
private final static String SESSION_ALLOWED_PREFIX = "opengrok-attr-plugin-allowed";
49-
private String SESSION_ALLOWED = SESSION_ALLOWED_PREFIX;
48+
private static final String SESSION_ALLOWED_PREFIX = "opengrok-attr-plugin-allowed";
49+
private String sessionAllowed = SESSION_ALLOWED_PREFIX;
5050

5151
private String ldapAttr;
5252
private final Set<String> whitelist = new TreeSet<>();
5353

5454
public LdapAttrPlugin() {
55-
SESSION_ALLOWED += "-" + nextId++;
55+
sessionAllowed += "-" + nextId++;
5656
}
5757

5858
@Override
@@ -78,7 +78,7 @@ public void load(Map<String, Object> parameters) {
7878
@Override
7979
protected boolean sessionExists(HttpServletRequest req) {
8080
return super.sessionExists(req)
81-
&& req.getSession().getAttribute(SESSION_ALLOWED) != null;
81+
&& req.getSession().getAttribute(sessionAllowed) != null;
8282
}
8383

8484
@SuppressWarnings("unchecked")
@@ -126,16 +126,16 @@ public void fillSession(HttpServletRequest req, User user) {
126126
* @param allowed the new value
127127
*/
128128
protected void updateSession(HttpServletRequest req, boolean allowed) {
129-
req.getSession().setAttribute(SESSION_ALLOWED, allowed);
129+
req.getSession().setAttribute(sessionAllowed, allowed);
130130
}
131131

132132
@Override
133133
public boolean checkEntity(HttpServletRequest request, Project project) {
134-
return ((Boolean) request.getSession().getAttribute(SESSION_ALLOWED));
134+
return ((Boolean) request.getSession().getAttribute(sessionAllowed));
135135
}
136136

137137
@Override
138138
public boolean checkEntity(HttpServletRequest request, Group group) {
139-
return ((Boolean) request.getSession().getAttribute(SESSION_ALLOWED));
139+
return ((Boolean) request.getSession().getAttribute(sessionAllowed));
140140
}
141141
}

0 commit comments

Comments
 (0)