1
19
20 package com.liferay.portal.security.auth;
21
22 import com.liferay.portal.service.UserLocalServiceUtil;
23
24 import java.util.Map;
25
26
33 public class LoginMaxFailures implements AuthFailure {
34
35 public void onFailureByEmailAddress(
36 long companyId, String emailAddress,
37 Map<String, String[]> headerMap, Map<String, String[]> parameterMap)
38 throws AuthException {
39
40 try {
41 UserLocalServiceUtil.updateLockoutByEmailAddress(
42 companyId, emailAddress, true);
43 }
44 catch (Exception e) {
45 throw new AuthException();
46 }
47 }
48
49 public void onFailureByScreenName(
50 long companyId, String screenName, Map<String, String[]> headerMap,
51 Map<String, String[]> parameterMap)
52 throws AuthException {
53
54 try {
55 UserLocalServiceUtil.updateLockoutByScreenName(
56 companyId, screenName, true);
57 }
58 catch (Exception e) {
59 throw new AuthException();
60 }
61 }
62
63 public void onFailureByUserId(
64 long companyId, long userId, Map<String, String[]> headerMap,
65 Map<String, String[]> parameterMap)
66 throws AuthException {
67
68 try {
69 UserLocalServiceUtil.updateLockoutById(userId, true);
70 }
71 catch (Exception e) {
72 throw new AuthException();
73 }
74 }
75
76 }