Improved: General refactoring and code improvements, package
org.apache.ofbiz.securityext.login.
Thanks Dennis Balkir for reporting and providing the patch.
@@ -95,8 +95,12 @@ public class LoginEvents {
}
// save parameters into the session - so they can be used later, if needed
- if (username != null) session.setAttribute("USERNAME", username);
- if (password != null) session.setAttribute("PASSWORD", password);
+ if (username != null) {
+ session.setAttribute("USERNAME", username);
+ }
+ if (password != null) {
+ session.setAttribute("PASSWORD", password);
+ }
} else {
// if the login object is valid, remove attributes
@@ -416,7 +420,9 @@ public class LoginEvents {
public static String getUsername(HttpServletRequest request) {
String cookieUsername = null;
Cookie[] cookies = request.getCookies();
- if (Debug.verboseOn()) Debug.logVerbose("Cookies:" + Arrays.toString(cookies), module);
+ if (Debug.verboseOn()) {
+ Debug.logVerbose("Cookies:" + Arrays.toString(cookies), module);
+ }
if (cookies != null) {
for (Cookie cookie: cookies) {
if (cookie.getName().equals(usernameCookieName)) {
