Fix purely empty whitespace lines, and remove trailing whitespace.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk/specialpurpose@757103 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Adam Heath
2009-03-21 23:48:00 +00:00
parent f691edfa0c
commit aa3f331a88
6 changed files with 54 additions and 54 deletions
+3 -3
View File
@@ -6,9 +6,9 @@
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
*
* http://www.apache.org/licenses/LICENSE-2.0
*
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -259,6 +259,6 @@ public class LdapLoginWorker extends LoginWorker {
}
}
return rootElement;
return rootElement;
}
}
@@ -6,9 +6,9 @@
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
*
* http://www.apache.org/licenses/LICENSE-2.0
*
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -37,17 +37,17 @@ import org.w3c.dom.Element;
/**
* The OFBiz ActiveDirectory Authentication Handler.<p>
*
*
* The ACL of a user is still controlled by OFBiz.
*
*/
public final class OFBizActiveDirectoryAuthenticationHandler extends AbstractOFBizAuthenticationHandler {
/**
* Public constructor, initializes some required member variables.<p>
* Public constructor, initializes some required member variables.<p>
*/
public OFBizActiveDirectoryAuthenticationHandler() {
}
public SearchResult getLdapSearchResult(String username, String password,
@@ -111,8 +111,8 @@ public final class OFBizActiveDirectoryAuthenticationHandler extends AbstractOFB
// No ldap service found, or cannot login.
throw new NamingException(e.getLocalizedMessage());
}
return result;
}
}
@@ -6,9 +6,9 @@
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
*
* http://www.apache.org/licenses/LICENSE-2.0
*
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -38,32 +38,32 @@ import org.w3c.dom.Element;
/**
* The OFBiz CAS-LDAP Authentication Handler.<p>
*
*
* The ACL of a user is still controlled by OFBiz.
*
*/
public final class OFBizCasAuthenticationHandler extends AbstractOFBizAuthenticationHandler {
public static final String PARAM_TICKET = "ticket";
public static final String PARAM_SERVICE = "service";
public static final String PARAM_RENEW = "renew";
/**
* Public constructor, initializes some required member variables.<p>
* Public constructor, initializes some required member variables.<p>
*/
public OFBizCasAuthenticationHandler() {
}
public String login(HttpServletRequest request, HttpServletResponse response, Element rootElement) throws Exception {
String ticket = request.getParameter(PARAM_TICKET);
String username = request.getParameter("USERNAME");
String password = request.getParameter("PASSWORD");
String casUrl = UtilXml.childElementValue(rootElement, "CasUrl", "https://localhost:8443/cas");
String loginUri = UtilXml.childElementValue(rootElement, "CasLoginUri", "/login");
String validateUri = UtilXml.childElementValue(rootElement, "CasValidateUri", "/validate");
@@ -106,7 +106,7 @@ public final class OFBizCasAuthenticationHandler extends AbstractOFBizAuthentica
}
}
}
if (casLoggedIn && username != null) {
// as we cannot get the password user input in CAS login page, we use a random one
password = randomString();
@@ -6,9 +6,9 @@
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
*
* http://www.apache.org/licenses/LICENSE-2.0
*
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -48,7 +48,7 @@ import org.w3c.dom.Element;
/**
* The abstract Authentication Handler.
*
*
* The ACL of a user is still controlled by OFBiz.<p>
*
*/
@@ -58,9 +58,9 @@ public abstract class AbstractOFBizAuthenticationHandler implements InterfaceOFB
* Public constructor, initializes some required member variables.<p>
*/
public AbstractOFBizAuthenticationHandler() {
}
public Object getPartyId(Element rootElement, SearchResult result) {
Object partyId = UtilXml.childElementValue(rootElement, "AutoPartyId", "admin");
return partyId;
@@ -75,14 +75,14 @@ public abstract class AbstractOFBizAuthenticationHandler implements InterfaceOFB
String username = request.getParameter("USERNAME");
String password = request.getParameter("PASSWORD");
SearchResult result = getLdapSearchResult(username, password, rootElement, true);
if (result != null) {
return login(request, response, username, password, rootElement, result);
}
return "error";
}
public String logout(HttpServletRequest request, HttpServletResponse response, Element rootElement) {
return "success";
}
@@ -91,7 +91,7 @@ public abstract class AbstractOFBizAuthenticationHandler implements InterfaceOFB
public String login(HttpServletRequest request, HttpServletResponse response, String username, String password, Element rootElement, SearchResult result) throws Exception {
HttpSession session = request.getSession();
// get the visit id to pass to the userLogin for history
String visitId = VisitHandler.getVisitId(session);
LocalDispatcher dispatcher = (LocalDispatcher) request.getAttribute("dispatcher");
@@ -111,7 +111,7 @@ public abstract class AbstractOFBizAuthenticationHandler implements InterfaceOFB
} catch (GenericEntityException e) {
throw new GenericEntityException(e.getLocalizedMessage());
}
GenericValue userLoginSecurityGroup = delegator.makeValue("UserLoginSecurityGroup", UtilMisc.toMap("userLoginId", username, "groupId", getSecurityGroup(rootElement, result), "fromDate", UtilDateTime.nowTimestamp()));
try {
userLoginSecurityGroup.create();
@@ -122,7 +122,7 @@ public abstract class AbstractOFBizAuthenticationHandler implements InterfaceOFB
userTryToLogin.setString("currentPassword", useEncryption ? HashCrypt.getDigestHash(password, LoginServices.getHashType()) : password);
userTryToLogin.store();
}
Map<String, Object> loginResult = null;
try {
@@ -6,9 +6,9 @@
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
*
* http://www.apache.org/licenses/LICENSE-2.0
*
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -28,64 +28,64 @@ import org.w3c.dom.Element;
/**
* The OFBiz LDAP Authentication Handler interface.<p>
*
*
*/
public interface InterfaceOFBizAuthenticationHandler {
/**
* Login a user.
*
*
* @param request HttpServletRequest
* @param response HttpServletResponse
* @param rootElement Element root element of ldap config file
*
*
* @return success if the user can login successfully; otherwise, error.
* @throws Exception
* @throws Exception
*/
String login(HttpServletRequest request, HttpServletResponse response, Element rootElement) throws Exception;
/**
* Get the security group of a user.
*
*
* @param rootElement Element root element of ldap config file
* @param result SearchResult
*
*
* @return the SecurityGroup object.
*/
Object getSecurityGroup(Element rootElement, SearchResult result);
/**
* Get the party id of a user.
*
*
* @param rootElement Element root element of ldap config file
* @param result SearchResult
*
*
* @return the PartyId object.
*/
Object getPartyId(Element rootElement, SearchResult result);
/**
* Logout a user.
*
*
* @param request HttpServletRequest
* @param response HttpServletResponse
* @param rootElement Element root element of ldap config file
*
*
* @return success if the user can login successfully; otherwise, error.
* @throws Exception
* @throws Exception
*/
String logout(HttpServletRequest request, HttpServletResponse response, Element rootElement);
/**
* Get LDAP search result from a username, password and configuration.
*
*
* @param username String
* @param password String
* @param rootElement Element root element of ldap config file
* @param bindRequired boolean if true, bind; false, just search the user in LDAP
*
*
* @return result SearchResult if ldap search successfully; otherwise, null.
* @throws Exception
* @throws Exception
*/
SearchResult getLdapSearchResult(String username, String password, Element rootElement, boolean bindRequired) throws NamingException;
@@ -6,9 +6,9 @@
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
*
* http://www.apache.org/licenses/LICENSE-2.0
*
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -34,14 +34,14 @@ import org.w3c.dom.Element;
/**
* The OFBiz LDAP Authentication Handler.<p>
*
*
* The ACL of a user is still controlled by OFBiz.
*
*/
public final class OFBizLdapAuthenticationHandler extends AbstractOFBizAuthenticationHandler {
/**
* Public constructor, initializes some required member variables.<p>
* Public constructor, initializes some required member variables.<p>
*/
public OFBizLdapAuthenticationHandler() {